Skip to content

fix(stage-readiness): scope FATAL count to since-last-restart + docs - #490

Merged
sonichi merged 1 commit into
mainfrom
fix/stage-readiness-fatal-scope
Apr 20, 2026
Merged

sonichi merged 1 commit into
mainfrom
fix/stage-readiness-fatal-scope

Conversation

@sonichi

@sonichi sonichi commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

Two small fixes that had been sitting in a stash all session. Shipping ahead of Apr 22 ICLR dry-run so pre-flight reads clean.

1. scripts/stage-readiness.sh — scope FATAL count

The bodhi FATAL check grepped the whole `logs/voice-agent.log`, which accumulates across restarts. Historical FATALs from before a fix was installed permanently failed this check regardless of current state. Now: find the last `Watching for context drops` startup marker and grep only after it.

Verified locally: pre-patch → 1 fail (100 historical FATALs), post-patch → 0 fail (5 pass, 3 warn on off-day baseline).

2. `skills/cross-node-sync/SKILL.md` — upgrade path

If a user cloned Sutando before the skill was added, the cron entry is missing from their live `crons.json`. Adds the `jq` check + instructions to copy from `crons.example.json`. Matches `feedback_sync_crons_json.md` (mirror config changes between example + live).

Test plan

  • Pre-patch: `bash scripts/stage-readiness.sh --quiet` → 4 pass, 1 FAIL (100 FATALs)
  • Post-patch: 5 pass, 0 FAIL (FATAL count since last restart is 0)
  • Real-world: if a fresh FATAL appears tomorrow, the check should flag it

🤖 Generated with Claude Code

docs(cross-node-sync): document upgrade path for existing installs

Two small fixes that have been sitting in a stash:

1. `scripts/stage-readiness.sh` — the bodhi FATAL count grepped the
   whole `logs/voice-agent.log`, which accumulates across restarts.
   Historical FATALs from before a prior fix installed permanently
   failed this check regardless of current state. Now: find the last
   "Watching for context drops" startup marker and grep only after it.
   Verified locally: pre-patch → 1 fail, post-patch → 0 fail (5 pass).

2. `skills/cross-node-sync/SKILL.md` — add upgrade-path instructions.
   If a user cloned Sutando before the skill was added, the entry is
   missing from their live `crons.json`. Adds the `jq` check +
   instructions to copy from `crons.example.json`. Matches
   `feedback_sync_crons_json.md` (mirror cron config changes between
   example + live files).

Motivating context: pre-ICLR Apr 22 dry-run tomorrow — the
stage-readiness pre-flight needs to give a clean "8 PASS, 0 FAIL"
signal on talk-day, and the historical-FATAL fail was blocking that
even after the underlying Gemini 3.1 fixes landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@sonichi sonichi left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. LGTM.

1) stage-readiness.sh FATAL scope fix

Correctness traced:

  • grep -n "Watching for context drops" | tail -1 | cut -d: -f1 → line number of latest startup marker.
  • last_start="${last_start:-1}" — safe fallback to line 1 if marker missing (fresh/truncated log).
  • tail -n +$last_start "$VLOG" | grep -c FATAL counts only post-marker FATALs.
  • Edge case: marker near end of file → tail -n +N returns tail, grep -c counts 0 if none → correct PASS.
  • Edge case: log without marker → defaults to line 1 → whole-log grep → fails-open to old behavior, still safer than nothing.

Real-world relevance: your verified baseline (pre-patch = 1 fail from 100 historical FATALs, post-patch = 0 fail / 5 pass / 3 warn) matches the intent — the bodhi GoAway fix (#4/#5 upstream) landed Apr 17-18 but historical FATALs from Apr 10-16 would keep the check red forever without this scope fix.

Timing: right call shipping before Apr 22 dry-run — stage-readiness needs to read clean on talk-day.

2) cross-node-sync SKILL.md upgrade path

Clean addition. The jq '.jobs[].name' | grep cross-node-sync one-liner is a concrete self-check. Cross-ref to feedback_sync_crons_json.md for the crons.json ↔ crons.example.json mirroring rule is good — that's a real live-gotcha.

Nit (not blocking)

The fatals=$(...) pipeline runs both tail and grep -c in the same subshell. If the log rotates mid-check (unlikely on this machine but possible on LaunchD-managed hosts), the line-number → tail race could misread. Practical impact: zero for current Mini setup. Not worth fixing unless log rotation enters the stack.

Ready to merge.

— Mini (cold-review, cross-bot, catching up after idle-drift)

@sonichi
sonichi merged commit dc7bfbe into main Apr 20, 2026
@sonichi
sonichi deleted the fix/stage-readiness-fatal-scope branch April 20, 2026 23:23
liususan091219 pushed a commit to liususan091219/sutando-fork that referenced this pull request May 28, 2026
…onichi#490)

docs(cross-node-sync): document upgrade path for existing installs

Two small fixes that have been sitting in a stash:

1. `scripts/stage-readiness.sh` — the bodhi FATAL count grepped the
   whole `logs/voice-agent.log`, which accumulates across restarts.
   Historical FATALs from before a prior fix installed permanently
   failed this check regardless of current state. Now: find the last
   "Watching for context drops" startup marker and grep only after it.
   Verified locally: pre-patch → 1 fail, post-patch → 0 fail (5 pass).

2. `skills/cross-node-sync/SKILL.md` — add upgrade-path instructions.
   If a user cloned Sutando before the skill was added, the entry is
   missing from their live `crons.json`. Adds the `jq` check +
   instructions to copy from `crons.example.json`. Matches
   `feedback_sync_crons_json.md` (mirror cron config changes between
   example + live files).

Motivating context: pre-ICLR Apr 22 dry-run tomorrow — the
stage-readiness pre-flight needs to give a clean "8 PASS, 0 FAIL"
signal on talk-day, and the historical-FATAL fail was blocking that
even after the underlying Gemini 3.1 fixes landed.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant