myco_excrete
Move an incorrectly captured raw note to an excreted tombstone with a reason and timestamp, preserving an audit trail. Refuses to act on integrated or distilled notes.
Instructions
Remove a single raw note from notes/raw/ when it should never have been captured: typo-paste, accidental project_dir routing, duplicate ingest, test data. The note is NOT unlinked — excrete moves it to .myco/state/excreted/.md and annotates its frontmatter with excreted_at, excreted_reason, and excreted_from, preserving an audit trail.
Use this when: you just ran myco_eat and immediately realized the content was garbage, or myco_hunger shows a raw note that should not have been captured. Do NOT use this to remove integrated or distilled notes — those are protected (R4 eat- insights + R7 top-down layering: integrated is a stable lower layer, silent deletion would rewrite history). Attempts to target notes/integrated/ or notes/distilled/ are refused with UsageError. For substantive removal of integrated material, use a myco_fruit craft proposal + myco_winnow review cycle.
Side effects: moves one file from notes/raw/ to .myco/state/excreted/. Writes the moved file with augmented frontmatter. .myco/state/ must be in R6 write_surface (added to template write_surfaces in v0.5.24; existing substrates may need to add .myco/state/** manually to _canon.yaml). Excreted tombstones are gitignored by default.
Returns: { exit_code, note_id, from_path, to_path, reason, excreted_at, dry_run }. exit_code 3 on UsageError (missing note_id, missing reason, or note not in notes/raw/); 0 on success, including dry-run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note_id | Yes | Stem of the raw note to excrete (filename minus .md, no directory prefix). Example: '20260424T080500Z_typo-paste'. List available stems via myco_forage --path notes/raw. The stem is looked up under notes/raw/ — targeting anything outside that directory is a UsageError. | |
| reason | Yes | Human-readable explanation of why this note is being deleted. Required — there is no way to excrete without a reason. The text is recorded in the tombstone's frontmatter as excreted_reason. Common values: 'typo-paste', 'wrong-substrate', 'accidental-ingest', 'duplicate-of-<other-note-id>', 'test-data-cleanup'. Single-quoted YAML scalar; apostrophes are auto-escaped. | |
| dry_run | No | When true, compute the exact move (from/to paths, excreted_at timestamp) and return the audit payload without writing. Use before destructive calls to confirm the right note is selected. Default false (moves immediately). | |
| 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. |