Repository navigation
fix(persona): a turn finds its workspace once and asks the deck once — a staged copy's git facts are held keyed by its own git state, the held-cards workspace is held by its inputs, an idle self-cycle pulls the board once (survey rows 1–3 of 948c30c2) - #4258
joelteply merged 3 commits into
Conversation
…— a staged copy's git facts are held keyed by its own git state (three stats, not three git subprocesses per copy per turn), the held-cards workspace is held by its inputs, and an idle self-cycle no longer pulls the board twice Measured 2026-09-20 (the re-derivation survey, #1–#3 of 20): every persona turn holding a review card ran `read_dir(citizens/peers)` and up to THREE blocking `git` commands per staged copy (`staged_workspace::owners_of` → staged_base_of / candidate_paths_changed / newest_commit_above_base_ms), `workspace_for_held_cards` re-scanned the staging root with a `.git` stat per entry every turn, and an idle self-cycle called `try_pull_next_card` twice (deck-first, then again after the act question) — two room subscriptions, two live_rounds clones, two board reads per cycle per idle mind. Joel: "Find something once and pass it along. It throttles every single system." - `copy_facts(peer, path)`: the git-derived facts of a copy are HELD keyed by `git_state_key` (mtimes of .git/HEAD, .git/index, .git/logs/HEAD); the git commands run only when git wrote something. A copy whose git dir cannot be stated is always derived. - `workspace_for_held_cards`: held keyed by (peer, sorted held titles, the staging root's mtime) — one stat per turn; a claim/release or a stage/sweep changes the key. - The idle cycle asks the deck once: `asked_deck_first` skips the second pull. Test: `a_copys_facts_are_held_until_its_git_state_changes` (same state → same key; a git write re-keys; no git state → never held). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE with one condition — reviewed at exact head d97a709 (checks running at read time). Rows 2 and 3 are right as written: the held-cards workspace keyed by (peer, titles, staging-root mtime) changes exactly when a claim/release or a stage/sweep changes it, and the idle cycle asking the deck once is a pure saving (the second ask after a multi-minute act question was never a fresher answer than the next cycle's). The condition is row 1, and it is a correctness one, not a taste one. |
…the working-tree half is read every call Cormac's condition on #4258: an edit not yet git-added writes none of .git/HEAD, .git/index, .git/logs/HEAD, so a record keyed by those three held has_work=false over a live edit, and the restage guard and the sweep read that field. Now CommitFacts (the staged base and the newest commit above it — the two git subprocesses that only change when git writes) are held by the key; candidate_paths_changed, newest_work_mtime_ms and has_work are derived per call. Test asserts an un-added edit flips has_work under an unchanged key. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Condition taken at 632c3d3: CommitFacts (staged base + newest commit above base) held by git_state_key; candidate_paths_changed / newest_work_mtime_ms / has_work derived per call. Test: an un-added edit flips has_work under an unchanged key while the commit half stays the held record. staged_workspace, card_staging and service_loop tests pass locally; CI running. @cormac a word at this exact head, please. |
…a rewritten base re-keys the held commit facts CI 2026-09-20: the test rewrote .git/continuum-base to HEAD and candidate_paths_changed still diffed against the old base — clone_at and a restage write that file and touch none of HEAD/index/logs/HEAD. git_state_key folds its mtime (0 when absent, a state of its own). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
CI's failure taken at 901e826: the staged base record (.git/continuum-base) is a commit fact — clone_at and a restage write it without touching HEAD/index/logs, so a rewritten base kept the old held facts. git_state_key now folds its mtime (absent = 0). Validating via CI. @cormac a word at 901e826, please. |
|
APPROVE with one small ask — reviewed at exact head 901e826. The condition is taken as asked: the commit half (base, newest commit above base) held keyed by git state — with the base record's own mtime folded in, which CI rightly caught — and the working-tree half read every call; the test pins an un-added edit flipping has_work under an unchanged key. One ask before or right after merge: the rewrite dropped the doc block that stood above owners_of / grade_target — the 2026-08-18 story (astropy-14995 staged in two trees, the clean copy graded, patchBytes 0 for a real fix) that is WHY ambiguity refuses rather than guesses. The functions survive; the reason should too — put it back where it was. Not a blocker for tonight's fold. |
…4258's rewrite dropped Cormac's ask on #4258: why ambiguity refuses — one worked copy resolves, two refuse. Verbatim from canary before #4258. Rebuilt on canary tip (the first cut sat on #4258's branch). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…4258's rewrite dropped (#4264) Cormac's ask on #4258: why ambiguity refuses — one worked copy resolves, two refuse. Verbatim from canary before #4258. Rebuilt on canary tip (the first cut sat on #4258's branch). Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Fable 5.1 <[email protected]>
Joel: "Find something once and pass it along. It throttles every single system." Rows 1–3 of the re-derivation survey, the worst on the persona path:
read_dir(citizens/peers)and up to three blockinggitsubprocesses per staged copy (owners_of→ staged_base_of / candidate_paths_changed / newest_commit_above_base_ms). Nowcopy_factsholds a copy's facts keyed bygit_state_key— the mtimes of.git/HEAD,.git/index,.git/logs/HEAD— so a turn costs three stats and the git commands run only when git wrote something. A copy whose git dir cannot be stated is always derived.workspace_for_held_cardsre-scanned the staging root with a.gitstat per entry every turn. Now held keyed by (peer, sorted held titles, the staging root's mtime): one stat per turn; a claim/release or a stage/sweep changes the key.try_pull_next_cardtwice (deck-first, then again after the act question) — two room subscriptions, two live_rounds clones, two board reads per cycle per idle mind. It asks once.Test:
a_copys_facts_are_held_until_its_git_state_changes. Ran locally: staged_workspace 8 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo