Distilled summary card of a `Paper`. The store layer keys this off ``paper_id`` so the card and its tree can be retrieved together. The card is the right shape for tagging, filtering, and dashboard surfaces; deep questions go to the tree.
| 32 | |
| 33 | CHUNK_SET = "paper_chunk_set" |
| 34 | GLOBAL_SUMMARY = "paper_summary" |
| 35 | STRUCTURE_TREE = "paper_structure_tree" |
| 36 | |
| 37 | |
| 38 | def _stable_hash(value: object) -> str: |
| 39 | """Return a deterministic SHA-256 hash for one JSON-compatible value.""" |
| 40 | payload = json.dumps( |
| 41 | value, |
| 42 | ensure_ascii=False, |
| 43 | separators=(",", ":"), |
| 44 | sort_keys=True, |
| 45 | ) |
| 46 | return hashlib.sha256(payload.encode("utf-8")).hexdigest() |
| 47 | |
| 48 | |
| 49 | def _text_hash(value: str) -> str: |
| 50 | return hashlib.sha256(value.encode("utf-8")).hexdigest() |
| 51 | |
| 52 | |
| 53 | def _paper_source_id(content_hash: str) -> UUID: |
| 54 | return uuid5(NAMESPACE_URL, f"quantmind:paper-source:{content_hash}") |
| 55 |
no outgoing calls