Skip to content

Add project clean --all-safe, a safe batch worktree cleanup (feature 004-project-clean-all-safe) - #33

Draft
brettheap wants to merge 555 commits into
mainfrom
004-project-clean-all-safe
Draft

brettheap wants to merge 555 commits into
mainfrom
004-project-clean-all-safe

Conversation

@brettheap

@brettheap brettheap commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoProject-2

Closes #9

Realizes the ratified OpenSpec change add-project-clean-all-safe (PR #11, landed as 0050f3e on Brett Heap's word "ratify, merge #11 and run the runbook", 2026-10-09) as Speckit feature 004-project-clean-all-safe.

What changes

  • Foundation (Phases 1 and 2, T001 to T035): the git-floor job in .github/workflows/tests.yml (T003) builds Git 2.36.6 from kernel.org's tarball, checks its sha256 and runs -k test_clean_ -k test_status_ -k test_doctor_; the test job is unchanged. project gains named regions (T004) for the timing table, the bounded runner (child handle, one-wide driver, scoped signal handlers), the five incremental parsers, the 31-name environment scrub (17 names and the 14 trace names of Q9 B, R-99 (b)) with the protocol and status pins, path escaping, the evidence model, and the internal-error guard.
  • US1, retire every safe worktree in one run: project clean ROOT --all-safe previews one plan, the selected worktrees first, then the excluded rows grouped by reason with each group's next step; with --apply it builds, prints and confirms its own fresh plan with one default-No question (Remove N worktrees, keeping N branches? [yes/N]), removes the selected worktrees in canonical order and keeps every local branch at its planned SHA. --yes skips the question; --expect-plan DIGEST refuses with plan-digest-mismatch when the fresh plan's digest differs; no terminal and no --yes refuses confirmation-required; bad flag combinations refuse invalid-arguments. Code: clean() as a fixed pipeline (T047) and its stages (T048 to T057).
  • US2, work not proven disposable is never removed: a worktree is removable only when local ancestry proves its branch merged, its reflog shows that work began on it here, and nothing in it is hidden from Git's own check; every other row is kept with its first failing gate and next step. This closes three holes in today's single-target removal: an edit hidden by assume-unchanged, a worktree holding a submodule, and a freshly created published worktree with no commit of its own (hidden-local-state, contains-submodule, unstarted-branch, reflog-unavailable). Code: T066 and T067.
  • US3, a named action gains the batch's checks: --apply --action remove --worktree P becomes a one-item batch with the same plan, gates, stages, refusal codes and exit statuses; it removes P beside a row it cannot read, among seventeen eligible rows and past the row cap, and removes a merged worktree whose upstream was deleted (Brett Heap's ruling of 2026-10-09). Push and delete-branch keep their flags; push refuses a branch whose upstream was deleted (remote-gone) and an incomplete inspection; both print their paths escaped and neither child is signalled (the push child's pins are LQ-3 below). Code: single mode in build_plan() (T075), push_or_delete() (T076), execute() and run_bounded() (T077).
  • US4, a change after the plan stops the removal: before each removal a targeted check of at most six Git children, seven where row 4c reads extensions.worktreeConfig true, and nine or ten where the path of the root or of the common directory holds a line feed (RI-3, below), compares the identities and evidence recorded at planning and refuses at the first difference; the rescan after a removal re-establishes the repository first and reports a branch race without losing a commit. No lock is claimed: the confirmation and the result each state the residual window in one line. Code: T084 and T085.
  • US5, every removal ends in a reconcilable record: each selected target ends in one stage with one reason and, unless it was not attempted, a reconciliation record, and is removed only on rescan evidence. A started removal is never interrupted (5 s floor, 300 s ceiling, a wait line); the result names what was removed, what was not attempted, every branch kept and the next command (the stop block). Code: the removal stages (T091 to T094), with a tick hook in run_bounded() (R-83 P-1).
  • US6, every run is bounded and says what it omits: one invocation deadline (60 s with a 10 s reserve; a run with no removal in flight ends within 64 s), per-child budgets of min(5 s, work remaining), row caps (128, and 256 for the plain report) and a limit of 16 targets per run; a plan that meets the deadline, a budget or a row cap is incomplete, says so and blocks apply, and plain project clean now exits 1 when its report is incomplete. Rows past the sixteenth are deferred to the next run (deferred-target-cap) with the plan complete. Code: T099 to T102.
  • US7, acting on exactly the repository given: every clean mode resolves its argument Git-first to one repository and its main worktree, and refuses what is not a repository root with target-not-repository-root (today an absolute path can be redirected to a family holder or a manifest ancestor, and a bare repository's worktrees can be removed). The merge target is found in a fixed, recorded order, with the manifest read bounded at 1 MiB. Code: T107 and T031.
  • US8, exact paths and one JSON document per run: a path holding a line feed, a control or bidirectional character, or bytes that are not UTF-8 is reported exactly (the $'...' form in text, path_valid_utf8 in JSON) or excluded as unsupported-path-bytes, never misread and never passed to a removal. Every clean --json run but a usage error or an interruption before the apply phase prints one versioned document, and with --apply the human plan and question go to standard error. Code: json_path() and human_path() (T017).
  • US9, status, doctor and update share the evidence: they inspect repositories through the one bounded evidence model on Git 2.36 or later (version checked once, the caller's Git variables scrubbed, the status configuration pinned, lazy fetches refused locally, every child stopped and reaped on every exit path). clean refuses an old or missing Git; status, doctor and the update report show an inspection-error row instead of refusing; a shape or bench update refuses a dirty that is not exactly false. Code: T117 to T120.
  • README.md and AGENTS.md (T122, T123): the "Clean up Git worktrees" section opens with the five behaviour changes users will notice (plain project clean exits 1 on an incomplete report; clean refuses below Git 2.36; --worktree P refuses a freshly created merged worktree as unstarted-branch and one whose reflog keeps no decisive entry as reflog-unavailable; --worktree P removes a merged worktree whose upstream was deleted, keeping its branch), then the preview and apply, the gates, the 16-per-run deferral, the result record and recovery; Install states Git 2.36; the exit-code line gains clean's 1, 143 and 129. AGENTS.md gains Git 2.36, the clean tests and a section, "Cleaning up worktrees for a person".
  • Retired helpers (T125, 78cbde8): default_branch(), ancestor(), cleanup_report(), print_clean_report() and matching_worktree() are removed as baseline helpers that no caller reaches, the list lead ruling R-34 names. cleanup_signature() keeps its caller and stays.
  • Change 1's tasks.md (L1, R-377; doc round 25, ecd0a7e): 004 no longer edits openspec/changes/add-project-clean-all-safe/tasks.md; its copy equals main's (15504f1). Three of 004's four hunks there lay on lines OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 rewrote, so the PRs conflicted at landing (R-366, R-368); OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's round (p) carries the four, and 004's tasks.md records it in its Path Conventions (:109-121) and T133's rewritten verify. The landing, the archive and PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's ruling belong to the change's own governance record.
  • Next steps and refusals that Git accepts (lane 3's W52, F-2 to F-10, and W59's G-4 and G-5; R-259; merged as d764c26). Each told the user to do what Git refuses (reproduced on Git 2.43.0 and 2.36.6), and each string equals OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's at 6bf9f77 where OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 states it (W65, R-269). F-3: registration-mismatch names the repository's config and the worktree's config.worktree. F-4, F-5, F-6 and F-10 have their texts under Departures. F-7, F-8 and G-4 add --force for a worktree that holds a submodule (Q4 (c) adds what to keep first, below); F-9 with G-5 adds --quit where --abort fails for a marker with nothing in progress. F-2, in its own commit 64ad453: a locked row's partial-removal note says to unlock it first.
  • Revalidation's deadline arms (writer B, R-241, merged as 8f6fa31; W49 LOW-3, R-266, merged as b60792c): nine cut-at-the-deadline tests, four more cases and one mutant-killing test, in tests/test_clean_revalidation.py.
  • Brett Heap's F-1 and O-1, and OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 round (h)'s strings (writer G, merged as 7164d7f and 3bc1d68; R-274, R-292, R-295). F-1: after a ceiling kill the rescan reads the target's .git by one lstat, and the note says inspect, then git worktree prune and delete PATH by hand, the --force form where the registry entry and .git are both present, or, where .git cannot be read, a third note that says not to prune ("R-284: yes", R-290; "R-324: yes", R-343). O-1: a gate-7 reflog read that the work deadline cuts ends the plan deadline-exceeded, in single mode too (R-283, R-295). operation-in-progress's and inspection-incomplete's steps gain what to delete or unset by hand (R-287 (a)). R-365's build and the Q-build change these notes' texts, below.
  • The redirected main worktree's message (R-286; 2707ff2, merged as 60631eb): a repository whose main worktree is redirected by core.worktree or core.bare is refused at resolution with a message that says to unset both in the repository's config, or in the main worktree's config.worktree, then run again (the old message told the person to pass the repository root, R-271); five tests, and W81's three (1061dd7, merged as 769215d, R-302).
  • LQ-11's work-tree probe reads one path (W70 M-2, R-287 (b); 4dfd6f5, merged as fc0019e), so a linked worktree whose path holds a line feed no longer reads registration-mismatch under extensions.worktreeConfig true.
  • Unread rows, T1 to T8 (ruled by Brett Heap, below). git worktree prune, git worktree remove of that row and, after three months, git gc delete the administrative directory of a worktree whose path Git cannot read, so while any plan row's path could not be read every next step that named prune drops it or warns against it, ending do not run git worktree prune, git worktree remove or git gc until it can (nine TEXT entries). Built in e569564, dfc2baa and e8dda2a (R-312, R-327, R-343), with real-Git subtests for rows 4c and 4b (2057c31, R-344). Q3 (b) adds the dry-run suffix to the plain forms.
  • Closed standard output (Codex's one review of Add project clean --all-safe, a safe batch worktree cleanup (feature 004-project-clean-all-safe) #33, P2 on project:6600, R-322; 42454cb, R-326): an --apply --json run with standard output closed at startup removed worktrees and exited 0 with no JSON; it now refuses internal-error, exit 2, before any removal. Six tests (R-331).
  • W90's M-1 and rows 4b and 4c (R-329 to R-338; 488d6f6, c8e23cd, b3f7e0b): where a directory above the target denies search the .git counts as unread, so R-284's third note prints; rows 4b and 4c read an exit 1 as unset only when Git printed nothing, as OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 D7 says; 7 tests.
  • Doc rounds 17 to 24, docs only, each with its verifies passing: merged as 0570efd, 41dcdd2, 4916642, 4b4c36b, 0a82a62, 211e43d, d6bac50 and f3724fc (R-256, R-272, R-308, R-317, R-331, R-340, R-355, R-361); the last fixed T030's spy clause and T128's bound and noted that the hand runs are owed again at the landing head.
  • R-365's build, F-1's (b) and T9 (Sonnet; 7a20789, merged as d8724e2, R-372, R-376), on Brett Heap's answers, "Yes, warn (Recommended)" and "Yes, add T9 (Recommended)" (R-365). F-1's (b): where any row's path could not be read, the ceiling's note reads Probable partial removal: inspect, then delete PATH by hand; a row's path could not be read, so do not run git worktree prune, git worktree remove or git gc until it can. (one new TEXT key, none changed). T9: status's stale recommendation (repo_state(), shared by doctor and update) ends with the same warning beside an unread row. Three new tests fail at f3724fc and pass here; CI green (run 39953390038); the suite at d8724e2 gives 494 OK. Q3 (a) later replaced (b)'s text; T9 stands.
  • The A-items, the lane-fixable findings of the wave 22 triage and lane 3's reads (Sonnet; e702a65, R-373, R-374, R-385; CI green, run 39962712250). T7: a NUL byte in a linked worktree's .git file or admin commondir, or a lone surrogate as a manifest's tracking_branch, ended status in a traceback and refused every clean internal-error; now the row is inspection-error and the name no local branch. T10: a branch named detached is classified by its upstream. T19: a failed row 7 makes the row inspection-error, as pcl:178-179 says, not review-required. T14: unsupported-path-bytes' step is move it to a valid UTF-8 path with git worktree move, or mv it and then git worktree repair NEWPATH. T15, T16 and the LOW-5 tests are tests and one comment; T17 was already pinned. project and six test files, TEXT unchanged; every behaviour test fails at d8724e2 and passes at e702a65.
  • The Q-build, Brett Heap's Q1 to Q5, Q8 and Q9 (b), on the A-items (Opus; 703b58c, merged as 1579c22; R-380, R-395, R-398). Each is OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's text from round (q), 818311a (R-387, R-391).
    • Q1, 9d5c2fb: -c core.ignoreCase=false joins the status pins and the removal, so that under core.ignoreCase=true a file that differs only in case from a tracked one is no longer hidden, and git worktree remove no longer resolves a path to another worktree that differs only in case.
    • Q2 and Q9 (b), 5eeaedd, 338edb0, 703b58c: a linked row whose path is, or encloses, the common directory, the main worktree or another row, or whose registered path is a symbolic link, is registration-mismatch; contains-submodule takes an entry named .git that one lstat finds in any directory holding an index entry, counted in the filesystem budget and run again at revalidation (step 7, nested_git_check()).
    • Q3, da5502d: (a) the ceiling's prune note names the target's own administrative directory, Probable partial removal: inspect, then delete PATH and its administrative directory ADMIN by hand., in every mode, superseding R-365's text (T9 stands); (b) every plain text that names git worktree prune ends ; git worktree prune also deletes the entry, and so the HEAD reflog, of every other worktree whose path is missing, one moved or on an unmounted drive included, so run git worktree prune --dry-run first and remount or repair any it lists that still exists.
    • Q4, c6daebc: the --force notes name their check first (check that git -C PATH status --short --ignored lists only deleted files, then git worktree remove --force PATH by hand; the ceiling's own note keeps inspect), and contains-submodule's step says to keep each submodule's commits first.
    • Q5, c28c9ea: gate 7's two steps name the checks their skipped gates would have made (git log -g HEAD, git ls-files -v and git status), and the non-drain line defers to each group's next step.
    • Q8, 70345ee: a status probe that exits 0 with a standard-error line other than Git's hint: lines, or with more than the 4 KiB kept, is probe-failed, so a repository holding refs/heads/HEAD has every row inspection-error.
    • Q6, Q7 and Q9 (a) are Risks entries and a residual in OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19, and Q9 (c) scopes OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's text; 004 builds nothing for them (R-380).
  • Doc rounds 25 and 26, docs only (Sonnet; ecd0a7e, R-379; then 8e90096, 8abd901 and 497f5a3, R-393, R-394, R-397; merged as 41759a4): round 25 documents R-365's two texts and L1's 004 half; round 26, the A-items, Q1 to Q5, Q8 and Q9 (b) (Parts A to C), then revalidation's nested .git checks and round (r)'s two scenarios, rows 123 and 124 (Part D). project and tests/ at 41759a4 equal 1579c22's.
  • Speckit files under specs/004-project-clean-all-safe/: spec.md, plan.md, research.md, data-model.md, contracts/project-clean.md, quickstart.md, tasks.md, checklists/requirements.md, traceability.md (124 rows, one per scenario of the three deltas: 100 on main and 24 of OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's), and hand-runs.md (T132's record, 0570efd).
  • Change 1's amendment, draft PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 (branch change/amend-clean-all-safe-push-pins), and what it brings into this build. OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 is at 4512441, its round (r) (R-395, R-396), and is not merged. Until OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 lands, 004 departs from main's copy of the change wherever OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 amends it; 004's strings equal OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's where OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 states them (R-391, R-396). OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 holds 73, 25 and 26 scenarios in its three deltas, and openspec validate --all --strict passes 9 of 9 at 4512441 (R-396). OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 brings in:
    • Gate 11, operation-in-progress (LQ-14), and gate 12, worktree-only-commits (LQ-13). Gate 11 follows hidden-local-state, and gate 12 is the last gate. Both run again at revalidation (R-121, R-124, R-127).
    • Q9 B, his earlier ruling, "yes, recommended for Q1-Q17" (R-99 (b)): GIT_TRACE2, GIT_TRACE2_EVENT and GIT_TRACE2_PERF are set to 0 on every Git child, and the scrub grows from 17 to 31 names with 14 GIT_TRACE names that Git 2.36.6 to 2.43.7 read alike (R-99 (d), R-103). Merged into 004 as ab10102 (R-123).
    • The revalidation rules (R-171, R-195, R-198, R-208). A read that decides nothing, or a Git child or filesystem read that fails or runs past its own budget while the deadline is not the limit, gives state-changed whatever its step; a decided value keeps its step's reason (a work-tree probe that names another toplevel is identity-changed; ENOENT or ENOTDIR decides that a path is absent); a read the deadline cuts leaves the target not-attempted with deadline-exceeded. contains-submodule or operation-in-progress outranks identity-changed (R-198). A target's check is at most six Git children, seven where row 4c reads extensions.worktreeConfig true (R-168, R-201), and nine or ten where the path of the root or of the common directory holds a line feed (RI-3, above).
    • The drain line. When all 16 rows taken past deferred-target-cap are excluded by a gate after it, the preview says these deferred rows will not drain while the 16 rows ahead of them are REASONS; follow each group's next step for those worktrees, REASONS naming those gates' reasons, each once, in gate order. It named only contains-submodule before (R-146 L-f; 310f97d, R-201), and then said review those worktrees, then remove them yourself (--force for any that holds a submodule), until Q5 (c28c9ea).
    • The relative or ~ HOME refusal (LQ-15, R-205). Before any Git child, git --version included, clean, status, doctor and update test HOME and XDG_CONFIG_HOME for a non-empty value whose first byte is not /. clean refuses with relative-config-path, exit 2, and the others report it as they report a Git below the floor. A HOME that begins with ~ fails the test, and nothing is read or expanded against it. R-205's two accepted departures are under "Departures for Brett Heap's word" below. GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM are the lead's extension, which he kept (O10 (A), R-370; see the residuals below).
    • Rounds (p) to (r) since 88d0d36 (R-378, R-387, R-396). (p), e0b1671: R-365's rule, T9 in D18, and L1's four tasks.md hunks. (q), 818311a: Q1 to Q9 and a project-command clause for T9, so that the parity rule (pc:289-290: baseline values stay, except where a requirement states a change) holds. (r), 4512441: revalidation re-runs Q2 (2)'s <dir>/.git lstats, a stating requirement for clean's stale recommendations, and M1 and M3 in Open Questions until Brett Heap answers. Round (s) owes the D7 phrase an entry found being a new .git entry, the Open Questions copy of M1 that says "parity rule FR-064" (to become pc:289-290's), and his M1 and M3 (R-396).
    • README.md and specs/004-project-clean-all-safe/ follow all of this (doc rounds 13 to 26, the last 497f5a3, above).

Departures for Brett Heap's word

R-numbers are the lane's lead rulings, cited as in specs/004-project-clean-all-safe/; rulings:N is line N of the lead's rulings file, lead-rulings-alignment.md, which is the lead's working file and is not in this repository; the R-numbers and the quoted texts are enough to follow each question, and the rulings:N pointers are for the lead. Where the change's text and the build differ, the change's text is given as path:line.

  • R-32, the test layout.
    • Ruling: R-32 (rulings:201); R-32a to R-32c (rulings:202-204).
    • Departs from: openspec/changes/add-project-clean-all-safe/design.md:971 (Migration Plan step 6, "Tests in tests/test_project.py: one per delta scenario, named after it") and openspec/changes/add-project-clean-all-safe/proposal.md:625 (Impact, "tests/test_project.py: each ADDED and MODIFIED requirement has a test named after its scenario").
    • The build: the new tests live in 20 modules tests/test_clean_<lane>.py and in tests/test_status_doctor_update.py, with helpers in tests/clean_support.py and the launcher in tests/launch_project.py; tests/test_project.py changes in one method (T046, test_clean_revalidates_a_worktree_after_confirmation) and one loader line (T009, the sys.modules registration). Stated at specs/004-project-clean-all-safe/tasks.md:48-53, plan.md:348-356 and research.md:664-700.
    • If he declines: the new modules are folded into tests/test_project.py before the merge.
  • AGENTS.md (T123), outside the proposal's Impact.
    • Ruling: R-32 (rulings:201: plan.md, research R15 and quickstart follow tasks.md on AGENTS.md (T123)).
    • Departs from: openspec/changes/add-project-clean-all-safe/proposal.md:598, :612 and :625, the Impact bullets for project, README.md and tests/test_project.py; nothing in the change names AGENTS.md. Stated at specs/004-project-clean-all-safe/tasks.md:54-56 and plan.md:352-354.
    • The build: AGENTS.md gains Git 2.36 and the clean tests with their commands under "Runtime and verification", and the section "Cleaning up worktrees for a person"; the OPENSPEC-SPECKIT-GLOBAL block and CLAUDE.md are untouched.
    • If he declines: the AGENTS.md hunk (T123) is dropped before the merge (the lead's proposed fallback).
  • R-35, CI on Linux only, by Brett Heap's decision of 2026-10-15 (ci: run the test suite on Linux only #32, e9d6711).
    • Ruling: R-35 (rulings:208) and R-46 (rulings:239).
    • Differs from: openspec/changes/add-project-clean-all-safe/proposal.md:651-652 ("on Linux and macOS with Python 3.10 and 3.12, as CI runs"; :648 and design.md:55 also name macOS). The change text stays as written, since ci: run the test suite on Linux only #32 leaves historical records under openspec/ and specs/ alone.
    • The build: every job of the test matrix runs on ubuntu-latest only, and the feature's text counts no jobs (R-46); the git-floor job runs on ubuntu-latest with Python 3.10 and Git 2.36.6.
    • If he declines: not applicable, since the difference is his own decision; this PR only notes it (specs/004-project-clean-all-safe/tasks.md:58-64, plan.md:357-362).
  • R-27, what probes and operations count.
    • Ruling: R-27 (rulings:185), read by R-57 L4 (rulings:325) and R-59 D10 (rulings:347); specs/004-project-clean-all-safe/research.md:368-406 and spec.md:1805-1815.
    • Departs from: openspec/changes/add-project-clean-all-safe/specs/project-clean/spec.md:868 (scenario "Bounded revalidation work": "the record's probes.performed equals the wrapper's count"), which read literally includes the three removals.
    • The build: probes.performed counts every Git child other than a removal child and operations.performed counts the removal children (3 in that scenario), each child once, as the packet counts them (ideation/brainstorm/project-maintenance-batch-cleanup.md:816-830 at da33d92). It awaits his word through draft PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's commit cecb4fc, "State which count holds the removals".
    • If he declines: the literal text holds, probes.performed counts the removals too, and the counters and the assertions of T096 to T098 and T102 follow.
  • Two more departures are open as questions below: the push child carries none of the protocol pins (LQ-3), and a bare repository's registry entry is left out of status's worktrees (LQ-9, widened below, which T117 now calls two departures).
  • R-21, the Git floor kept at 2.36 with GIT_INTERNAL_SUPER_PREFIX added to the scrub (openspec/changes/add-project-clean-all-safe/proposal.md:766-776, a departure from task 2.2's rule that the floor is raised to the lowest version verified), and the bounded runner (proposal.md:795, a departure from BA:1212-1213): both stand in the proposal's departures list, which Brett Heap ratified with OpenSpec: add-project-clean-all-safe (batch worktree cleanup from the maintenance design packet) #11's merge. The build keeps both as the change states them.
  • R-205 (a), a ~ target refuses under a HOME that fails the relative-path test (lane 3's W30 M-1 found the crash, R-202).
    • Ruling: R-205 (a) (rulings:1576), on R-202 M-1 (rulings:1563); lane H's addendum 1 at 22f95d1, merged as 0b7dd94 (R-206, R-209; rulings:1587-1588).
    • Departs from: OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's rule that status, doctor and update report a failed configuration-path test as they report a Git below the floor (design.md:845-848, and proposal.md:317-322, at f0bf538), which names no target argument that needs ~ expanded; and the baseline, where HOME=~ or HOME=~/x crashed status, doctor and update with RuntimeError: Could not determine home directory. (rulings:1563).
    • The build: a target argument that needs ~ expanded, ~ alone or ~/..., refuses with relative-config-path and the message about HOME, exit 2, with no Git child; ~user is read from the user database and expands as before. A HOME of ~, ~/x or ~user fails the test like any relative value, and nothing is read or expanded against it (home_directory(), expand_user(); contracts/project-clean.md:728-729 at 4f921f8).
    • If he declines: R-205 records no fallback. The crash stays fixed either way, since it was a defect (R-202 M-1). Only the exit-2 refusal of this target is in question.
  • R-205 (b), new refuses under a HOME that fails the test.
    • Ruling: R-205 (b) (rulings:1577): "new is outside LQ-15; a defensive refusal is safer. Record it in Add project clean --all-safe, a safe batch worktree cleanup (feature 004-project-clean-all-safe) #33's body for Brett."
    • Departs from: OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's LQ-15 scope at f0bf538, which names only clean, status, doctor and update (proposal.md:957-983); and the baseline, where new raised a traceback or created the project under a relative h/projects.
    • The build: new with no parent argument, no --into and no PROJECTS_DIR, under a HOME that fails the test, has no default parent and refuses with the message about HOME, exit 2 (contracts/project-clean.md:747-751 at 4f921f8).
    • If he declines: the refusal is dropped and new is as at the baseline, a traceback or a project under a relative h/projects.
    • Open LOW, no fix: new --into ~/x under a ~ HOME still raises a traceback. It is outside LQ-15 (R-205's LOW follow-up, rulings:1578; contracts/project-clean.md:752-753 records it).
  • F-1, F-2 and O-1, amendments of ratified text, ruled by Brett Heap on 2026-10-22 (R-263, rulings:1719-1722), verbatim "F-2: yes; F-1: prune-then-delete; O-1: deadline-exceeded"; he added "R-284: yes" for F-1's note on an unreadable .git (R-290, rulings:1869).
  • F-4, the printed -- in delete-branch, declared in the contract (W65's LOW-2, R-269, rulings:1742-1746; R-259, rulings:1701).
  • F-5, the refusal for a branch the main worktree holds, declared in OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 (R-248, rulings:1669; W59's G-2, R-253, rulings:1681-1683; R-258, rulings:1694-1696).
  • F-6 and F-10, 004's own report advice (R-259, rulings:1701; "not stated in OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 and are 004-only", R-251, rulings:1676).
    • Departs from: the baseline's report texts, which OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 neither states nor quotes (proposal.md:1858-1860): 15504f1:project:607 and :610 for the main worktree's merged rows ("may be removed explicitly", "switch away before removal") and :568 for a locked stale-worktree row ("Review and prune stale worktree metadata manually.").
    • The build: row_evidence() replaces the advice after the ladder, the class unchanged: The main worktree is never removed by project clean., and Review, unlock it, then prune stale worktree metadata manually., since git worktree prune keeps a locked entry (contracts/project-clean.md:402-409); Q3 (b) later adds the dry-run suffix to both stale recommendations. If he declines: the baseline texts return.
  • RI-3, F-7 and F-8, amendments on lane rulings that wait on his ratification of OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 (lane 3's W70, M-1 and M-3, R-285; OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's round (j) groups them, with the cap's re-run, R-187 and R-190, and the count split above, at proposal.md:1243 at 173d83c, and quotes RI-3's departure at :1167, R-293).
    • Departs from: RI-3 (R-259, rulings:1701), where the path of the root or of the common directory holds a line feed (git rev-parse has no NUL form): a revalidation spawns up to nine children (ten with extensions.worktreeConfig true) and the final rescan up to six, against BA:679 (at most five children), BA:726-727 and BA:743 (three for the final rescan); it is W70's one new DEPARTS. F-7 and F-8 (R-248, R-252) change ratified next-step texts to add --force.
    • The build: as under "What changes". If he declines: no fallback is recorded in the rulings.
  • T9, a departure from FR-064, and F-1's (b), RULED by Brett Heap on 2026-10-23 (R-365, rulings:2125): through the question tool, answered 2026-10-23T11:49:16Z, "Yes, warn (Recommended)" for F-1's (b) and "Yes, add T9 (Recommended)" for T9.
    • Departs from: for T9, FR-064 (specs/004-project-clean-all-safe/spec.md:1863-1886 at 497f5a3, its dated notes; R-399), which keeps baseline functions unchanged, and OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's parity rule (pc:289-290: baseline values stay, except where a requirement states a change); F-1's (b) amends the ratified F-1 text (pcl:253-256, pcl:922-926), under the F-1 entry above.
    • The build: status, doctor and update end the stale-entry recommendation, "Review the stale worktree metadata before pruning it manually.", with ; a row's path could not be read, so do not run git worktree prune, git worktree remove or git gc until it can. beside an unread row; with every path readable it is the baseline's text byte for byte (7a20789; declared in contracts/project-clean.md; stated in OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's round (q), R-380). Q3 (a) later replaced F-1's (b) text; T9 stands. If he declines: not applicable, he ruled.
  • Q1 to Q9, RULED by Brett Heap: "yes, recommended for Q1-Q9" (2026-10-23T13:30:27Z; R-380, rulings:2161). Each of the nine stated a lean (wave22/outputs/triage.md, section 3), so each is taken as recommended. They amend ratified text of the project-clean, project-command and project-clean-review-safety deltas, as OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's round (q) restates it; none is a departure from OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19.
    • The build: Q1 to Q5, Q8 and Q9 (b), above. specs/004-project-clean-all-safe/spec.md records each changed behaviour in a dated note under FR-054 and FR-011 (Q1), FR-055 (Q2 (1), Q9 (b)), FR-023, FR-046 and FR-047 (Q2 (2)), FR-028 (Q3, and Q4 (c)'s and Q5's texts), FR-009 (Q4 (a), (b)), FR-020 (Q5, Q4 (c)), FR-032 (Q5) and FR-057 (Q8); FR-064's note records that Q3 (b)'s warning is not given to status (M1, below). If he declines: not applicable, he ruled.
  • Checked for further accepted departures that stand: every ruling from R-98 to R-400. LQ-10 to LQ-12 are OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's text now, none a departure (R-102 (c) 5). The lead's file-list and region exceptions for lane writers concern who edited what, not the change's text. R-205's two and the entries above stand, with two that OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's round (f) declares against the packet (R-245, R-247): 19-10 (BA:271-272; a revalidation read or child that the work deadline cuts counts as no difference, proposal.md:1113-1126) and 19-11 (BA:424-425; push refuses a wider set of upstream mappings with the baseline's message, proposal.md:1127-1135). 004 builds both as OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 states them, and with F-5 they take effect only when he ratifies OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 (R-258).

Ratified with #11 and not reopened here: V1, V4, V5, V10, OQ-23, OQ-24, R-4, R-8, R-9, R-21 and the runner (the departures record, rulings:183).

Open questions for Brett Heap

  • LQ-2, squash-merged branches. Question: may a local patch-equivalence proof (git cherry or patch IDs against the merge target) count a squash-merged branch as merged? The build now: ancestry alone proves a branch merged, so a squash-merged branch is never selected and a squash-merging repository's batch selects little (specs/004-project-clean-all-safe/spec.md:780-786, EC-001; :1780-1788). Recommendation: a local patch-equivalence proof as a follow-on change, not in this feature (openspec/changes/add-project-clean-all-safe/design.md:999-1001; proposal.md:1001-1005). Rulings: V1 to V3 (rulings:104), the naming note (rulings:181), the departures record (rulings:183).
  • LQ-3, the push-child exception. Question: the ratified text says every Git child carries the seven protocol pins (openspec/changes/add-project-clean-all-safe/specs/project-command/spec.md:113-117; design D11), but the retained push needs its child to reach a remote, and a pinned push ends fatal: transport 'file' not allowed, exit 128; so (a) amend the unarchived change by draft PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 (branch change/amend-clean-all-safe-push-pins), or (b) a follow-up change after the archive? The build now: the push child runs through execute() with none of the seven pins, in project's own process group, unbounded, never signalled and waited for, and keeps the caller's GIT_ALLOW_PROTOCOL; the other 30 of the 31 scrubbed names stay removed from it, and it carries the three trace2 pins at 0; every other Git child, the delete-branch child included, keeps the 31-name scrub and the pins (specs/004-project-clean-all-safe/research.md:32-101; contracts/project-clean.md:601-603). Recommendation: (a). If he rules (b), only the push child's treatment moves: T074, T077 and the push halves of T076 and T073 (specs/004-project-clean-all-safe/tasks.md:4216-4219). Rulings: R-28, R-31, R-80 (P-9 to P-11 and P-14; no ruling), R-81 (b). PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 is an open draft at 4512441.
  • LQ-4, the preflight's scope. Question: does "the first target's repository-wide checks SHALL serve as the preflight of every selected target" (openspec/changes/add-project-clean-all-safe/specs/project-clean-review-safety/spec.md:94-96; scenario "New worktree and pre-removal changes", :134-141) also cover a later target's per-worktree ignored-file state and classification before the first removal, which the child budgets of D7 (at most five per target in main's copy, six, or seven where row 4c reads true, in OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's) do not provide? The build now: the first target's revalidation compares every selected target's registration, lock, filesystem identity, branch tip and upstream object, and the merge-target SHA; a difference on any target refuses the FIRST target with the matching reason, removes nothing and leaves later targets not-attempted with batch-stopped, and the refusal does not name the differing path; ignored-file state and classification are checked in each target's own revalidation before its own removal (specs/004-project-clean-all-safe/research.md:702-755). Recommendation: none given; the build follows R-41's reading. Rulings: R-41 (rulings:214, :227), R-77, R-80 (P-9 to P-11 and P-14; no ruling), R-82.
  • LQ-5, the remedy reading. Question: does the delta's rule that every plan-blocking refusal names git worktree prune, git worktree repair or removing the offending row by hand "as the cause fits" (openspec/changes/add-project-clean-all-safe/specs/project-clean/spec.md:649-651) let a cause that no repair fixes name its own remedy? The build now: D18's deadline-exceeded remedy, "the run ran out of time; remove worktrees explicitly or re-run", names none of the three and stands (specs/004-project-clean-all-safe/contracts/project-clean.md:340-345). Recommendation: none given; R-45 (7) keeps the reading. Rulings: R-45 (7) and R-80 (P-9 to P-11 and P-14; no ruling).
  • LQ-6, PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 and lane 5's extension clauses. Question: should PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's evidence-model rewrite absorb lane 5's three extension clauses (for OpenSpec: add-project-clean-branch-retirement (opt-in paired retirement of a removed worktree's local branch) #26's branch child and OpenSpec: add-project-overview-remote-merge-status (opt-in exact-head GitHub pull-request evidence in project overview --remote) #29's remote reads and gh child), or do OpenSpec: add-project-clean-branch-retirement (opt-in paired retirement of a removed worktree's local branch) #26 and OpenSpec: add-project-overview-remote-merge-status (opt-in exact-head GitHub pull-request evidence in project overview --remote) #29 carry their own MODIFIED blocks? The build now: this feature builds nothing for it and PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's text is not widened; OpenSpec: add-project-clean-branch-retirement (opt-in paired retirement of a removed worktree's local branch) #26's block is 16051d1 and OpenSpec: add-project-overview-remote-merge-status (opt-in exact-head GitHub pull-request evidence in project overview --remote) #29's is f66ed58, both written against PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's text at c462d87 and both still in their PRs (open drafts), and whichever archives second re-bases. Recommendation: none beyond the ruling, which keeps the two blocks separate unless he prefers that PR OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 absorb them. Rulings: LQ-6 (rulings:238) and the LQ-6 record (rulings:279).
  • LQ-7, the delta's two exit rules and the closed-output cases. Question: a write that fails in a preview or report after its plan is built meets two sentences of the project-clean delta (openspec/changes/add-project-clean-all-safe/specs/project-clean/spec.md) that disagree, :940-941 (an unexpected exception before the apply phase refuses internal-error, exit 2) and :958-960 (a preview or report exits 2 only for a refusal raised before a plan is built); which governs, and should an internal error after the apply phase begins print its exception's type on standard error? The build now (R-55): before the apply phase the write failure is internal-error, exit 2, nothing mutated; the first failed write points that stream at /dev/null; a recorded signal outranks it (130, 143 or 129 with Cancelled.); after the apply phase begins writes are best-effort and D19 decides the exit; with standard output closed, --action push exits 2 with REFUSED: BrokenPipeError: [Errno 32] Broken pipe and starts no child, and an --apply --json run with it closed at startup refuses internal-error, exit 2, before any removal (R-322, R-326); an unwritable question is internal-error, not cancelled; after the apply phase begins no exception type or text is printed (specs/004-project-clean-all-safe/contracts/project-clean.md:326-338). Recommendation: R-55's reading stands until he rules; none given on printing the type. Rulings: R-55, R-59 (D1 to D3), R-74 (c) (3), R-76 (g), R-80 (P-9 to P-11 and P-14; no ruling), R-81 (b), R-87 (c), R-91.
  • LQ-8, the command form's escapes. Question: should change 1's path rule write non-ASCII code points in a printed command as their UTF-8 bytes, \xHH, which every shell with $'...' reads alike in any locale, while the display form keeps \u and \U? The build now: it implements the delta as written (openspec/changes/add-project-clean-all-safe/specs/project-clean/spec.md:1061-1066), \xHH, \uXXXX and \UXXXXXXXX in text and commands alike, and documents the limit: the command needs bash, zsh, ksh93 or a POSIX.1-2024 shell, not dash, and a \u or \U escape needs a UTF-8 locale, since in a C locale it can name a different path or branch (specs/004-project-clean-all-safe/contracts/project-clean.md:378-395; quickstart.md:228-231). Recommendation: the \xHH amendment, not applied (R-61 (a)). Rulings: R-60, R-61 (a), R-80 (P-9 to P-11 and P-14; no ruling), R-83 (P-2), R-92 (a).
  • LQ-9, a bare repository's entry, and a gitfile layout's, in status's worktrees. Question: does the project-clean delta's "the common directory SHALL never be probed as a worktree row" (openspec/changes/add-project-clean-all-safe/specs/project-clean/spec.md:478) cover status's worktrees, so that leaving a bare repository's registry entry out is a fill, or is it a departure from the project-command delta's "Values SHALL equal those of the inspection this model replaces, except where a requirement states a change" (openspec/changes/add-project-clean-all-safe/specs/project-command/spec.md:196-197) that needs his word? Lane 3's F5 M-2 widened it (R-101 (e), rulings:960, :1012): for a gitfile layout, a separate git directory or a submodule's checkout, the git directory's record becomes the checkout's row, with its dirty and ignored_files read there, false and 0 where they were null; the lead accepted that as a fill too. The build now: T117 leaves a bare repository's registry entry out of worktrees (specs/004-project-clean-all-safe/tasks.md:3804-3820; plan.md:419-433). Recommendation: a fill, which the lead and lane 3 recommend, since :478 and data-model.md:18 both say the common directory is never a worktree row. Rulings: R-75 (a), R-81 (d), R-101 (e).
  • LQ-10 to LQ-15, RULED on 2026-10-21 (R-102, rulings:1042-1064): "LQ-15: yes, refuse relative HOME like OpenSpec: add-project-overview-remote-merge-status (opt-in exact-head GitHub pull-request evidence in project overview --remote) #29" in this lane's session (rulings:1043); "yes to all six recommendations, LQ-10 to LQ-15" in lane 3's (rulings:1044). Each is OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's text now, so none is a departure (R-102 (c) 5): the stat pins (LQ-10, ab10102), a redirected work tree read as registration-mismatch (LQ-11, 91552e3), update's owner tools run with the push child's scrub (LQ-12, 2439838), worktree-only-commits (LQ-13, 93a3ae9), operation-in-progress (LQ-14, e0c589a) and relative-config-path (LQ-15, 5794f91, with addendum 1 for a ~ HOME, 0b7dd94).
  • LQ-16, OPEN. Question: a clean or process filter that a repository's configuration defines (in its own file, an includeIf or a submodule) runs inside every read-only status probe: report, preview, status, doctor, revalidation, and a fresh clone alike. That is user code in a "read-only" probe. Should those probes neutralize every configured clean and process filter? Lane 3's reader RA checked the fix, an empty -c filter.<x>.clean= for each configured filter. It fails safe: a filtered file whose stat changed then shows as modified and the worktree is kept (R-105 H2, rulings:1092-1093). The build now: nothing; the probes run configured filters as Git does. The exposure stays under an absolute HOME (R-107, rulings:1120; R-125 L2, rulings:1238). Recommendation: yes, in the read-only probes only. The removal child keeps the user's own filters, since it is a confirmed mutation once LQ-15 holds (R-105 (b), rulings:1098).
  • LQ-17, OPEN. Question: the removal's own internal git status writes the index and fires post-index-change, and branch -d fires reference-transaction. Should the removal and branch children run with -c core.hooksPath=/dev/null, as RA's checked fix has it (R-105 H3, rulings:1094-1095)? The build now: nothing; both children run the repository's own hooks, as Git does and as the baseline did (e45155a:project:719 and :734, R-105 (b)), with no core.hooksPath pin. Recommendation: AGAINST suppressing hooks. A reference-transaction hook can veto a ref deletion and may be the user's guard on a branch, so suppressing it would bypass a protection, and post-index-change only informs.
  • LQ-18, OPEN. Question: should the push child pass --no-follow-tags and --recurse-submodules=no, so that the push does only what the plan shows? A configured push.followTags or push.recurseSubmodules would make it do more (R-108 (b), rulings:1127; R-130, rulings:1275). The build now: neither flag is passed, and the push child follows the repository's configuration as git push would; they are not built until he rules. Recommendation: yes, pass both.
  • LQ-19, OPEN. Question: a relative GIT_EXEC_PATH made worktree remove run a planted git, exit 0, which the amendment writer reported at its checkpoint (R-114, rulings:1174). Should LQ-15's relative-path test cover it? A PATH with an empty or relative entry is the same class, not recommended. The build now: nothing; the test covers HOME, XDG_CONFIG_HOME, GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM only, and OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 says other relative paths in the environment are outside it (design.md:850-852 at f0bf538). Recommendation: add GIT_EXEC_PATH to the test. It goes to him with R-132's question on update, in the residuals below.
  • LQ-20, RULED on 2026-10-22 (R-236): "LQ-20: go with (i), measure first". Measured (R-243): LQ-11's probe 8.7 ms and LQ-13's rev-list over 9,940 commits 160.3 ms, with the margin; the cap test passes, the 16th removal spawning at 30.0 s with 20.0 s left. OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's round (f) records it (662be89, R-247).
  • F-1, F-2, O-1, R-284 and T1 to T8, RULED on 2026-10-22 (amendments of ratified text, as under Departures; OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 records them from round (h)). "F-2: yes; F-1: prune-then-delete; O-1: deadline-exceeded" (R-263, rulings:1719-1722); "R-284: yes" (R-290, rulings:1869), for the third note where Git cannot stat .git, which his F-1 question had not covered (W73 M-1); "R-307: yes; R-310: yes" (R-319, rulings:1976) for T1 to T5; "R-320: yes" (R-321, rulings:1987) for T6 to T8; and "R-324: yes" (R-343, rulings:2084), which extends them: every no-prune warning ends "do not run git worktree prune, git worktree remove or git gc until it can", since git worktree remove and git gc also delete an unread row's administrative directory. OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 carries the texts in round (n) (R-345), 004 in e8dda2a.
  • F-1's (b) and T9, RULED on 2026-10-23 (R-365, rulings:2125): "Yes, warn (Recommended)" for F-1's (b), where a ceiling-cut P sits beside an unreadable sibling, and "Yes, add T9 (Recommended)" for status's stale-entry advice beside an unread row (the questions of R-310, R-324 and R-327). Built in 7a20789; Q3 (a) later replaced (b)'s text, and T9 stands (R-380).
  • O-2, OPEN, put to Brett Heap on 2026-10-22 as a reading to confirm (R-216, R-221; design.md:493-496 and proposal.md:1657-1661 at f0bf538). Question: R-208 reads BA:271-276, "a value that cannot be re-read, including a filesystem call that times out, counts as a mismatch", this way: a read that fails decides no identity difference, so its mismatch is the packet's "any other" difference, state-changed, for a Git child and for a filesystem read alike. Does he confirm it? The build now: it builds that reading (73d8888, merged as 9ab996e, R-218). The rules are under What changes (R-208, R-212).
  • M1, OPEN, put to Brett Heap on 2026-10-23T15:11:48Z (lane 3's W133 MEDIUM-1; wave23/brett-questions-w133.md). Question: do status, doctor and update, with no row's path unread, take Q3 (b)'s dry-run warning on their plain stale advice, "Review the stale worktree metadata before pruning it manually."? It names no command, so Q3 (b) did not reach it; lane 3 calls it a gap that needs his word, not a departure. The build now: the baseline text stays (FR-064's note, R-380). Recommended (a): no. It names no command and already says to review first; the warning matters most in clean, where the prune advice sits beside one row and reads as about that row alone; and keeping it adds no second departure, across three commands, from the parity rule (pc:289-290) and no change to the status rules lane 4's 005 reads. (b) Yes: all three end it with Q3 (b)'s dry-run warning (Q3 above). That is a second departure from the parity rule, and changes 004's code and tests, OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's pc:308-309, :394 and D18, lane 4's pin and lane 5's OpenSpec: add-project-overview-remote-merge-status (opt-in exact-head GitHub pull-request evidence in project overview --remote) #29 block.
  • M3, OPEN, put to Brett Heap on 2026-10-23T15:11:48Z (W133 MEDIUM-3; the same file). Question: under his Q2 (1), a linked worktree whose registered path is, or holds, the main worktree, the common directory or another worktree is registration-mismatch, and prints that class's next step, which ends "... or remove the row by hand". Followed literally for such a row, that step deletes the main worktree and the repository, or the other worktree (confirmed on plain Git, triage T2). Should such a row get its own step? The build now: the class's step, (c). Recommended (a): yes, "its path is or holds the main worktree, the common directory or another worktree, so do not delete it by hand or with git worktree remove; review its registration with git worktree list --porcelain" (197 characters, inside lane 4's 200-character rule; a row that shares its path with another row takes it too, R-67 (c)); a new next-step text in 004 (code and tests) and OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's D18. (b) No next step for such a row, and D18 says why: simpler, but no guidance. (c) Keep the class's step: not recommended, unsafe as worded.
  • "Yes, recommended for M1 and M3" takes both leans. 004's code changes only if he rules M1 (b), M3 (a) or M3 (b): M3 (a) would add a next step and its tests, and M3 (b) would print no step for such a row, either in a later code round.

Also open from #11, and known residuals

  • Carried from OpenSpec: add-project-clean-all-safe (batch worktree cleanup from the maintenance design packet) #11, not an LQ of this lane: the CPU-saturation risk is Brett Heap's call (openspec/changes/add-project-clean-all-safe/design.md:906-912; R-24). Under heavy load a plan reaches the deadline and goes incomplete with deadline-exceeded; it is never unsafe.
  • Residuals of the final fixes (R-95 (d)), no fix: an entry whose registration alone cannot be read is compared by its realpath only (R-57 L2); in single mode a twin of P that existed at planning, spelled through an unsearchable directory, is not caught, and both spellings name one clean merged worktree, so no work is lost (lane 3's LOW-3).
  • LQ-15's GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM (R-102 (c) 3, rulings:1054-1055). The two are the lead's extension of his ruling, Git's own config-path variables, and he ruled to keep them: O10 (A), "yes, recommended for O3, O5, O8-O11 and D5 clause 2" in lane 4's session (2026-10-23T12:19:11Z; R-370). OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 states them in one separate sentence (design.md:803-828 at f0bf538; R-115 L2, rulings:1179).
  • R-132, update's scope under LQ-15, to be put with LQ-19 (rulings:1284-1292). The build follows OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's D16 (R-131 (a), rulings:1279): under a bad HOME, update --apply refuses shape and bench only, and workflow and tools still run. Lane 3, as packet owner, recommends that update refuse every component with relative-config-path, exit 2, before any child, owner tools included, with no substitute HOME: an owner tool's git -C <repo> reads the planted configuration, OpenSpec: add-project-overview-remote-merge-status (opt-in exact-head GitHub pull-request evidence in project overview --remote) #29's C-44 refuses up front, a substitute HOME would change what the tools read, and the cost is one re-run with an absolute HOME. Until he rules, 004 builds OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's text as written.
  • Lane 3's env L-1 (PROTOCOL_PINS), from its reader RA (RA-L1): a remote-helper protocol of another name with its own allow=always in the repository's configuration still runs its helper from PATH, which the protocol pins cannot stop. It is R-25's accepted residual (OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19, Decisions), rated LOW. The rulings hold it "to be read and put to Brett Heap with the other LQs" (R-116, rulings:1188); no LQ number records it yet.
  • Task 1.7 of OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 (tasks.md:123-127 at 173d83c) is unticked: the push-child exception ratified by his word on OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19, with his words and the link still to fill. It waits for LQ-3. His words on Q9 B, on LQ-10 to LQ-15, on LQ-20 and on F-2, F-1, O-1 and R-284 are recorded in task 1.2, which is ticked. 004 plans under the exception until he rules (specs/004-project-clean-all-safe/spec.md:1801 and :1879).
  • update's tools component reaches the host's workBenches from any root (R-202, rulings:1568). An ad hoc update <fixture> --apply --component tools --yes ran the host's real setup.sh once, writing two gitignored files. This is existing behaviour, outside 004's scope; tests must put fake owner tools first on PATH.
  • A repository that holds refs/heads/HEAD makes every row inspection-error, not only that branch's (R-116, rulings:1184-1186). Git warns refname 'HEAD' is ambiguous. on standard error in every worktree's status probe, and a status probe whose standard error holds anything but Git's hint: lines is probe-failed with unparseable output. It fails closed (R-61 (b), rulings:358-361), and Brett Heap's Q8 puts the rule into OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19 with this consequence (R-380).
  • A branch.B.remote that is a path or a URL reads as unpublished, and a push then re-points the upstream to origin, as the baseline does (R-108 (d), rulings:1129). Recorded for a later evidence ruling; no change now.
  • Observations, no change: SonarCloud's gate failed at 2cf34d3 on a new security rating C from the git-floor job and passes since c9103ba, with four S8714 issues left open on purpose (R-99 (a), R-100 (f), R-106).
  • W65 LOW-3 (R-269, rulings:1747), a baseline function, left as a follow-on: repo_state()'s advice for a stale entry, "Review the stale worktree metadata before pruning it manually." (project:6806 at 7164d7f; baseline 15504f1:project:501), omits unlocking for a locked entry, which git worktree prune keeps; FR-064 keeps baseline functions unchanged. The no-prune warning beside an unread row is T9, ruled (R-365).
  • Q3 (b)'s warning is not given to status's text (R-380; M1 above).
  • The nested .git lstats of Q2 (2) are not measured on a worktree with very many tracked directories (R-398). They fail closed: a call over budget makes the row inspection-error at planning or state-changed at revalidation.
  • No test drives a .git made after the plan through --apply (R-397); the exit 2 and the later target's batch-stopped are pinned for contains-submodule only with a modules directory (test_clean_submodules_after_confirmation). It is for the next code round, with M3's step.
  • T127's tuple X holds two old gate-7 spans that main's D18 still quotes, until OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's D18 carries round (q)'s; revisit at landing (R-394).
  • The redirect message's limits, declared in OpenSpec: amend add-project-clean-all-safe so the push child reaches its remote #19's D18 (W81 M-1 and L-1, W80's L-2 and L-5, R-297; round (k), R-301), with no change to 004's code: a relative core.worktree whose target is missing gets the plain message, a submodule's redirect takes the variant, and a main checkout whose .git is a symlink gets the plain refusal, as before (W81 O-3).

Gate

R-76 (b) says this PR opens only when every task of feature 004 has landed, T084, T085, T092, T093 and T099 among them, and that its body names this gate. Tasks ticked: 133 of 133 at 41759a4, the head. The final gates ran at 4f921f8; the rows below are restated at later heads where a ruling gives them. The code merge the suite runs at is 1579c22 (703b58c, the Q-build, on the A-items e702a65, on d8724e2, R-365's build on f3724fc); 41759a4 adds doc rounds 25 and 26 (497f5a3), docs only. merge-tree of 41759a4 with #19's 4512441 is clean, and change 1's tasks.md equals main's copy (L1, R-377). Lane 3's sweep at d6bac50 is done (R-358, R-360); its batched read of 41759a4 and 4512441 is pending. Merges to main wait on Brett Heap's word, and so do the OPEN questions above, M1 and M3. Landing steps still owed: main (15504f1) merged into 004, with no rebase; the hand runs (T132) walked again at the landing head, by the lead through tmux or by Brett Heap (R-50, R-360); and his word. #19 lands first. Line cites to specs/004 are at 4f921f8 and to #19 at b3228bb, unless a cite names another sha. origin/main (e45155a) was merged into the branch as 05e6218, never rebased; it now reads 15504f1, with #21 (b233333) and #28 (15504f1) after e45155a, both OpenSpec changes only, and is not yet merged here.

Verification

Check Result
Suite on Python 3.12 and 3.10 (T128), with the module count equal to the tests/test_*.py count and tests/test_project.py unchanged but the one method and the loader line At 1579c22, the code merge (R-398): the full suite gives 516 OK (skipped=1) in 760.5 s. At 41759a4, docs only after it: 516 OK (skipped=1) in 742.3 s (R-401). The 14 modules the Q-build touched pass on Python 3.10 (and on 3.12), 299 tests with 1 skipped (R-395). Earlier: 494 OK (skipped=1) at d8724e2 (R-376); 491 OK on 3.12 and 3.10 at d6bac50 (R-360). 22 of 22 test modules; tests/test_project.py differs from main in the loader line and T046's method only
Git 2.36 floor (T129) git version 2.36.6; the 14 touched modules, 299 tests OK (R-398); test_status_the_sixteenth_scrubbed_name_on_git_2_36 ran and passed, not skipped (4f921f8); every earlier round's modules passed on 2.36.6 too (R-274 to R-352), and T129 passes at d6bac50 (R-360)
/usr/bin/openspec validate --all --strict (T130) 7 of 7 at 41759a4, and at every head since d764c26 where a ruling gives it (R-259 to R-361, R-372); the 10 kept scenarios byte-identical (4f921f8). #19 at 4512441: 9 of 9, with 73, 25 and 26 scenarios; its one INFO is main's own #28 delta against #21's requirement, not #19's (R-396)
Realization checks (T131) No non-ASCII added line; no file outside the path conventions and none changed but unlisted; parser() changed under clean only; requirements.txt unchanged. Exit 0 at every head a ruling gives, e69f6ef to d6bac50 (R-202 to R-360), and at 7a20789 (R-372), e702a65 (R-385), 8e90096 and 8abd901 (R-393, R-394, R-398; non-ASCII 0, unlisted [])
Hand runs, User Stories 1 to 9 (T132, hand-runs.md) Complete: walked by the lead through tmux on 2026-10-22 on project at e69f6ef, 41 of 41 MATCH (R-250, R-255; 0570efd); three runs walked again at d764c26, all MATCH (R-259); T132's verify exit 0 at f6e3d4b (R-272). Not re-walked since, and owed again at the landing head (R-50, R-360); T132 stays ticked
Traceability, one row per delta scenario (T126) 124 rows (100 on main, 24 of #19's), with six named gaps, each covered by tests whose names do not begin with the scenario's title (R-397; the gap notes in traceability.md); T002 and T126 pass
README and AGENTS.md review re-run on the final code (R-84 (b)) ACCEPT WITH FIXES (R-97) at 71e58fe; not re-run since. README changed after it only in doc rounds 13 to 15 and 18 to 26
Every task's verify Lane 3's sweep of all 133 at d6bac50 (W101, W102; R-358, R-360): 133 of 133 exit 0. Since then each writer ran the verifies of the tasks it touched (R-372, R-385, R-393, R-394, R-398); no full re-sweep at 41759a4 is recorded
CI (test jobs and git-floor) 41759a4: green (runs 40006309838 and 40006299501; R-403). Earlier heads green (R-261 to R-363): f3724fc (runs 39897478275 and 39897473466), 7a20789 (run 39953390038, R-376) and e702a65 (run 39962712250, R-385)

Lane 3's packet-fidelity and delta reads of this feature and of #19, with counts as the rulings record them (H, M, L are HIGH, MEDIUM, LOW):

Landing

Draft until the gate is met and the independent re-verification is posted here. Lands by squash only on Brett Heap's word for this PR, naming lane, PR and head, after #19 lands; the hand runs (T132) are walked again at that head first (R-360). If main moves (15504f1 now), main is merged in, with no rebase and no force push. After landing comes the archive PR for add-project-clean-all-safe (runbook step 3), on Brett Heap's word.

🤖 Generated with Claude Code

Brett Heap and others added 30 commits October 21, 2026 08:29
Lane: openRepoProject-2

Lead ruling R-93 (e), LOW-1: during the apply phase the first signal
stops scheduling, so that no further probe starts (pcl:931-933). In
region apply, revalidation_difference() now reads the signal slot
(slot_set()) before each read it starts, its Git children and its
filesystem steps alike. A set slot ends the revalidation as the seam
before the spawn does: the target is not-attempted with interrupted and
no reconciliation, later targets follow, and the exit stays 130, 143 or
129. The rescan of a removal already spawned is unchanged.

Test: test_clean_a_signal_during_a_removal_sigint_during_a_revalidation
(lane 3's sig-reval-INT), with a new fake kind, status-slow-again-in,
in tests/clean_support.py. At 41971d9 it fails: the hidden-state probe
started after SIGINT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2

test_clean_single_target_a_deadline_among_other_rows_leaves_p_decided
follows lane 3's single-deadline-note run: P and a merged worktree whose
status probe hangs, through the launcher with deadline 3 s and reserve
1 s. P's status probe and ls-files run before the other rows' status
probes; the plan is complete with the note deadline-exceeded naming P;
P is not-attempted with deadline-exceeded, exit 1, in the human result,
the JSON plan and the JSON result record; nothing is removed. At 41971d9
it fails: exit 2, inspection-incomplete, P excluded reflog-unavailable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2

Lead ruling R-93 (e), LOW-2: nothing pinned R-80 P-2's revalidation
deadline cut. Two tests beside T098's, both through the launcher, with a
new fake kind, ls-files-stuck-again-in, whose second ls-files in a path
ignores SIGTERM and sleeps:

- a revalidation read cut at the deadline (deadline 8 s, reserve 2 s,
  probe budget 30 s, grace 1 s): both targets not-attempted with
  deadline-exceeded, records null, nothing removed, exit 1;
- the same read cut at a 1 s probe budget: the first target refused
  with hidden-local-state, exit 2, a timeout staying a difference.

Both pass at 41971d9. With read_cut() and work_spent() returning False
(lane 3's mutant), the first fails with exit 2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2
resolve_clean_target() prints the PATH of discover()'s two bare-name
repository-not-found messages through human_path(), with U+202E and
0xFF tests in tests/test_clean_paths.py; discover() is unchanged. The
three nits: an unused local, print_plan()'s docstring and a comment in
tests/test_clean_timing.py (lead rulings R-92 (c) and (e), R-93 (c)).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2

When match_target() leaves P's match undecided (lead rulings R-73 (d)
and R-78 (b)), build_plan() records none of single mode's non-blocking
notes inspection-incomplete, inspect-cap and deadline-exceeded: each
says the rows do not block P beside the plan's refusal of P, and the
inspect-cap note counted P among the rows past the cap. The refusal,
inspection-incomplete, speaks alone (lead ruling R-93 (e)).

New test_clean_single_target_an_undecided_match_has_no_non_blocking_note,
lane 3's r78b.py shape in process (the single cap patched to 4; P's own
realpath, then another entry's, unread): inspection-incomplete, exit 2,
no note; at 41971d9 it fails with the inspect-cap note. The one existing
assertion that pinned that note in
test_clean_single_target_p_s_own_realpath_unread_keeps_the_cap now
expects no note.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2

Lead ruling R-93 (e), LOW-3: registry_twin() skipped a listed entry
whose lstat or realpath could not be read, so a twin spelled through an
unsearchable directory went uncaught (lane 3's twin-unreadable). Now
such an entry, failing other than with ENOENT or ENOTDIR (absence,
R-36), gives identity-changed (rs:92-93), as planning fails closed
(R-78 (b)). One entry is exempt: a row the plan read with present null
whose lstat fails again, null in the plan and null again (rs:89-92), so
that single mode's non-blocking inspection-error row does not refuse P
(pcl:258-262, pinned in test_clean_single.py). The docstring's "as in
planning" is corrected.

Test:
test_clean_admin_registration_changed_a_twin_spelled_through_an_unsearchable_directory.
At 41971d9 five of its seven subtests fail: the target is removed, exit 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2

test_clean_single_target_an_undecided_match_has_no_non_blocking_note
patched the single-mode row cap down to 4, which tasks.md's rule 6 for
new tests forbids (caps are never scaled, R11). LOW-5 stays pinned at
the real cap of 128 by the assertion in
test_clean_single_target_p_s_own_realpath_unread_keeps_the_cap, which
expects no note. No helper or import was used by that test alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2
In a named removal, build_plan() runs P's gates on P's rows right after
match_target() and before worktree_rows() inspects any other row, as
design D13 orders, so a work deadline among the other rows leaves P
decided beside the note deadline-exceeded (lead ruling R-93 (d)). With
P's match undecided, single mode's non-blocking notes are left out and
the refusal speaks alone (R-93 (e)). Tests in tests/test_clean_single.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2
The final writer of the test-hygiene lane merges the integration branch
first, so that R-81 (b)'s and R-82 (d)'s tests run against the code as it
stands: US8, the polish wave, and final-fixes lanes A and C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2
R-90's R-81 (b) item. In process, the counting wrapper is the only git on
PATH; after the full re-inspection runs through it as built, the wrapper
is made not executable, or removed. The delegate's spawn then fails, and
the run refuses with the baseline's `Cannot run git: ...`, exit 2, prints
the plan and nothing relayed, and attempts no other child: subprocess.Popen
sees the delegate alone after the re-inspection, and the branch is kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2
A revalidation reads the signal slot before each read it starts and ends
with interrupted, so no probe starts after a signal (pcl:931-933). The
revalidation deadline cut and its budget contrast are pinned. The twin
check refuses identity-changed on an entry whose lstat or realpath
cannot be read, except one the plan also read as failed (rs:89-93;
pcl:258-262). Two fake kinds are added to tests/clean_support.py (lead
rulings R-93 (e) and R-95).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…robe (R-82 (d))

Lane: openRepoProject-2
R-90's R-82 (d) item, as R-93 (a) corrects it. Between Git's exit 0 and
the rescan, a post-remove hook replaces a parent by a file: the target's
own parent reads path_present false and the target `removed`, exit 0;
the repository root's parent loses the identity, every field null,
`unknown` with `unconfirmed-removal`, exit 1; the contrast, the parent
made mode 000 (EACCES), is `reconciliation-incomplete`, exit 1. A second
test cuts the rescan's identity probe at its budget while the root is
still there: the marked all-null record gives `reconciliation-incomplete`,
exit 1, and no later rescan read runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lane's last push

Lane: openRepoProject-2
Final-fixes lane B (LOW-1, LOW-2 and LOW-3) landed on the integration
branch while the lane's suite ran; the lane merges it, with no conflict,
and runs the whole suite again before its last push.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…doc round 12 items 1 to 4

Lane: openRepoProject-2

R-93 (d), HIGH-1 as built by lane A: in single mode P's row is established
first, its status probe then its gates (1 to 7, the deferral with P alone,
9 and 10), before any other row is inspected; D13's order is named a fill
of FR-013's "probed first" in the contract, data-model, T070 and T075. T070
and T075 name test_clean_single_target_a_deadline_among_other_rows_leaves_p_decided,
and both verify fields now collect or run it.

R-93 (e), LOW-5: none of single mode's three notes is recorded when P's
match is undecided (contract, data-model, T075, T069), with R-94 (b)'s
reading that several matches count as decided.

R-93 (e), LOW-4: the contract and T094 record R-79 P-11's three placements
of the partial-removal note. R-93 (e), LOW-6: data-model takes lane 3's
wording for deadline-exceeded and batch-stopped.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Lane: openRepoProject-2
Six test-only items (lead rulings R-81 (b) and (c), R-82 (d) as R-93 (a)
corrects it, R-85 (c), R-86 (c), R-89 (c)): the group test lists its
descriptors once sleep is blocked; the kill test prints its diagnostic
only under CLEAN_TEST_DEBUG=1; two docstrings; a branch deletion that
cannot be spawned refuses with exit 2 and no other child; a parent
replaced by a file after a removal (ENOTDIR is absence) and a cut rescan
identity probe. The first writer hung on an approval and was stopped;
a second writer finished the last two items.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…idation read and the twin check as built, doc round 12 items 5 to 8

Lane: openRepoProject-2

R-94 (a): the contract's PENDING paragraph is rewritten as built, and T112
names lane C's two tests and gains tests/test_clean_paths.py in its files.
R-95 (a), LOW-1: data-model's signal-slot table and revalidation text, T093
(files and verify now run the test in test_clean_revalidation.py) and
interim row 1. R-95 (b), LOW-2: T098 names its two revalidation-cut tests,
collects and runs them, and interim row 7's evidence names them; T011 names
status-slow-again-in and ls-files-stuck-again-in and checks FAKE_KINDS.
R-95 (c) and (d), LOW-3: data-model's twin text, step 5 and residuals, and
T099 (its verify now runs the unsearchable-directory test).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…doc round 12 items 11 and 12

Lane: openRepoProject-2

R-95 (e): T009's second script is given T046's method by name; T033's
verify checks what holds after T125 and T117: worktree_rows() called from
build_plan() and from repo_state(), repo_state() keeping its baseline
signature, and the evidence and project modules passing. R-95 (e) says
repo_state() is unchanged since 961c405, but T117 rewrote it (project:5798),
so the check is of its signature and its worktree_rows() call.

Item 11: traceability.md gains the LOW-1, LOW-2 and LOW-3 tests on the rows
"A signal during a removal", "Deadline expiry mid-batch" and "Admin
registration changed". T126's verify still reads 101 rows.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…item 9

Lane: openRepoProject-2

R-96: T073 names test_clean_a_branch_deletion_that_cannot_be_spawned
(R-81 (b)), the one push task whose tests drive the git branch -d child,
and its verify collects and runs it. T093 names the two rescan tests of
tests/test_clean_result.py, as R-93 (a) corrects R-82 (d): a target's own
parent replaced by a file reads removed, the root's parent unconfirmed-
removal, EACCES reconciliation-incomplete, and a cut identity probe
reconciliation-incomplete with every field null. T093's files gain
tests/test_clean_result.py, whose module its verify already runs whole.
No scenario row fits the three names under T126's rule 1 check, so
traceability.md is unchanged by this item.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Lane: openRepoProject-2
The lead walked quickstart.md's hand runs for User Stories 1 to 9 through
a tmux pane against project at e48de37 (lead ruling R-50). Every run
matched quickstart.md; no divergence, so no defect against the tasks.
The record is specs/004-project-clean-all-safe/hand-runs.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2
The final fixes as built folded into their tasks (no new task ID):
HIGH-1 and LOW-5 into T069, T070 and T075; LOW-1 into T093; LOW-2 into
T098 and T011; LOW-3 into T099; R-92 (c) into T112; the hygiene tests
into T073 and T093. LOW-4 and LOW-6 worded; the contract's PENDING
paragraph built; T009's and T033's stale verify fields fixed (lead
rulings R-93 to R-97).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2

R-97 (a): the `modules` entry is read from the worktree's administrative
directory, not its index; the removal floor rule (once less than 5 s of work
time is left, later targets are not-attempted with deadline-exceeded, exit 1);
what `--apply --json` prints (the result record once the apply began,
otherwise the plan or the error object); the stop block's `Branches not
confirmed:` and `Branches kept: none.`; single mode's completeness rule (D13,
R-93 (d)); and that `Selected (N):` and `Excluded (M):` print only when they
have rows. README.md only.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Lane: openRepoProject-2
R-84 (b)'s final review of README.md and AGENTS.md (lead ruling R-97):
the modules entry is read from the administrative directory; the floor
rule; what --apply --json prints; the not-confirmed and kept-none
branch lines; single mode's complete-plan rule (D13); headings print
only when they have rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2
A revalidation now reads the signal slot before each read it starts
(slot_set(); lead ruling R-95 (a)), so the seams are no longer the only
readers in the apply phase. Docstring only.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Lane: openRepoProject-2
handle.budget_end - handle.started is (t + 15) - t, which floating point
does not always give as exactly 15: CI failed once on it at e48de37 with
14.999999999999972 != 15. assertAlmostEqual(places=6) keeps the check.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Lane: openRepoProject-2
interrupting()'s docstring names the revalidation's own slot reads
(R-95 (a)), and the runner test compares the 15 s budget with a
tolerance: CI failed once at e48de37 on 14.999999999999972 != 15.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2
At 7528966, the last code merge (lead ruling R-93 (h)):
- T128: Python 3.12, Ran 350 tests in 280.360s, OK (skipped=1), and
  tests/test_project.py differs from 961c405 only in T046's method and
  T009's loader line; Python 3.10.21 (PyYAML 6.0.3), Ran 350 tests in
  274.076s, OK (skipped=1), 22 of 22 test modules run.
- T129: git version 2.36.6, the selection passes, and the sixteenth
  scrubbed name's test ran.
- T130: openspec validate --all --strict 7 of 7; 10 kept scenarios equal.
- T131: no non-ASCII added, no file outside the path conventions, parser
  changed under clean only, requirements.txt unchanged.
Every task's verify passed in a sweep at c813869 except T009 and T033
(stale fields, fixed in doc round 12) and T132 (then not yet run).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-2

The git-floor job failed on PR #33's pull_request run 39583441317 while
building Git 2.36.6: reflog.c:209:104: error: macro 'unreachable' passed 3
arguments, but takes just 0. ubuntu-latest is now ubuntu-26.04, whose GCC
defaults to C23; C23 defines unreachable() in <stddef.h>, and Git 2.36.6's
reflog.c declares a function of that name. Push runs passed only because they
restore the cached build; a pull_request run cannot see the head branch's
cache, so it builds from source. The make call now passes
CFLAGS="-g -O2 -Wall -std=gnu17" (Git's default CFLAGS plus the C standard).

SonarCloud's quality gate failed on three security issues in this job, and
this commit clears each of them, in this job only:
- S8541: the pip install now passes --only-binary :all:, so no setup script
  runs.
- S8544: the install now reads a hash-pinned requirement written to
  $RUNNER_TEMP/floor-requirements.txt by the step itself (PyYAML==6.0.3, which
  satisfies requirements.txt's PyYAML>=6.0,<7), with --require-hashes. It
  lists the sha256 of every CPython 3.10 Linux wheel of 6.0.3 on PyPI.
- S6506: the curl call now passes --proto '=https' --proto-redir '=https'.

requirements.txt and the test job are unchanged, and no file is added.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Lane: openRepoProject-2
PR #33's pull_request run 39583441317 failed building Git 2.36.6 on
ubuntu-26.04, whose GCC defaults to C23 (reflog.c's unreachable() meets
the C23 macro); the job now builds with -std=gnu17. SonarCloud's three
security issues in the job (S8541, S8544, S6506): PyYAML installs from a
hash-pinned wheel with --only-binary, and curl enforces HTTPS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brett Heap and others added 29 commits October 23, 2026 19:11
…y run (R-397)

test_clean_a_nested_repository_made_after_the_plan, in tests/test_clean_revalidation.py: a batch whose first target tracks tools/run.sh; at the confirmation question the hook runs `git init` in that tracked directory, and the run stops at the first target as contains-submodule (exit 2, the later target batch-stopped), no removal child runs, and every tree, the nested repository's .git included, is still there.

It pins Brett Heap's Q2 (2) (lead R-380) through a real --apply run, as lead R-397 asks; before it, only two in-process tests in tests/test_clean_apply.py pinned the revalidation step. The batch() fixture takes an optional setup(tree), passed to merged_worktree(). The test fails against project at e702a65 (both targets removed) and passes at 41759a4.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…w 123, and W140's items (R-394, R-405, R-406, R-407)

Docs only (specs/004-project-clean-all-safe/). No code and no test change; the branch is first fast-forwarded to c0841aa, which adds R-397's test.

T127 (W140 MEDIUM-1): its static check failed on the tree 004 has once #19 lands (git merge-tree --write-tree of c0841aa and 4512441, git archive into an empty directory): 129 D14 and D18 spans, 32 with no literal in tests/clean_support.py. Each is classed in T127's text. (a) 26 are not a text 004 prints and go into tuple X: 14 Git and project commands, 4 messages of Git's own, 5 words of Brett Heap's, 2 cites (R-284's letter, the parity rule) and 1 superseded text quoted as history. (b) 1, ADMIN, joins the placeholder list. (c) 5 are printed texts that project holds outside TEXT and NEXT_STEPS (project:7308, :551, :2426, :7464-7466 at c0841aa), each pinned by a test with its own literal; widening the source to TEXT and NEXT_STEPS would find none, so they are entries of X with that reason. The check passes on both trees (30 spans on the branch's own, 98 on the merged one) and still fails on a changed D18 string.

LOW-1: data-model.md step 7's paragraph and traceability's row 123 note carry R-406's measured residual (one _fs() call under min(5 s, the work remaining); warm at 1,000, 10,000 and 50,000 tracked directories; cold cache and deep nesting unmeasured, both fail closed).

LOW-3: the Q8 notes (spec.md FR-057, the contract, data-model.md) say "under Git's default `core.warnAmbiguousRefs`", copied by script from #19 at 4512441 (project-command spec.md:268-271), and that with the setting false the probe exits 0 with empty standard error, so no row is inspection-error on that account.

OBS: spec.md's Q3 (b) note on status is the lane's reading under R-380, and M1 is still open; the three project-command cites (data-model.md, tasks.md, plan.md) are labelled as the ratified copy's lines at 0050f3e, with 4512441's.

R-397's test (R-405): traceability row 123 names test_clean_a_nested_repository_made_after_the_plan (T083), so the named gaps go from six to five; T126's text and verify, T083, T084, the gap list and the tail say so, and the head sentence reads c0841aa.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… MEDIUM-1, R-409)

Lane 3's W139 MEDIUM-1: enclosing_rows() (Q2 (1)) and _read_row()'s
symbolic-link branch (Q9 (b)) sat in the shared worktree_rows(), which
repo_state() uses, so status, doctor and update reported an enclosing
worktree and a symlinked registered path as inspection-error with dirty
null, and doctor exited 1, where f3724fc read both rows and exited 0. Both
rules are clean's review safety (rs:13-16 at 4512441); pc states neither,
so its parity rule (pc:311-312) keeps the report commands at the
baseline's values. Lead call R-409: confine both to clean's plan.

- worktree_rows() and _read_row() take for_clean (default false). Only
  clean sets it: match_target() and build_plan() (planning, and the
  re-plan of push and delete-branch through build_plan()), and
  registry_twin(), revalidation's step 5 re-read, so clean's behaviour is
  unchanged. repo_state() leaves it false.
- R-67 (c)'s shared-path and twin rows stay in every command, as at
  f3724fc: shared_paths() and shared_identities() are not gated.
- tests/test_status_doctor_update.py: a new test on W139's fixture (wt-a
  moved with a symbolic link left at its registered path; w1 holding
  w1/sub/w2) asserts f3724fc's entries for every row in status, doctor
  and update --json (report only), doctor exit 0, and that clean
  --all-safe --json still excludes both rows as registration-mismatch.
  It fails at c0841aa (status, doctor and update subtests) and passes
  with f3724fc's project for those three; report_env() puts recording
  owner tools first on PATH and XDG_CONFIG_HOME and TMPDIR in the
  fixture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… R-409)

Lane 3's W139 LOW-2: pc:391-395, "A stale entry beside a worktree whose
path cannot be read", names project status --json, project doctor --json
and project update --json, and the test looped over status and doctor
only. It now reads update's report as well (no --apply), with exit 0 in
every state, under report_env(): recording owner tools first on PATH,
XDG_CONFIG_HOME and TMPDIR in the fixture, and none of the tools run.
W139 found update conforming on Git 2.43.0 and 2.36.6; the test passes on
both. Test only; project is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…W140 LOW-2, R-409)

Lane 3's W140 LOW-2: main's review-safety requirement "Cleanup protects
the process worktree" names the current worktree from the working
directory "including a directory nested within it", and no test ran
clean from such a directory; every clean cwd= in the suite was a
worktree's top level. The code was right (row_evidence()'s `current`,
active.startswith(tree + b"/")).

The new case in tests/test_clean_single.py, not tests/test_project.py
(FR-066, R-32), runs from sub/deeper inside a merged, clean, published
worktree: the report shows it current and merged-current, --all-safe
selects nothing and excludes it as merged-current, and the explicit
removal refuses with "Cannot remove the current worktree.", exit 2, in
human and JSON output, removing nothing. On a scratch mutant without the
nested branch of `current` it fails: (False, 'merged-removable') !=
(True, 'merged-current'). Test only; project is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…OW-4, R-409)

Lane 3's W140 LOW-4: the comment over TEXT_FIXTURES's
partial_removal_note_locked in tests/clean_support.py still said the
note "waits on Brett Heap's word". He ruled it on 2026-10-22, "F-2: yes"
(the lead's R-263; traceability.md:307-308), and T16 already fixed the
same sentence in project. The comment now says so. Comment only; no
fixture text or behaviour changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…or shares another (R-413)

Brett Heap ruled on 2026-10-23, "yes, recommended for M1 and M3" (lead
R-413). M1 needs no code. M3 (a): a row clean excludes as
registration-mismatch because its path is, or holds, the main worktree,
the common directory or another row (Q2 (1)), or because it shares its
path with another row, printed the class's next step, whose "or remove
the row by hand" deletes what it holds (lane 3's W133 MEDIUM-3).

- TEXT "next_step_registration_mismatch_holds", beside
  next_step_registration_mismatch_unread, byte for byte #19's M3 (a) at
  4512441 (197 characters). It names no git worktree prune, so it has no
  PRUNE_DRY_RUN and no unread form; it is the same in every mode.
- WorktreeRow.holds, never serialized: worktree_rows() sets it for a row
  in enclosing_rows() (clean's plan alone), shared_identities() (R-67
  (c)) or shared_paths() (R-57 L3).
- excluded_groups() gives those registration-mismatch rows a group of
  their own, first, with the new step; the reason's other rows (the
  core.worktree and core.bare redirect, Q9 (b)'s symbolic-link row) keep
  the class's step, and its unread form where a path was unread.
- Tests (tests/test_clean_gates.py): a new test with w1 holding
  w1/sub/w2, a path listed twice (R-57 L3), a worktree under two
  spellings (R-67 (c)) and a symbolic-link row (Q9 (b)) checks both
  groups in the --all-safe preview, in --all-safe --apply --json's human
  text on standard error, in single mode naming w1, and beside an unread
  row; test_clean_the_main_worktree_inside_a_linked_worktree now checks
  W's step in batch and single mode and that no line says "remove the row
  by hand". Both fail at c0841aa, where all such rows print the class's
  step. tests/clean_support.py gains the fixture key.
- Not changed, for the lead: such a row is counted toward
  inspection-incomplete, whose remedy_inspection_incomplete_redirect
  (and its _unread form) still says "or remove the row by hand after
  review".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rett Heap's M3 (a) next step (R-409, R-413, R-416)
…eap's M1 and M3, and T127 on #19's 54e869b (R-409, R-413, R-415, R-416)

Docs only (README.md and specs/004-project-clean-all-safe/). The branch first merges impl/004-q-build at d640539 (the code round, c0841aa..d640539), with no rebase.

The code round (R-409, R-416). W139 MEDIUM-1: Q2 (1) and Q9 (b) apply in clean's plan alone (worktree_rows and _read_row take for_clean), so status, doctor and update report those rows as the baseline does. FR-055's two notes, the contract, the data model, T031 and the README now say so, with a corrective note citing R-409 and #19's design.md:591-598 at 54e869b (the brief's :588-596 are dab8a64's lines); T031's verify names the new worktree_rows signature. M3 (a)'s step, next_step_registration_mismatch_holds (197 characters, copied from project by script), is in the README's next-step table and preview text, the contract's next-step paragraph and preview layout, the data model's next steps, FR-028's note, and T011, T052 and T061. The code round's tests are listed in their tasks (T061, T071, T115) and in traceability's tail.

Brett Heap's M1 (a) and M3 (a) are RULED (R-413, 2026-10-23T21:10:31Z, "yes, recommended for M1 and M3"). FR-064's Q3 (b) note and the contract's matching paragraph record M1 in his words with the time; FR-028's note records M3.

W146's items (R-415): contracts/project-clean.md's note that #19 does not carry F-6 and F-10 says #19 now states both (project-clean spec.md:207-214 and :216-240, scenarios :296 and :308, at 54e869b); the cites of #19's revalidation sentence and reason list are spec.md:112-114 and :133-134 at 54e869b, with round (s)'s wording quoted (the contract, data-model.md, FR-046, FR-047, T084; W146's :113-116 and :133-135 are off by a line, checked by script).

T127 passes on this branch's own tree (30 spans) and on the tree that git merge-tree makes with #19's 54e869b (102 spans of 139), and still fails on a changed D18 string. Three spans had no literal: (a) the label "The main worktree's recommendation", a scenario title; (c) the two baseline recommendations round (s) quotes as the main row's former text, which project still prints for every other row (RECOMMENDATIONS, project:2451-2452) and tests pin with their own literals (the lead's R-412 called them (a)); all three are entries of tuple X. M3's step needs no entry: its fixture is a literal in tests/clean_support.py, and at c0841aa it would have been a fourth missing span.

Traceability gains rows 125 ("The main worktree's recommendation", round (s)) and 126 ("A worktree whose path holds the main worktree", round (t)), titles copied by script, each a named gap with its covering tests; T002 and T126 count 126 rows and seven gaps; the head sentence reads d640539.

Not done: the stale cite at project:775-776 (traceability.md:253-255) is in project's own comment, outside this round's files, as is tests/clean_support.py:647's (traceability.md:307-308). M4 is not documented.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… Heap's M3 (a), and four small items

- W139 MEDIUM-1 (lead R-409): Brett Heap's Q2 (1) and Q9 (b) apply only in
  clean's plan (worktree_rows and _read_row take for_clean); status, doctor
  and update report those rows as the baseline does, doctor exiting 0.
- Brett Heap, 2026-10-23T21:10:31Z, "yes, recommended for M1 and M3" (lead
  R-413): an enclosing or shared-path row prints
  next_step_registration_mismatch_holds in its own group.
- R-397's --apply test for a .git made after the plan; update --json in the
  T9 test; clean from a nested directory; the T16 comment.
Accepted as R-405 and R-419: the full suite gives 520 OK (skipped=1) at d640539.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Doc round 27 (22cddaa; lead R-407, R-411, R-412): W140's items, T127 on the
landing tree, R-406's measured residual, and row 123 covered. Doc round 28
(e3c10c6; lead R-409, R-413, R-415, R-416): Q2 (1) and Q9 (b) as clean's
alone, M3's step, Brett Heap's M1 and M3 rulings, W146's items, T127 against
#19's 54e869b (102 spans, none missing), and traceability rows 125 and 126.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in #40 (f271a39, "feat: discover openBenches checkouts"), #41
(b42355e, the openBenches README link), and the OpenSpec changes of #21
(b233333) and #28 (15504f1). README.md and tests/test_project.py merged
on their own.

One conflict, in workbenches() (project:132-137 after the merge):
- main's discovery is kept as main has it: names ("openBenches",
  "workBenches"), each projects directory for each name, then the
  current directory, then both names beneath it and each ancestor,
  nearest first, with duplicates removed; and main's refusal, "Cannot
  find openBenches or workBenches; set WORKBENCHES_ROOT or --workbenches
  PATH.", which merged on its own.
- 004's rules are kept: the marker path expands through expand_user(),
  never Path.expanduser(), so a `~` marker under a HOME that fails D11's
  test gives None (R-202, LQ-15); and the `root is not None` guard in
  the candidate loop stays. projects_dirs() is 004's HOME-safe one.

main added no other expanduser() call: its only one was the marker
line inside the conflict hunk. The guard is at project:139.

Made under wave 26's brief (lane openRepoProject-2; lead ruling R-429).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…survive (W155, W156; lead R-429)

Comments only. No code, no string literal and no test logic changes; the
ast.dump of project, tests/clean_support.py and tests/test_clean_gates.py is
equal to d640539's.

- F-2's ruled sentence (project, tests/clean_support.py) is cited by its
  content in traceability.md, "F-2's note replaces ratified text", not by
  lines that went stale.
- M3's ruled text (project, tests/clean_support.py, tests/test_clean_gates.py)
  is cited as #19's D18 at 54e869b, design.md:1480-1483 and pcl:120-123, in
  place of "Open Questions at 4512441".
- project, worktree_rows(): a comment says that in clean's plan the twins and
  shared terms of row.holds are subsumed by enclosing_rows(), since equality
  is enclosure, so a mutant that drops them survives by design (W155 OBS-1).

Not done: W155 OBS-2's two cites ("rs:13-15" in enclosing_rows()'s docstring,
"rs:15-16" in _read_row()'s). They sit in docstrings, and a docstring edit
changes the AST, which this round's brief forbids.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d R-430)

project: enclosing_rows()'s docstring cited "rs:13-15" and _read_row()'s
"rs:15-16", which are 4512441's lines. At 54e869b Q2 (1) is at rs:14-16 and
Q9 (b) at rs:16-17, so each cite now says so and names the sha.

Only those two docstring lines change, by the lead's ruling R-430. With every
docstring stripped, the ast.dump of project equals d640539's, and the only
functions whose docstring differs are enclosing_rows and _read_row.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…rentheses nest, and gate 9's directory set is worded in full (W156 LOW-1, LOW-2 and OBS; R-429)

Docs only (specs/004-project-clean-all-safe/). No merge, no code comment, no M4.

W156 LOW-1: traceability.md's preamble said "126 rows, each a named gap", and "the first of them" after "124 rows". It now says that of round (r)'s two scenarios the first, row 123, has a test of its own title since doc round 27 and the second, row 124, is a named gap; that round (s)'s and round (t)'s scenarios, rows 125 and 126, are each a named gap; and that of the 126 rows seven are named gaps (rows 104, 111, 116, 122, 124, 125 and 126, listed below). T002 and T126 still count 126 rows and seven gaps.

W156 LOW-2: T126's text closed its first parenthesis early, at "seven since doc round 28)", so that the ")" after 598929b was one too many (depth -1 at that point, 4 opening and 5 closing in the prose). The early ")" is gone, so the parenthesis that opens at "(114 rows" closes after 598929b, as it did at 41759a4. The prose now has 4 and 4, never below 0, ending at 0.

W156 OBS, gate 9's directory set: round (s)'s words "directly or below it, other than the worktree's own top level" (copied by script from #19's project-clean-review-safety delta at 54e869b, lines 112-114, and checked after whitespace normalisation) are now at the four sites that paraphrased them away: spec.md FR-023's note, data-model.md's gate 9 row, contracts/project-clean.md's step 7 sentence, and T084's prose. Each sentence keeps its grammar.

Not done, as the brief says: the "put to him on 2026-10-23T15:11:48Z" time stays (the lead checked the transcript: M1 and M3 were put to Brett at 15:11:48.455Z); the stale code comments belong to the code-comment writer; the head sentence stays d640539. M4 is not documented.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…(R-429)

The merge of main at b42355e (1a29e80) brings #40's (f271a39)
WorkbenchesDiscoveryTests into tests/test_project.py: seven tests and
three other methods, all main's. Four verifies that compared the file
with main's 961c405 copy, or counted its tests, then failed on main's
methods although 004 changed nothing more:

- T001: the test count of test_project.py is main's 103 at b42355e,
  where it was 96 at 961c405.
- T009 (second script), T046 and T128: the ast comparison base moves
  from 961c405 to b42355e, and still allows only 004's two edits, the
  rewritten test_clean_revalidates_a_worktree_after_confirmation and the
  one sys.modules loader line. T128's prose names the new base too.

Each change carries a dated note citing lead ruling R-429. No other pin
of a main sha in specs/004-project-clean-all-safe/ is made wrong by the
merge: the rest are line citations or counts at named commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lead's correction to this wave's brief: T001 is exempt from R-429
by its own "not re-run" text, so its verify keeps main's 961c405 count,
96, and carries no note. This reverts 66cbd89's T001 hunk (the count
103 and the dated note) and nothing else.

T009's and T046's notes now cite lead ruling R-429 (b), under which
their ast clause moves to b42355e with T128's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
aa342ad (33940cb, then aa342ad) changes comments and two docstring cites
only, in project, tests/clean_support.py and tests/test_clean_gates.py:
F-2 cited by content; M3 cited as #19's D18 at 54e869b; W155's OBS-1
comment at holds; and OBS-2's rs cites, rs:14-16 and rs:16-17 at 54e869b.
The AST, with docstrings stripped, equals d640539's (lead rulings R-430
and R-431).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fe06ab7: traceability.md's preamble names its seven named gaps (W156
LOW-1); T126's parentheses balance again (W156 LOW-2); and gate 9's
directory set keeps round (s)'s "directly or below it, other than the
worktree's own top level" at spec.md, data-model.md, the contract and
T084 (lead ruling R-432).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lete remedy (R-432)

Brett Heap ruled on 2026-10-31T18:20:06Z, "(a) Add M3's exception
(Recommended)" (lead R-432; lane 2's wave24 question M4). A row that takes
M3's step (its path is, or holds, the main worktree, the common directory
or another worktree, or shares its path with another) is
registration-mismatch, so it counts toward inspection-incomplete, whose
redirect remedy said "or remove the row by hand after review": followed
for such a row, that deletes what it holds.

- TEXT gains remedy_inspection_incomplete_redirect_holds (699 characters)
  and remedy_inspection_incomplete_redirect_unread_holds (534), built from
  the two redirect remedies as the lead's generator built
  wave26/m4-texts.json: "or remove the row by hand after review" gains
  M3's exception after it, once, nothing else changed. Both equal
  m4-texts.json byte for byte.
- incomplete_refusal() prints the _holds form, plain or unread, only when
  a row the refusal counts is excluded as registration-mismatch and has
  WorktreeRow.holds. Every other refusal prints the same text as before.
- tests/clean_support.py: the two fixture literals, copied from
  m4-texts.json by script (the harness compares them with TEXT).
- tests/test_clean_gates.py: a new test,
  test_clean_the_refusal_beside_a_row_that_holds_another_takes_m3_s_exception
  (an enclosing row and a shared-path row print the variant; a core.bare
  redirect or Q9 (b)'s symbolic-link row alone prints today's text; batch
  and single mode, human and --json, plain and unread).
  test_clean_the_main_worktree_inside_a_linked_worktree now asserts the
  exact variant for a row holding the main worktree, in --json too, and
  its unread form.
- Three existing tests whose refusal counts a shared-path or twin row now
  expect the _holds form (test_clean_gates' shared-path subtest,
  test_clean_batch's single-mode shared path, test_clean_single's
  deadline-stopped variant test).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…8, R-432)

Lane 3's W161, row 004-08: a registry path listed twice (lead rulings R-57
L3 and R-59 D5) and two spellings of one worktree (R-67 (c)) were
registration-mismatch in every command, so status, doctor and update
reported them inspection-error with dirty null, and doctor exited 1,
where the baseline at 15504f1 probed them and doctor exited 0. pc states
neither rule, so its parity rule (pc:311-312) keeps the report commands
at the baseline's values. Lead R-432, RULED (b): confine both to clean's
plan, as R-409 confined Q2 (1) and Q9 (b).

- worktree_rows() reads shared_paths() and shared_identities() only when
  for_clean is true (match_target() and build_plan()); repo_state() leaves
  it false, so _read_row() gets shared false and every such row is read
  and probed as the baseline did. registry_twin() (revalidation) is clean's
  and unchanged. Clean keeps these rows registration-mismatch, with M3's
  step and M4's remedy.
- Docstrings and comments of WorktreeRow, registration_verdict(),
  verify_registration(), shared_paths(), shared_identities(), _read_row(),
  worktree_rows() and repo_state() say so, citing R-432. The holds comment
  reads "add nothing beyond enclosing" (lane 3's W164 OBS, at the lead's
  word).
- tests/test_status_doctor_update.py: a new test,
  test_status_a_path_listed_twice_and_a_twin_spelling_keep_the_baseline_s_values,
  beside R-409's: status, doctor and update --json (report only, recording
  owner tools) give every row 15504f1's values, read from 15504f1's
  project on the same layout (dirty false, ignored_files 0, no
  classification), doctor exit 0 and no error check; clean --all-safe
  --json still excludes the four rows as registration-mismatch, its
  refusal M4's _holds remedy.
- tests/test_clean_evidence.py: the in-process worktree_rows() calls of
  the R-57 L3 and R-67 (c) subtests pass for_clean=True, since the
  default is now status's reading; their assertions are unchanged, and
  every clean CLI test passes unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… clean

949c58a: the two inspection-incomplete redirect remedies gain their
`_holds` variants, M3's exception, printed only when a row the refusal
counts is `registration-mismatch` and holds the main worktree, the common
directory or another worktree (Brett Heap, 2026-10-31T18:20:06Z, "(a) Add
M3's exception (Recommended)"; lead ruling R-432). The texts equal #19's
round (u) at 1476110 byte for byte.

b7cf86e: R-67 (c)'s shared-path and twin rows are `registration-mismatch`
in clean's plan only; status, doctor and update read them as the baseline
does (lane 3's W161, ledger row 004-08; lead ruling R-432, as R-409 did
for Q2 (1) and Q9 (b)).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…confined to clean's plan, R-61 (b) kept, row 127, T127 on #19's 1476110 (R-432 to R-443)

Docs only (README.md and specs/004-project-clean-all-safe/), on top of the merges of 004 at 0fb3d30 and the code round's accepted head b7cf86e.

1. M4 (a), ruled on 2026-10-31T18:20:06Z, "(a) Add M3's exception (Recommended)": README, the contract (the refusal-code row, a paragraph that says when the _holds form prints, the unread forms and the Q3 (b) list) and data-model.md document remedy_inspection_incomplete_redirect_holds and remedy_inspection_incomplete_redirect_unread_holds, copied by script from project's TEXT (699 and 534 characters, equal to wave26/m4-texts.json). Dated notes on FR-027 and FR-028 cite his words, the time and R-432. T011, T053, T061 and T070 name the fixtures and the changed tests; T061's verify collects the new test.
2. LQ-3, O-2 and F-4 are ruled, with his ledger word of 2026-10-23T21:31:02Z, his "Broad (lane 3's reading)" at 2026-10-31T17:58:12Z and his answer at 18:20:06Z: research.md R1, plan.md, spec.md (Assumptions, Dependencies, a note on FR-047), the contract (the pins, F-4's "for Brett Heap's yes or no"), data-model.md (R-208's reading) and tasks.md.
3. R-67 (c), with R-57 L3, is clean's plan alone (lane 3's W161, row 004-08): data-model.md, the contract (a dated note and the status-difference row), spec.md (FR-055's note and a dated note), T029, T031 and T115 say that status, doctor and update keep the baseline's values.
4. R-61 (b) is kept in every command (lane 5's RN-1): the sentence that a run of add-project-clean-branch-retirement can retire refs/heads/HEAD is corrected in the contract, data-model.md and spec.md; #19 states R-61 (b) at pcm:251-256 at 1476110.
5. data-model.md's revalidation step 7 has gate 9's directory set in full, copied by script from #19's delta (W164 OBS 1).
6. T128's note cites R-429 (b) (W165 OBS-4).
7. Traceability: row 127, "A refusal beside a worktree whose path holds the main worktree" (pcl:133 at 1476110), a named gap, title copied by script; T002 and T126 count 127 rows and eight gaps; a gap bullet, the preamble and a tail paragraph that lists the code round's tests.
8. T127 passes on this branch's own tree (30 spans) and on the tree that merge-tree makes of this branch and 1476110 (105 spans, 0 missing).
9. The head sentence reads b7cf86e.
10. T127's tuple X gains Brett Heap's quoted answer, "(a) Add M3's exception (Recommended)" (D18, design:1731-1732 at 1476110), class (a) (lane 3's W169 LOW-1). Before the entry the merged-tree check passed at 106 spans only because the code round's comment at tests/clean_support.py:672 quotes the answer; on 0fb3d30 x 1476110 it missed three spans.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… test's no-root doctor run (lead R-448, R-437)

W174 OBS-3: project (the docstrings of worktree_rows() and repo_state())
and tests/test_status_doctor_update.py cited "pc:311-312" with no commit.
At #19's d9c482b the parity rule ("Values SHALL equal those of the
inspection this model replaces, except where a requirement states a
change") is at pcm:316-317, so each of the three cites now names that
sha and those lines. The two project cites sit in docstrings, so the text
of two docstrings changes and nothing else: ast.dump equals b7cf86e's once
the docstring text is blanked.

W165 OBS-3: the tilde test's doctor run with no WORKBENCHES_ROOT looked for
a registry in PROJECTS_DIR, then in the current directory and its parents,
so it could read a host registry. It now finds a fixture registry under
PROJECTS_DIR first (self.base/workBenches/config/bench-config.json), so
its lookup still runs and reads nothing above the temporary directory. The
test's assertions are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…-10-31)

Prose only: the data-model paragraph and T031's sentence that confine R-57 L3 and R-67 (c) to clean's plan now carry the date of lane 3's W161 ruling, 2026-10-31 (lead R-432), as the notes beside R-409's do.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
b73ff9b: three cites of "pc:311-312" become #19's parity rule at d9c482b,
pcm:316-317 (two docstrings and one comment; lane 3's W174 OBS-3), and the
tilde test's no-root doctor run finds a fixture registry under
PROJECTS_DIR first, so it reads no registry above the temporary directory
(lane 3's W165 OBS-3; lead rulings R-448 and R-450).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
343db6d (5a813c8, then 343db6d): Brett Heap's M4 (a), LQ-3, O-2 and F-4
ruled (2026-10-31T18:20:06Z), documented with his words and the chain;
R-67 (c) confined to clean's plan; R-61 (b)'s "can retire refs/heads/HEAD"
claim corrected at three sites; gate 9's full wording at data-model.md's
step 7; T128 cites R-429 (b); traceability row 127 for #19's new scenario,
a named gap (127 rows, eight gaps); Brett's quote in T127's X list (lead
rulings R-432 to R-450).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

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.

OpenSpec: add-project-clean-all-safe (batch worktree cleanup from the maintenance design packet)

1 participant