Skip to content

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

Merged
brettheap merged 29 commits into
mainfrom
change/add-project-clean-all-safe
Oct 9, 2026
Merged

brettheap merged 29 commits into
mainfrom
change/add-project-clean-all-safe

Conversation

@brettheap

@brettheap brettheap commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoProject-2
Claim: #9 (comment)

Governed change: add-project-clean-all-safe (DRAFT, awaiting Brett Heap's ratification)

OpenSpec proposal for project clean <root> --all-safe, the repository-scoped batch removal of eligible linked worktrees designed in the project maintenance packet (ideation/brainstorm/, PR #7 at da33d92), with the shared evidence model that status, doctor, update and the later project overview read. Change 1 of two; add-project-overview (#10, PR #12) depends on it.

Baseline: origin/main 7a9134b merged in (PR #8 realization of feature 002, PR #13 archive of prefer-triad); citations pinned at da33d92 with the stated line offsets; project cleanup paths unchanged in content. No code, no tests and no Speckit artifacts are in this PR.

Phases

  • 1-2 proposal.md drafted
  • 3 alignment review (stack-architect 4 MISMATCH + 10 DRIFT, qa-lead 4 MISMATCH + 10 GAP) and fix round at 0ed2f59; packet author's fidelity reads folded
  • 4-5 council (product-advocate, systems-architect, adversary-engineer): 12 VALID, 5 NOTED, 0 DISMISSED; fix round at ea9c73b; clarifications.md at 1d4ed5b; main merged at e21b24d; restated at 0669a20; packet author's delta read (M1-M7) at ba9f7c3
  • 6 spec deltas at 90854a3, precisions at 335111e: project-clean 5 MODIFIED + 6 ADDED; project-clean-review-safety 2 MODIFIED + 1 ADDED; project-command 2 MODIFIED + 1 ADDED; 94 scenarios, every canonical scenario of the MODIFIED requirements kept byte-identical; design.md D1-D20; governance tasks.md with one Speckit handoff (feature 004-project-clean-all-safe, created by /speckit.specify after ratification)
  • openspec validate add-project-clean-all-safe --strict valid; openspec validate --all --strict 6 passed, 0 failed; simulated archive 5 passed; openspec status 4/4; python3 -m unittest discover -s tests -v 94 OK
  • amendment at 9ea2f02 and 0b3c33d: the unstarted-branch gate reads the creation reflog (at most 64 KiB) in every case, so a fast-forward-merged branch at the target's tip stays eligible and a missing, empty or expired reflog is reflog-unavailable; manifest over-cap detected from st_size; path escaping names Unicode categories Cc, Cf, Zl and Zp; a validity flag beside every nested JSON path (ignored_samples entries become {path, path_valid_utf8} objects). Resolves the two Codex inline findings. 95 scenarios
  • sibling reconciliation (PR OpenSpec: add-project-overview (project overview from the maintenance design packet) #12 at 996a181); independent re-verification at 0b3c33d and the packet author's delta read: every finding resolved at d6aaa9a (apply order and exit-table scope, signals before apply, push and delete-branch in single mode, status/doctor errors shape with root_valid_utf8, the anchor-based reflog test with one outcome rule, [E]'s null-root directory rule, unified remedy texts, departures recorded); 96 scenarios; checks green
  • targeted re-check of d6aaa9a: every ruling R-11 to R-14 verified applied with the ruled wording, consistency sweep clean, READY for content; two advisory wordings aligned at 6792e06; origin/main 26a5668 merged at a83a661 (the change directory unchanged; openspec validate --all --strict 7 passed, 0 failed with PR OpenSpec: fix-parent-obstacle-wording (follow-up to prefer-triad-in-project-new) #15's unarchived change counted)
  • packet author's delta read of 6792e06 (one MEDIUM, a fail-open regression: a branch created by fetch, update-ref or a local push has no "branch:" reflog message, so the message-based anchor missed it): resolved at 9eeac52 by anchoring the reflog test on the creation entry whatever its message (an all-zeros old object), with a fetch-created scenario, the reflog-unavailable remedy "missing, expired or undecidable", the over-64 KiB residual in Risks, tasks 1.2 aligned with the later-rulings list, and selected: null with an inspect-cap note above 128 rows; 4f2162b states what excluded and plan_digest hold in that band; 97 scenarios; openspec validate --all --strict 7 passed, 0 failed; 94 tests OK
  • packet author's delta read of 4f2162b (R-15 and R-17 confirmed applied; three LOW): resolved at 7e2589f, the report digest rule scoped to the band above 128 rows (at or below 128 a report's digest equals the preview's for the same selection, which is intended), D19's notes list carrying the report-mode inspect-cap note, R-17 and R-19 recorded; 97 scenarios; openspec validate --all --strict 7 passed, 0 failed
  • packet author's last delta read at 7e2589f: clean; its three wording notes applied at 8973762 (the report band names the digest's full scope: repository identity, merge target and selection; one movement phrase aligned with the spec)
  • READY at 8973762; Speckit handoff renumbered to 004-project-clean-all-safe at 7a31f70 and cab78d8 because lane 1's PR Name a parent that is not a directory in project new (feature 003-parent-obstacle-wording) #17 holds feature 003 (numbering only; head cab78d8): content verified by the independent re-verification, two targeted re-checks and the packet author's four delta reads; openspec validate --all --strict 7 passed, 0 failed; 94 tests OK; 97 scenarios; origin/main 26a5668 merged
  • task 2.2, the Git 2.36 floor, executed and ticked at c873c81 (ruling R-21): Git 2.36.6, 2.40.4 and 2.43.0 compared on 75 captures; rows 1-6 of D17 identical; row 7 differs by one environment variable (GIT_INTERNAL_SUPER_PREFIX, printed by 2.36 through 2.39 and fatal to every command on those versions when set), now the sixteenth name in the unconditional scrub; the floor stays 2.36. This departs from task 2.2's literal rule (raise to the lowest version verified, 2.40), because 2.40 would exclude Debian 12's Git 2.39 for a one-name difference; open to Brett Heap at ratification
  • open question 1 ruled by Brett Heap and applied at b772195 (98 scenarios; openspec validate --all --strict 7 passed, 0 failed; 94 tests OK)
  • task 2.1, the OQ-4 measurement, executed and ticked at 251978d (ruling R-24: every cap stands as measured; the degraded cases and the gitlink residual recorded in Risks; numbers in the comments); ruling R-25 closes the lazy-fetch gap (GIT_ALLOW_PROTOCOL the seventeenth scrubbed name; every common transport pinned to never)
  • ratified by Brett Heap on 2026-10-09, in his words to this lane: "ratify, merge OpenSpec: add-project-clean-all-safe (batch worktree cleanup from the maintenance design packet) #11 and run the runbook"; final head df75ef6; squash-merged per the runbook; next: /speckit.specify 004-project-clean-all-safe, the archive after that feature lands

Departures from packet decisions, open to Brett Heap at ratification: V5 retires the target-cap refusal, so that when more than 16 rows pass every gate before deferred-target-cap the first 16 in canonical order go on to the index gates and the rest are deferred as deferred-target-cap, the plan staying complete and apply allowed, and re-running drains the backlog 16 at a time; V10 keeps 15 s per Git child for status, doctor and update, which have no deadline, withdrawing the packet's 5 s for them; V1 never signals a started removal child, waiting for it through SIGINT, SIGTERM, SIGHUP and the work deadline, with only a 300 s hard ceiling killing it; V4 records another row's inspection error, row-cap omission or unprobed state as a non-blocking omission for a single-target removal instead of refusing it; OQ-23 narrows the Git 2.36 requirement so that clean refuses an old or missing Git while status, doctor and update report it instead of refusing; OQ-24 replaces the additive superset with one schema_version 1 envelope for every clean --json, baseline keys keeping their names and types; the bounded runner runs Git children in place of the timeout argument the packet gives probe(); R-9 makes each ignored_samples entry a {path, path_valid_utf8} object and puts a validity flag beside every path value; R-8 escapes every code point of Unicode categories Cc, Cf, Zl and Zp, with a \UXXXXXXXX form above U+FFFF, where the packet enumerates a set and has one escape form; and R-4 adds detecting an over-cap manifest from st_size before it is read.

Ruled by Brett Heap on 2026-10-09, to this lane: "yes, local ancestry proof outranks remote-gone, apply it". Applied at b772195: the classification ladder tests local ancestry before the remote-gone rung for worktree rows, so a merged worktree whose upstream was deleted is merged-removable (eligible, the ordinary merged remedy) and only an unmerged one is remote-gone; push still refuses on a deleted upstream whatever the class; revalidation treats a value null in the plan and null again as no difference; the fifth user-visible change (such a row is now removed by --worktree P) is listed with the other four. Still open for Brett Heap: open question 2 (squash merges never satisfy the ancestry proof; recommendation: a local patch-equivalence follow-on change).

Out of scope, as the packet defers them: branch deletion, cache disposal, remote or GitHub queries, family traversal, bench, container and park integrations. Any future paired-retirement extension is a MODIFIED requirement on project-clean (PR #2 decision record).

Refs #9, #6.

🤖 Generated with Claude Code

Scaffold the OpenSpec change and draft proposal.md only: a
repository-scoped `project clean <root> --all-safe` preview and
confirmed batch removal on one shared, revalidated, reconcilable
mutation seam, with single-target `remove` as a strict one-item batch,
Git-first resolution, one bounded evidence model for clean, status,
doctor and update, and a versioned JSON envelope. It names the
MODIFIED and ADDED requirements for project-clean,
project-clean-review-safety and project-command, takes the open
decisions that concern this change, and records the packet readings
and corrections. Spec deltas, design and governance tasks follow the
alignment review and the council.

Refs #9, #6

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

sourcery-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR adds only a draft OpenSpec proposal—no production code, tests, spec deltas, or Speckit artifacts—for a future safety-first project clean <root> --all-safe implementation, including its planning, eligibility, bounded execution, revalidation, reconciliation, evidence, JSON, and governance contracts.

Sequence diagram for safe batch worktree removal

sequenceDiagram
    actor User
    participant Clean as project clean
    participant Git as Git
    participant Worktree as Target worktree

    User->>Clean: --all-safe --apply
    Clean->>Git: Build fresh plan with bounded probes
    Git-->>Clean: Eligibility evidence and plan_digest
    Clean->>User: Print plan and request confirmation
    User->>Clean: Confirm or --yes
    loop Each selected target in canonical order
        Clean->>Git: Revalidate target identity and safety gates
        Git-->>Clean: Validation result
        alt Target remains safe
            Clean->>Git: retire_worktree(plan, target)
            Git->>Worktree: Remove non-force worktree
            Git-->>Clean: Removal status
            Clean->>Git: Rescan target
            Git-->>Clean: Reconciliation evidence
        else Validation fails
            Clean-->>User: Refuse target and stop batch
        end
    end
    Clean-->>User: Versioned plan and result record
Loading

Entity-relationship diagram for cleanup planning and reconciliation

erDiagram
    CLEAN_PLAN ||--o{ CLEAN_TARGET : selects
    CLEAN_TARGET ||--|| RECONCILIATION : produces
    CLEAN_PLAN {
        string mode
        string plan_digest
        string completeness
    }
    CLEAN_TARGET {
        string path
        string eligibility
        string refusal_reason
        string stage
    }
    RECONCILIATION {
        string outcome
        string observed_state
        string recovery
    }
Loading

Flow diagram for the proposed all-safe worktree cleanup

flowchart TD
    A["project clean <root> --all-safe"] --> B["Resolve repository Git-first"]
    B --> C["Build fresh bounded plan"]
    C --> D{"Complete and eligible targets exist?"}
    D -->|No| E["Preview plan or refuse"]
    D -->|Yes| F["Confirm exact selected set"]
    F --> G["Revalidate each target"]
    G --> H["retire_worktree(plan, target)"]
    H --> I["Rescan and reconcile result"]
    I --> J{"Target result is removed?"}
    J -->|Yes| K["Continue in canonical order"]
    J -->|No| L["Stop batch and report recovery"]
Loading

File-Level Changes

Change Details Files
Adds a draft OpenSpec proposal defining a repository-scoped, safety-gated batch worktree cleanup command and the implementation contract it would impose.
  • Defines preview and apply flows for clean --all-safe, including fresh-plan confirmation, plan digests, deterministic ordering, and stop-on-failure behavior.
  • Specifies conservative eligibility gates for submodules, hidden local state, locks, registration, paths, and repository/worktree identity.
  • Unifies single-target removal with the batch planning and mutation seam, including targeted revalidation and post-removal reconciliation.
  • Defines bounded probing, deadlines, caps, signal handling, refusal/stage/exit-code semantics, and structured versioned JSON output.
  • Specifies shared Git evidence probing and Git 2.36 requirements for clean, status, doctor, and update.
  • Documents path-byte handling, human/JSON escaping, README and test coverage expectations, sequencing, dependencies, and explicit out-of-scope areas.
openspec/changes/add-project-clean-all-safe/.openspec.yaml
openspec/changes/add-project-clean-all-safe/proposal.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Apply the stack architect (SA-1..SA-14) and QA lead (QA-1..QA-14)
alignment findings to the proposal under the lead's rulings:

- D-B: R6 narrowed; clean refuses old or unusable Git, status, doctor
  and update never do; project-command "Inspect and diagnose" MODIFIED;
  the ADDED requirement carries the 5 s child budget, no invocation
  deadline or row cap for status/doctor/update, and 15 s for non-Git
  children. Relabelled as a deliberate departure from the packet.
- D-C: --apply --json accepted for --all-safe and --action remove only,
  one stdout document; push and delete-branch keep the refusal.
- D-D: "Clean can explicitly push safe feature branches" MODIFIED with
  the remote-gone and incomplete re-inspection refusals.
- D-E: C2 moved to reading R9; bare-repository refusal is R10, replacing
  BA:1255-1256.
- D-F: preview and report exits by completeness; SIGTERM and SIGHUP in
  the top row of the exit table.
- D-G: Git children through a new bounded runner, start_new_session,
  daemon threads for filesystem calls (Impact, C4).
- D-H: OQ-22 cites add-project-overview for the acf0133 supersession.
- D-K: Dependencies and Sequencing under Impact; Status notes the extra
  sections. D-L: cross-citations by change name and label.
- Amendments: D-M (ADDED project-command names overview and carries the
  evidence model), D-N and D-S (R1 baseline changes; doctor renders null
  inspection fields as error rows), C1 and C8 completed, D-Q (OQ-4
  measurement in governance tasks.md), D-R ("Explicit maintenance"
  MODIFIED), D-T (both origin/ strips), D-U (target-cap trigger), D-V
  (256-row report cap), D-W (deadline scope), D-X (pre-apply signals,
  best-effort printing), D-Y (Why wording), D-Z (Decisions split), and
  the remote-gone question under Open Questions.

The resolution of every finding is tabulated under "Questions Resolved
by the Alignment Review".

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

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Alignment review resolution, add-project-clean-all-safe @0ed2f59

Proposal: openspec/changes/add-project-clean-all-safe/proposal.md. The lead's
rulings D-A to D-L bind where they differ from a reviewer's wording; D-A keeps
R1 as written. D-I, D-J, D-O and D-P concern only add-project-overview.

Stack architect (4 MISMATCH, 10 DRIFT)

Finding Severity Ruling Proposal section changed
SA-1 MISMATCH applied per D-G Impact (project); What Changes (evidence model); Corrections C4
SA-2 MISMATCH applied per D-B What Changes (evidence model); Capabilities (project-command); Impact; OQ-22, OQ-23; R6
SA-3 MISMATCH applied per D-C What Changes (single-target, JSON); OQ-10
SA-4 MISMATCH applied Rules This Change Keeps; Capabilities (review-safety :21)
SA-5 DRIFT applied per D-B Capabilities (project-command ADDED)
SA-6 DRIFT applied Capabilities (review-safety :49)
SA-7 DRIFT applied Decisions OQ-23
SA-8 DRIFT applied per D-G Corrections C4; Impact (project)
SA-9 DRIFT applied; a drvfs mount named instead of a host path Impact (tests)
SA-10 DRIFT applied Impact (tests)
SA-11 DRIFT applied per D-F What Changes (reconcilable); OQ-16
SA-12 DRIFT applied per D-E Why; Readings R9; Corrections intro
SA-13 DRIFT applied per D-F, merged with QA-1 Capabilities (other capabilities); R5
SA-14 DRIFT applied per D-K Status; Impact (Dependencies and Sequencing)

QA lead (4 MISMATCH, 10 GAP)

Finding Severity Ruling Proposal section changed
QA-1 MISMATCH applied per D-F Capabilities (other capabilities); What Changes (bounded work); R5
QA-2 MISMATCH applied per D-C What Changes (single-target)
QA-3 MISMATCH applied per D-E (labelled R10, not R9) What Changes (resolution, evidence model); Capabilities (Git-first); OQ-15; R10
QA-4 MISMATCH applied (stays in Why, not under Corrections, per D-W) Why
QA-5 GAP applied per D-B; the refusal text is superseded by D-B Capabilities (project-command); R6
QA-6 GAP applied Capabilities (:25, :55, review-safety :49)
QA-7 GAP applied per D-D What Changes (single-target); Capabilities (:39 now MODIFIED, review-safety :38, :49)
QA-8 GAP applied; amended per D-T Capabilities (Git-first ADDED)
QA-9 GAP applied per D-F What Changes (reconcilable); OQ-16
QA-10 GAP applied per D-C What Changes (JSON)
QA-11 GAP applied Decisions OQ-29
QA-12 GAP applied; R6 scenario superseded by D-B, R2 scenario at 256 rows per D-V Impact (tests)
QA-13 GAP applied Rules This Change Keeps
QA-14 GAP applied; the caps sentence superseded by D-Q What Changes (spelling, eligibility, bounded work, paths, README and tests); Corrections C3

Later rulings from the packet author's fidelity reads

Ruling Applied as Proposal section changed
D-M the ADDED requirement names overview among its readers and carries the version check, probe directory rule, scrub with GIT_OPTIONAL_LOCKS=0, NUL parsing, combined probe and bounds, 5 s per child Capabilities (project-command ADDED)
D-N failed root git status (project:326-328) becomes a row-level inspection-error, with a parity test R1; Impact (tests)
D-S same for legs and the update report (project:995-1000); doctor renders null dirty or any null inspection field as an error row; "without exit changes" withdrawn R1; Capabilities (Inspect and diagnose, ADDED)
D-B relabelled R6 is a deliberate departure from the packet's doctor refusal (OV:231-234, DI:1156-1160, BA:1241-1245 agree), not a correction R6
C1 completed HO:365-366 added; 80fdef3 missing from DI:33-35, BA:39-42 and OV:176-178 Corrections C1
C8 completed R7 also departs from the Resolution record, HO:210 R7; OQ-24
D-Q caps marked provisional in the deltas; the warm and cold-cache measurement is in governance tasks.md before the handoff, on a Linux filesystem path OQ-4; What Changes (bounded work); Impact (Speckit handoff)
D-R "Explicit maintenance" MODIFIED: update --apply refuses unless every dirty is exactly false; leg-timeout scenario; review-safety :51-55 preserved Capabilities (project-command, project-review-safety); Dependencies
D-T both origin/ strips named; origin/develop scenario Capabilities (Git-first ADDED)
D-U target-cap trigger is more than 16 rows passing every gate before the index gates, with no index probe run What Changes (bounded work)
D-V mode: "report" caps rows at 256 (7 + W + 16 children, 41.85 s); apply modes keep 128 and 16 OQ-29; What Changes (bounded work); Impact (tests)
D-W the deadline bounds inspection and removal children only; push and delete-branch stay unbounded. No C5 existed in this proposal, so there was nothing to withdraw What Changes (bounded work)
D-X pre-apply SIGTERM and SIGHUP terminate and reap probe children; best-effort printing after SIGHUP OQ-16
D-Y untracked-file defect worded as a requirement of the new probe Why
D-Z Decisions split: packet open decisions taken; departures (OQ-23, OQ-24); adopted (OQ-5, 9, 25); lane additions (OQ-1, 3, 22, 29) Decisions Taken by This Proposal
OPEN FOR BRETT merged worktree with a deleted remote branch classifies remote-gone; the packet's ladder is kept until Brett Heap rules Open Questions (new section)

Capabilities after the rulings: project-clean 5 MODIFIED + 6 ADDED;
project-clean-review-safety 2 MODIFIED + 1 ADDED, 2 untouched;
project-command 2 MODIFIED (Inspect and diagnose, Explicit maintenance)

  • 1 ADDED, 2 untouched.

Attachments (the lead will append them): alignment-stack-architect-clean.md
and alignment-qa-lead-clean.md.

Lead rulings (D-A to D-Z) follow in the next comment; the two review reports after that.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Lead rulings on the alignment reviews (binding for #11 and #12)

Lead rulings on the alignment reviews (lane openRepoProject-2, 2026-10-08)

Cross-change rulings. Both proposals apply them identically.

D-A Failed status probe on the merge-target checkout: change 1's R1 governs. A failed, timed-out or deadline-cut status probe sets the row to inspection-error directly, on the merge-target branch too, with that code's repair finding of severity error. The overview follows; its OQ-19/OQ-20 drift findings apply only to a checkout the ladder classifies protected-default. (clean: R1 stays; overview: SA-1, QA-1 fix.)

D-B Git 2.36 scope: change 1's R6 is narrowed. The version check runs only when a Git repository is about to be inspected; a directory with no .git keeps present: false. clean and overview refuse with git-too-old or git-unavailable, exit 2, before any probe; under --json they print {"error", "code"}. status, doctor and update never refuse: doctor reports an old or unusable Git as an error check row and keeps its exit semantics for error rows; status marks rows it cannot inspect inspection-error; update --apply --component tools|workflow does not require Git. Change 1 therefore MODIFIES project-command "Inspect and diagnose" (minimal text for the doctor check row and the status row rule) and keeps "Explicit maintenance" untouched; its ADDED project-command requirement carries the shared evidence model, the 5 s child budget for status/doctor/update, no invocation deadline or row cap for them, inspection-error without exit changes, and 15 s kept for non-Git children. The overview adds an 11th ADDED requirement "Overview exits by completeness and severity" carrying exits 0/1/2/130, SIGINT (terminate and reap, Cancelled. on stderr, no result document, 130 wins over 1), and its own Git refusal before any root is listed. (clean: SA-2, QA-5, SA-5; overview: SA-2, QA-13.)

D-C --apply --json: accepted for --all-safe and --action remove only; prints exactly one stdout document, the plan envelope or the extended error object when the run stops before the apply phase, otherwise the apply result record; human plan, prompt and progress on stderr. With --action push or --action delete-branch it stays refused invalid-arguments, exit 2. Single-target remove: flags unchanged, --apply --json now accepted. (clean: SA-3, QA-2, QA-10.)

D-D push and remote-gone: push refuses a remote-gone branch (its configured upstream was deleted; it must be reviewed before it is republished) with refusal reason remote-gone, exit 2. push and delete-branch refuse with inspection-incomplete, inspect-cap or deadline-exceeded, exit 2, when their re-inspection is incomplete. project-clean "Clean can explicitly push safe feature branches" becomes MODIFIED with exactly those two additions. (clean: QA-7.)

D-E Bare repositories: refused in every clean mode with target-not-repository-root, exit 2 (OQ-15), recorded as a new baseline change replacing BA:1255-1256 (QA-3). Overview: a bare repository's row has repository.root: null and no clean suggestion (QA-18).

D-F Exit codes: a read-only preview or report whose plan carries inspect-cap, inspection-incomplete or deadline-exceeded exits 1; one carrying only target-cap exits 0; every resolve refusal and every refusal under --apply exits 2 (QA-1). SIGTERM and SIGHUP: in the apply phase as SIGINT, taking the top row of the exit table as 143 and 129, the first signal received setting the status; before the apply phase exit 143 and 129 with zero mutation (QA-9, SA-11).

D-G Runner: Git children run through a new bounded runner, not probe(): Popen(start_new_session=True) per child, environment scrubbed, stdout read as bytes and streamed so a probe stops at its record bound; probe() stays for non-Git children; abandonable filesystem calls run on daemon threads, never a concurrent.futures pool, never preexec_fn (SA-1, SA-8 clean). The overview owns the four-way scheduler, the in-flight registry terminated together on SIGINT or deadline, and the daemon filesystem workers (SA-8 overview).

D-H OQ-22 is change 1's decision (no doctor health section; doctor changes only through the shared evidence). Change 2 records only that acf0133's unmerged project-doctor-repository-health capability is superseded by project-overview; change 1 cites change 2 for that supersession (SA-12, QA-7 overview).

D-I On a protected-default checkout the dirty, diverged, unpushed and remote-ahead findings carry suggested_command: null, overriding the attention table for that checkout only and never setting the row's suggested_command; stated as a deliberate departure from DI:635-636 and DI:650-651, because project clean offers no action for the merge-target checkout (SA-6, QA-6 overview).

D-J Repository gate: target-cap does NOT withhold the --all-safe suggestion; the batch preview is complete and lists every target, and the user removes some explicitly first (QA-17 over SA-3 overview). The gate withholds on inspection-incomplete and inspect-cap only, computed from the overview's own evidence; a plan cut by the batch's own deadline is not predicted. Record the DI:675-686 clarification under Corrections.

D-K Section layout, both proposals: house order; "Dependencies and Sequencing" as ### at the end of Impact; "Decisions Taken by This Proposal" and "Corrections to the Packet" as ## after Out of Scope and before "Questions Resolved by the Alignment Review"; title case as change 1; Status line notes the two extra sections.

D-L Cross-citations between the two proposals are by change name, section title and reading label (R1, OQ-23), never by line number, because both files are being edited in parallel.

Every other MISMATCH, DRIFT and GAP in the four reports is accepted as the reviewer worded it unless it conflicts with a ruling above, in which case the ruling wins.

Amendments after lane openRepoProject-3's fidelity read of PR #12 (2026-10-08, later)

D-M Binding after archive (lane 3 M1): no requirement may depend on "change 1's budgets/ladder/gates" by prose reference, because after archive only canonical headers survive. Change 1's ADDED project-command requirement "Repository inspection requires Git 2.36 and shares one evidence model" names overview among its readers, alongside clean, status, doctor and update, and carries the probe directory rule, the environment scrub with GIT_OPTIONAL_LOCKS=0, NUL parsing, the combined probe and its bounds, the version check and the per-child budget; the overview's requirements cite that canonical header by name wherever they rely on it, and the overview's own 60 s deadline is stated in its own requirement (project-command keeps "no invocation deadline or row cap" for status, doctor and update).

D-N Baseline change (lane 3 M4): at a040790 a failed git status in the repository root raises Refused (project:326-328), ending clean, status and doctor with exit 2; under the shared model it is a row-level inspection-error. Change 1 lists it under R1 as a baseline behavior change with a parity test; the overview inherits it.

D-J amended (lane 3 L2): the overview's repository gate withholds --all-safe when the repository has any unprobed row (classification null from the 512-row cap or the deadline) as well as on inspection-incomplete and inspect-cap; target-cap still does not withhold. C14 is not a packet defect and is not recorded under Corrections; QA-17's sentence suffices.

D-B relabelled: OV:231-234, DI:1156-1160 and BA:1241-1245 are consistent with each other (exit 2, the same two codes, code added per DI:1086-1089 and BA:978-980); D-B is a deliberate departure from the packet's doctor-refusal rule, not a correction of an inconsistency, and change 1 labels it so.

D-I relabelled: the passages D-I departs from are DI:704, DI:645 and DI:650-651; DI:635-636 fixes only the code vocabulary and DI:626-630 already puts a dirty finding on a protected-default row.

C1 completed: 80fdef3 is also missing from DI:33-35 and OV:176-178; HO:365-366 and HO:377-380 (PR #7 "open") go in both proposals' Corrections. C8 completed: HO:210 (the Resolution record) also says "additive superset", so change 1's R7 departs from the Resolution record as well as BA:949-953.

D-O Overview signals (lane 3 L1): SIGTERM and SIGHUP get the SIGINT treatment in project overview, exits 143 and 129, so no Git child is left running under start_new_session=True.

D-P Withheld suggestion reason (lane 3 L3): when the overview withholds --all-safe or any clean suggestion for a repository, the finding carries a reason code naming why (the gate that withheld it), so a repository over 128 rows says why it only gets the read-only command.

D-Q Measurement (lane 3 M3): OQ-4 is worded in both proposals as: the spec deltas mark the caps provisional, and the governance tasks.md carries the warm and cold-cache measurement (DI:179-180, 189-190, 227-228; OV:314-319) before the Speckit handoff.

C13 completed (lane 3 L4): also DI:1338-1347 and DI:1402-1408 in the overview's scenarios. L5: the overview's decisions preamble must call OQ-1-3, 20-24, 28 and 29 lane additions, as change 1 does, not the packet's consolidated decisions.

Amendments after lane openRepoProject-3's fidelity read of PR #11 (2026-10-08, later still)

D-R Fail closed on unknown state (lane 3 H1): under the shared probes a failed or timed-out status probe leaves dirty null. update --apply refuses whenever the root's or any child's dirty is not exactly false, as push already does (project:541); scenario: a leg's status probe times out at 5 s and the owner tool is never invoked. project-command "Explicit maintenance" becomes MODIFIED with that one sentence and scenario, so project-command is 2 MODIFIED + 1 ADDED. project-review-safety "Updates preserve estate and owner safeguards" (:51-55) is thereby preserved, not modified.

D-S Doctor and status on unknown state (lane 3 M1): today a failed root or leg status ends status, doctor and the update report with exit 2 (project:327-328, :995-1000); under D-B they report instead. That is a baseline behavior change, listed under R1. Doctor renders a null dirty (and any null inspection field) as an error check row, never "ok" (project-command spec :24, "Missing or malformed state SHALL be visible"); this goes in the MODIFIED "Inspect and diagnose". D-B's phrase "without exit changes" is withdrawn.

D-T Merge-target resolution (lane 3 M2): the delta names both origin/ strips, on the manifest tracking_branch (DI:576; project:383 removeprefix) and on the origin/HEAD symref, with a scenario for tracking_branch: origin/develop resolving to refs/heads/develop and never silently falling back. QA-8's accepted text is amended accordingly; BA:169-177 is a packet defect lane 3 is fixing.

D-U target-cap trigger (lane 3 M3): target-cap refuses when more than 16 rows pass every gate before the two index gates, with no index probe run (BA:96-101, 673-675, 1004); never "more than 16 eligible rows".

D-V Report-mode cap (lane 3 M4, packet-owner decision, accepted): mode: "report" caps worktree rows at 256 by the same fit rule (7 + W + 16 children; 256 fits at 41.85 s); apply modes stay at 128 rows and 16 targets; the overview's suggestion for a repository over 256 rows carries D-P's reason code.

D-W Deadline scope (lane 3 L3, packet-owner decision, accepted): the 60 s deadline bounds inspection and the batch's removal children only; push and delete-branch children via execute stay unbounded as today. C5 is withdrawn as a packet correction: the packet says "probe" and only probe() children have a timeout; the proposal's "each Git child" was the slip (QA-4's fix stays, not under Corrections).

D-X Signals before apply (lane 3 L2): with start_new_session=True the pre-apply SIGTERM and SIGHUP handling terminates and reaps probe children as SIGINT does; after SIGHUP printing may fail with EIO, so the result is printed on a best-effort basis and "always printed" is not claimed. Same for the overview under D-O.

D-Y Untracked-file defect (lane 3 L1): unreachable at a040790 (under showUntrackedFiles=no the ignored probe fails and every clean worktree is inspection-error); word it as a requirement of the new probe, not a live bug.

D-Z Decisions labelling (lane 3 on C19): "Decisions Taken by This Proposal" distinguishes (a) packet open decisions taken, each citing the packet text that leaves it open, and (b) departures from packet decisions, each citing the packet decision departed from: OQ-23 (BA:1241-1245 scope) and OQ-24 (BA:949-953 with HO:210) are departures; OQ-5, 9, 25 are packet decisions the proposals adopt, not open questions. Both proposals.

D-Q completed (lane 3 M5): the measurement runs on a Linux filesystem path, never /mnt/c.

OPEN FOR BRETT (lane 3 M6): a merged worktree whose remote branch was deleted classifies remote-gone, because the ladder tests remote_present before merged (project:442 before :457). With GitHub head-branch auto-delete and fetch.prune that is the usual state of a merged branch, and D-D refuses the old workaround (push, then remove), so under the MVP such worktrees are never eligible for --all-safe. Lane 3 puts the question to Brett with the recommendation that a local ancestry proof outranks remote-gone for worktree rows (the MVP never deletes the branch). Until he rules, both proposals keep the packet's ladder and say so under Open Questions.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Alignment review report: stack architect (read-only, at fed64d4)

Alignment review: STACK ARCHITECT, add-project-clean-all-safe

Tree: worktree at fed64d4 (da33d92 + the proposal commit). Read-only review.
Proposal: openspec/changes/add-project-clean-all-safe/proposal.md (478 lines).
Counts: 4 MISMATCH, 10 DRIFT.

Dimension summary

  1. Pattern alignment: two findings, SA-1 and SA-5. Every project:N citation
    resolves to the code it describes (60-65, 157-162, 307-313, 339, 352,
    418-468, 421-426, 442, 508-518, 523-524, 681, 699, 728-758, 788-789,
    844-846, 995-1000). The ladder has 15 classes.
  2. Tech stack: SA-2, SA-7, SA-8, SA-9. C4 correctly flags process_group=0
    as 3.11-only.
  3. Architecture docs: every cited BA/SY/OV/DI/HO range says what the proposal
    says it says, and each departure (R1-R8, OQ-15/16/23/29) is stated as one.
    Exceptions: SA-11 and SA-12.
  4. Integration surface: all 9 MODIFIED or Untouched headers exist verbatim at
    the cited lines. The 7 ADDED headers collide with nothing in
    openspec/specs or in the prefer-triad delta, and nothing contradicts that
    delta (SA-2 records one nearby edge). Findings: SA-3, SA-4, SA-6, SA-10,
    SA-13.
  5. Config and protocol: openspec/config.yaml has no rules (only
    schema: spec-driven). Clean: Lane: first line, one Speckit feature
    (specs/003-<slug>/), no task list, ASCII only, no host-absolute paths.
    One DRIFT on section order (SA-14).

MISMATCH

SA-1 Extending probe() cannot deliver the shared evidence model

  • Finding: Impact says probe() "gains a timeout argument and per-child
    process groups". But probe() is subprocess.run(text=True, capture_output=True, env={**os.environ, "GIT_OPTIONAL_LOCKS": "0"}). That
    call cannot stop reading at the 65th ignored or 4,097th record. It decodes
    stdout as text, which raises the very UnicodeDecodeError the change
    claims to fix. It passes the caller's environment unscrubbed.
  • Source: project:60-65; BA:795-799 (streamed, stop and terminate);
    BA:1223-1224 and OV:220-222 (non-UTF-8 path); BA:243-253 (scrubbed
    environment).
  • Proposal reference: Impact, project bullet, proposal.md:296-298 (also
    What Changes :136-140).
  • Fix: replace "probe() gains a timeout argument and per-child process
    groups" with "Git children run through a new bounded runner, not the
    baseline probe(): each is a Popen in its own process group, with the
    environment scrubbed of BA:243-253's variables, and its stdout is read as
    bytes and streamed, so a probe can stop at its record bound. probe()
    stays for non-Git children."

SA-2 The Git 2.36 refusal blocks doctor's diagnosis and update's repair paths

  • Finding: R6 makes status, doctor and update refuse with exit 2 on
    old or missing Git, before any work. That changes three things:
    • Doctor's own git PATH check row becomes unreachable.
    • update --apply --component tools refuses. That component runs
      workBenches setup.sh, the route for installing tools.
      --component workflow refuses too.
    • Today status and doctor on a non-Git .project.json project report
      present: false and refuse nothing.
      The proposal still lists Inspect and diagnose and Explicit maintenance
      as untouched, and OQ-22 says doctor changes "only" through this refusal.
  • Source: project:755-757 (doctor's git check row); project:844-846 and
    :885, :905-906 (update runs snapshot before its component commands);
    project:317 and :322-325 (non-Git project reports present: false);
    openspec/specs/project-command/spec.md:22-29 and :31-38. Prefer-triad
    delta, "A generator that initialises no Git repository", leads to
    Next: project doctor on a directory with no Git.
  • Proposal reference: Capabilities, project-command, proposal.md:276-286;
    R6 :433-437; OQ-22 :395-396.
  • Fix: replace R6's outcome with: "status, doctor and update run the
    git --version check only when a Git repository is to be inspected. A
    directory with no .git keeps present: false. doctor reports
    git-too-old or git-unavailable as an error check row, which exits 1,
    instead of refusing. update --apply --component tools|workflow does not
    require it." Or keep the refusal and change the two requirements from
    Untouched to MODIFIED, naming the lost diagnosis and repair paths.

SA-3 --apply --json is unscoped, but only removal has a result record

  • Finding: What Changes allows --apply --json for every clean apply and
    prints "the apply result record". That record is defined only for
    worktree-removal targets. Push and delete-branch "keep their behavior
    apart from argument resolution", and that behavior includes refusing
    --json with --apply. So the push requirement cannot stay Untouched as
    the proposal claims.
  • Source: project:523-524; BA:424-425; BA:1191-1192 (the recommendation
    covers "single-target removal and the batch" only); BA:1017-1042.
  • Proposal reference: What Changes, proposal.md:149-151; OQ-10 :381-382;
    Untouched :39, :232-234.
  • Fix: replace ":149-151" with "--apply --json with --all-safe or
    --action remove prints the apply result record (BA:1017-1042) as the
    one stdout document, with the human plan, prompt and progress on stderr
    (OQ-10). --apply --json with --action push or delete-branch stays
    refused with invalid-arguments, exit 2." Add "removal only" to OQ-10.

SA-4 Main-worktree protection is cited as a kept rule, but no spec or code has it

  • Finding: the cited requirement protects only the process (current)
    worktree. Neither the canonical specs nor the code protect the main
    worktree. A main worktree checked out on a merged, published, non-target
    branch can classify merged-removable today, and Git then refuses its
    removal. The main-worktree gate is new in this change.
  • Source: openspec/specs/project-clean-review-safety/spec.md:9-13;
    project:418-468, :567-571; BA:118, :153, :308.
  • Proposal reference: Rules This Change Keeps, proposal.md:176-177.
  • Fix: replace with "The current worktree is never removed
    (project-clean-review-safety/spec.md:9-13). The main worktree is never
    removed either, through the new main-worktree gate this change adds."
    Also add "the main worktree" to MODIFIED :21's list of new preserved
    states (:259-261), or name it in the ADDED batch requirement.

DRIFT

SA-5 Budgets for status, doctor and update are not specified

  • Finding: moving repo_state onto the shared probes brings in the 5 s
    per-child budget. The proposal does not say whether the 60 s deadline,
    the 128-row cap and omitted also bound status, doctor and update
    across an estate's legs and members. It does not say what those commands
    exit when incomplete; in doctor, exit 1 already means "findings". Nor does
    it say whether probe()'s 15 s stays for docker and for doctor's
    validators, which "may access upstream" (BA:1238 drops it to 5 s).
  • Source: project:715 and :817 (non-Git probe() callers); README:194-195;
    BA:1238-1240.
  • Proposal reference: Capabilities, project-command ADDED, proposal.md:277-282.
  • Fix: append to that ADDED description: "Each Git child in status,
    doctor and update gets 5 s. Those commands get no invocation deadline
    or row cap, and an unreadable or timed-out row shows as inspection-error
    without changing their exit codes. Non-Git children (docker, doctor
    validators) keep 15 s."

SA-6 MODIFIED :49 keeps an unscoped MUST beside the residual-window requirement

  • Finding: the canonical text says "MUST refuse when the state no longer
    matches the reviewed plan". The ADDED narrow-guarantee requirement admits
    that ignored files and index flags created after revalidation are
    destroyed. The two would sit side by side in one capability.
  • Source: openspec/specs/project-clean-review-safety/spec.md:51-53;
    BA:293-295, :319-325.
  • Proposal reference: proposal.md:263-267 and :272-275.
  • Fix: add to the MODIFIED :49 description: "The MUST is scoped to the
    revalidation immediately before each spawn; changes after it are the
    residual window the ADDED guarantee states, and Git's own non-force check
    is the last defense."

SA-7 The Git 2.36 floor rests on behavior verified only on 2.43

  • Finding: 2.36 is justified by worktree list -z alone. Several other
    behaviors were verified or hard-coded on Git 2.43 only, and CI has no lane
    that runs the floor:
    • Combining ls-files -v --stage -z.
    • The scrubbed variable list.
    • Git's refusals on removal (modules, populated submodule).
    • ls-files -v reading the current directory's index.
  • Source: BA:132-137, :243-244, :307-311, :579-581, :593, :665; tests.yml:9-10.
  • Proposal reference: What Changes, proposal.md:141-143; OQ-23 :397-398.
  • Fix: add to OQ-23: "Design verifies each probe, the variable list and the
    removal refusals on Git 2.36 itself, by a fixture run against a pinned
    2.36 build or a CI job, or raises the floor to the lowest version
    verified."

SA-8 Two Python 3.10 traps C4 does not name

  • Finding: the filesystem bound runs calls in worker threads and abandons
    them on timeout. Two consequences follow:
    • With threads alive, the 3.10 fallback preexec_fn=os.setpgrp is unsafe.
    • concurrent.futures workers are joined at interpreter exit, so one
      abandoned lstat stuck on a dead mount would hold the process past the
      stated ~60 s bound.
  • Source: BA:451-458; BA:397-400; README:17; tests.yml:10.
  • Proposal reference: C4, proposal.md:469-472; What Changes :116-118.
  • Fix: replace C4's last sentence with "Design uses
    Popen(start_new_session=True) (3.2+) for each child's own process group,
    never preexec_fn, and runs abandonable filesystem calls on daemon
    threading.Threads, not a concurrent.futures pool."

SA-9 Platform assumptions in the test plan

  • Finding: Impact runs all 35 scenarios on Linux and macOS. Two do not
    carry over cleanly:
    • macOS APFS rejects names that are not valid UTF-8, so the
      unsupported-path-bytes and \xHH scenarios cannot be built on
      macos-latest.
    • APFS is case-insensitive by default, which bears on the raw-byte order
      against Git's core.ignoreCase sort.
      On the WSL2 workstation, /mnt/c (drvfs) inode numbers may not be
      stable, which only fails closed through dev/ino.
  • Source: tests.yml:9; BA:780-781, :1588-1593; BA:376-377; README:191-192.
  • Proposal reference: Impact, tests bullet, proposal.md:308-316.
  • Fix: append: "Non-UTF-8 path scenarios run on Linux only and are skipped
    on macOS with that reason; ordering tests use names that differ by more
    than case; WSL2 measurement (OQ-4) uses a Linux filesystem path, not
    /mnt/c."

SA-10 Existing test expectations that change are not named

  • Finding: Impact defers naming them to the deltas. Four existing tests
    depend on baseline behavior the change replaces:
    • test_project.py:590-611 calls module.clean with a Namespace that has
      no all_safe or expect_plan, and expects Refused to be raised. A
      refused target is now a result record with exit 2.
    • :450-467 asserts "Cannot remove the current worktree".
    • :409-425 asserts "unpublished" on stderr.
    • :542-546 asserts the old message under {"error"}.
      The last three now flow through target-excluded or no-merge-target.
  • Source: tests/test_project.py lines above; BA:413-423, :1011-1015.
  • Proposal reference: Impact, proposal.md:312-314.
  • Fix: replace "except an expectation a listed baseline change alters, which
    the delta names" with "except test_clean_revalidates_a_worktree_after_ confirmation, which moves to the result record. The three message
    assertions keep passing because target-excluded and no-merge-target
    messages keep the baseline wording."

SA-11 The SIGTERM and SIGHUP exits have no row in the precedence table

  • Finding: OQ-16 adds exits 143 and 129, and this is a stated departure
    from BA:474-477. But the first-match table it cites lists only 130 for
    SIGINT, so the precedence of 143 and 129 against 1, Git's status and 2 is
    undefined.
  • Source: BA:474-477, :530-536.
  • Proposal reference: What Changes, proposal.md:112-115; OQ-16 :393-394.
  • Fix: OQ-16 should read "...exiting 143 and 129, in the 130 row of
    BA:530-536 (the first signal received sets the status)."

SA-12 C2 is a confirmation, not a correction

  • Finding: C2 concludes "The claim holds". The Why section still points to
    it as "Corrections, C2".
  • Source: BA:1214-1220; DI:1124-1129.
  • Proposal reference: proposal.md:50-51, :456-462.
  • Fix: move C2 under "Readings of packet gaps" as "R9, deleted upstream
    re-verified", and at :51 write "(re-run for this proposal; R9)".

SA-13 The project-review-safety citation overclaims

  • Finding: :80-82 requires only that YAML decoding errors become
    structured exit-2 refusals. It does not require that every clean
    refusal do so.
  • Source: openspec/specs/project-review-safety/spec.md:78-82.
  • Proposal reference: proposal.md:288-289.
  • Fix: "Every clean refusal, manifest-invalid included, exits 2 with
    structured JSON, consistent with project-review-safety/spec.md:80-82
    for YAML decoding errors."

SA-14 Three top-level sections the house example lacks

  • Finding: the house sections keep their order, but "Dependencies and
    Sequencing" sits between Impact and Out of Scope. "Decisions Taken" and
    "Corrections to the Packet" sit between Out of Scope and "Questions
    Resolved".
  • Source: openspec/changes/prefer-triad-in-project-new/proposal.md:20-487
    (Why, What Changes, Rules, Not Own, Capabilities, Impact, Out of Scope,
    Questions Resolved).
  • Proposal reference: proposal.md:323, :364, :446.
  • Fix: demote "Dependencies and Sequencing" to ### Dependencies and Sequencing as the last part of Impact. Keep Decisions and Corrections as
    ## sections after Out of Scope, and note in the Status line: "Adds
    Decisions and Corrections sections because this change adopts a
    non-normative packet."

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Alignment review report: QA lead (read-only, at fed64d4)

Alignment review, QA lead: add-project-clean-all-safe

Tree: /workspace/projects/.lane-worktrees/openRepoProject-2/add-project-clean-all-safe at fed64d4
(da33d92 plus the proposal commit; the packet, specs, project and tests are byte-identical to da33d92).
Read-only review. P:N is proposal.md line N. BA, SY, OV, DI, HO as the proposal defines them.

Counts: 4 MISMATCH, 10 GAP.

Dimension summaries

  1. Header accuracy: clean. All 5 project-clean, 4 project-clean-review-safety and 4 project-command
    headers are quoted verbatim with the right line numbers; no canonical requirement is left
    unnamed; the 7 ADDED headers collide with nothing in openspec/specs, the prefer-triad delta or
    the archive. (Whether two "untouched" headers should be MODIFIED is QA-5.)
  2. Values: clean apart from QA-1 and QA-4. Checked and matching: 128 rows, 16 targets, 64 / 4,096 / 8,
    60 s, 50 s work deadline, 10 s reserve, 5 s child and filesystem call, 5 s floor, 2 s grace,
    Git 2.36, Git 2.43 fixture, Python 3.10 and 3.12 (CI), process_group needing 3.11 (C4), exit codes
    0/1/2/130/128/255 and Git pass-through, 143 and 129 (128+15, 128+1), the refusal codes, stage names,
    schema_version: 1, plan_digest, the removal argv, 35 scenarios at BA:1347-1628, 43 tests, the
    15 ladder classes at project:418-468, the 7 classes at project-clean/spec.md:27-28, and every
    project:N, README and BA/OV/SY/DI/HO citation spot-checked.
  3. Coverage: QA-6 to QA-11 and QA-13. The proposal's own decisions that go beyond the packet are flagged
    as such (R1, R2, R6 extending Git 2.36 to status and update, OQ-15 bare refusal, OQ-29
    mode: "report"); none of those is reported as unbacked.
  4. Acceptance: QA-14. Most bullets can be tested through the packet tables they cite.
  5. Spec consistency: QA-5 and QA-6. The rules "branch deletion separate", "never force", "read-only
    default" and "noninteractive refusal" are kept. Nothing collides with the prefer-triad delta: it
    modifies only Delegate project creation and its terminal rule covers project new alone. End of
    input at an existing prompt still exits 130, which matches BA:532.

MISMATCH

QA-1. Finding: The proposal says every clean refusal exits 2, but a read-only preview exits 0 or 1
when its plan carries a refusal.
Requirement source: BA:547-549 (preview exits 0 when complete even with target-cap, 1 when
incomplete, 2 when no plan can be built); BA:1011-1015 (exit 2 for every refusal only "Under
--apply"); SY:203-204.
Proposal reference: Capabilities, project-review-safety bullet, P:288-289. It also contradicts the
proposal's own R2 (P:424-426) and the target-cap text (P:122-123).
Fix: "Every clean resolve refusal (the extended error object, manifest-invalid included) and
every refusal under --apply exits 2 with structured JSON. A read-only preview or report whose plan
carries inspect-cap, inspection-incomplete or deadline-exceeded exits 1, and one carrying only
target-cap exits 0."
Severity: MISMATCH

QA-2. Finding: The proposal says single-target remove keeps its interface unchanged, but OQ-10 lets
--apply --json through for single-target removal, which the baseline refuses.
Requirement source: BA:1191-1195 ("allow --apply --json for both single-target removal and the
batch"); project:523-524 (the baseline refusal).
Proposal reference: What Changes, P:88 ("Its interface is unchanged"); Decisions OQ-10, P:381-382;
P:150-151.
Fix: "Its flags are unchanged, but --apply --json is now accepted for --action remove as for
--all-safe. --apply --json with --action push or --action delete-branch is still refused
with invalid-arguments and exit 2." The last sentence is the reviewer's suggestion; the packet is
silent on push and delete-branch, so the proposal must state one rule either way.
Severity: MISMATCH

QA-3. Finding: The proposal says the deltas carry every packet baseline change, but OQ-15's bare
refusal makes one of them void and creates a new one that it does not list.
Requirement source: BA:1255-1256 ("A bare repository's first registry record is no longer reported
as an inspection-error checkout"); BA:221-224 (a bare repository is reachable from inside a linked
worktree through a relative path, no argument or a bare name); project:337-352 (today clean run
inside a bare repository's linked worktree reports, and can remove).
Proposal reference: What Changes, P:143-144 ("the deltas carry each one"); OQ-15, P:390-392;
Bounded-work list R1/R2.
Fix: Replace "plus R1 and R2" with "less BA:1255-1256, plus R1, R2 and R9". Add R9: "In every
clean mode, a repository whose common directory has no main worktree (a bare repository) is refused
with target-not-repository-root and exit 2, including from a relative path, no argument or a bare
name inside one of its linked worktrees. At a040790 clean reports such a repository and can
remove its worktrees."
Severity: MISMATCH

QA-4. Finding: The proposal's Why says every Git child has a fixed 15 s timeout, but only probe()
children have one; the delegated push and remove children run with no timeout at all.
Requirement source: BA:53-54 ("each Git probe has a 15 s timeout"); project:60-65 (probe) against
project:157-162 (execute, with no timeout).
Proposal reference: Why, P:54-55.
Fix: "Each Git probe has a fixed 15 s timeout, the removal child has none, and the run has no deadline."
Severity: MISMATCH

GAP

QA-5. Finding: The ADDED Git 2.36 refusal changes the behaviour of two project-command requirements
that the proposal lists as untouched.
Requirement source: project-command/spec.md:22-25 ("Status and doctor SHALL support ... local
tooling. Missing or malformed state SHALL be visible"); :31-38 (update reports by default). Today
doctor reports a missing git as a warning row (project:755-757) and an absent checkout as
present: False (project:323-325).
Proposal reference: Capabilities, project-command, P:277-286.
Fix: Either MODIFY Inspect and diagnose and Explicit maintenance, or give the ADDED requirement
this text and scenario: "When Git is missing, unusable or older than 2.36, status, doctor and
update SHALL refuse with exit 2 before any repository probe, instead of reporting Git as a doctor
check row." Scenario: WHEN doctor runs with no git on PATH, THEN it exits 2 with
git-unavailable, and under --json it prints {"error", "code"}.
Severity: GAP

QA-6. Finding: Three MODIFIED requirements do not say whether their canonical scenarios survive. One of
those scenarios carries the rule that the worktree goes and the branch stays.
Requirement source: project-clean/spec.md:32-37 ("Dirty or unmerged work is preserved"); :63-68
("Remove a merged clean worktree ... refusing to remove its branch unless the user separately
requests branch deletion"); project-clean-review-safety/spec.md:55-58 ("Worktree changes while
confirmation is pending").
Proposal reference: Capabilities, P:215-226 and P:263-267. Compare P:213-214, P:231 and P:261-262,
which do say their scenarios stay.
Fix: Add "the scenario stays" to :25, :55 and :49. To :55 add the batch scenario "WHEN
--all-safe --apply removes every selected worktree, THEN every local branch remains and the result
says so" (BA:1281, BA:1353-1356). To :49 add a sentence: a worktree that becomes dirty after
revalidation is refused by Git (failed, git-refused, exit 128) and is still preserved (BA:298).
Severity: GAP

QA-7. Finding: The shared evidence model changes push, which the proposal calls untouched. A deleted
upstream now fills upstream and classifies remote-gone, so push builds
git push <remote> <b>:<remote_branch> instead of today's git push -u origin <b>. The proposal
also does not say how push and delete-branch treat an incomplete, capped re-inspection.
Requirement source: project:539-555 (the push command depends on row["upstream"]; remote-gone
is not in the refused set at :545); BA:1214-1222; BA:898-900; BA:424-425 ("keep their behavior
apart from argument resolution").
Proposal reference: Capabilities, "Untouched (:39)", P:232-234; P:266-267 ("push and
delete-branch keep the full re-inspection").
Fix: State one rule and give it a scenario: either "push refuses a remote-gone branch: its
configured upstream was deleted, so it must be reviewed before it is republished", or "push of a
remote-gone branch pushes to its configured upstream, as project-clean-review-safety:38-42
requires". Then MODIFY :39 or say why it stays. Add: "push and delete-branch refuse with
inspection-incomplete, inspect-cap or deadline-exceeded, exit 2, when their re-inspection is
incomplete."
Severity: GAP

QA-8. Finding: The merge-target contract has no requirement to live in: the {name, source, sha}
record, resolution through the ref listing's %(symref), the merge-target-conflict note, and the
manifest-invalid and no-merge-target refusals before mutation.
Requirement source: BA:167-184; BA:895-896; BA:999-1000; scenario BA:1618-1628.
Proposal reference: Capabilities ADDED list, P:235-255. The record appears only as "merge-target
identity objects" at P:103 and in the JSON field list.
Fix: Place it under the ADDED "Clean resolves its target Git-first" requirement, or under MODIFIED
:21 beside its "Default branch cannot be established locally" scenario, as: "The merge target is
the first of the manifest tracking_branch, the branch origin/HEAD names, main, master that
exists as a local branch; a manifest that conflicts with origin/HEAD wins with an informational
merge-target-conflict note; no candidate refuses no-merge-target and an unreadable or wrong-kind
manifest refuses manifest-invalid, both with exit 2 before any mutation."
Severity: GAP

QA-9. Finding: OQ-16 gives SIGTERM and SIGHUP exits 143 and 129, but does not place them in the
first-match exit table and does not say what they do before the apply phase.
Requirement source: BA:530-536 (first matching row wins; 130 is the top row); BA:474-477 (before
the apply phase SIGINT exits 130 with zero mutation; other signals are outside the contract);
BA:1660-1661.
Proposal reference: What Changes, P:114-115; OQ-16, P:393-394.
Fix: "In the apply phase SIGTERM and SIGHUP behave as SIGINT and take the top row of the exit table
as 143 and 129. When more than one signal arrives, the first one received sets the status. Before
the apply phase SIGTERM and SIGHUP exit 143 and 129 with zero mutation." The pre-apply clause is
the reviewer's suggestion; the packet leaves it open.
Severity: GAP

QA-10. Finding: The --apply --json rule leaves out the packet's case where the run stops before the
apply phase, in which stdout carries the plan envelope instead.
Requirement source: BA:1193-1195 ("the plan envelope when the run stops before the apply phase,
otherwise the apply result record").
Proposal reference: What Changes, P:149-151.
Fix: "--apply --json prints exactly one stdout document: the plan envelope (or the extended error
object) when the run stops before the apply phase, otherwise the apply result record. The human plan,
prompt and progress go to stderr."
Severity: GAP

QA-11. Finding: mode: "report" (OQ-29, R2) is a new envelope mode, but the proposal does not say
which plan fields it carries.
Requirement source: BA:959 (the packet defines only all-safe and single); BA:966-976.
Proposal reference: P:145-147; OQ-29, P:407-409; R2, P:423-426.
Fix: State, for example: "mode: "report" carries every plan field. selected lists what
--all-safe would select, plan_digest is computed, apply_allowed is false, and target-cap
applies as in a preview." Or list the fields it omits.
Severity: GAP

QA-12. Finding: The proposal's own decisions have no acceptance scenarios, because the packet's 35
scenarios do not cover them: R1, R2, R6, R9 (QA-3), OQ-10, OQ-16 and C3.
Requirement source: BA:1347-1628 (none of these appears); OV:231-234 (Git 2.36 for clean and doctor only).
Proposal reference: Impact, tests, P:308-316.
Fix: Add scenarios for each: a failed status probe on the merge-target row reads inspection-error
and makes the plan incomplete (R1); plain clean with more than 128 rows exits 1 (R2); status and
update with Git 2.35 exit 2 with git-too-old (R6); a relative path inside a bare repository's
linked worktree is refused (R9); --apply --json stdout holds one document and stderr holds the
prompt (OQ-10); SIGTERM mid-removal is reconciled and exits 143 (OQ-16); doctor JSON row values
for a deleted upstream (C3).
Severity: GAP

QA-13. Finding: Two packet rules are missing from "Rules This Change Keeps": stale worktree metadata
is never pruned, and an orphaned directory is never deleted.
Requirement source: BA:192-193 ("Do not prune stale worktree metadata as a side effect");
BA:1300-1303 and BA:1537-1538 ("nothing deletes it").
Proposal reference: Rules This Change Keeps, P:160-182 (P:99 covers only "never deletes a directory
itself").
Fix: Add a bullet: "Never prune, repair, lock or unlock. project never runs git worktree prune
or repair, and it leaves an orphaned directory for the person to inspect."
Severity: GAP

QA-14. Finding: Several bullets cannot yet be turned into tests as written.
Requirement source: BA:79-80 and BA:991 (--expect-plan must be 64 lowercase hexadecimal
characters); BA:368-370 (a non-UTF-8 repository.root refuses before any plan); BA:152-160 (the
full gate order); OV:314-319.
Proposal reference and rewording:

  • P:82-86, the eligibility bullet. Write the order in full: "main-worktree,
    unsupported-path-bytes, registration-mismatch, locked-worktree, the baseline classification
    when it is not merged-removable, not-requested, contains-submodule, hidden-local-state."
  • P:71-74, the spelling bullet. Add: "an --expect-plan value that is not 64 lowercase hexadecimal
    characters is invalid-arguments, exit 2."
  • P:153-157, the paths bullet. Add: "a repository.root or common_dir that is not valid UTF-8
    refuses with unsupported-path-bytes, exit 2, before any plan or digest."
  • C3, P:467-468 ("which design fixes"). Name the doctor and status row fields whose values change,
    at least upstream, ahead and behind for a deleted upstream, with expected values.
  • P:124-125 ("provisional until measured"). Write: "the spec states 128 and 16 as fixed values; a
    measurement that fails the fit test lowers them through a follow-up change."
  • P:158, "README and tests ... cover all of the above". Write: "each ADDED and MODIFIED requirement
    has at least one test named after its scenario; README states the Git 2.36 floor and clean's
    exit codes 0, 1, 2, 130, 143, 129 and Git's own status."
    Severity: GAP

@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T23:49:43.727125Z 0ed2f59 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ed2f59493

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +152 to +155
(identity, `worktree list --porcelain -z`, one `for-each-ref` in the shared
format, the merged set), and one combined bounded status probe per row
(`BA:585-652`), all parsed NUL-delimited, with the scrubbed environment of
`BA:243-253`, through a new bounded runner (Impact). The ladder keeps its

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Encode identity probe paths without newline delimiters

The cited identity probe uses git rev-parse --path-format=absolute --show-toplevel --git-common-dir, whose results are LF-terminated rather than NUL-delimited; Git 2.43 also treats -z as ordinary input rather than an output-format option. When a valid UTF-8 repository root contains a newline, the two returned paths therefore cannot be split reliably, so the command cannot satisfy the later promise to support every such path exactly and may refuse or misidentify the repository. Specify a parseable encoding (or separate single-result probes and update the probe budget) instead of treating this output as NUL-delimited.

Useful? React with 👍 / 👎.

Comment on lines +169 to +173
- **Every path is exact or excluded.** JSON carries a valid UTF-8 path
exactly with `path_valid_utf8: true`; a non-UTF-8 path is escaped, excluded
as `unsupported-path-bytes` and never a removal operand; human output
prints control, bidirectional, format and undecodable characters in the
`$'...'` form of `BA:913-939`. A `repository.root` or `common_dir` that is

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Escape all invisible Unicode format characters

The referenced $'...' rules escape only a small enumerated subset of format/bidirectional characters, omitting invisible valid UTF-8 characters such as U+200B ZERO WIDTH SPACE, U+200D ZERO WIDTH JOINER, and U+FEFF. A worktree path containing one of these remains eligible but is printed verbatim in the human plan and confirmation, where it can appear identical to another path; this contradicts the exact-path safety promise for a destructive command. Base the escape decision on the relevant Unicode categories/properties and add representative tests rather than relying on the packet's partial list.

Useful? React with 👍 / 👎.

brettheap and others added 4 commits October 9, 2026 00:21
Council fix round, proposal.md only (stopped for a handoff; the
clarifications.md with N1-N5, the merge of origin/main and the V12
restatement are not yet done).

- V1: the removal child is never signalled once spawned; the deadline
  gates only its start; 300 s hard ceiling, removal-ceiling and
  partially-removed; overrun stated beside the reserve and stage table.
- V2: unstarted-branch gate; squash-merge open question.
- V3: core.untrackedCache=false and core.fsmonitor=false pins.
- V4: single-target completeness, P exempt from the row cap, remedies.
- V5: deferred-target-cap replaces the target-cap refusal (departure).
- V6: honest yield, ignored count and sample, cache disposal follow-on.
- V7: remote-gone question with survey numbers; merged remote-gone text.
- V8: behaviour changes first; what the person sees; stop block.
- V9: runner outcomes in the evidence model; fake-git fixtures.
- V10: 15 s per Git child outside a deadline (departure).
- V11: status and doctor JSON changes listed beside R7.
- Carried: D-S narrowed, D-AB, D-AC, D-AD, D-AF, X2 (R11), D-Q.
- Council Verdicts table; alignment rows merged by ruling (819 lines).

Lane: openRepoProject-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The council's NOTED constraints, in the house shape (Raised by,
Concern, Design impact), binding design.md and the Speckit plan:

- N1 (SA-2): the runner's loop mechanics; stderr drained in the loop,
  a poll tick of 100 ms or less, handlers that record and wake, killpg
  in finally for probe groups, the removal child waited for.
- N2 (X1 from add-project-overview's council): the runner as a child
  handle, a one-wide driver, pure incremental byte parsers.
- N3 (AE-2): an in-use gate on Linux as a design option, not MVP.
- N4 (AE-1): detecting a probable partial removal; advisory only.
- N5 (SA-3): the OQ-4 measurement protocol and its governance task.

Every proposal.md reference to clarifications.md names one of these.

Lane: openRepoProject-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
V12 (AE-4) after merging origin/main at 7a9134b (e21b24d):

- Dependencies and Sequencing: PR #8 merged at d7f6b0e (141 lines in
  project, tests 43 to 94) and PR #13's archive of
  prefer-triad-in-project-new merged at 7a9134b; "archive in either
  order" and "whichever lands second" replaced by those facts.
- Citations stay pinned at da33d92: at 7a9134b lines 285-1007 of
  project sit 141 lower (probe and execute unmoved), the cited test
  lines 383 lower, README citations up to 88 lower; feature 003
  re-pins at its specify and plan.
- Capabilities, project-command: all ten requirements at 7a9134b
  accounted for. "Inspect and diagnose" and "Explicit maintenance"
  (MODIFIED) are verbatim and unchanged, 22 lines lower; "Delegate
  project creation", "Distribution and compatibility" and the six
  requirements the archive added are listed untouched, verbatim.
- Impact: 94 existing tests; 002 merged by PR #8.
- Why: the defects still hold at 7a9134b. Corrections C1: main is no
  longer da33d92.
- Lead ruling (lane 3's final read of #12): the 1 MiB cap on the
  manifest read that resolves a merge target lives in the shared
  evidence model (What Changes; project-command ADDED; Git-first; a
  test). P6-1 confirmed already present (reap waits the 2 s grace,
  then abandons the child as probe-timeout).

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

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Council resolution, add-project-clean-all-safe @0669a20

Verdict commit ea9c73b on 0ed2f59 (V1 to V11 and the carried items);
then 1d4ed5b adding clarifications.md (N1 to N5), e21b24d merging
origin/main at 7a9134b, and 0669a20 restating the change against it
(V12, the 1 MiB manifest-cap ruling). Branch head 0669a20, pushed.
proposal.md 849 lines (819 at ea9c73b); clarifications.md 168 lines,
new. Capabilities: project-clean 5 MODIFIED + 6 ADDED (5 of 5 accounted
for), project-clean-review-safety 2 MODIFIED + 1 ADDED (4 of 4),
project-command 2 MODIFIED + 1 ADDED (10 of 10 at 7a9134b).

Concern Severity Verdict Section changed
PA-1 target cap refuses the backlog HIGH VALID, V5; departure from BA:96-101 and OQ-5's refusal, open to Brett What Changes (person sees, bounded work); Capabilities (bounds); Decisions (OQ-5, OQ-4); Impact (README)
PA-2 caches keep most worktrees out HIGH VALID, V6 Why; What Changes (person sees); Out of Scope
PA-3 remote-gone dead end MEDIUM VALID, V7 Capabilities (:25); Open Questions; Impact (README)
PA-4 human surface by citation only MEDIUM VALID, V8 What Changes (first bullet, person sees); Capabilities (batch, reconcilable); Impact (README)
SA-1 single remove fails on any row HIGH VALID, V4 (with AE-5); departure Why; What Changes (single-target); Rules (never prune); Capabilities (:55); Decisions
SA-2 runner failure modes MEDIUM-HIGH VALID, V9; loop mechanics NOTED, N1 (X1 as N2) What Changes (evidence model); Capabilities (project-command ADDED); Impact (project, tests); clarifications.md
SA-3 5 s budget without a deadline MEDIUM VALID, V10; departure; protocol NOTED, N5 What Changes (evidence model); Capabilities (project-command); Decisions (budget, OQ-4); clarifications.md
SA-4 status/doctor JSON unplaced LOW-MEDIUM VALID, V11 Capabilities (:22); R7
AE-1 killed removal leaves half a tree HIGH VALID, V1; detection NOTED, N4 What Changes (seam, reconcilable, bounded work); Rules; Capabilities (:25, :55, bounds, result); Decisions (council, OQ-4, OQ-16); Impact (tests); clarifications.md
AE-2 unstarted worktrees selected HIGH VALID, V2; in-use gate NOTED, N3 What Changes (eligibility); Capabilities (:55, review-safety :21); Out of Scope; Open Questions; clarifications.md
AE-3 Git's check blinded by config MEDIUM-HIGH VALID, V3 What Changes (seam, evidence model); Rules; Does Not Own; Capabilities (:55, review-safety :49); Decisions (council)
AE-4 stale baseline MEDIUM VALID, V12 (after the merge, at 0669a20) Citations; Why; Capabilities (project-command); Impact (tests, Speckit handoff; Dependencies and Sequencing); Corrections C1
AE-5 single remove without remedy MEDIUM VALID, V4 (one item with SA-1) as SA-1

NOTED (in clarifications.md, Raised by / Concern / Design impact):

  • N1 (SA-2) the runner's loop: stderr drained in the loop, poll tick of
    100 ms or less (PEP 475), handlers record and wake, killpg in finally
    for probe groups; the removal child waited for, never in that set.
  • N2 (X1) the runner as a child handle, a one-wide driver, pure incremental
    byte parsers, so add-project-overview drives four without forking it.
  • N3 (AE-2) an in-use gate on Linux as a design option, not MVP.
  • N4 (AE-1) detecting a probable partial removal; advisory, never a
    classification change; the .git-deleted-first case is
    registration-mismatch with its named remedy.
  • N5 (SA-3) the OQ-4 measurement protocol and its governance task.

DISMISSED: none.

Merge note: git merge --no-edit origin/main (7a9134b: PR #8's
d7f6b0e and PR #13's archive) as e21b24d; git merge-tree pre-check
clean, no conflicts, nothing in openspec/changes/add-project-clean-all-safe
touched by main. At 7a9134b project differs from da33d92 only by
insertions above discover (+141, -0), so every Why defect still holds.

Writer adjustments the lead accepted (at ea9c73b):

  • R11: core.worktree is unset after git init --separate-git-dir on Git
    2.43, so the main worktree is the candidate toplevel whose .git file
    names common_dir; a linked worktree of such a repository whose main
    checkout cannot be named is refused.
  • unstarted-branch placed after not-requested and before
    deferred-target-cap.
  • V5 caveat: rows an index gate excludes still take places among the 16.
  • removal-ceiling as the hard ceiling's reason code.
  • V4 labelled a departure from BA:419-420, BA:1268-1272, BA:1562-1563.

This round (for the lead):

  • 1 MiB manifest cap (lane 3 LOW on OpenSpec: add-project-overview (project overview from the maintenance design packet) #12) placed in the evidence model and
    scoped to the manifest read that resolves a merge target (clean and the
    overview); snapshot's manifest reads for status, doctor and
    update resolve no merge target and are not capped. Git-first's
    manifest-invalid includes it; one test added to Impact.
  • P6-1 confirmed already in What Changes (evidence model): after SIGKILL
    the reap waits at most the 2 s grace, then abandons the child as
    probe-timeout. P6-2 to P6-6 touch only the overview's text.
  • Corrections C1: "it is da33d92" became "PR Design packet: project overview and project clean --all-safe (design only) #7's squash da33d92
    superseded it", the sibling's wording, since main is now 7a9134b.
  • N5 cites BA:625-627 for "a failed repository-wide probe nulls every
    row"; SA-3's BA:619-621 is off by six at da33d92.
  • The shift range: lines 265-1007 of da33d92 all sit 141 lower; the
    proposal says 285-1007 (discover onward), which covers every citation
    (none falls in 204-264, the band shifted by 105 or 139).

Checks at 0669a20: openspec validate add-project-clean-all-safe --strict
fails only on "Change must have at least one delta"; openspec validate --all --strict "Totals: 5 passed, 1 failed (6 items)", the failure this
change; python3 -m unittest discover -s tests -v "Ran 94 tests ... OK".

Lead verdicts follow in the next comment; the three council reports after that.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Lead council verdicts, add-project-clean-all-safe

Council verdicts, add-project-clean-all-safe (lead, lane openRepoProject-2, 2026-10-08)

Reports: council-product-advocate-clean.md (PA-1..4, with an estate survey), council-systems-architect-clean.md (SA-1..4), council-adversary-engineer-clean.md (AE-1..5, fixture-verified under scratchpad/adv/). Cross-examination: SA-1 and AE-5 are one item and both reviewers agree; AE-3's fixture overrides the "Git's own check is the last defense" claim; PA-1's survey is new estate evidence against a packet decision, ruled as a departure; SA-3 reopens D-B with evidence that post-dates it (D-R, D-S) and is accepted; AE-4 is a fact (main moved) and is applied to both changes.

VALID (proposal.md changes)
V1 (AE-1, HIGH) Once the removal child is spawned, project does not signal it: SIGINT, SIGTERM, SIGHUP and the work deadline are deferred until it exits; the deadline gates only the start of a removal (a removal starts only when work_remaining is at least the 5 s floor) and never its completion; a separate hard ceiling (300 s, for a hung mount) ends the wait by killing the group and recording the target unknown with a partially-removed note and recovery text ("inspect, then git worktree remove --force <path> by hand"). The report's ladder text for a registered row whose only working changes are deletions of tracked files carries the partial-removal note beside, never instead of, the dirty classification, so the plain "commit the working changes" advice is not the only thing shown. Scenarios: project killed with -9 during deletion then a rerun of the report shows the note; the hard ceiling. OQ-4 measures deletion time on the drvfs mount as a stated degraded case.
V2 (AE-2, HIGH) New gate unstarted-branch: a row is excluded when its branch has no commit of its own: its head equals the merge-target SHA, or its head is an ancestor of the target and the branch's creation reflog entry shows no commit since creation; a missing reflog fails closed (excluded, reason stated). Scenario: git worktree add -b x then git push -u with no commits is excluded. Second Open Question for Brett, beside remote-gone: squash merges (this repository's history is single-parent) never satisfy the ancestry proof, so the MVP selects little in squash-merge repositories; recommendation: a local patch-equivalence proof (git cherry / patch-id against the target) designed as a follow-on change, not in the MVP.
V3 (AE-3, MEDIUM-HIGH) Every status probe and the removal child carry -c core.untrackedCache=false -c core.fsmonitor=false beside the status.showUntrackedFiles pin; the "last defense" sentence names the pinned configuration it depends on; the scrub-list note says -c covers GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM where the scrub does not; scenario from fixture adv/k3 (untracked cache on, checkStat minimal, an index-writing status has run; a file created after revalidation is refused with 128).
V4 (SA-1 with AE-5, HIGH) Single-target remove (mode: "single"): completeness is the repository-wide evidence plus P's own row; other rows' inspection-error, inspect-cap and unprobed states are recorded as non-blocking omissions in the plan; P's own revalidation stays fully strict; the named target is probed first so the 128-row cap never omits it (the cap counts registered rows, present: false included, and P is exempt); target-cap in single mode counts P alone because not-requested precedes the counted gates. Every refusal that remains carries a named manual remedy in its message (git worktree prune, git worktree repair, or remove that row by hand). The Why bullet "one unreadable worktree refuses the whole repository" is corrected to say removal is fixed and the batch records the omission. Scenarios: single remove succeeds beside another row's inspection-error; 17 eligible rows and --worktree P removes P; more than 128 rows and --worktree P removes P.
V5 (PA-1, HIGH; departure from BA:96-101 and the OQ-5 refusal) When more than 16 rows pass the pre-index gates, the plan selects the first 16 in canonical order, lists the rest as excluded deferred-target-cap with the next command, and apply is allowed; re-running drains the backlog 16 at a time; the fresh plan and revalidation are unchanged; the target-cap refusal is retired (the code survives only as the overview's limiting gate reason). Human text and README state it. OQ-4 gains a governance task recording the eligible-row counts from this workstation beside the timing. Labelled a departure from a packet decision, open to Brett's ratification.
V6 (PA-2, HIGH) Why gains one sentence of honest scope ("the batch removes only worktrees with no ignored files; caches such as __pycache__ keep a worktree out until the cache-disposal change"); the plan's human output prints, for each ignored-local-files exclusion, the bounded count and the first ignored path already probed; Out of Scope names cache disposal as the first follow-on change, citing the survey (Omnigent-Install 20 of 29 merged worktrees excluded for caches alone).
V7 (PA-3, MEDIUM) The remote-gone Open Question carries the measured numbers (4 of about 90 merged worktrees here; fetch.prune unset everywhere; auto-delete on 2 of 21 repositories) and "universal under auto-delete plus prune"; until Brett rules, MODIFIED :25's recommendation text for a remote-gone row whose merged_into_target is true reads "Merged locally, upstream deleted: not removable by project until the open question is ruled; review, then git worktree remove yourself" (names and order of the ladder unchanged, OQ-28); README line to match.
V8 (PA-4, MEDIUM) What Changes gains "What the person sees": the preview layout (selected rows, then excluded rows grouped by reason with each next step), a default-No prompt naming the count ("Remove 7 worktrees, keeping 7 branches? [y/N]"), the success line ("Removed 7; branches kept: ..."), and the stop block ("Stopped at P (reason). Removed k of n. Not attempted: ... Next: "), with a delta scenario for the stop block; and a first bullet "Behaviour changes users will notice" carrying R2 (plain clean exits 1 when incomplete) and R6 (clean refuses below Git 2.36), repeated first in the README section.
V9 (SA-2 requirement-level parts, MEDIUM-HIGH) The evidence-model requirement states: a probe stopped by project at its record bound is a complete outcome, never probe-failed; after SIGKILL the reap waits at most the 2 s grace, then the child is abandoned and the row recorded probe-timeout; every exit path terminates the process groups it started (clean's equivalent of the overview's requirement 11); stderr is drained and capped. Impact tests gain fake-git fixtures: a git that floods stderr, one that ignores SIGTERM, one that prints 5,000 !! records. The loop mechanics (selector tick, self-pipe) are NOTED.
V10 (SA-3, MEDIUM; amends D-B and D-M) status, doctor and update keep 15 s per Git child (they have no deadline); min(5 s, work_remaining) applies only under clean's and the overview's deadlines; OQ-4 measures the combined probe and the for-each-ref against index size (about 10k and 100k entries) and branch count (about 1k), cold and warm, and records drvfs as measured-degraded; D-M's "5 s child budget for status, doctor and update" is withdrawn.
V11 (SA-4, LOW-MEDIUM) The status and doctor JSON changes are placed and listed: inspection-error and null fields on root and leg dicts live in a named field matching worktree rows (repository.classification, or an errors[] list; the delta names one); the list of status/doctor JSON changes sits beside R7's and says status and doctor stay unversioned in this change.
V12 (AE-4, MEDIUM) Merge origin/main (d7f6b0e, PR #8 merged, tests now 94) into the branch, never rebase; Dependencies and Impact restated (PR #8 merged; test count); every project:N citation stays pinned at da33d92 with one sentence that at d7f6b0e repo_state and clean sit about 141 lines lower and that feature 003's specify and plan re-pin against the main of that day; the project-command headers are re-checked against lane 1's pending triad archive (which lands a MODIFIED "Delegate project creation", no overlap with this change's MODIFIED "Inspect and diagnose" and "Explicit maintenance") and "archive in either order" is re-stated only if openspec validate --all --strict still passes with the archive simulated.

NOTED (clarifications.md)
N1 (SA-2 loop mechanics) stderr drained in the same selector loop and capped, or sent to a temporary file; a poll tick of 100 ms or less because PEP 475 retries select() after a flag-only handler; killpg in a finally clause for every exit path; signal handlers record the first signal and wake the loop.
N2 (X1 from change 2's council) The runner is a child handle (start, readable fds, terminate_group() with the 2 s grace, reap()), the serial path a one-wide driver of it, and the status, registry and ref parsers pure incremental byte parsers, so the overview can multiplex four children in one loop without forking the runner.
N3 (AE-2 option) An in-use gate on Linux (any /proc/*/cwd under the path) as a design option, not an MVP requirement.
N4 (AE-1 detection) How the report detects a probable partial removal (a dirty row whose only changes are deletions of tracked files; the .git file present; the registry entry present) is design's; the note is advisory and never changes the classification.
N5 (SA-3 protocol) The measurement protocol for OQ-4 (fixture sizes, cold and warm passes, Linux path, drvfs as degraded) and the governance task that carries it.

DISMISSED: none.

Also carried: D-S narrowed, D-AB, D-AC, D-AD, D-AF (generic readers in [E]; no R6 timing stated for every reader), X2 (gitfile main checkout supported through core.worktree; submodule checkout refused target-not-repository-root as a listed baseline change; scenarios), D-Q completion (Linux path; eligible-row counts).

CROSS-CHANGE to add-project-overview (sent to its writer): under V5 the batch no longer refuses target-cap; the overview's suggestion_gate: target-cap means "limited to 16 per run; re-run to drain the backlog", with the message saying so. V10 leaves the overview's own 5 s budget unchanged.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Council report: product-advocate (read-only, at 0ed2f59)

Council: Product Advocate, add-project-clean-all-safe (tree 0ed2f59)

Read-only review. New evidence came from a read-only survey of this workstation
(/workspace/projects, 22 repositories with linked worktrees, 2026-10-08). The
survey used git worktree list, status --porcelain [--ignored],
merge-base --is-ancestor, for-each-ref %(upstream:track) and
gh api repos/... .delete_branch_on_merge. It approximates the ladder; it does
not run it.

Repo linked wt merged ~merged-removable blocked by ignored files merged + upstream gone
Opensoft-Tenant 54 31 ~20 10 0
Omnigent-Install 35 29 ~8 20 0
openXwallet 7 7 ~1 5 0
new-workstation 8 7 ~3 0 4

fetch.prune is unset in every repository. delete_branch_on_merge is true on
2 of 21 (AgentTower, openRepoShape). The ignored files are almost all
__pycache__/ (268 entries) and .pytest_cache/.

Dimension verdicts

  • Problem clarity: the Why is solid on safety. The eight defects are real and
    cited, and the assume-unchanged data loss was reproduced. It is weak on
    outcome: it never says how many worktrees a user can expect to retire.
  • Scope: this is two layers, a removal-hardening layer and a batch layer. Lead
    OQ-1 settled that as one change, so I don't re-open it. The 128-row cap, the
    worktree-only removal, the retained branches and the refused bare
    repositories are all right-sized. The 16-target cap is not (Concern 1).
  • Dependencies: the ordering before add-project-overview is sound.

Concern 1 (HIGH): the target cap refuses the whole batch in the repository that needs it most

  • Concern: In the busiest repository on this workstation, --all-safe refuses apply outright, so the user is back to the one-at-a-time removals the Why calls the problem.
  • Evidence: What Changes, "Bounded work": more than 16 rows that pass the pre-index gates give "a complete plan refused with target-cap". Opensoft-Tenant has about 20 such rows. The proposal never tells the user what to do next. Only the packet does, at BA:100: "removes some explicitly first or waits for a separately designed larger batch". So 4 or more single-target runs are needed before the batch works at all. OQ-5, the 16, is adopted as a packet decision "subject to OQ-4". This survey is the first real-estate data point against it, so it is new evidence and not re-litigation.
  • Impact: HIGH. The first user with a real backlog gets a preview that lists 20 selected worktrees and then refuses with exit 0. That reads as a bug, and the feature's main promise fails exactly when it matters.
  • Suggestion: Put one more Open Question before Brett. Proposed text: "When more than 16 rows pass, should the plan select the first 16 in canonical order, list the rest as excluded deferred-target-cap, and allow apply, so that re-running drains the backlog 16 at a time? The fresh plan and revalidation are unchanged." If Brett keeps the refusal, the What Changes bullet and the README must still state the recovery in the plan's human text. Proposed wording: "target-cap: N worktrees qualify; at most 16 run per batch. Remove N-16 with --apply --action remove --worktree P, then re-run." Also add a governance task to OQ-4: record the eligible-row counts from this workstation next to the timing.

Concern 2 (HIGH): regenerable caches keep most merged worktrees out, and the user gets no next step

  • Concern: ignored-local-files excludes most merged worktrees because of __pycache__/ and .pytest_cache/. Cache disposal is out of scope, so the batch's real yield is a minority of what the user sees as "finished".
  • Evidence: In Omnigent-Install, 20 of 29 merged worktrees are excluded for ignored files alone. Opensoft-Tenant has 10, openXwallet 5. Out of Scope lists "Cache disposal (OV:144...)" and Decisions OQ-27 sends it to its own change. The proposal states no expected yield. The baseline recommendation, "Preserve or relocate ignored local files before cleanup", is all the user gets.
  • Impact: HIGH on perceived value. Users will judge --all-safe as removing "almost nothing". Some will then fall back to git worktree remove --force or rm -rf, which is the unsafe path this change exists to replace. Keeping the gate is correct. Leaving it silent is not.
  • Suggestion: (a) Why: add one sentence of honest scope. Proposed text: "The batch removes only worktrees with no ignored files; caches such as __pycache__ keep a worktree out until the cache-disposal change." (b) Plan human output: for an ignored-local-files exclusion, print the count and the first ignored path that is already bounded and probed (the ignored_files evidence exists), so the user can see that it is only __pycache__. (c) Out of Scope: name cache disposal as the first follow-on change, with this survey as its motivation. Don't fold it in.

Concern 3 (MEDIUM): remote-gone is a dead end, with no project command that can retire such a worktree

  • Concern: The proposal's Open Question overstates how common the case is today. It also understates the damage, because a merged remote-gone worktree can be retired by neither --all-safe, single-target remove (refused as target-excluded) nor push-then-remove (refused by MODIFIED :39).
  • Evidence: Open Questions says that with auto-delete and fetch.prune this is "the usual state of a merged branch". On this workstation neither setting is on (2 of 21 repositories auto-delete, fetch.prune unset everywhere), and only 4 of about 90 merged worktrees are merged with their upstream gone, all in new-workstation. But the state is one git fetch --prune, or one repository setting, away. When it flips, rows that were eligible yesterday silently become ineligible. The baseline recommendation, "Confirm the branch should be republished before removing local work", now points at a push that this change refuses.
  • Impact: MEDIUM. The value lost today is small (about 4%). It is large for any user or organisation that turns on auto-delete, which is GitHub's recommended setting. Meanwhile the user sees advice the tool itself refuses to act on.
  • Suggestion: (a) Reword the Open Question with the measured numbers: "rare here today (4 of ~90; prune off, auto-delete on 2 of 21 repositories) but universal under auto-delete plus prune". Keep the recommendation that local ancestry proof outranks remote-gone for worktree rows. (b) Until Brett rules, MODIFIED :25 should replace the remote-gone recommendation text for a row whose merged_into_target is true. Proposed text: "Merged locally, upstream deleted: not removable by project until #; review, then use git worktree remove yourself." The ladder keeps its names and order (OQ-28), and only the text changes. (c) Add a README line saying the same thing.

Concern 4 (MEDIUM): the human-facing surface is defined only by citation, and two baseline breaks are buried

  • Concern: The proposal fully specifies the JSON, stages and exit codes. The plan, the prompt and the result a person reads are left to BA citations, and two user-visible breaks are not where users look.
  • Evidence: What Changes says "recomputes, prints and confirms its plan" and "the confirmation and result each state the residual window in one line", but it defines no prompt form (y/N, or typing the count) and no human result summary. It doesn't say what a person sees on the first refusal: which target stopped, what remains, the next command (BA:1276-1312 exists but is not carried into a delta scenario). Breaks: plain project clean changes from always exit 0 to exit 1 when incomplete (R2), and clean refuses below Git 2.36 (R6). Both sit in Readings and Impact, not in What Changes.
  • Impact: MEDIUM. Speckit will invent the prompt and the stop message, and confirmation UX is a safety surface. Scripts that treat exit 1 from project clean as failure break without warning.
  • Suggestion: Add a What Changes bullet, "What the person sees", defining four things: the preview layout (selected rows, then excluded rows grouped by reason, each with its next step); a default-No prompt naming the count, for example "Remove 7 worktrees, keeping 7 branches? [y/N]"; the success line, "Removed 7; branches kept: ..."; and the stop block, "Stopped at P (reason). Removed k of n. Not attempted: ... Next: ". Add a delta scenario for that stop block. Move R2 and R6 into a "Behaviour changes users will notice" bullet in What Changes, and make it the first thing the README section says.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Council report: systems-architect (read-only, at 0ed2f59)

Council: Systems Architect on add-project-clean-all-safe

Tree: .lane-worktrees/openRepoProject-2/add-project-clean-all-safe at 0ed2f59. Read: proposal.md (all 662 lines),
lead rulings D-A to D-Z, BA (identity, seam, deadline, interruption, probes, revalidation, cap arithmetic, residual
window), project (1,007 lines, all of probe/execute/discover/repo_state/cleanup_report/
clean/snapshot/check_rows/update/main). Read-only; nothing edited.

Dimension verdicts

  • Feasibility (stdlib only, Python 3.10): feasible. Popen(start_new_session=True), selectors over pipe fds,
    os.killpg, daemon threading.Thread, time.monotonic all exist on 3.10 on Linux and macOS. C4 fixed the one
    3.11-only call (process_group=0). The runner contract still has gaps (Concern 2).
  • Architecture fit: the evidence model fits. snapshot already goes through repo_state (project:681, :699), so
    status/doctor/update pick up the new probes at one seam, and per repository the work drops from about 5+4W children
    to 4+W. retire_worktree as one seam works for both single and batch. The invasive part is the unknown-state
    handling D-R and D-S add, at check_rows (project:736, :750 truthiness) and update (:863, :869). It is small, but
    it changes unversioned JSON (Concern 4).
  • Hardest part: the bounded runner and its signal and reap behaviour, not identity. The proposal does see the identity
    window and the residual window (BA:261-325) and both origin/ strips (D-T).
  • Tech stack: Python 3.10 floor kept (C4). Git 2.36 behaviour is verified only on 2.43; OQ-23's "pinned 2.36 build or
    CI job, or raise the floor" should be a governance task in tasks.md, not just design prose. -z on worktree list is exactly 2.36, --path-format is 2.31, and ls-files -v --stage has not been checked below 2.43. WSL2 is
    covered for the measurement only (Concern 3).
  • Performance/fit arithmetic checks out. Apply at 128 rows: 7+128+16 = 151 plan children, plus about 83 for
    revalidation and rescan (5T+3), gives 234 x 150 ms = 35.1 s, plus 16 x 0.3 s removals = 39.9 s. The last spawn
    leaves about 10 s, which meets the 5 s floor (28.2 s at 100 ms). Report at 256 rows: 279 x 150 ms = 41.85 s (27.9 s
    at 100 ms). Memory is O(1) per streamed probe. The for-each-ref output is O(refs), which is fine. Per-target
    revalidation is 5 children, about 0.75 s. The weakness is the model, not the sums: it treats per-child cost as a
    constant (Concern 3).

Concerns, ranked

1. HIGH: single-target remove now fails on any other row's problem and on the caps and deadline

  • Concern: making --action remove --worktree P a strict one-item batch means one unreadable or slow worktree
    anywhere in the repository, more than 128 rows, or a plan cut by the 50 s work deadline blocks removing a proven-
    safe P. Today that removal has no cap and no deadline.
  • Evidence: What Changes, "Single-target remove ... an inspection error anywhere in the repository refuses it"
    (BA:413-423). The Why section lists "One unreadable worktree path refuses the whole repository with exit 2
    (project:339, :995-1000)" as a defect this change fixes. For removal the change keeps that outcome and only moves it
    from exit 2 to an incomplete-plan refusal. Today's clean() (project:559-574) needs only the target row plus the
    report. The >128-row and deadline refusals for single remove are not among the listed baseline behaviour changes
    (R1, R2, R10).
  • Impact: HIGH. In a large or partly unreachable repository (a worktree on a hung or slow mount, an EACCES worktree
    from another user, more than 128 worktrees), project can no longer remove any worktree, even one at a time. No
    flag gets around it. The person falls back to raw git worktree remove, which skips every new gate (hidden-local- state, contains-submodule). That is less safe than today.
  • Suggestion: for mode: "single", define completeness as the repository-wide evidence plus P's own row. Other rows'
    inspection-error, inspect-cap and unprobed rows go in the plan as recorded, non-blocking omissions. P's own
    revalidation stays fully strict. If the council keeps the packet's rule instead, add these to Corrections or
    R-readings as explicit baseline changes, each with a scenario: single remove refused over 128 rows, and refused
    because of another row's inspection-error. Also correct the Why bullet, which currently implies the defect is
    fixed for removal.

2. MEDIUM-HIGH: the bounded runner's failure modes are not fully specified

  • Concern: the runner is the part most likely to misbehave in practice, and the proposal specifies only "Popen in its
    own group, scrubbed env, stdout streamed as bytes" (Impact, D-G). Five behaviours that decide correctness are left
    out.
  • Evidence and gaps:
    (a) stderr. If it is piped and not drained during the stdout stream, a chatty Git (warnings for each worktree) fills
    the 64 KiB pipe and deadlocks until the 5 s timeout. The row becomes probe-timeout, a false inspection- error.
    (b) Early stop. BA:795-798 stops the combined probe by terminating the child at the 65th !! or 4,097th record, so
    its exit status is nonzero, SIGPIPE or SIGTERM. The runner must treat "stopped by project at its bound" as a
    completed outcome, not probe-failed. Otherwise every truncated row becomes inspection-error, which
    BA:812-814 says must never happen.
    (c) Reaping after SIGKILL is unbounded (BA:466-468, "reaps the child"). A Git child stuck in uninterruptible sleep
    on a hung mount does not die. wait() then blocks past the deadline, the same hazard BA:449-453 acknowledges
    for filesystem calls but not for children.
    (d) start_new_session=True takes away the free cleanup the baseline relied on: terminal Ctrl-C and SIGHUP no
    longer reach Git children. Any path that unwinds without the runner's cleanup orphans them, for example
    KeyboardInterrupt before the apply phase or an exception inside the selector loop. D-X covers SIGTERM and
    SIGHUP; a runner-level try/finally: killpg on BaseException is not stated.
    (e) Under PEP 475, select() retries after a signal handler that only sets a flag, so the apply-phase SIGINT flag
    (BA:462-464) is seen only when the select times out. The loop needs a short poll tick, or the handler must
    raise.
  • Impact: MEDIUM-HIGH. (b) alone would turn the bounded-ignored design into inspection errors on any worktree with
    more than 64 ignored entries, which blocks --all-safe. (c) and (d) break the "ends within about 60 s" claim and
    leave stray git processes.
  • Suggestion: add a runner contract to the ADDED project-command evidence-model requirement, or to Impact, with tests
    that use a fake git on PATH:
    • stderr drained in the same selector loop and capped, or sent to a temporary file;
    • a distinct "stopped-at-bound" outcome that counts as complete;
    • wait(timeout=grace) after SIGKILL, then abandon the child and record unknown or probe-timeout;
    • killpg in a finally clause for every exit path;
    • a poll tick of 100 ms or less. Fixtures: a git that floods stderr, one that ignores SIGTERM, and one that prints
      5,000 !! records.

3. MEDIUM: a 5 s per-child budget plus fail-closed unknown state turns slow repositories into errors

  • Concern: status/doctor/update drop from 15 s to 5 s per child (D-B). D-R and D-S later made a timed-out status an
    error check row (doctor exit 1) and an update --apply refusal. Meanwhile, git status time and for-each-ref %(upstream:track) time scale with index size and branch count, not with a constant per-child cost.
  • Evidence: the cap arithmetic (BA:723-735) assumes 100 to 150 ms per child. OQ-4 measures only cap fit, on a Linux
    path, "never /mnt/c". The 5 s figure exists so that work fits a 60 s deadline. D-B and D-M give status, doctor and
    update no deadline, so they gain nothing from 5 s. Today probe uses 15 s (project:63).
  • New evidence, beyond D-B: D-R and D-S post-date D-B and raise the cost of a timeout from "row unknown" to "doctor
    fails, update refuses".
  • Impact: MEDIUM. A cold cache, a large monorepo, or WSL2 work on drvfs (status there often exceeds 5 s) gives:
    • doctor exiting 1;
    • update refusing where it succeeds today;
    • clean --all-safe plans that are always incomplete, never applicable. One slow for-each-ref nulls every row
      (BA:619-621).
  • Suggestion: keep 15 s per Git child for status/doctor/update, which have no deadline, and use min(5 s, work_remaining) only under the clean and overview deadlines. Extend the OQ-4 task to time the combined probe and
    the row-6 for-each-ref against index size (about 10k and 100k entries) and branch count (about 1k), cold and warm.
    Record drvfs as measured-degraded, not just excluded. If 5 s stays, list the status/doctor/update timeout change as
    a baseline behaviour change with a scenario.

4. LOW-MEDIUM: changes to status and doctor JSON are not versioned or placed

  • Concern: R7 versions clean --json. status --json and doctor --json also change, with no stated field
    placement:
    • inspection-error on the root and leg dicts, which today have no classification field (project:370-373, :699);
    • dirty: null where they exit 2 today;
    • the upstream value change (C3);
    • ignored_files becoming a lower bound or null on a truncated dirty row (BA:801-812).
  • Evidence: Capabilities, MODIFIED "Inspect and diagnose" ("status marks rows it cannot inspect inspection-error");
    D-S; print_report (project:761) dumps the snapshot unchanged.
  • Impact: LOW-MEDIUM. Consumers (workBenches onp, the overview's own reuse) see undocumented shape drift, and the
    spec deltas cannot say where the marker lives.
  • Suggestion: name the field, for example repository.classification or repository.errors[] on root and leg dicts,
    matching worktree rows. List the status/doctor JSON changes beside R7's list, and say that status and doctor stay
    unversioned in this change.

Not raised (checked, solid)

  • Identity objects and the residual window: correct, and the proposal states them (BA:282-325 table).
  • Merge-target strips: D-T covers both the manifest tracking_branch strip and the origin/HEAD symref strip. for- each-ref patterns are prefix-from-slash, but files-backend D/F conflicts make that safe.
  • schema_version: 1 as a clean break is the right call (R7).
  • The ladder becoming a pure function is mechanical: cleanup_report's rungs (project:418-468) already read only row
    fields, plus the current and merged inputs.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Council report: adversary-engineer (read-only, at 0ed2f59)

Council: adversary engineer on add-project-clean-all-safe

Tree 0ed2f59, Git 2.43.0, Python 3.12, baseline project from that tree. Fixtures
under scratchpad/adv/; each claim below was reproduced there unless marked "reading".
Read-only; nothing in either repository was changed.

1. HIGH: killing the removal child mid-delete leaves a half-deleted worktree that the classifier calls dirty and tells the person to commit

Concern. The seam terminates an in-flight git worktree remove on SIGINT, SIGTERM,
SIGHUP or work-deadline expiry (What Changes "Every target ends reconcilable" and
"Bounded work"; BA:460-483; stage table BA:485-494). Once Git has passed its own
check and started deleting, that termination produces the worst state available.
Evidence (fixture adv/k). 20,000 tracked files; setsid git worktree remove; TERM to
the group after 0.25 s gave Git exit 143, 18,333 files left, .git present, still
registered. Baseline project clean --json then reports the row dirty, whose ladder text
is "Preserve or commit the working changes before cleanup" (project:427-429 at
a040790). Every later plain git worktree remove refuses with 128. The proposal never
forces or repairs, so project has no way out. The packet records this target as
unknown and says nothing about what that state is or how to recover it.

  • With the 60 s deadline this is not limited to signals. A removal "gets
    work_remaining" and needs only the 5 s floor (BA:430-445). The same 20k-file removal
    took 1.27 s on overlay/ext4. On drvfs, the user's own WSL2 workstation, deletion is
    typically ten or more times slower. A large target late in a 16-target batch is
    therefore killed partway by design.
  • Readdir order decides whether <path>/.git goes early. If it does, the row becomes
    registration-mismatch, an inspection-error that makes every later plan incomplete,
    --action remove included ("an inspection error anywhere in the repository refuses
    it"). The whole repository is then blocked until someone runs git worktree prune by
    hand. (Reading, from the gate rule plus Git's deletion order; not timed.)
    Impact. An agent or person follows the dirty recommendation and commits the deletion
    of thousands of files onto the branch, then pushes it. Or the repository's cleanup stays
    wedged with no remedy that project can name.
    Suggestion.
  • Add a requirement: once the removal child is spawned, project does not signal it. It
    defers SIGINT, SIGTERM and SIGHUP and the work deadline until the child exits, with only
    a separate hard ceiling (for example 300 s) for a hung mount.
  • Do not let a removal child start inside the deadline machinery at all. Exclude a slow
    filesystem up front instead, or measure deletion under OQ-4.
  • Add a partially-removed note and its recovery text (inspect, then git worktree remove --force <path> by hand) for a target that ends unknown with its path present.
  • Add a scenario: "TERM during deletion, then a rerun of the report, shows the row with
    the partial-removal note, never the plain dirty advice."

2. HIGH: "local ancestry is the only removal proof" selects worktrees that were never started and misses finished ones

Concern. Ancestry proves that the branch adds nothing. It does not prove that the work
is finished, so --all-safe sweeps live, just-created worktrees.
Evidence (fixture adv/z). git worktree add -b started-today, then git push -u
with no commits: baseline project clean --json gives merged-removable, because a tip
equal to main is an ancestor (project:457 at a040790). This is how Speckit and lane
worktrees begin (create, publish to claim, then read and plan). Such a worktree is clean
for minutes to hours while an agent's cwd and an editor's buffers live in it.
"The current worktree is never removed" protects only the invoking process
(project-clean-review-safety/spec.md:9-13).

The reverse also holds. opensoft/openRepoProject allows squash merges and every commit
on main has one parent. A squash-merged branch is never an ancestor (BA:195-199).
Together with the Open Question (an auto-deleted remote gives remote-gone), the
finished worktrees this feature exists for are mostly never eligible, while unstarted ones
are.
Impact. One --all-safe --apply --yes (the scripted path, OQ-11 optional digest)
deletes the cwd of every freshly claimed lane. Those sessions fail or write into a vanished
tree. No commit is lost; the in-flight session and anything not yet written is. Meanwhile
the batch selects nothing useful in the repositories that squash-merge, which defeats the
Why section.
Suggestion.

  • Add a gate, unstarted-branch: exclude a row whose branch has no commit of its own,
    where its head equals the merge-target SHA or is an ancestor of the target's tip at the
    branch's creation reflog entry. Fail closed when the reflog is missing.
  • Optionally add an in-use gate on Linux: any /proc/*/cwd under the path.
  • Put the squash-merge consequence next to the remote-gone question before Brett, since
    both decide whether the MVP selects anything in opensoft repositories.

3. MEDIUM-HIGH: Git's non-force check is not an independent last defence; repository config blinds it where the probe still sees

Concern. The residual-window argument and the MODIFIED :49 text assume that Git's own
check catches tracked or untracked changes that appear after revalidation (BA:298:
failed, git-refused, 128). That check is a plain git status that honours the
repository's core.untrackedCache, core.fsmonitor and core.checkStat. The removal
command pins only status.showUntrackedFiles.
Evidence (fixture adv/k3, adv/m1, reproducible 3/3). Setup: core.untrackedCache=true
plus core.checkStat=minimal, which stands in for a filesystem whose directory mtimes are
unreliable (drvfs, 9p, network mounts; feature.manyFiles turns the cache on). An
untracked file is created and the directory mtime is unchanged. One ordinary index-writing
git status --ignored=matching then runs, the kind an IDE or another tool issues.

  • The proposal's combined probe (GIT_OPTIONAL_LOCKS=0 ... --ignored=matching) still
    prints ?? sub/u.txt.
  • Plain git status --porcelain prints nothing.
  • git -c status.showUntrackedFiles=normal worktree remove exits 0 and deletes the file.
  • Adding -c core.untrackedCache=false makes the same removal refuse with 128.

So the two layers the guarantee relies on diverge, and the layer that guards the residual
window is the blind one. core.fsmonitor (built-in daemon on macOS, a CI target) is the
same class of problem. (Reading; not run here.)
Impact. A file created between revalidation and Git's check (an editor autosave, an
agent write) is deleted with exit 0 and stage removed. The changes-after-confirmation
row promises git-refused.
Suggestion.

  • Make it a requirement that every status probe and the removal child carry
    -c core.untrackedCache=false -c core.fsmonitor=false beside the
    showUntrackedFiles pin. -c reaches Git's internal status through
    GIT_CONFIG_PARAMETERS, which the scrub removes only from the parent environment.
  • Add a scenario based on this fixture.
  • Reword "Git's own non-force check is the last defense" so that it names the pinned
    configuration it depends on.
  • The scrub list (BA:243-253) does not cover GIT_CONFIG_GLOBAL or GIT_CONFIG_SYSTEM.
    Pinning by -c covers them; scrubbing does not need to.

4. MEDIUM: the proposal's baseline is stale; main moved under it

Concern. Impact and Dependencies describe a main that no longer exists.
Evidence. origin/main is d7f6b0e (PR #8 merged): +141 lines in project, +1,163 in
tests/test_project.py; tests 43 -> 94; repo_state 322 -> 463, clean 521 -> 662. The
proposal still says "Draft PR #8 ... whichever lands second", "depends on nothing
unmerged", "the 43 existing tests", cites project:N at a040790, and 0ed2f59 has not
merged main.
Impact. Speckit 003 plans against wrong line anchors and a wrong test inventory. The
parity tests ("value-parity ... against the baseline") may be written against the
pre-PR #8 executable. The archive of prefer-triad-in-project-new (lane 1,
archive-triad) may land a MODIFIED project-command text before this delta, which voids
the claim "archive in either order" until it is re-checked.
Suggestion. Merge main into the change branch (never rebase); restate Dependencies
(PR #8 merged at d7f6b0e, 94 tests); pin project:N to one named commit; re-verify the
Why bullets there; re-check project-command headers against the triad archive.

5. MEDIUM: single-target remove gains refusals that have no remedy

Concern. Making --action remove a strict one-item batch imports the batch's
whole-repository refusals into a command that works today. The proposal names no way out
for any of them.
Evidence.

  • What Changes and BA:413-423: the same 128-row cap, the 60 s deadline, and refusal on
    any inspection-error anywhere.
  • A worktree on an unresponsive mount (an lstat timeout at 5 s), an EACCES path, or
    one registration mismatch (including the half-removed tree from concern 1) blocks
    removal of an unrelated, clean, named P.
  • A repository with more than 128 registered entries, stale ones included, can never use
    remove again. The proposal forbids prune and repair (Rules This Change Keeps).
  • At a040790 the unreadable case is already exit 2 (project:339), but the cap, the
    deadline and the registration case are new refusals of the user's one explicit,
    named act.
  • target-cap uses "every gate before the two index gates" (D-U). In single mode
    not-requested precedes those gates, so P alone counts. The delta must say so, or an
    implementer counts merged-removable rows. Seventeen merged worktrees would then refuse
    both --all-safe and the "remove some explicitly first" remedy (BA:100-101).
    Impact. This is a wrong refusal with exit 2 on the documented recovery path, in exactly
    the repositories that need cleanup most.
    Suggestion. Give every plan-blocking refusal a named manual remedy in its message
    (git worktree prune, git worktree repair, or remove that row by hand); add a scenario
    pinning target-cap in single mode (17 eligible rows, --worktree P removes P); state
    whether the 128-row cap counts present: false rows, or exempt them.

Checked, not raised: concurrent --apply runs fail closed (identity-changed or Git 128);
digest scope is fine since --apply always replans; bare and non-UTF-8 cases are refused.

@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

brettheap and others added 3 commits October 9, 2026 00:55
Lane 3's delta read of #11 at ea9c73b, as ruled by the lead:
- M1: a removal in flight when a signal arrives ends by its own exit and
  the rescan; the run exits per the 130 row (130, 143 or 129).
- M2: `yes` stays the only accepting answer ("[yes/N]"), for clean's
  removal apply only; confirm() for new, update, push, delete-branch
  unchanged.
- M3: the creation reflog is a bounded filesystem read, never a Git child;
  a missing or expired reflog fails closed as `reflog-unavailable`.
- M4: unstarted-branch applies in single mode; listed as a behaviour
  change; gate order cited as BA:152-160 as extended by V2 and V5.
- M5: V1 and V4 also depart from HO:208 and HO:247-249; run bound restated;
  V10 also departs from OV:228-230.
- M6: R11 precedence: submodule test first, then core.worktree, then the
  candidate toplevel whose .git file names common_dir.
- M7: the evidence-model entry states its termination rule itself.
Also: probe groups qualified (a running removal child is waited for, per
V1); the manifest cap listed as a baseline behavior change with a
scenario; the V-label map added under Council Verdicts.

Lane: openRepoProject-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lead's precision on M1: a removal child killed at the 300 s ceiling
is removed when the rescan shows its registry entry and path gone, and
otherwise unknown with the partially-removed note; the reason
removal-ceiling names the cause either way, and the run exits 1.

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

Phase 6 of /opsx:propose, from the aligned, council-applied proposal and
clarifications N1-N5, with lane 3's M1-M7 and the ceiling precision.

Spec deltas, 94 scenarios:
- project-clean: MODIFIED 5 (reports 6, classifies 4, push 4, retire 11,
  hands off 2); ADDED 6 (Git-first 8, batch 10, bounds 5, reconcilable 8,
  paths 2, versioned JSON 2).
- project-clean-review-safety: MODIFIED 2 (preserves 5, revalidates 9);
  ADDED 1 (narrow guarantee 3).
- project-command: MODIFIED 2 (inspect and diagnose 6, explicit
  maintenance 3); ADDED 1 (Git 2.36 and one evidence model 6).
Every canonical scenario of each MODIFIED requirement is kept verbatim;
the packet's 35 validation scenarios are mapped in design.md D20.

design.md: D1-D5 answer N1-N5; D6-D19 the how; D20 the scenario map.
tasks.md: governance 1.1-1.5 done, 1.6 ratification open; 2.1 OQ-4
measurement, 2.2 Git floor verification, 2.3 the dependent change.

Speckit handoff: one feature, 003-project-clean-all-safe, branch
003-project-clean-all-safe, tasks specs/003-project-clean-all-safe/tasks.md
(reserved), created by /speckit.specify after ratification.

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

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Phase 6 landed at 90854a3: spec deltas (project-clean 5 MODIFIED + 6 ADDED; project-clean-review-safety 2 MODIFIED + 1 ADDED; project-command 2 MODIFIED + 1 ADDED; 94 scenarios), design.md D1-D20, governance tasks.md with the single Speckit handoff 003-project-clean-all-safe. Checks: validate --strict valid; validate --all --strict 6 passed, 0 failed; simulated archive 5 passed; status 4/4; 94 tests OK. One amendment follows (the unstarted-branch gate reads the reflog in every case so a fast-forward-merged branch at the target's tip stays eligible), then independent re-verification.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

brettheap and others added 3 commits October 9, 2026 01:28
…-safe

The lead's two precisions on M1, on top of 90854a3 because 4b0c149 was
already pushed: a removal child that exits nonzero on its own is failed
with Git's status whether or not a signal reached project, and the rescan
decides between removed and unknown with partially-removed only for a
child killed at the ceiling or whose exit could not be observed,
removal-ceiling naming the ceiling cause; a run with no removal in
flight ends within 64 s (50 s of work, the 10 s reserve, up to 4 s to
stop a probe child), a removal in flight adding up to 300 s. Applied to
proposal.md, the project-clean delta and design.md D9, D15 and D19.
Error ordering is not mentioned in the proposal, so (3) is not stated.

Lane: openRepoProject-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A head equal to the merge-target SHA is not by itself proof of an
unstarted branch, because a fast-forward-merged branch sits at the
target's tip. The gate now reads logs/refs/heads/<branch> (one bounded
filesystem read, at most 64 KiB, in the filesystem budget) for every row
it checks: unstarted-branch only when the reflog shows no movement since
its creation entry and that entry equals the head, a rename entry not
counting as movement; a missing, empty (0 byte) or expired reflog is
reflog-unavailable at the same gate position. A new scenario keeps a
fast-forward-merged branch at the target's tip eligible. Design D10 notes
gc.reflogExpire's 90-day default and the empty file Git 2.43 leaves when
every entry expires, and drops the fast-forward risk (V2 as amended,
R-1). The evidence model now says an over-cap manifest is detected from
st_size and the read never exceeds 1 MiB (R-4).
Codex findings on PR #11 (R-8, R-9): path escaping now covers Unicode categories Cc, Cf, Zl and Zp, and every nested JSON path value carries a validity flag ({path, path_valid_utf8} samples, root_valid_utf8, common_dir_valid_utf8).

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

Design D8 now reads the manifest as the evidence model states: over-cap is
detected from st_size before the read, and the read never exceeds 1 MiB
(the proposal had no "one byte" phrase). The proposal's first What Changes
bullet and design's Migration Plan name reflog-unavailable beside
unstarted-branch: a merged worktree whose creation reflog entry has expired
(gc.reflogExpire's 90-day default) is refused in single mode and withheld
from the batch, with the remedy "remove the worktree explicitly if wanted".

Lane: openRepoProject-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brett Heap ruled open question 1 on 2026-10-09, to lane
openRepoProject-2: "yes, local ancestry proof outranks remote-gone, apply
it". The lead's OQ-1 application rulings (a) to (f) govern the edits.

- Spec deltas: "Clean classifies preservation and cleanup actions" tests
  merged ancestry before the remote-gone rung, so a merged row whose
  upstream was deleted is merged-removable (or merged-current) with its
  class's recommendation and only an unmerged one is remote-gone; the
  interim recommendation text is gone, and its scenario "A merged worktree
  whose upstream was deleted" is replaced under the same title. "Clean can
  explicitly push safe feature branches" refuses on the deleted upstream
  itself, whatever the row's class. "Cleanup revalidates destructive
  actions" gains the clause that a value null in the plan and null at
  revalidation is no difference, while one that cannot be re-read is.
- Fifth user-visible behaviour change: --worktree P now removes a merged
  worktree whose upstream was deleted, where a040790 refuses it as
  unpublished; listed with the other four in What Changes, Impact (README)
  and the Migration Plan, which count five, and covered by an AND clause
  in the replaced scenario.
- proposal: Status, What Changes (first bullet, eligibility, evidence
  model), Capabilities (:25, :39, review-safety :49), Impact (README),
  Decisions (departures bullet quoting the ruling, the BA:969 nullable
  typing kept), Open Questions closed, later-rulings paragraph.
- design: Context, D6, D7, D20, Risks, Migration Plan, Open Questions.
- tasks: 1.2 names the ruling and this commit by title; 1.6 names the
  squash-merge open question and stays unticked.
- R-21: the scenario "The sixteenth scrubbed name on Git 2.36" added under
  "Repository inspection requires Git 2.36 and shares one evidence model".

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

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Head b772195: Brett Heap's ruling to this lane, "yes, local ancestry proof outranks remote-gone, apply it" (2026-10-09), applied. The ladder tests local ancestry before the remote-gone rung for worktree rows (merged + deleted upstream = merged-removable, or merged-current for the current worktree; remote-gone only when unmerged); the interim recommendation is gone; push refuses on the deleted upstream itself whatever the class; the review-safety revalidation text says a value null in the plan and null at revalidation is not a difference; the row now removed by --worktree P is the fifth user-visible change; a scenario for the sixteenth scrubbed name (R-21) is added. Checks: validate --strict valid; validate --all --strict 7 passed, 0 failed; status 4/4; 94 tests OK; 98 scenarios, canonical scenarios byte-identical. Open question 2 (squash merges) stays open. The OQ-4 measurements (task 2.1) are still running.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-1
main moved: PR #17 (realization of fix-parent-obstacle-wording) landed by squash as f401e06 on Brett Heap's word "ratify 17" (2026-10-09). It changes project (known_obstacles only), tests/test_project.py and README.md, and adds specs/003-parent-obstacle-wording/. Per your proposal, merge main into your branches (no rebase). The archive of the change follows as its own PR.

brettheap and others added 2 commits October 9, 2026 14:10
Lane: openRepoProject-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Lane: openRepoProject-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Head f2b40f9 (81ec2cb: the scenario "A deleted upstream is remote-gone" now states the branch is not merged into the merge target, as the ruling requires; f2b40f9: merge of origin/main f401e06, lane 1's feature 003 implementation, no conflicts, the change directory unchanged). Checks at f2b40f9: validate --strict valid; validate --all --strict 7 passed, 0 failed; status 4/4; 96 tests OK (PR #17 added two); 98 scenarios, canonical scenarios byte-identical. Content sha for the packet record: 81ec2cb.

The revalidation requirement says a value null in the plan and null at
revalidation is no difference, while a value that cannot be re-read is. The
scenario "Deleted upstream reappears before revalidation" gives the clause its
other side: a selected merged-removable row whose deleted upstream is recreated
by a fetch has a non-null upstream_oid at revalidation and is refused with
state-changed, exit 2, with later targets not-attempted; a row null at both
times is applied (shown with the reappearance after its removal, since a
difference stops the run and a preflight difference removes nothing).

Review-safety scenarios 17 -> 18 (99 in all). R-22 is recorded in the
proposal's later-rulings list, tasks 1.2, and design Context and D20; tasks 1.4
now states the scenario counts of the three deltas. Every existing scenario is
unchanged.

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

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Head 03f0550: one scenario added under the revalidation requirement, "Deleted upstream reappears before revalidation" (ruling R-22): a selected merged-removable row whose deleted upstream is recreated by a fetch before apply is refused state-changed with no child spawned and the later target not attempted, exit 2; when the reappearance comes after the first removal child exits and before the rescan, the first row is removed and the second refused. Review-safety now 18 scenarios, 99 in total; validate --strict valid; validate --all --strict 7 passed, 0 failed; canonical scenarios byte-identical.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Task 2.1, the OQ-4 measurement (design D5, clarifications N5), executed in py-bench (Ryzen AI MAX+ 395, 32 threads, WSL2, Git 2.43.0; fixtures on the container's overlayfs, the real survey on ext4; cold cache by sync plus per-file page-cache eviction confirmed with mincore, since drop_caches is impossible in the container; no Windows drive mounted, so drvfs is unmeasured). Warm / cold medians (ms): the pinned status probe 42-49 / 38-63 at 10k index entries and 215-232 / 244-248 at 100k; for-each-ref at 1,000 branches 108-112 / 121 packed and 240 / 838 truly loose; the merged set 17-48; removal of a 20,000-file worktree 0.66 / 0.72 s (worst 14.1 s under saturation, under the 300 s ceiling and waited for against the 5 s floor). The fit of BA:729-735 at the protocol's costs rejects no cap: 128 rows (the 16th removal spawns at 23.6 s, worst case 24.3 s), 256 report rows (19.9 s; the rule would allow 512), 16 targets (the rule would allow 24), 64 s (the final rescan 0.16 s of the 10 s reserve), 15 s per child and min(5 s, remaining) (largest probe child 3.8 s). Degraded cases the fit does reject, recorded as risks, not cap changes: rows of 100k-entry indexes (the rule gives 64 rows) and CPU saturation at load 165 (a 128-row plan takes 77 s; the rule gives 16 rows and 8 targets); both only make a plan incomplete. Survey of this workstation under the ladder at 03f0550: 355 repositories, 296 resolving with 561 rows, 47 submodule checkouts and 12 no-merge-target refused; gate totals: main-worktree 296, locked 1, stale 7, dirty 25, ignored-local-files 102, detached 11, unpublished 23, remote-gone 2 (both unmerged), remote-ahead 5, unpushed 1, pushed-unmerged 51, deferred-target-cap 4, contains-submodule 16, selected 17 (13 under the pre-ruling ladder: Brett Heap's ruling moves exactly four merged rows with deleted upstreams to merged-removable); unstarted-branch 0 and reflog-unavailable 0 (37 rows reach the reflog gate and all show movement; no merged row sits at its target's tip here). One residual, recorded in Risks: the repository that motivated the V5 deferral tracks a gitlink in every worktree, so its 20 gate-passing rows are all contains-submodule after the deferral and none is removable; its deferred count never drains. The full report with raw timings and the survey rows is in the lane's session scratchpad (oq4-clean/).

brettheap and others added 2 commits October 9, 2026 18:36
Git 2.43 has no GIT_NO_LAZY_FETCH, so a read-only probe in a partial
(promisor) clone can fetch a missing object from the network. The evidence
model in project-command now has every Git child, of every kind, pass
-c protocol.allow=never beside the status pins, so a lazy fetch fails
locally, the probe fails and the row is inspection-error, never a network
call. The removal argument vector in project-clean and design D9, the
review-safety defense list, design D6 and D11 and the proposal's seam,
evidence model and departures carry the pin.

Checked here on Git 2.43.0 in a clone made with --no-checkout --filter=tree:0
whose upload-pack is a logging script: the unpinned status probe fetches
HEAD's tree and the script runs; pinned, it exits 128 ("transport 'file' not
allowed") and the script never runs. A protocol.<name>.allow setting or
GIT_ALLOW_PROTOCOL in the caller's environment outranks protocol.allow for
that protocol; design Context and D11 record it.

project-command scenarios 16 -> 17 (100 in all): "A lazy fetch in a partial
clone is refused locally". R-23 is recorded in the proposal's later-rulings
list and departures, tasks 1.2 and 1.4, and design Context and D20. Every
existing scenario is unchanged.

Lane: openRepoProject-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…(R-24, R-25)

R-24: task 2.1 is ticked with the 2026-10-09 py-bench measurement. The fit of
BA:729-735 rejects no cap, so the caps stand as measured and the "provisional"
wording is removed from the proposal, the design and the project-clean delta.
Two degraded cases (rows of 100,000-entry indexes, CPU saturation at load 165)
and the residual of a repository whose every worktree carries a gitlink (its
deferred count never drains) are recorded in design Risks; the plan requirement
and D12/D18 gain the human report's sentence saying why the deferred rows will
not drain when every one of the 16 rows past the cap is contains-submodule.

R-25: protocol.allow is only the default policy, so every Git child also pins
the six per-protocol policies (file, ssh, git, http, https, ext) and the scrub
gains GIT_ALLOW_PROTOCOL, seventeen names. Checked on Git 2.36.6, 2.40.4 and
2.43.0: a protocol.file.allow=always in the repository's config defeats
protocol.allow=never alone and not the six pins; GIT_ALLOW_PROTOCOL=file defeats
every pin and only the scrub stops it. The scenario "A lazy fetch in a partial
clone is refused locally" gains that AND clause, with =file because
GIT_ALLOW_PROTOCOL=always names no protocol and refuses file by itself. The
residual of a remote-helper protocol of another name is recorded in Risks.

Task 1.6 is ticked with Brett Heap's word to lane openRepoProject-2 on
2026-10-09: "ratify, merge #11 and run the runbook". R-24 and R-25 are recorded
in the proposal's later-rulings list, tasks 1.2 and design Context. No scenario
is added: 100 in all.

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

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Head 251978d: task 2.1 ticked with the OQ-4 measurement posted above (the caps stand as measured; the degraded cases and the gitlink residual recorded in Risks, R-24); ruling R-25 closes the lazy-fetch gap: GIT_ALLOW_PROTOCOL is the seventeenth scrubbed name and every Git child pins protocol.file/ssh/git/http/https/ext.allow=never beside protocol.allow=never (verified on partial-clone fixtures on Git 2.36.6, 2.40.4 and 2.43.0: the per-protocol config defeats the default pin alone but not the six; the environment variable defeats every pin, so only the scrub stops it); task 1.6 ticked with Brett Heap's words to this lane, "ratify, merge #11 and run the runbook". Checks: validate --strict valid; validate --all --strict 7 passed, 0 failed; status 4/4; 100 scenarios, canonical scenarios byte-identical. One wording commit (the proposal's Status line) follows, then the squash-merge per the runbook.

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

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

brettheap added a commit that referenced this pull request Oct 9, 2026
Brett Heap ratified add-project-overview on 2026-10-09, in his words to
lane openRepoProject-2: "ratify, merge #11 and run the runbook". The
change lands by squash-merge of PR #12 after PR #11, with the Speckit
handoff 005-project-overview to follow after feature 004 merges.

proposal.md: the Status line now records the ratification in place of
"awaiting ratification". tasks.md: 1.6 is ticked with the same words.

openspec validate add-project-overview --strict: Change
'add-project-overview' is valid.
openspec validate --all --strict: Totals: 7 passed, 0 failed (7 items).

Lane: openRepoProject-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@brettheap
brettheap merged commit 0050f3e into main Oct 9, 2026
10 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

LANDED: squash as 0050f3e on Brett Heap's word "ratify, merge #11 and run the runbook".

brettheap added a commit that referenced this pull request Oct 9, 2026
… design packet) (#12)

Lane: openRepoProject-2

Ratified by Brett Heap: "ratify, merge #11 and run the runbook" (2026-10-09). Governing issue #10. Depends on PR #11 (0050f3e).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Oct 11, 2026
…R-25

Both proposals' cap measurements landed: the overview's caps stand as
measured (128 candidates, 512 rows; worst case 48.3 s of 60 s) and
clean's as measured too (128 rows, 256 report rows, 16 targets; the
worst 128-row run ends at 24.3 s of the 64 s bound); D-Q's "caps
provisional until measured" closes. The measurement found that Git 2.43
lacks GIT_NO_LAZY_FETCH, so ruling R-23 pins -c protocol.allow=never on
every Git child of clean, status, doctor, update and the overview; R-22
adds the reappearing-upstream revalidation scenario. The three wording
items lane 3 raised on the ruling commits landed (81ec2cb, 894b429), the
five wording items of verification 6 are applied, and the records cite
the final texts (change 1 at content 251978d, head df75ef6; change 2 at
head c563f16). Brett Heap ratified both proposals on 2026-10-09
("ratify, merge #11 and run the runbook"); every departure the packet
held open to his ratification is recorded as ratified with the merges,
0050f3e (#11) and 961c405 (#12) on main.

Design record only; packet validator passes.

Lane: openRepoProject-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Oct 20, 2026
…esign packet (design record only) (#16)

Design documents only: revision 1 of the five-document packet under
ideation/brainstorm/ keeps the design record accurate against the two
ratified OpenSpec changes, add-project-clean-all-safe (PR #11, 0050f3e)
and add-project-overview (PR #12, 961c405). It records:
- the factual corrections and mechanism errata that their reviews found;
- the decisions and council rulings they took;
- what landed after them.

It also points at the pending drafts #26, #27 and #29, and bounds a run
with a removal in flight as change 1 does: 64 s, plus at most 300 s, so
364 s.

No code, tests, OpenSpec change or Speckit artifacts. Squash-merged on
Brett Heap's word ("go ahead and merge PR #16"). Governing issue #6,
which stays open.

Lane: openRepoProject-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap pushed a commit that referenced this pull request Oct 22, 2026
…stem reads at revalidation (R-207, R-208)

Lane: openRepoProject-2

Lane openRepoProject-3's W36 confirm read of round (c), a664799..2e819ad
(HIGH 0, MEDIUM 2, LOW 6), under the lead's R-207 and R-208, with its W32
read of LQ-14 in feature 004 (R-200).

M-A (R-207). LQ-20's option (c) is now "a longer work deadline where
extensions.worktreeConfig is true", the 5 s removal floor kept; 45 s is
called the spawn limit. Costed: at least 70.55 s on the 150 ms basis (the
16th spawn at 65.55 s; the 64 s run bound becomes 84.55 s), at least
55.0 s on the mixed basis (49.98 s; bound 69.0 s), none on the measured one.

M-B. Every option is costed on every basis, in D14's new table and one
line per option and basis in LQ-20 (design Open Questions and proposal):
(a) 150 ms, 0 on every run since a re-run builds the same plan (from 127
rows 1, 1, 1, 1, 1, 2, 2, 3, ...), measured 16, mixed 11, 13, 16;
(b) 150 ms 13 (13th at 44.85 s, 14th 46.2 s), measured 16, mixed 16;
(c) as above; (d) 150 ms (64, 8) at 33.15 s or (32, 16), mixed (128, 8) or
(64, 16), report cap 128, measured none. No option is chosen. Re-derived
from task 2.1's numbers and D14's counts; no timing was run.

LOWs: L-a (d)'s time with E = T, 33.15 s; L-b PR #11 and "the larger
median of runs 2 and 3" cited for D14's costs; L-c the cap test takes the
10,000-file removal, the 20,000-file one a sensitivity case; L-d the Open
Questions preamble excepts LQ-20; L-e (ii) names the three bases, the flat
one as a change to D5; L-f D14's Time column "or to the point where it
stops", and the two report rows that stop at 50 s.

W32 L1 (R-200, R-208). "Clean previews and applies a batch of eligible
worktree removals in one repository": the operation-in-progress listing,
and also the worktree-only-commits logs/HEAD read (same code path in 004,
admin_state_gates), not finished within the filesystem budget record
probe-timeout and make the row inspection-error, where the text said the
row was left unprobed; D21 and D22 likewise. The branch-reflog read of
gate 7 is unchanged: 004 keeps it unprobed there.

R-208. "Cleanup revalidates destructive actions": the one rule now decides
every Git child and every filesystem call; a failed or over-budget read of
the repository's or target's identity or registration gives state-changed,
a decided different value identity-changed; ENOENT/ENOTDIR is not a
failure but decides that the path is absent (planning's reading, pcm); a
deadline cut gives deadline-exceeded. D7, D22 and the proposal's
Capabilities bullet say the same. The scenario "A check that fails at
revalidation" gains an AND: P's .git file unreadable gives state-changed.
Checked on Git 2.43.0 and 2.36.6: with P/.git at mode 000 the registry
listing and the main worktree's identity probe are unchanged and the read
of P/.git fails with EACCES.

This commit also re-wrapped the paragraphs its edits lengthened, with no
other change of words. Scenarios: project-clean 71, review-safety 22,
project-command 24. openspec validate --all --strict: 9 passed, 0 failed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap pushed a commit that referenced this pull request Oct 22, 2026
…ne 2's open points (R-258 to R-263)

Lane: openRepoProject-2

Round (h) of #19, change 1's amendment, first commit (the lead asked for a
commit per finished part while the shared account runs high). The round's
records (the later-rulings entry, design Context, tasks.md 1.2) and lane 3's
W64 L-3 and L-4 follow in the next commit.

- Departures preamble: the Decisions opening and the departures list now
  separate the eleven entries PR #11 ratified, the seven that carry Brett
  Heap's rulings of 2026-10-21 (Q9 B, LQ-10 to LQ-15), and the three that
  this amendment's rounds declared (19-10, 19-11, F-5), which wait on his
  ratification; design Open Questions says the same (W64 point 1). No
  entry's text changed.
- Redirect remedy (R-258, W64 M-1): every refusal that a core.worktree or
  core.bare redirect of a linked worktree causes is inspection-incomplete
  (batch preview, apply and report; push; delete-branch; a single target
  naming the redirected row), checked with 004 at d764c26 on Git 2.43.0 and
  2.36.6. D18 gives that refusal a registration-mismatch variant naming the
  unset; project-command's redirected-worktree scenario pins it and gains an
  AND for the repository-config case (W64 L-5).
- RI-3: the bounds sentence and review-safety's revalidation bound carry the
  line-feed exception (9/10 children, rescan 6), for a root or a common
  directory holding a line feed; probes.estimated counts the extra children;
  D7 and D14 say so.
- F-9: operation-in-progress's next step gains the by-hand fallback, true for
  every row of writer E's table (re-run on both builds).
- F-4: D18 says this change states no delete-branch argv, and that 004 runs
  git -C ROOT branch -d -- BRANCH.
- Brett Heap, 2026-10-22, "F-2: yes; F-1: prune-then-delete; O-1:
  deadline-exceeded" (R-263): F-1's two texts in both spec sites and an AND
  in "A removal past the hard ceiling"; O-1's gate-7 sentence; F-2 recorded
  as ruled in D4 and D18; a new list of amendments of ratified text.

Scenario counts stay 71/22/24; openspec validate --all --strict gives 9/9.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap pushed a commit that referenced this pull request Oct 23, 2026
… current head, every cite checked by content there; the HEAD restore form defensive under Q8 (RE2-1); the unreadable holder keeps R-324's clause under Q3 (a) and A-103 (3); N1's residual under Q8

D14 at 818311a equals 88d0d36's byte for byte (:1064-1239), task 2.1 gains only the PR #11 link (:161-214), and every cite of 662be89's design, f0bf538's spec and 88d0d36's design holds by content; a Context row records the refs/heads/HEAD status warning on Git 2.43.0 and 2.36.6; the Migration Plan says what the archive-time re-base takes.

Lane: openRepoProject-5

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant