01-projects/ray-ops/2026-11-10-fable-bakeoff

fix IMPLEMENTATION NOTES

Fable 5.2 fix run: implementation notes (2026-11-10)

Implements the "Safe" steps of task1-harness-audit-B.md. Order: 0b, 1b, 1a, 1d, 1c, 3a, 2d, 2c, 4c, 5b, 5d, 4e, 5a. Pre-change snapshot (read-only reference): ~/.claude/state/pre-fable-fix-2026-11-10/.

Session start: 2026-11-10 06:29 ET.

Summary (written at the end of the run)

Step Status Evidence in one line
0b DONE The three sensitive files are out of the git index and ignored; leak-scan.py --staged rc=0 on tonight's commit; throwaway-repo test holds back a planted token and fails closed when the scanner is broken
1b DONE New selector finds 38 runs with denials in the real logs; the old one matched 0 of 406
1a DONE (books-refresh not fired) house-clock produced its first run log ever and filled the October row; old code reproduced the silent no-run in a sandbox
1d DONE (opt-in per job) report= held on the live house-clock run; 7 sandbox cases pass
1c DONE graph-reingest ran model-free through the dispatcher (first audit-log line since 08-17); sync-contacts ledger mtime moved from 2026-08-17 to 2026-11-10 06:50:47 on Haiku 5.5 with 0 denials
3a DONE All three IDs smoke-tested OK before the switch; one tier file read by dispatcher, runner and watchdog; the 08:00 check-board cron ran on claude-sonnet-5-5, exit 0, 0 denials
2d DONE (positive path not run with a real channels session) Real claude -p children skip with and without the inherited flag; private-tmux run of the restart script's own export line arms window 0 and not the fleet window
2c DONE (new brief step first runs 06:30 tomorrow) 263 files moved to archive/2026-11-10/, 279 files before and after, 13 left and listed; dead crontab line removed
4c DONE The restart script's own filter now yields only caf-architect and ingest-agent; no process killed
5b DONE (settings lines proposed only) grep CLAUDE\.md over skills, runner context and runner leaves only two intentional mentions; throwaway sync pushes AGENTS.md, crontab and both plists
5d DONE for scripts 41 unreferenced files moved to scripts/archive/2026-11-10/; 4 backups and ask-model.sh skipped because still referenced
4e PARTIAL Changelogs: 14 active skills migrated, 42 KB out of SKILL.md, line-for-line conservation check passes. Off-skill archive skipped: every one is still referenced
5a DONE 22 of 22 sandbox tests; live 07:11 tick migrated state and fired nothing unscheduled; a real scheduled job fired at 08:00 and logged to the new persistent log; --validate rc=0

Files changed (everything else is untouched; the founder-gated files were verified unmodified at the end: settings.json is byte-identical to the snapshot, settings.local.json, SOUL.md, AGENTS.md and agents/ have pre-run mtimes):

Two files under the do-not-edit memory path (MEMORY.md, feedback_delegation_model_effort_pairing.md) show an mtime of 06:29:31. My first command ran at 06:29:38 and I never wrote there; that change predates this run.

Session-level notes

0b. Backup excludes + pre-commit leak scan: DONE

Re-verified live: git ls-files in ~/Projects/ray-config still tracked dotclaude/settings.local.json, home/.claude.json, dotclaude/state/books-raw.json; a names-only scan of the whole tracked tree flagged exactly one file (dotclaude/settings.local.json, "1Password service account token").

Changed (all in ~/Projects/ray-config):

Verified:

Not done / needs a human:

1b. Denial parser: DONE

Re-verified live: every one of 406 run logs has its result JSON starting {"duration_api_ms"; the old selector grep -m1 '^{"is_error"' matched none.

Changed: ~/.claude/scripts/cron-job-runner.sh:224-226 selects the result with jq -R -c 'fromjson? | select(type == "object" and .type == "result")' (last one wins, non-JSON lines skipped). :228-239 the is_error verdict now reads the parsed result instead of grepping the whole log (the old grep could in principle match text inside a result). :285 the denial block reuses that result.

Verified:

Heads-up: the alarm is now live. Deep-research had denials on 7 of its last 15 runs, so expect a cron-denial-deep-research ops-log entry and an iMessage attempt roughly every other night until those commands are allow-listed. From the launchd tree that iMessage usually fails (audit finding 3) and falls back to cron-undelivered/ plus a cron-failures.log line, which the morning brief reads.

1a. Slugs, lock failures, backfill: DONE (books refresh deliberately not fired)

Re-verified live: the four inline-prompt jobs had 617, 1023, 1270 and 990-character slugs. Reproduced in a sandbox with the snapshot dispatcher + runner: FORCE-FIRE logged, 0 run logs, 0 failure lines, claude never invoked.

Changed:

Verified:

Not fired, needs Ray or the founder:

My own mess: a root-cause probe for 1c ran ops-log.sh --help, which is not a help flag; it appended an empty entry ## 2026-11-10 06:42 ET · --help to ~/.claude/state/ops-log.md. The file carries the uappnd (append-only) flag, so I left it. Two older --help entries (10-14, 10-20) show other runs have made the same mistake.

1d. Runner postconditions: DONE (opt-in per job)

Changed:

Why opt-in rather than on for every job: I measured the last 14 days. open-threads-check reports on about 1 run in 5 by design (silent when nothing to park), process-youtube and cert-study skip the ops log on no-op runs, and process-newsletter, finance-pulse, compile-vault and self-review did not show an entry on every run. A blanket rule would have put false failures in the morning brief daily. The six slash-command jobs above reported on every measured run.

Verified: sandbox cases 2-8 (report landed, prefix match, none landed, wrong source, fresh written, stale file, missing file) all pass, and the live house-clock run above passed its report= check.

Not covered: jobs without report=/fresh= are still trusted on exit 0 (though a denial now raises the 1b alarm). sync-contacts gets fresh= in 1c.

1c. Haiku jobs: DONE

Root cause, now confirmed (the audit only had a hypothesis). Probe from ~, headless, same two commands on each model (an append to a file in ~/.claude/state/ and an ops-log.sh call): claude-haiku-4-5-20251001 returned permission_denials for both and answered "DENIED"; claude-haiku-5-5 ran both with 0 denials. So under Haiku 4.5 every Bash call outside the allow-list was denied in headless runs; the allow-listed stage commands ran, the writes did not.

graph-reingest is now model-free:

sync-contacts stays a model job on the haiku tier, which is now Haiku 5.5 (see 3a), with scheduled-jobs.txt:129 fresh=~/.claude/state/sync-contacts-ledger.json.

Verified:

Not done: nothing kills a shell job's child processes on timeout (same limitation the claude path already has).

3a. One tier map: DONE

Smoke tests, run before anything was switched, each with claude -p "reply OK" --model <id> --strict-mcp-config --no-session-persistence --output-format json:

Changed:

Verified:

Proposed founder-gated diff (~/.claude/settings.json, not applied): the per-model override is keyed to the old Sonnet ID, so it no longer matches anything the crons run.

   "modelSettings": {
-    "claude-sonnet-5": {
+    "claude-sonnet-5-5": {
       "effortLevel": "high"
     }
   }

It makes no difference today because the global effortLevel is also high; it will matter the day the global default changes. agents/fanout.md and the delegation memory (audit step 3c) are untouched.

2d. Re-arm hook is now an allowlist: DONE

Re-verified live: emit-cron-rearm.sh armed any session without RAY_HEADLESS_CRON or RAY_SUPPORT_AGENT; this session was told to arm /morning-prep one minute before 06:30.

Something the audit missed: ps shows this headless session is a descendant of the live channels session (claude --name channels-agent --channels ... → zsh → run-fix.sh → claude -p). An env flag is inherited by every child, so the audit's plan as written ("arm only when RAY_CHANNELS_AGENT=1") would still have armed this session once the flag existed. The fix therefore uses the flag and the launch shape together.

Changed:

Code path for tomorrow's 04:00 restart, read end to end:

  1. ~/Library/LaunchAgents/com.claude.channels.plist: /bin/zsh ~/.claude/scripts/claude-channels-restart.sh at 04:00 (and at load).
  2. Restart script :101 tmux new-session -d -s claude-channels -c /Users/ray creates window 0 with a login zsh.
  3. :109 types export DISABLE_AUTO_UPDATE=true DISABLE_UPDATE_PROMPT=true RAY_CHANNELS_AGENT=1; source ~/.zprofile; source ~/.zshrc into that shell. Neither profile file mentions RAY_ (grep), so nothing unsets it.
  4. :166 types claude --name channels-agent --channels plugin:imessage@claude-plugins-official --chrome "<seed>" into the same shell; the retry at :183 uses the same shell. The claude process inherits the flag and has --channels in its arguments.
  5. settings.json hooks.SessionStart (matchers startup and resume) runs /Users/ray/.claude/scripts/emit-cron-rearm.sh as a child of that claude process, so rule 3 arms (and rule 5 would too if ps failed).
  6. Fleet windows: :220 exports RAY_SUPPORT_AGENT=1 in each new window; rule 1 skips them, and they have no --channels.

Verified:

Not verified, and how to check: the positive path with a real claude --channels process was not run, because a second channels session would attach to the founder's iMessage channel. After the 04:00 restart on 2026-11-11, tail ~/.claude/logs/cron-rearm.log should show one ARM launch shape has --channels (RAY_CHANNELS_AGENT=1) line near 04:01, and CronList in the live session should list /morning-prep. The live session was not restarted and no tmux or claude process was killed.

2c. Undelivered backlog, drain, dead crontab line: DONE (drain step not exercised live)

Re-verified live: ~/.claude/state/cron-undelivered/ held 276 top-level files (plus 3 in superseded/), oldest 2026-06-12; messages-watchdog.sh:16 is a bare exit 0 and the crontab still ran it every 5 minutes; morning-prep/SKILL.md read only cron-failures.log.

Changed:

Verified:

Not verified: the new morning-prep step has not run (running the skill sends the brief). It first runs at 06:30 on 2026-11-11. Check that morning's · morning-prep ops-log record for the relayed/moot counts and that cron-undelivered.sh count drops.

For Ray to relay by hand (13 pending files, 6 topics, all from the last 3 days, none delivered by me). Check the thread first; any the founder has since answered are moot. Then cron-undelivered.sh done <name>....

  1. cert-study off-track alert (11-09 07:48), the one clearly founder-relevant item: "AWS AIP-C01 - off-track. Cold pretest still not taken, 3 days past the plan's own week-1 window, so the Dec-4 date stays a placeholder until it's scored." File cert-study-20261109T074850.md.
  2. Rental car: log as expense instead of mileage? Ray's unanswered ask from 11-09 16:58. Files open-threads-check-20261109T181150.md, ...T191143.md, ...T201344.md.
  3. Odometer reading for the mileage log. Ray's ask from 11-09 13:08. File open-threads-check-20261109T151357.md.
  4. Research queue re-aim to 3 outcomes: decision. Files open-threads-check-20261109T111146.md, ...T121150.md.
  5. TagaPet post (Ship 30 Post 3): SC-020 honesty check, Amsterdam detail, post timing. Ray's ask from 11-08 11:37. Files open-threads-check-20261108T131159.md, ...T141217.md, ...T151410.md, ...T161210.md.
  6. Dash cam price/fit check. Files open-threads-check-20261107T181142.md, ...T190713.md.

Still open (founder hands, audit 2a): the cause of the failed sends is untouched. Sends from the launchd tree will keep landing in this folder; the difference is that the morning brief now reads it.

4c. sw-* fleet lines: DONE

Re-verified live: fleet-manifest.txt listed six agents; scheduled-jobs.txt records the studio as paused by the founder on 2026-11-01; state/fleet-status/sw-*.md last written Oct 1-9.

Changed: ~/.claude/scripts/fleet-manifest.txt:14-22 the four sw-product, sw-design, sw-engineering, sw-growth lines are commented out under a dated note. caf-architect and ingest-agent are unchanged (4d is a founder decision).

Verified: the restart script's own filter (grep -v '^[[:space:]]*#' fleet-manifest.txt | grep '|') now yields only caf-architect and ingest-agent; diff against the snapshot shows only the comment block and the four # prefixes; the four running claude --name sw-* processes are still running (not killed) and all four handoff files are still in state/handoffs/.

Tell the founder: the four Scribble Works agents stop respawning from the 04:00 restart on 2026-11-11. Resume = uncomment four lines.

5b. Stale text and backup gaps: DONE (settings lines proposed only)

Re-verified live: ~/CLAUDE.md does not exist; AGENTS.md hard rules 1-4 carry the same numbers the skills cite, so the references map one to one.

"CLAUDE.md" → "AGENTS.md" (exact-string replacements, each asserted to occur exactly once):

Discord remnants outside settings: most mentions are accurate history ("replaced Discord #ops on 2026-09-04") and were left. Changed only text that still read as a live instruction: skills/graph-query/SKILL.md:52, skills/finance-pulse/SKILL.md:294, the comment at scripts/cron-job-runner.sh:99-100, the comment at scripts/scheduled-jobs.txt:75-77.

Backup gaps (~/Projects/ray-config):

Verified:

Skipped on purpose:

Proposed founder-gated diffs (not applied):

~/.claude/settings.json:14-18, remove the five permissions for the retired Discord plugin:

-      "mcp__plugin_discord_discord__reply",
-      "mcp__plugin_discord_discord__react",
-      "mcp__plugin_discord_discord__edit_message",
-      "mcp__plugin_discord_discord__fetch_messages",
-      "mcp__plugin_discord_discord__download_attachment",

~/.claude/settings.local.json, in permissions.allow:

-      "mcp__plugin_discord_discord__reply"

(mind the trailing comma on the line before it). In the same file the env block holding OP_SERVICE_ACCOUNT_TOKEN should be deleted after rotation (audit 0a); scripts/op-service-account.sh reads the token from Keychain. I did not open that block.

~/.claude/settings.json:106, the skill override for a skill that does not exist:

-    "investing-edgar-watch": "off"

(and drop the trailing comma on the line above).

5d. Clutter sweep: DONE for scripts (settings backups left for the founder)

Re-verified live: ~/.claude/scripts/ held 38 .bak-* files and 125 entries in total.

Changed: 41 files moved (not deleted) to ~/.claude/scripts/archive/2026-11-10/, with an ARCHIVE-MANIFEST.md listing each one and how to restore it.

Reference check before each move (/tmp/fable-wip/refcheck.sh, a loop of grep -F for the file name): user crontab, ~/Library/LaunchAgents, scheduled-jobs.txt, every live script and precheck, settings.json and settings.local.json (match only, nothing printed), skills/, agents/, AGENTS.md, SOUL.md, CAPABILITIES.md, cron-runner-context.md, ray-handoff.md. Every moved file had zero references. leak-scan.py over all 41: clean.

Skipped because still referenced:

Skipped by judgment: alpaca-paper-smoke-test.py and catalog-sync-prod.sh are unreferenced but are reusable hand-run tools, not one-offs.

Verified: ls scripts | wc -l went 125 → 85 (41 out, the archive/ folder in); ls archive/2026-11-10 | wc -l is 42 (41 files + manifest); ls scripts | grep -c '\.bak' is 4, exactly the four skipped; bash -n cron-job-runner.sh and cron-dispatcher.py --validate still pass.

Left for the founder (not touched): the 16 ~/.claude/settings.json.bak-* files. They are unreferenced and leak-scan.py finds no credential pattern in them, but they sit beside the two settings files I was told not to edit, so I did not move them. If wanted: mkdir -p ~/.claude/settings-backups/2026-11-10 && mv ~/.claude/settings.json.bak-* ~/.claude/settings-backups/2026-11-10/ The 534 MB backup-repo .git is part of founder step 0c.

4e. Changelogs out of SKILL.md: DONE. Off-skill archive: SKIPPED (all still referenced)

Changelogs

Re-verified live, and the audit was wrong on one number: it said /improve was "56 KB, of which 52 KB is changelog". The first ## Changelog in that file is an example inside a code fence; the real changelog was the last 16 KB. The other 40 KB is the skill's own instructions (mostly the 14-check recurrence guardrail), which is not a changelog and was not touched.

Changed:

Verified:

Not verified: that the weekly headless /improve autonomous run (Monday 07:00, Opus) follows the new step and that auto mode lets it run the script. Check improve/CHANGELOG.md and the SKILL.md sizes after the 2026-11-16 run.

The 22 switched-off skills: not moved

The rule for this step was to skip anything still referenced, with settings.json on the list of places to look. Every one of the 21 off skills that exists is named in settings.json skillOverrides, so under that rule none can move without a settings edit, which is founder-gated.

The re-check also showed the audit's recommendation was too broad. Beyond the override:

Being switched off already keeps a skill out of the listing, so the context cost the audit worried about is not there; the remaining cost is disk and backup size.

Proposed, founder-gated (not applied). If the two unreferenced ones should go:

mkdir -p ~/.claude/skills-archive/2026-11-10
mv ~/.claude/skills/building-an-exo ~/.claude/skills/snowflake-cli ~/.claude/skills-archive/2026-11-10/

and in ~/.claude/settings.json skillOverrides:

-    "building-an-exo": "off",
-    "snowflake-cli": "off",

Leaving those two override lines in place is harmless and has one benefit: a restored skill comes back already switched off.

5a. Dispatcher hardening: DONE

Re-verified live: no catch-up logic; state[slug] was set before run_precheck; a missing precheck logged "proceeding (fail-open)"; the only log was /tmp/ray-cron-dispatcher.log; per-job timeout and effort lived in TIMEOUTS / EFFORT_MAP in the dispatcher and a case in the runner. Found one more while reading: a forced fire returned before the normal tick, so any job due in the same minute as a forced fire was silently dropped.

Changed:

Verified:

Not done:

5a addendum: live due-job self-test (07:15)

To prove the live path a scheduled job takes (launchd tick, tick, handle, fire, runner) without waiting for a real job, I appended one temporary manifest line at 07:14:17: 15 7 10 11 * | system | shell | - | name=fable-selftest timeout=60 | ~/.claude/scripts/model-tier.sh sonnet (a model-free job that only prints a model ID). Result at 07:15:05: ~/.claude/logs/cron-runs/fable-selftest-20261110T071505.log contains claude-sonnet-5-5 and === done exit=0 ===; ~/.claude/logs/cron-dispatcher.log (the new persistent log) got its first line, FIRE fable-selftest model=shell timeout=60s effort=inherit; the state file recorded fable-selftest: 2026-11-10T07:15; no failure line. Then the manifest was restored byte-for-byte (cmp against the copy taken before the test), the state key was removed, and --validate is back to OK: 22 jobs (21 system), 0 errors, 0 warnings. The run log is left in place; the runner's 14-day retention removes it.

Observed at 08:00, the first natural claude job on the new dispatcher, runner, manifest and Sonnet 5.5: ~/.claude/logs/cron-dispatcher.log shows 2026-11-10T08:00:05 FIRE check-board model=claude-sonnet-5-5 timeout=1800s effort=inherit; logs/cron-runs/check-board-20261110T080005.log header carries report=check-board and ends === done exit=0 === at 08:00:41; the result JSON has is_error:false, 11 turns, 0 permission denials, modelUsage only claude-sonnet-5-5; the ops log has one ## 2026-11-10 08:.. ET · check-board entry, so the report= postcondition held on a natural run; cron-failures.log has no line dated after 07:00; the lock was released; state reads check-board: 2026-11-10T08:00.

Run ended 2026-11-10 08:01 ET.