Expand description
Phase 4.D LLM-summary execution path.
§Posture today
run_llm_summary_job is wired end-to-end:
-
If
operator_attestationisNone, the call refuses withDecayError::LlmSummaryRequiresOperatorAttestationunder the stable invariantsuper::DECAY_LLM_SUMMARY_REQUIRES_OPERATOR_ATTESTATION_INVARIANT. LLM summarisation is operator-fired only — the schema-migration boundary is the precedent: a destructive / non-deterministic action cannot be unattended. -
If
operator_attestationisSome(path), the envelope at that path is parsed and structurally validated (Ed25519 signature over the canonical bytes, schema_version, purpose discriminator). Any validation failure refuses withDecayError::LlmSummaryAttestationRejectedunder the stable invariantsuper::DECAY_LLM_SUMMARY_ATTESTATION_REJECTED_INVARIANT. -
With the envelope verified, the function loads source memories / episodes from the store, builds a
cortex_llm::SummaryRequestcarrying the operator-pinnedmodel_nameandprompt_template_blake3, and callscortex_llm::SummaryBackend::summarize. Any backend refusal (allowlist mismatch, prompt template mismatch, upstream failure, output validation failure, or the noop default backend) surfaces asDecayError::LlmSummaryBackendCallFailedunder the stable invariantsuper::DECAY_LLM_SUMMARY_BACKEND_CALL_FAILED_INVARIANT. -
On a successful backend call, the function validates that the backend’s
model_name_echoedbyte-equals the envelope’smodel_name(so a silently-routed provider cannot launder the attestation pin) and that the produced claim is non-empty and within the deterministic byte budget. It then composes a candidate-tierMemoryCandidateunder the same pessimistic-merge posture as the deterministic compressor (super::compress):confidence = min(source confidences),authority= lowest-trust authority among sources, provenance = deduplicated union of source provenance arrays. The candidate is persisted withMemoryRepo::insert_candidateand supersession edges are recorded for every source viaDecayJobRepo::record_memory_supersession(for memory sources) orDecayJobRepo::record_episode_supersession(for episode sources).
§CLI default posture
The CLI surface (cortex decay run --operator-attestation <PATH>)
injects a cortex_llm::NoopSummaryBackend today. That means a
production LLM-summary run will get all the way through envelope
verification and then refuse with
DecayError::LlmSummaryBackendCallFailed (reason
summary_backend_not_configured). Operators who want to actually
produce summaries inject a hosted backend programmatically, or pass
a cortex_llm::ReplaySummaryBackend fixture in CI.
§Doctrine note
An LLM summary is candidate-tier evidence only. It is NEVER
directly promoted to principle: the standard
cortex_memory::lifecycle::accept_candidate ceremony still applies
(proof closure, contradiction scan, semantic trust, operator temporal
authority). The LLM call itself is gated by operator attestation, and
the per-call attestation binds the operator’s signing key to:
- the model name (so a captured envelope cannot authorise a different model);
- the source ids being compressed — bound via the decay job id, so a captured envelope cannot be replayed against a different source set;
- the prompt template digest (so a captured envelope cannot silently swap prompts).
Structs§
- LlmSummary
Operator Attestation Envelope - On-disk envelope for an operator attestation authorising an LLM summary job. Structurally analogous to the migration-attestation envelope: the Ed25519 signature is computed over a domain-tagged length-prefixed binary encoding of the non-signature fields.
Functions§
- canonical_
signing_ input - Canonical signing input for the LLM-summary operator attestation
envelope. Length-prefixed big-endian framing, fixed field order, with a
1-byte domain tag that is structurally disjoint from the
migration-attestation domain. The LLM-summary domain tag is
0x21. - run_
llm_ summary_ job - Run an LLM-summary decay job.
- run_
llm_ summary_ job_ typed - Run an LLM-summary decay job for a typed
DecayJobKind. Convenience wrapper used by callers that already hold a typedsuper::DecayJob.