Repository navigation
Description
Context
#2431 puts host-only managed-worktree findings into the hygiene review. Their path is the logical reference-worktree://<worktree id>, and their one repair removes a worktree; nothing is written to a brain file (docs/decisions/managed-worktrees.md#hygiene-and-cleanup).
While fixing #2723 (the card no longer offers "Open file ›" for such a finding), the pinned browser captures of a worktree card showed that the card's state copy still describes a Markdown file edit:
postCheckreads "Then re-runs validation on this file." for any non-broken-link repair, includingdelete-worktree(postCheck=,packages/ui-react/src/components/activity/hygiene-review.tsx:842-848).- A failed removal reaches the card as
check_failedand reads "The change was written, but the check still fails: cleanup-failed." (stateText,packages/ui-kit/src/decisions/HygieneCard.tsx:54). Nothing was written. stalereads "This file changed since the finding was shown." andrefusedreads "Couldn't write reference-worktree://…" (packages/ui-kit/src/decisions/HygieneCard.tsx:50-52).fixedreads "Finding no longer detected in reference-worktree://…" (packages/ui-kit/src/decisions/HygieneCard.tsx:75).- An
unknownworktree finding has no repair, so its commit button reads "Done, check again" (packages/ui-react/src/components/activity/hygiene-review.tsx:850), although the user has nothing to edit; the host's explanation says "Check again later."
Observed in the ui-react-layout captures for hygiene-review.layout.tsx, both themes, 320 and 1280.
The maintainer has approved caller-supplied display copy and the corrected worktree wording below. Related: #2734 (owner-only detail view), which does not cover this copy.
Scope and maintainer decision (2026-10-24)
Option A selected: extend the presentational HygieneCard with optional caller-supplied inert state/status, busy and fixed-outcome copy. Preserve existing file defaults and meanings. The feature layer selects copy from actual action/outcome evidence; do not add worktree-domain branching or a finding-kind prop to the generic kit. Exact prop names are implementation design, not preapproved here. This is an additive public-prop change.
The maintainer approved the corrected copy direction:
- No-repair commit action: Check again.
- Check explanation: Checks its current state. A worktree verified clean and unused may be reclaimed automatically.
- Confirmed removal: Worktree removed.
- Finding cleared without confirmed removal: No longer needs review.
- Uncertain reply: The outcome wasn't confirmed. Check again.
- Other states describe the actual worktree checking/removal stage, preserve opaque inert reasons, and make no unsupported nothing-changed or nothing-removed claim. No Markdown-write, file-validation or real-file-URI wording.
- There is no Undo state for this category; the caller must not select undone copy. Existing file copy, state machine, interaction, confirmation, focus and announcement behavior stay unchanged.
The earlier design brief is useful for layout and tests, but its claim that check-only reassessment never removes anything is superseded. Source evidence: run(check) calls reassess with remove:true (reference-worktree-hygiene.ts); reassess may invoke automatic removal only when fresh assessment proves a clean, unheld worktree (reference-worktrees.ts). A sent action alone is not proof of removal. Choose Worktree removed only with confirmed outcome evidence; otherwise use the finding-cleared text. Never infer nothing was removed from a reassessment or an uncertain/failed reply. No server policy or outcome-shape change is authorized.
Implement the complete worktree state/post-check and check-only copy under these rules; supplied display values are inert strings with safe wrapping, never callbacks, Markdown or new authority. Optional-copy omissions must preserve every current file default, including busy/fixed rendering.
Out of scope
The Open action (#2723), the owner-only detail view (#2734), server finding or outcome shapes, and Markdown finding copy.
Acceptance criteria
- Implement the approved optional caller-copy boundary and exact action, check-explanation, confirmed-removal, cleared-finding and uncertain-reply strings above. Cover every remaining worktree state with truthful operation-specific copy and preserved opaque reasons; no claim of absence of effects without evidence.
- Managed-worktree states make only supported outcome claims: no Markdown write, no file-validation promise, no reference-worktree URI presented as a real file. Unknown work/check outcome remains unknown; failure does not imply data was removed.
- No-repair findings offer Check again with the approved explanation that freshly verified clean, unused worktrees may be reclaimed; never promise reassessment cannot remove anything or imply a user file edit. Existing Apply/Later/Dismiss, confirmation, idempotency and recovery behavior remain unchanged.
- Pinned native browser scenes cover every affected state at 320px and desktop, both themes, keyboard focus and long inert values, with a failing-first assertion and a mutation that restores generic file wording. Existing Markdown-finding scenes and the no-Open-file behavior from ui-react: the hygiene card opens a nonexistent file for a managed-worktree finding #2723 remain unchanged.
- Owner-only detail remains ui-server: owner-only detail view for private managed-worktree hygiene findings #2734; replicated worktree cards stay opaque and no new owner/private detail leaks into copy.
Verification
Pinned browser proof in packages/ui-react/tests/browser/hygiene-review.layout.tsx once scoped.
Contract impact
Approved additive optional inert display-data props with existing file defaults and meanings preserved. Retain contract, use a CONTRACT: commit, update the package contract and API report in the same commit, and ship a minor changeset. Record the selected boundary/corrected worktree copy policy in the applicable decision record. No breaking file semantics, host outcome changes or new cleanup authority is approved.
2026-10-24 triage at main 77f35ef1ba34e4fab7092ada5362ae799852ea24: Completed the UX scope, exact kit-API options/consequences and checkable proof/privacy criteria. Attached the full managed-worktree review-copy deliverable to #2390; p2 is wanted unscheduled correctness work. The current file-state wording is source-verified, but no replacement copy, public API or UX is approved. A self-contained design prompt follows.
2026-10-24 triage reconciliation: priority p1 appeared concurrently with this pass's p2 classification. Preserve the newer higher priority and remove only p2 so exactly one priority remains. This supersedes the earlier unscheduled-p2 note; the outstanding design/API decisions, native #2390 parent and every other label remain. No milestone is invented by this correction.
2026-10-24 maintainer ruling: approved A with corrected copy, including possible automatic reclamation during reassessment, evidence-based confirmed-removal text, neutral cleared/uncertain outcomes and no Undo. The API and copy-direction prerequisites are resolved; implementation and browser proof remain. Preserve the already-recorded higher p1 and remove duplicate p2.
Activity
schlessera commentedon Oct 24, 2026
2026-10-24 triage at main
77f35ef1ba34e4fab7092ada5362ae799852ea24: Completed the UX scope, exact kit-API options/consequences and checkable proof/privacy criteria. Attached the full managed-worktree review-copy deliverable to #2390; p2 is wanted unscheduled correctness work. The current file-state wording is source-verified, but no replacement copy, public API or UX is approved. A self-contained design prompt follows.Needs design: truthful state and check-only copy for managed-worktree hygiene. The host finding, private-card opacity, confirmed cleanup and no-file-Open behavior are settled. The missing judgment is the wording the owner reads at each outcome and on a finding with no repair; generic file-edit copy is false here. The separate public kit API question in the body remains a maintainer decision, not something this prompt approves.
schlessera commentedon Oct 24, 2026
2026-10-24 triage reconciliation: priority p1 appeared concurrently with this pass's p2 classification. Preserve the newer higher priority and remove only p2 so exactly one priority remains. This supersedes the earlier unscheduled-p2 note; the outstanding design/API decisions, native #2390 parent and every other label remain. No milestone is invented by this correction.
schlessera commentedon Oct 24, 2026
Design brief (1/2): managed-worktree state copy
Answers the design prompt. Read at main
77f35ef1:HygieneCard(stateText, the fixed callout,busyLabel)managed-worktrees.md(Hygiene and cleanup) andpackage-api.md(managed-worktree findings)reference-worktree-hygiene.tskinds and handler, and the browser fixture'scleanup-failedreplyThe copy below doesn't depend on which option the API ruling picks. I'm not proposing a field name. The copy is plain inert strings; where a line needs a fact the caller must know, it is marked [fact].
Host facts the copy relies on (all existing)
retained,unknownandcleanup-failed.delete-worktreeis offered for retained and cleanup-failed findings, and never for unknown.stale. A failed removal returnscheck_failedwithcode: "cleanup-failed"and a fixed opaquereason, and the finding reappears with a new fingerprint.undonecan't happen for this category (see §1).1 · State table (exact copy)
Removing… checking the worktree firstbusyLabelChecking the worktree again…This worktree changed since the finding was shown. Nothing was removed.The host refused the removal: <reason>. The worktree was not removed.Couldn't write <path>cleanup-failed)The worktree couldn't be removed. It's kept for review: <reason>The check couldn't finish: <code>. The worktree's state wasn't confirmed.Didn't hear back, so the worktree may or may not be removed. Checking again won't remove it twice.Didn't hear back. Checking again is safe.Still needs review. Nothing was removed.Removed · the worktree was reclaimedNo longer needs review · re-checked. Nothing was removed.delete-worktreeRemoval versus reassessment.
fixedreads differently depending on which action the user sent. The caller already knows that action, because it sent it. No new host fact is needed; it's the [fact] above.2 · Check-only action (unknown kind, no repair)
Check again. This replacesDone, check again, because the user had nothing to do.Its work or owner can't be established, so it's kept as is. Checking again reads its state afresh. It never removes anything.Post-check line for
delete-worktree(replacesThen re-runs validation on this file.):3 · Inert values and unavailable facts
reasonandcodeare rendered as text nodes inside the Callout, wrapped withoverflow-wrap:anywhere. They are never linkified or parsed as markdown. The host reason is already fixed and opaque.reference-worktree://…id appears only in the existing identityPathRef. It is never inside a sentence that calls it a file or names it as a write target.reasonfalls back tono reason given, and a missingcodetocheck unavailable. No other fallback promises an outcome.Part 2 covers mocks, focus, browser criteria and dependencies.
schlessera commentedon Oct 24, 2026
Design brief (2/2): mocks, focus, browser criteria, dependencies
Mocks
320px, cleanup-failed (removal failed):
Desktop (~560px column), unknown kind, no repair:
Fixed by removal (replaces the card, as today):
4 · Focus, announcements and behavior
The behavior below is unchanged; only the strings are new:
role="status"region and cadence: one announcement per state change, nothing on load.data-hygiene-title) after an outcome, and the next card afterfixed.Check againandRemove worktreeuse the existing DispositionBar commit slot, so targets stay at least 44px.5 · Browser assertions (pinned
hygiene-review.layout.tsx, 320 + 1280, light + dark)Per managed-worktree state (applying ×2, stale, refused, cleanup-failed, other check_failed, unknown reply ×2, still_detected, fixed ×2):
file,written,validationorCouldn't write, and noreference-worktree://outside the PathRef.Check again.Done, check againis absent.delete-worktreeand for the unknown kind.[x](http://e.test)<b>y</b>renders literally.Controls (must stay unchanged): the existing Markdown broken-link and required-field scenes keep their file wording (
Applying… checking the file first,Then re-runs validation on this file.,Done, check again). The #2723 no-Open-file assertion still passes.Mutation: restoring the generic file defaults for the managed-worktree category must fail every changed assertion above. Record that in the PR.
Dependencies for the maintainer
API boundary (
needs: decision, body). The copy works under either option:Under A, the caller supplies the state text, the busy label and the fixed text. Under B, the kit needs the kind and the "action sent" fact.
Recommend A, as the body does: the
fixed: removal/fixed: check onlysplit needs a fact that only the caller has, which B would have to grow a second prop for.undoneis impossible for this category. Confirm that the caller should never pass it, instead of the kit guarding against it.Commit label
Remove worktree. The mock assumes the existing repair label; this brief doesn't change it. If the current label differs, it's out of scope here.schlessera commentedon Oct 24, 2026
Decision (maintainer, 2026-10-24): Approved A with corrected copy. Add optional caller-supplied inert display copy to HygieneCard, preserving all existing file defaults. Check again explains that a freshly verified clean, unused worktree may be reclaimed automatically; the earlier never-removes claim is not approved. Use Worktree removed only with confirmed outcome evidence; otherwise a cleared finding says No longer needs review. An uncertain reply says The outcome wasn't confirmed. Check again. Other states describe actual checking/removal without unsupported nothing-changed claims, private detail or file-edit wording. No Undo for this category; preserve interaction/state-machine behavior. The body records the additive API classification, approved wording and source correction. Decision/design prerequisites are resolved; implementation and browser proof remain.
schlessera commentedon Oct 24, 2026
Claimed (claim
bk044-2837-card-copy), branchfix/2837-worktree-card-copy-044, stacked on the #2734 branch because both changeHygieneCardand the hygiene card. Implementing decision A with the corrected copy; draft PR to follow.CONTRACT: fix(ui-react): describe a managed worktree, not a file, on …