Skip to content

Design packet: project overview and project clean --all-safe (design only) - #7

Merged
brettheap merged 7 commits into
mainfrom
docs/project-maintenance-design
Oct 7, 2026
Merged

brettheap merged 7 commits into
mainfrom
docs/project-maintenance-design

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Lane: openRepoProject-3
Claim: #6 (comment)

Design only

This branch contains design documents only. It adds no code, no tests, no
OpenSpec proposal and no Speckit artifacts, and performs no cleanup operation.
It extends the four-document brainstorm packet under ideation/brainstorm/
for the two proposed features (project overview and project clean --all-safe) and resolves the five pre-PR review findings recorded in the
handoff ideation/brainstorm/next-session-project-maintenance-fix-handoff.md,
which remains in the branch as the review trail. Governing issue: #6.

Findings resolved

# Finding Where the contract now lives
1 Batch safety boundary Batch cleanup: Safety boundary (identity, narrow guarantee, changes after confirmation, residual window, branch race)
2 Execution and interruption Batch cleanup: Execution model (fresh plan and plan_digest, one retire_worktree seam, deadline and reserve, stages, reconciliation, exit codes)
3 Bounding and sharing the expensive work Batch cleanup: Probe accounting and limits; Overview: Discovery scope and ordering, Probe model and deadline
4 Explicit repository and JSON contracts Batch cleanup: Repository and JSON contract with plan and apply-result fixtures; Overview: JSON contract with envelope fixture
5 Discovery scope and acceptance gaps Overview: Collector boundary and error isolation, Merge target and classification reuse, Attention categories, acceptance scenarios

Baseline

Designs target the cleanup contract of a040790 (separate explicit remove
and delete-branch actions). origin/main has since advanced to ca4c615:
PR #4 archived the completed OpenSpec changes and promoted their specs to
openspec/specs/, and PR #5 added the prefer-triad-in-project-new OpenSpec
proposal; the project executable and its tests are unchanged. The cleanup
branch (PR #2, closed unmerged on 2026-10-07 and retained on origin at
bb91a49) is cited as extension evidence only; nothing here assumes it, and
the handoff records the follow-ups its decision record names. Each feature
document lists the baseline behavior changes a later proposal must record.

Checks

  • Brainstorm packet validator: PASS (4 docs: 2 atomic, 1 synthesis, 1 overview)
  • git diff --check: clean
  • Adversarial design review, round 1: 6 high / 14 medium / 15 low; every high
    and medium resolved
  • Verification review, round 2: 3 high / 9 medium / 13 low; every high and
    medium resolved
  • Targeted re-verification of the round-2 fixes: 0 high / 1 medium / 4 low;
    all five resolved before this PR; no raw bidirectional control characters
    in the packet

🤖 Generated with Claude Code

brettheap and others added 6 commits September 11, 2026 16:01
Revise the four-document brainstorm packet so every finding in the
2026-09-11 handoff has a written contract and validation scenarios, and
append a resolution record to the handoff:

- Batch cleanup: narrow safety boundary over Git common-directory, admin
  registration and device/inode identity; fresh plan on --apply with a plan
  digest; one mutation seam shared by single-target remove and batch; a
  monotonic 60 s deadline with a 10 s reconciliation reserve; stage enum,
  reconciliation record and exit codes; targeted revalidation with
  probe/operation accounting; caps of 128 worktree rows and 24 targets
  derived at 150 ms per Git child; additive plan JSON and an apply result
  record with fixtures; the removal command overrides
  status.showUntrackedFiles and a hidden-local-state probe guards
  assume-unchanged and skip-worktree edits.
- Project overview: sorted candidate discovery before caps (32 roots, 128
  candidates, 512 worktree rows) with four-way cross-repository probing;
  collector boundary that isolates failing candidates; family holders as
  one row; merge-target resolution with source and SHA; attention
  categories; overview JSON envelope with fixture; Git-first clean handoff
  carrying the canonical repository root as an argv array.
- Both: shared probe model (four repository-wide children, one combined
  status probe per worktree row), NUL-delimited path handling, a baseline
  behavior changes list for the later proposal, and the moved origin/main
  (67efa80, OpenSpec archive only; project unchanged).

Design only: no code, tests, OpenSpec or Speckit artifacts. Packet
validator passes; adversarial review round 1 findings resolved;
verification review pending before the PR.

Lane: openRepoProject-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
… documents

Fifth overview gate (no --all-safe suggestion while any worktree row is inspection-error), locked-worktree exclusion name, shared and batch-only baseline change groups, the handoff's capture-time state line, and the shared probe-timeout item naming the per-child process group.

Lane: openRepoProject-3

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Apply the second review round to the four-document brainstorm packet and
re-align the overview, synthesis and handoff with the feature documents:

- Probe directory rule: worktree-specific probes run in the worktree's own
  index (`git -C <worktree path>`), repository-wide probes at the canonical
  root; without it the hidden-local-state probe read the main index.
- Caps follow the removal floor: a removal child is spawned only with at
  least `removal_floor_seconds` (5 s) of the work deadline left, so the
  batch target cap is 16, not 24 (128 worktree rows unchanged); the
  overview's listing phase is an estimate counted against the deadline,
  with a 5 s bound per root, and the break-even and single-repository
  figures move with it.
- Submodules: any gitlink, or an admin `modules` directory, excludes a
  worktree as `contains-submodule` from the same bounded `ls-files` probe.
- One path-escaping form in both documents (`\xHH` bytes, `\uXXXX` code
  points, lowercase hex); the packet carries no raw bidirectional control
  character.
- Merge target: strip `refs/remotes/origin/` from the `origin/HEAD` symref;
  manifest revalidation compares against the plan-time value.
- Rewritten scenarios whose expectations the documents' own rules made
  impossible ("Repository replaced mid-batch", "Gated merged worktrees");
  explicit error-row fields; `{"error", "code"}` exit-2 JSON; `doctor`'s Git
  refusal; the overview's fifth gate also withholds `--all-safe` above the
  batch row cap.
- Handoff resolution record updated with the round-2 result and the cap
  decision; baseline notes record origin/main at ca4c615 (PR #5, OpenSpec
  only) and the closure of PR #2 (`cleanup`, retained on origin) with the
  follow-ups its decision record names.

Design only: no code, tests, OpenSpec or Speckit artifacts. Packet
validator passes; review rounds 1 and 2 resolved for every high and medium
finding; targeted re-verification recorded in the PR.

Lane: openRepoProject-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Sorry @brettheap, your pull request is larger than the review limit of 150,000 diff characters

Add PR #7 and governing issue #6 to the handoff's
Checks section and state that the completion gate is met: validator PASS,
every high finding has a contract and scenario, design-only PR open; no
OpenSpec proposal until it is reviewed and merged.

Lane: openRepoProject-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant