Skip to content

Session-start fast-forward; tracer check compares nested helpers - #438

Merged
Kyu-seok merged 2 commits into
masterfrom
retro/stale-checkout-and-nested-helpers
Nov 22, 2026
Merged

Kyu-seok merged 2 commits into
masterfrom
retro/stale-checkout-and-nested-helpers

Conversation

@Kyu-seok

Copy link
Copy Markdown
Owner

Two checks from the retro on #433, so the next build doesn't repeat two of its mistakes.

Stale main checkout. A session reads CLAUDE.md, skills and scripts from the main checkout, and nothing kept it current: it sat seven merges behind through the #433 build, pointing at a gh-ticket.sh --json that no longer existed. A new SessionStart hook, .claude/hooks/sync-main-checkout.sh, fast-forwards the main checkout when it is on master with no change to a tracked file, and prints one line into the session:

main checkout: fast-forwarded 7 commits to e78da5b4. These changed, so re-read any you were given at session start: .claude/skills/ CLAUDE.md

When it can't (another branch, local changes, master has commits of its own) it moves nothing and prints how far behind the checkout is and the command that catches it up. It is silent in a worktree session, when the checkout is current, and when origin can't be reached. The hook has a 20-second timeout in .claude/settings.json.

Nested tracer helpers. scripts/check-tracer-helpers.py compared only top-level functions, so a third copy of a nested heap helper reached review in #433. It now compares nested functions too. Twelve nested copies were already there, across about 40 tracers; they are listed in scripts/walkthroughs/nested-copies.known, which passes exactly those. A new copy, one more file copying a listed one, or a line that no longer holds (STALE) fails. #435 moves the twelve into codebite.py and empties the list.

Evidence

  • scripts/sync-main-checkout.test.sh (new, scratch repositories): level, behind, instruction files changed, untracked files, local changes, another branch, diverged, a worktree session, origin unreachable, no repository.
  • scripts/check-tracer-helpers.test.py: five new cases (nested copy, nested inside a method, listed copy passes, third file fails, stale line fails); the old "nested functions are not compared" case is now methods only.
  • scripts/run-script-tests.sh passed in both commits' hooks; shellcheck and scripts/check-doc-references.py pass; scripts/check-tracer-helpers.py exits 0 on the real tracers with the list and prints the twelve without it.
  • Not exercised: the hook inside a real session start. The first session opened after this merges is that check; it should print nothing when the checkout is current.

Door

Two-way. Removing the SessionStart entry from .claude/settings.json turns the hook off; emptying the check back to top-level is one revert. The hook only ever fast-forwards, the same move scripts/ship-branch.sh makes before a ship.

🤖 Generated with Claude Code

Kyu-seok and others added 2 commits November 22, 2026 14:57
A session reads CLAUDE.md, skills and scripts from the main checkout, which
nothing kept current: it sat seven merges behind through the #433 build.
The hook fast-forwards a clean master and says what it moved, or says how
far behind the checkout is and the command that catches it up.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A third copy of a nested heap helper reached review in #433: the check
compared only top-level functions. The twelve nested copies already there
are listed in nested-copies.known, which passes exactly those and fails on
a new copy or a stale line; #435 moves them into codebite.py.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Kyu-seok
Kyu-seok merged commit e749425 into master Nov 22, 2026
5 checks passed
@Kyu-seok
Kyu-seok deleted the retro/stale-checkout-and-nested-helpers branch November 22, 2026 06:14
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