Expand description
Deterministic-concatenate compression for Phase 4.D decay jobs.
Given N candidate-tier memories (or N episode summaries), produce ONE summary memory whose:
claimis a deterministic concatenation + truncation of the sources’ claims (separatorsuper::DECAY_SUMMARY_CLAIM_SEPARATOR, truncation atsuper::DECAY_SUMMARY_MAX_CLAIM_BYTESwith suffixsuper::DECAY_SUMMARY_TRUNCATION_SUFFIX).confidence=min(source.confidence)— pessimistic.authority= lowest-trust authority across sources. The trust order is theAuthorityTier::trust_rankladder; compression CANNOT launder authority upward.source_episodes_json/source_events_json= deduplicated union of the sources’ provenance arrays.domains_json= deduplicated union of the sources’ domain tags.created_at/updated_at=Utc::now().memory_type="summary"(so downstream readers can distinguish a compressed-from-many memory from a primary candidate).status="candidate"(the compressed summary is candidate-tier evidence; the standard acceptance ceremony still applies).
The source memories / episodes are NOT deleted; the
memory_supersessions / episode_supersessions join tables landed by
migration 009_decay_supersessions record the “this summary was
produced by compressing X, Y, Z” edge.
§Determinism contract
Same inputs (source rows, source-id order) MUST produce a summary memory
whose claim, confidence, authority, and provenance arrays are
byte-stable across runs. The only non-deterministic field is the
summary memory’s id (ULID) and its created_at / updated_at
timestamps. The runner (super::runner) and the compressor are
intentionally separate so this determinism stays inspectable from the
call site.
Enums§
- Authority
Tier - Trust-tier ranking used to fold an authority label across N sources.
Functions§
- compress_
candidate_ memories - Compress N candidate-tier memories into one summary memory and persist the produced summary as a candidate row.
- compress_
candidate_ memories_ with_ job - Same as
compress_candidate_memoriesbut attaches the produced supersession edges to a specific decay job (so the runner can write the audit trail under the job’s id). - compress_
episodes - Compress N episode summaries into one summary memory and persist the produced summary as a candidate row.
- compress_
episodes_ with_ job - Same as
compress_episodesbut attaches the produced supersession edges to a specific decay job.