myco_senesce
Run a reflect pass to promote notes and update boot_brief.md at session end. Optionally trigger immune --fix to repair findings, preventing raw queue backlogs.
Instructions
Put the session into dormancy: run a reflect pass (which may promote raw notes, update integrated frontmatter, and patch boot_brief.md). In full mode (default), also run myco_immune --fix to repair any mechanically-fixable findings the session produced. This is the R2 SESSION-END RITUAL per the Hard Contract.
Use this: at session end BEFORE compaction (PreCompact hook calls this with quick=false — full mode). On abrupt exit with a tight kill budget (~1.5s, SessionEnd hook), pass quick=true — reflect only, skip immune; the next SessionStart catches up. Do NOT skip this at session end: without senesce, the raw queue backs up across sessions and reflex signals go stale.
Side effects: may write to notes/integrated/ (promotions), boot_brief.md (signal refresh), and trigger full immune --fix in default mode (which may write to various R6-allowed paths). In quick=true mode: reflect only, no immune.
Returns: { exit_code, findings: [...], reflect: { promoted, errors, outcomes }, immune: { dimensions_run, skeleton_downgrade_applied, exit_on, fix, fixes }, mode }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quick | No | When true, skip immune --fix and run only reflect (the note-promotion + boot-brief patch subset). Use from SessionEnd hook where the process has ~1.5s before kill. The next SessionStart or PreCompact picks up the skipped immune work. Default false = full reflect + immune --fix pass (slower, typically 2-5s). | |
| project_dir | No | Absolute path of the workspace / project whose Myco substrate this call targets. Overrides auto-discovery. When omitted, Myco resolves via MCP roots/list, then MYCO_PROJECT_DIR, then cwd — the substrate_pulse field in every response echoes which source answered. |