Skip to content

fix(commands): more command steps use the shared input checks - #783

Merged
dean0x merged 7 commits into
mainfrom
fix/781-shared-input-checks
Nov 10, 2026
Merged

dean0x merged 7 commits into
mainfrom
fix/781-shared-input-checks

Conversation

@dean0x

@dean0x dean0x commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

More command steps use the shared input checks that plan-files.cjs added in #776.

  • /code-review, /bug-analysis and /research make their run folder with plan-files.cjs claim, not with mkdir -p. Only the script's RUN_DIR= line with exit=0 sets the folder. Any other result stops the step.
  • /plan Phase 14 runs plan-files.cjs claim design and check on the design file path before it makes the file.
  • plan-files.cjs gets the new forms claim reviews|bug-analysis <branch-slug>, claim research <topic-slug> and claim design. check also accepts a new design file. Plain claim (the plan run folder) does not change. Only the plan folder keeps its tracking rule, so a team that commits reviews, research or design files keeps working.
  • /plan and /research make the topic slug in prose and use it only when it matches ^[a-z0-9-]{1,50}$, else untitled. The docs-framework skill and its patterns reference have no shell form of the slug now.
  • /bug-analysis and /resolve fetch the PR body only when the PR number is digits only, as /code-review does.
  • The Git agent passes PR_NUMBER to gh pr view or to a --pr flag only when it is digits only: post-review-summary, post-resolution-summary, check-merge-readiness (its script call and its evidence step) and update-pr-evidence. The review-decision step of check-merge-readiness is the script's specification and runs only inside the script, so its text does not change; a frozen golden pins it.
  • Outside a git checkout, claim reviews|bug-analysis|research takes the working folder as its root, with the same folder checks. /research therefore still works outside a git repository. The plan and design claims still need a checkout.

Closes #781

Tests

  • tests/evidence-policy/plan-files.test.ts: 41 new cases for the new claim forms and the design check. They failed before the script change.
  • tests/guards/shared-input-checks.test.ts (new): one arm per step, each with known-bad probes. The first 14 cases failed on the old prompts; the 5 Git-agent cases failed before the _pr.mds change.
  • Existing guards that pinned the old wording now pin the new wording: pass-paths, docs-framework-authority, docs-root, code-review-diff-gating, bug-analysis/structural, resolve/known-limits, retired-wording.
  • docs-root: the docs-path mention floor falls from 42 to 36. Six literal run-folder paths left the corpus, because the claim now names those folders. The new guard pins each claim.

Size ceilings (tests/fixtures/numeric-floors.json)

Each row is set to the measured size, with no headroom.

Row Old New Reason
command-code-review-max 31,695 31,755 The review folder claim replaces mkdir -p; only its RUN_DIR line sets REVIEW_DIR and TIMESTAMP.
command-code-review-curation-off-max 30,079 30,139 Same.
command-code-review-compliance-off-max 29,146 29,206 Same.
command-code-review-both-off-max 27,530 27,590 Same.
command-bug-analysis-max 22,063 22,187 The analysis folder claim replaces mkdir -p; the PR body fetch takes the digits-only gate; the report date takes the stamp of the folder.
command-bug-analysis-curation-off-max 19,337 19,461 Same.
command-bug-analysis-compliance-off-max 21,532 21,656 Same.
command-bug-analysis-both-off-max 18,806 18,930 Same.
command-research-max 11,072 11,144 The research folder claim; the topic slug is made in prose and checked.
command-research-curation-off-max 8,231 8,303 Same.
command-plan-max 33,243 33,799 Phase 14 makes the slug in prose, checks it, checks the design path, and takes seconds in the stamp once when a file stands there. A clause that restates the skill paid for part of it.
command-plan-curation-off-max 31,639 32,195 Same.
command-plan-compliance-off-max 33,098 33,654 Same.
command-plan-both-off-max 31,494 32,050 Same.
command-resolve-max 46,938 46,996 The PR body fetch takes the digits-only gate.
command-resolve-curation-off-max 44,864 44,922 Same.
command-resolve-compliance-off-max 40,288 40,346 Same.
command-resolve-both-off-max 38,198 38,256 Same.
skill-docs-framework-max 8,782 8,491 The shell forms of the slug and the folder helpers left the skill; one line names the claim script.

Known limits

  • The handoff and evidence files at the docs root keep their own writers. The evidence writer already has its own file checks.
  • /code-review, /bug-analysis and /research now stop when the checkout path holds a quote, $, a backtick, \, a glob character or a control character. /plan already had this rule.

Known follow-ups

  • src/assets/skills/review-methodology/references/patterns.md:99-105 still shows mkdir -p for a reviews path. No command runs it before the claim.
  • The slug pattern ^[a-z0-9-]{1,50}$ also accepts a leading or trailing dash. The script then refuses the design name, so the step stops.
  • src/assets/skills/docs-framework/references/violations.md keeps wrong/right bash examples that set a raw title in a variable. They are examples, not a slug command.

…lders with the shared checks

plan-files.cjs claim now also makes the run folder of /code-review,
/bug-analysis and /research, and the design folder of /plan, with the
same folder checks as the plan run folder. check also accepts a new
design file. The plan folder alone keeps its tracking rule.
/code-review, /bug-analysis and /research make their run folder with
plan-files.cjs claim, and /plan checks its design file path with the
same script. /plan and /research make the topic slug in prose and check
its pattern; the docs-framework skill drops the shell form of the slug.
/bug-analysis and /resolve fetch the PR body only for a PR number of
digits only. A new guard pins each step.
Each changed build is set to its measured size with no headroom. The
CHANGELOG entry and the PR list each row with the old and new value.
…heckout

/bug-analysis sets the report date from the claimed folder. /plan runs
the design check in the checkout, stops on a quote anywhere in the
artifact path, and takes seconds in the stamp once when a file stands
at the path. The plan name example stays, as a test pins it.
@dean0x

dean0x commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner Author

Evidence (head 67a631f)

Merge of main (67a631f): origin/main (dcbd9f0) merged with no conflict. CI on 67a631f: build-and-test (22), macos-bash32-hooks and security/snyk pass. The local suite below ran on 0c47242, the head before the merge.

Tests (local, node 24)

  • Full suite: 409 files passed; 19,278 tests passed, 8 skipped.
  • npm run build and tsc -p tsconfig.scripts.json: pass.

CI (0c47242): build-and-test (22), macos-bash32-hooks and security/snyk pass.

RED first

  • tests/evidence-policy/plan-files.test.ts: the 41 new cases failed before the script changes and pass after them (153 of 153). Five of them cover a claim outside a git checkout.
  • tests/guards/shared-input-checks.test.ts: the 14 command and skill cases failed on the old sources. The 5 Git-agent cases failed before the _pr.mds change. All 19 pass now.

Changes since the first evidence (e348dd6)

  • Outside a git checkout, claim reviews|bug-analysis|research takes the working folder as its root, with the same folder checks. /research therefore works outside a git repository, as before.
  • The Git agent passes PR_NUMBER to gh pr view or a --pr flag only when it is digits only: post-review-summary, post-resolution-summary, check-merge-readiness (script call and evidence step) and update-pr-evidence. The review-decision step of check-merge-readiness is the script's specification and runs only inside the script; the guard pins that sentence. The PR-host byte budget stays inside its limit.

Independent review (one agent, the diff of the three steps only)

  • The checks hold in all three steps. The script has no gaps.
  • Fixed from the review: /bug-analysis sets the report date from the claimed folder. /plan runs the design check in the checkout, covers the whole artifact path, and takes seconds in the stamp once when a file stands at the path. The guard pins each fix with a known-bad probe.
  • Not changed: see "Known limits" and "Known follow-ups" in the PR body.

Static scan: Snyk Code on plan-files.cjs: 0 issues.

The Git agent passes PR_NUMBER to gh pr view or to a --pr flag only when
it is digits only, in post-review-summary, post-resolution-summary,
check-merge-readiness and update-pr-evidence. Outside a git checkout,
claim reviews|bug-analysis|research takes the working folder as its
root with the same folder checks, so /research still works there.
…table

The comment operations report a skip for a PR number that is not
digits only, in fewer bytes. update-pr-evidence gates the PR number at
the start of its step and keeps its evidence-path sentence.
@dean0x
dean0x merged commit 0d4d888 into main Nov 10, 2026
3 checks passed
@dean0x
dean0x deleted the fix/781-shared-input-checks branch November 10, 2026 22:14
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.

Existing docs and PR-body steps: use the shared input checks

1 participant