Log cycle — compose the entry as a Python dict, json.dumps, then
append via dream-log-append "$LINE". RECEIPTS-FIRST (added 2026-06-11):
if long verifies are still running when every other step is done, append
the entry NOW with those items marked "<doc>:PENDING" in actions, then
amend after via dream-log-amend <session_id> '<patch-json>' (flock'd,
value-only, audited; added 2026-06-11 because hand-rolled rewrites of the
canonical log missed a residual marker) — never hold the whole cycle's
receipts hostage to the slowest probe. The amend done-test greps the
amended ENTRY for PROVISIONAL|:PENDING, not just the tests.yaml. Cron/staged sessions can be cut at any moment; results that exist
only in-context are lost (the 18:07 6/11 audit lost its entire log+report
this way and REFLECT had to forensically recover it from the transcript).
STAGED-WAKE REFLECT BINDING (2026-06-11, 2nd occurrence same day): any
stage that recovers or finishes a cut dream/audit cycle owns this append.
The cycle is INCOMPLETE until the dream-log line exists — an audit report,
journal entry, or trace does NOT substitute (dream-recent-clean keys ONLY
on dream-log.jsonl recency, so a report-without-append forces a redundant
cycle next wake). Recovery checklist order: dream-log append (with
:PENDING markers) FIRST, then report/journal/trace.
The CLI enforces the schema
(canonical actions keys, dict-typed phase_2_meta_review, inline —
never pointer — mistakes_2plus_30d_assessment, single-object JSON,
newline repair) and rejects non-compliant entries: on exit≠0, fix the
reported field and retry — never bypass, never bare >>.
Entry shape (canonical actions keys are exactly these; empty arrays may
be dropped):
{"ts":"...","session_id":"...","stats_snapshot":{...},
"meta_audit":{"chronic_failures":[],"stuck_topics":[],
"noisy_threshold":false,"permanently_contested":[]},
"actions":{"coverage_ingests":[],"coverage_edits":[],"quality_repairs":[],
"quality_verifies":[],"staleness_supersedes":[],
"contested_resolved":[],"gaps_surfaced":[],"transients":[],
"substrate_fixes":[]},
"step_results":{...},
"phase_2_meta_review":{
"predictions_accuracy":{...},
"mistakes_2plus_30d_assessment":"<full inline 2+/30d root-cause-clustered assessment>",
"s4_initiatives":{...},
"session_capsule_check":{"exists":true,"action":"skip"}},
"escalations":[],"duration_ms":0}
S4 path pin: the s4-initiatives ledger is
~/.local/state/alfred/areas/s4-initiatives/ (NOT ~/areas/ — stubs only).
Approximations go in string fields ("count_7d_approx":"~11"), never a
tilde in a numeric slot.
Hook-ship preserve gate: if this cycle shipped a NEW hook, then BEFORE
the log append: declare it in ~/.local/state/alfred/hooks-preserve.json
and confirm hooks-preserve-check PASS. FAIL blocks the append exactly
like a schema FAIL (generic discipline: alfred.md Pre-Ship Gate #7).