PR #772 follow-ups: session_start.py residuals nf-wrgo ← Beads

closed priority 2 task unassigned

Twinned from https://github.com/cfsh/ninefold/issues/775 by tools/beads/import_github.py's reconcile pass.

Suggestions from ninefold-reviewer's review of #772. Unclaimed, unlabelled — fold any of them into #772's branch instead if you prefer; nothing here blocks that PR.

  1. OFF-MAIN advises a command git can refuse, and never fetchestools/pr/session_start.py, orient(). The message says `git switch main && git pull --ff-only. In the ~/nf/devs/<topic> worktree layout the clone holds main, so a second checkout of it fails with the already used by worktree error this repo documents at rebuild_f5.py:195 / notes/f5.md. CLAUDE.md loop step 1 is git switch -c feat/<name> from latest main, which works in either layout. The branch also skips the fetch, so origin/main` may be stale when the session follows the advice — and fetching a remote-tracking ref writes nothing into the worktree, so the "least able to surprise" argument does not cost anything here.
  1. ASK before switching is stronger than the risk — same function. Switching away endangers neither a live PR nor unpushed commits; the branch ref and its commits survive. The one real hazard is the opposite case: git switch main with uncommitted tracked edits carries them onto main, and that sub-case gets the mildest wording ("It also has uncommitted changes: …"). Inverting the emphasis lets the clean case proceed without a human round-trip (CLAUDE.md value 1).
  1. _count() reports 0 on failure, which reads as CURRENTtools/pr/session_start.py. A failed or unparseable rev-list --count yields ahead=0, behind=0 and the line "On main, level with origin/main" — a positive claim the tool did not verify, in the module whose own standard is "a hook that reports CURRENT off a stale ref is worse than no hook" (DEV_PRINCIPLES D2). test_an_unreadable_count_does_not_crash_the_hook pins the current behaviour. Suggest int | None, with NoneUNKNOWN/OFFLINE carrying git's message.
  1. AHEAD drops the dirty list from its reportDIRTY and OFF-MAIN both name their dirty paths; AHEAD stores dirty and never prints it (report() only appends the untracked line when untracked_only is set). AHEAD is the state that ends in "report it — do not resolve it silently", so it is the one where a human wants the whole picture.
  1. WiringTest does not assert the registered path existstools/tests/test_session_start.py. It checks the command *string* contains tools/pr/session_start.py; a rename that misses .claude/settings.json leaves the test green and the hook pointing at nothing. One assertTrue((ROOT / "tools" / "pr" / "session_start.py").is_file()) closes it, in the same guard-the-guard shape as test_launchers.py's test_the_scan_finds_the_known_entry_points.
  1. "The five states" heads a seven-row tabletools/pr/session_start.py docstring.

Dependencies

None.

Comments

No comments.

Add a comment