Repository navigation
fix: Toolkit Standards Conformance - #37
Conversation
There was a problem hiding this comment.
Pull request overview
Brings the wt CLI and repository artifacts into conformance with the sahil87 toolkit standards audit (shll v0.0.23), including a small behavioral fix for non-interactive safety and the accompanying conformance/reporting trail.
Changes:
- Make the fallback (non-TTY) selection menu return an actionable structured refusal on EOF-with-no-input, and honor partial input at EOF.
- Add unit + integration tests to pin the new non-TTY behavior across
wt open,wt go, andwt delete. - Update the README command-reference URL and add the conformance report + backlog/memory documentation for the audit and deferrals.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/internal/worktree/menu.go | Refines fallback menu EOF handling to produce an actionable refusal and accept partial-line-at-EOF input. |
| src/internal/worktree/menu_test.go | Adds unit tests covering EOF-with-no-input refusal and partial-line-at-EOF acceptance. |
| src/cmd/wt/integration_test.go | Adds integration coverage ensuring non-TTY menu entrypoints refuse actionably and don’t surface the bare EOF error. |
| README.md | Fixes the command reference URL to match the readme-extraction standard. |
| fab/changes/260717-6end-toolkit-standards-conformance/plan.md | Records the audit plan and acceptance criteria for the conformance change. |
| fab/changes/260717-6end-toolkit-standards-conformance/intake.md | Captures audit intake context and constraints for the conformance run. |
| fab/changes/260717-6end-toolkit-standards-conformance/conformance-report.md | Adds the per-standard conformance report (PASS/gaps + fix/deferral dispositions). |
| fab/changes/260717-6end-toolkit-standards-conformance/.status.yaml | Tracks fab change metadata and progress/status for the conformance change. |
| fab/changes/260717-6end-toolkit-standards-conformance/.history.jsonl | Records fab stage transition history for this change. |
| fab/backlog.md | Adds deferred follow-ups (skill adoption, delete stdout/stderr realignment, delete dry-run). |
| docs/memory/wt-cli/toolkit-standards-conformance.md | Adds a durable “baseline receipt” memory doc for the standards audit results and re-audit trigger. |
| docs/memory/wt-cli/menu-navigation-contract.md | Updates the menu contract memory doc to reflect the new EOF handling semantics. |
| docs/memory/wt-cli/index.md | Links the new toolkit-standards conformance memory doc from the wt-cli memory index. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Refuse with an actionable, flag-naming error instead of hanging | ||
| // or surfacing a bare "reading input: EOF" (principles №1 / №4). | ||
| return 0, fmt.Errorf("%s", WtError( | ||
| "This is an interactive selection menu and stdin is not a terminal", |
There was a problem hiding this comment.
Fixed — reworded the fallback-menu EOF refusal so it describes the input condition ("this selection menu reached end of input before a choice was entered") instead of asserting stdin is not a terminal, which is inaccurate when an interactive TTY degrades to the fallback prompt or on Ctrl-D. Actionable Why/Fix guidance and the --non-interactive escape are unchanged; the pinned unit + integration tests were updated to assert the new wording. (3b6f7a3)
Meta
6endexcludes
fab/,docs/· generated by fab-kit v2.15.5Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Summary
Constitution v1.1.0 added a Toolkit Standards article requiring
wtto conform to the sahil87 toolkit's published standards (shll standards), but no conformance audit had ever been run. This change runs that audit against shll v0.0.23 (principles,help-dump,readme-extraction,skill), fixes the small-additive gaps found, and defers the larger ones to backlog.Changes
shll standards/shll standards <name>(re-verified at apply time; matched intake snapshot)help-dumpandreadme-extraction; all tenprinciplesassessed per-command against actual behaviorfab/backlog.mdConformance report — audited against shll v0.0.23
Standards were re-enumerated at apply time via
shll standards+shll standards <name>(noshll updateneeded;shll standardsexited 0). Runtime list matched the intake snapshot:principles,help-dump,readme-extraction,skill. The audited binary iswtbuilt byjust build(versionv0.0.24-2-g97b9f0e, stamped fromgit describe). shll version row:shll v0.0.23.Sections follow
shll standardslist order. Every gap carries exactly one disposition: fixed in this change or deferred to [].principles
Assessed per-command against actual behavior (
create,list,open,go,delete,init,shell-init,update, root — non-TTY paths probed empirically).wt openmain-repo menu,wt gono-name,wt deleteno-name) in a non-TTY reached EOF and surfaced a barereading input: EOF(exit 1) — no hang, but not a refusal naming the escape. fixed in this change: the shared fallback-menu path (internal/worktree/menu.gorunFallbackMenu) now returns a structuredError:/Why:/Fix:refusal stating the menu cannot run without a TTY and naming the escape (pass a worktree name, or--non-interactivewhere supported).create/delete/go/listalready carry--non-interactive;wt go --non-interactiveandwt delete --non-interactivealready refuse cleanly. (The toolkit uses--non-interactive, not--yes; the principle is satisfied by any flag that makes the command non-interactive.)wt create(path line on stdout; summary/separators/banner/prompts on stderr),wt go(resolved path on stdout, arrow confirmation on stderr),wt init(all diagnostics on stderr, no stdout contract), andwt list(--jsonfor programmatic consumption; default table is a read command's data) all honor the split. Machine format stability is pinned by the help-dumpschema_versionevolution rule. gap —wt delete's non-warning human copy (Worktree/Branch/Path,Removing worktree...,Deleted worktree:,Cancelled., branch-cleanup lines, multi-delete summary,No worktrees found.) is written to stdout viafmt.Printf/fmt.Println; only the two pre-menu warnings were realigned to stderr (260622-log5).wt deletehas no stdout machine contract, so nothing programmatic breaks today. deferred to [ohwb] — command-wide (~20 call-site) realignment, beyond the audit's small-additive boundary.Long:+ per-commandLong:/usage; README +docs/site/workflows.mdcarry examples). The hiddenhelp-dumpsubcommand emits the JSON tree by walking the Cobra command tree (internal/worktree/helpdump.goBuildHelpDump), never by parsing-h; see the help-dump section below for the mechanical receipts. Pinned byTestHelpDump_EmitsValidEnvelope.ExitWithError(what, why, fix)/WtError(internal/worktree/errors.go) across all commands, with typed exit codes fromerrors.go(ExitSuccess 0,ExitGeneralError 1,ExitInvalidArgs 2,ExitGitError 3,ExitRetryExhausted 4,ExitByobuTabError 5,ExitTmuxWindowError 6,ExitInitFailed 7) —0/1/2convention honored for success/operational/usage. The one unactionable path (non-TTY menureading input: EOF) was fixed in this change (see №1).list/open/goread;create/delete/initwrite); destructivewt deleterequires explicit consent (TTY confirmation, satisfiable by--non-interactive) per №1. gap — no destructive path supports--dry-run(a preview sharing the live code path). deferred to [p5m9] — a new flag plus a preview code path threaded through the deletion flow is restructuring-sized.git worktree list --porcelain,git rev-parse, no state files or global config writes — Constitution I).wt createarms a rollback (internal/worktree/rollback.go) that removes a partially-created worktree on failure/SIGINT; re-running after a partial failure converges.wt deletecontinues-on-error across multiple targets and re-derives the worktree set each run.wtshells out togitand tobrew(viainternal/update) rather than reimplementing them;wt openis the toolkit's canonical launcher that peers (hop) delegate to, andwt list --jsonis the composition surfacehop ls --treesconsumes.wt updateprobes the callee's advertised flag (--no-brew-update/--skip-brew-update) rather than assuming it.BuildAvailableAppsdetects;handleAppMenuprintsNo supported applications detected.and exits 0); color isNO_COLOR-gated (errors.goinit()blanks the color vars) and box-drawing falls back to ASCII inPhaseSeparator;wt init's built-infab syncdefault gracefully skips (exit 0) in a non-fab repo;wt updatereportsbrew not foundas a single actionable line.wt list --statuscaps its worker pool (maxListConcurrency = 8) and the default path runs a single git subprocess;wt delete's unpushed-commit preview is explicitly capped (... and N more). No unbounded dump surface. (No--quietflag exists; the principle's--quietclause is conditional — "what survives--quietwhere present" — and no surface is verbose enough to require one, so its absence is not a violation.)docs/site/follow the readme-extraction standard (see that section — one URL fixed, rest PASS) and are pulled/rendered by shll.ai. The<tool> skillbundle half is not yet adopted (see the skill section). №10 is a SHOULD, and per the skill standard's own Adoption note a tool withoutskillis "not yet in violation."help-dump
PASS — the standard's "Verifying conformance" checklist executed verbatim against the built binary (
v0.0.24-2-g97b9f0e):wt help-dumpexits 0, writes valid JSON to stdout only, stderr empty (0 bytes). ✓{root, schema_version, tool, version}— nocaptured_at. ✓tool = "wt",schema_version = 1(integer),version = v0.0.24-2-g97b9f0e(reflects the built binary, not a literal). ✓completion,help, and all hidden nodes (incl.help-dumpitself); visible subcommands are exactlycreate, delete, go, init, list, open, shell-init, update(8). ✓wt -hdoes not listhelp-dump(declaredHidden: true). ✓TestHelpDump_EmitsValidEnvelope(src/cmd/wt/help_dump_test.go) asserts exit 0 + valid JSON +tool/schema_version+captured_atabsence + filter rules. ✓No fix required. Re-verified after this change's fixes — the command tree is unchanged (R2 edits only README prose; R4 edits only an error string), so the dump is byte-stable.
readme-extraction
One gap, fixed in this change; the rest PASS.
README.mdwashttps://shll.ai/tools/wt/commands/, but rule 8 specifieshttps://shll.ai/<tool>/commands/=https://shll.ai/wt/commands/. fixed in this change (README.mdline 85 →https://shll.ai/wt/commands/).#H1 → exact toolkit blockquote → badges → prose tagline.Contributing/Development/Building/License/Acknowledgementsheading; the whole README is intentionally site-worthy.docs/site/install.md/docs/site/workflows.md(the auto-rewritten README→docs/site form);docs/site/**internal links are all between-page./install.md/./workflows.md(closure holds, no..escape); external links absolute.https://…); no#gh-*-mode-onlyfragments; no```mermaidfences.docs/site/page namedoverview,readme, orcommands(tree isinstall.md,workflows.md).docs/site/pages and (post-fix) the absolute command-reference URL.Re-ran the grep checklist after the edit: the URL is the only change and no new violation was introduced.
skill
Deferred, not yet adopted (phased per-repo adoption; no seven-repo flag-day).
wthas noskillsubcommand (wt skill→unknown command) and no canonicaldocs/site/skill.md. Per the standard's own Adoption section ("No tool shipsskilltoday") and principle №10 being a SHOULD, this is not a current violation. Tracked as [v7xy] for eventual adoption (a hidden-freewt skillprinting a static ≤150-line bundle byte-identical to a newdocs/site/skill.md, embedded via a sync + drift-guard).Summary — fixed in this change: readme-extraction command-reference URL (rule 8); principle №1/№4 non-TTY menu actionable refusal. Deferred: skill adoption [v7xy]; principle №2
wt deletestdout→stderr realignment [ohwb]; principle №5wt delete --dry-run[p5m9]. help-dump and the rest of readme-extraction and principles №3/№6/№7/№8/№9/№10 PASS. Tests green; command tree unchanged (help-dump checklist re-verified).