Repository navigation
Description
Summary
/assess still emits --phases spec,security-review,exec,qa for security-review issues because no --security-review additive flag exists. PR #557 (issue #554) added --testgen symmetry and rule 8 in assess/SKILL.md explicitly documents this asymmetry. Add --security-review to close the loop — same pattern, mechanical replication.
Motivation
Today, after #557:
npx sequant run 500 -q --phases spec,security-review,exec,qa
After this issue:
npx sequant run 500 -q --security-review
Same runtime behavior, shorter display. Removes the only --phases line /assess is still forced to emit for non-resume / non-power-user cases.
Acceptance Criteria
- AC-1:
--security-reviewflag registered inbin/cli.tsnear--testgen(currently line 208). Option text mirrors--testgen:"Run security-review phase after spec". - AC-2:
RunOptions.securityReview?: booleanadded tosrc/lib/workflow/batch-executor.tsand plumbed throughmergedOptionslike--testgen. - AC-3:
phase-mapper.determinePhasesForIssueinsertssecurity-reviewafter spec whenoptions.securityReviewis set. Mirror the existing testgen branch (phase-mapper.ts:174-189). - AC-4: SKILL.md Rule 8 updated in all 3 skill directories. Remove the "asymmetry: no --security-review additive flag exists yet" clause; list
--security-reviewas the second additive flag. - AC-5: SKILL.md example at
:386switches tonpx sequant run 500 -q --security-review. TheCleanup:block's--phases ...,security-reviewannotation simplifies to--security-reviewaccordingly. - AC-6: Test in
src/lib/__tests__/assess-skill.test.tsextended to reject--phases <any>,security-review,<any>patterns — mirrors the existing testgen assertion. - AC-7: CHANGELOG entry under
[Unreleased] / ### Addedreferencing this issue.
Non-Goals
- Not changing how the security-review phase runs at runtime — same
phase-executor.tspath. - Not renaming the phase. Internal name stays
security-review. - Not adding label-driven auto-detection beyond what
phase-mapper.tsalready does forauth/securitylabels (verify at /spec time; preserve existing behavior).
Risks / Open Questions
- Existing auto-detection:
phase-mapper.tsmay already auto-addsecurity-reviewfor certain labels. /spec must verify and preserve current label-driven behavior —--security-reviewis the explicit-override path. - Mirror sync drift: 3-dir sync test (
assess-skill.test.ts:143) catches this. - Documentation:
docs/features/assess-minimal-flags.md(added in feat(#554): emit minimal command flags in /assess output #557) needs a one-line update once--security-reviewships.
Complexity
small — one CLI option + ~5 lines in phase-mapper + skill examples + test extension. Single PR.
Self-assessed workflow
`spec → exec → qa` with `-q` (multi-file: CLI + interface + phase-mapper + 3-dir skill sync + test + CHANGELOG)
Origin
Deferred from #554 / PR #557 per the issue body's own AC-5 fallback clause.
Activity
admarble commentedon May 3, 2026
→ PROCEED —
--security-reviewadditive flag, mechanical mirror of #557's--testgenpattern, 7 ACsWorkflow:
spec → exec → qawith-qCan run in parallel with #551 (no file overlap). Must land before #556 — both modify
assess/SKILL.mdacross 3 skill dirs.admarble commentedon May 3, 2026
Complexity: Standard (7 ACs, ~6 directories)
AC Quality Check
All 7 ACs passed lint (no vague/unmeasurable/incomplete patterns). Each AC names a specific file path or line number — verification targets are concrete.
Scope Assessment
Non-Goals: Present — runtime behavior unchanged, no rename, no new label-driven auto-detection.
Verdict: ❌ SCOPE_SPLIT_RECOMMENDED (analyzer) — Override: ✅ SCOPE_OK
Override rationale: Analyzer over-splits because the change touches 6 directories (bin/, src/lib/workflow/, src/lib/tests/, 3× skill mirrors, CHANGELOG). All 7 ACs implement a single change — adding
--security-reviewCLI flag — and are tightly coupled (CLI option ↔ interface ↔ phase-mapper ↔ docs ↔ test). Splitting would create non-atomic PRs that ship a half-wired flag. /assess already verified single-PR via PROCEED action.Acceptance Criteria
AC-1:
--security-reviewflag registered inbin/cli.tsVerification: Integration Test
Scenario: Given
bin/cli.tsis parsed → When inspecting Commander options → Then--security-reviewexists with help text "Run security-review phase after spec"Assumptions: Place adjacent to
--testgen(currentlybin/cli.ts:208). Existingassess-skill.test.ts:128-138collects--[a-z][a-z-]*flags frombin/cli.tslines starting with.option(— new flag will be picked up automatically.AC-2:
RunOptions.securityReview?: booleanplumbed end-to-endVerification: Integration Test
Scenario: Given
--security-reviewpassed on CLI → When batch executor reads merged options → Thenoptions.securityReview === truereachesdeterminePhasesForIssueAssumptions: Add field to
RunOptionsinsrc/lib/workflow/types.ts:180-220(alongsidetestgen?: booleanat line 190). Mirror env-var override inbatch-executor.ts:296-298(SEQUANT_SECURITY_REVIEW === "true"→config.securityReview = true). Spread throughmergedOptionsfollows existing testgen pattern.AC-3:
phase-mapper.determinePhasesForIssueinsertssecurity-reviewafter specVerification: Unit Test
Scenario: Given
basePhases = ["spec","exec","qa"]andoptions.securityReview = true→ WhendeterminePhasesForIssuecalled → Then result containssecurity-reviewimmediately afterspec, idempotent on repeatAssumptions: Mirror testgen branch at
phase-mapper.ts:174-179. Also extendPhaseMapperOptionsinterface (phase-mapper.ts:17-19) withsecurityReview?: boolean. Verify idempotency — auto-detection from security labels (phase-mapper.ts:84-88) already insertssecurity-review; manual flag must not duplicate.AC-4: SKILL.md Rule 8 updated across all 3 skill directories
Verification: Integration Test
Scenario: Given Rule 8 prose at
assess/SKILL.md:251→ When updated → Then "asymmetry: no--security-reviewadditive flag exists yet" clause is removed and--security-reviewis listed as the second additive flag (alongside--testgen)Assumptions: 3-dir sync test (
assess-skill.test.ts:155-164) enforces byte-identical content across.claude/skills/,templates/skills/,skills/. Suggest single edit applied withreplace_allper file, or use sed -i across all 3.AC-5: SKILL.md example at
:386-415switches to--security-reviewVerification: Integration Test
Scenario: Given the 13-issue batch example → When updated → Then line at
:406readsnpx sequant run 500 -q --security-reviewand theFlags:annotation at:414simplifies from--phases ...,security-reviewto--security-reviewAssumptions: Apply across all 3 skill dirs. Marker at
:423(assess:phases=spec,security-review,exec,qa) stays unchanged — it records resolved workflow.AC-6: Test in
assess-skill.test.tsextendedVerification: Unit Test
Scenario: Given
assess-skill.test.ts:141-152testgen rejection → When extended → Then test also assertsexpect(line).not.toMatch(/--phases\s+\S*\bsecurity-review\b/)for every examplesequant runline in SKILL.mdAssumptions: Add as a sibling assertion in the existing
it()block, OR rename the test to "should not restate default phases or non-additive testgen/security-review in example commands". Single line addition.AC-7: CHANGELOG entry under
[Unreleased] / ### AddedVerification: Manual Test
Scenario: Given CHANGELOG.md → When opened → Then
[Unreleased] / ### Addedcontains a one-line entry referencing #559 (e.g.,- \--security-review` additive CLI flag for symmetry with `--testgen` (#559)) **Assumptions:** Match existing CHANGELOG style — check what #557 (--testgen` PR) wrote and mirror format.Implementation Plan
Phase 1: TypeScript wiring (CLI → phase-mapper)
src/lib/workflow/types.ts:190— addsecurityReview?: boolean;toRunOptions(next totestgen?: boolean).src/lib/workflow/phase-mapper.ts:17-19— extendPhaseMapperOptionsinterface withsecurityReview?: boolean;.src/lib/workflow/phase-mapper.ts:174-179— add branch mirroring testgen:if (options.securityReview && phases.includes("spec")) { … phases.splice(specIndex + 1, 0, "security-review"); }. Guard against duplicate when label-based auto-detection already inserted it.bin/cli.ts:208— add.option("--security-review", "Run security-review phase after spec")immediately after--testgen.src/lib/workflow/batch-executor.ts:296-298— add env-var override:if (process.env.SEQUANT_SECURITY_REVIEW === "true") { config.securityReview = true; }.src/lib/workflow/batch-executor.ts:641-656— verify whether the runtime testgen-injection block needs a parallelsecurityReviewbranch, OR whetherdeterminePhasesForIssuealready covers both flag-driven insertion paths. Pick one consistent location; do not split.Phase 2: Skill prose sync (3 mirrors)
{.claude,templates,/}skills/assess/SKILL.md:251— rewrite Rule 8: replace "currently--testgenis the only additive flag" with "additive flags:--testgen(bin/cli.ts:208) and--security-review"; delete the asymmetry sentence; keep marker/displayed-command divergence note.:406— changenpx sequant run 500 -q --phases spec,security-review,exec,qa→npx sequant run 500 -q --security-review.:414— simplify--phases ...,security-reviewannotation to--security-review.Phase 3: Tests + changelog
src/lib/__tests__/assess-skill.test.ts:141-152— addexpect(line).not.toMatch(/--phases\s+\S*\bsecurity-review\b/)and rename test to cover both flags.CHANGELOG.md— add entry under[Unreleased] / ### Added.Sequencing: Phase 1 → Phase 2 → Phase 3. Phase 2 edits must apply to all 3 mirrors atomically (3-dir sync test will fail otherwise).
Design Review
Where does this logic belong? CLI option in
bin/cli.ts(Commander layer); flag-to-phase mapping inphase-mapper.ts(domain layer); env-var bridge inbatch-executor.ts(orchestration layer). Mirrors existing--testgenexactly — no new architecture.What's the simplest correct approach? Mechanical mirror of
--testgen. Reject any temptation to refactor "the additive-flag mechanism" into a generic registry — premature abstraction with N=2.What existing pattern does this follow? The
--testgenadditive-flag pattern, fully implemented in feat(#554): emit minimal command flags in /assess output #557. Same shape: option → RunOptions field → PhaseMapperOptions field → phases.splice insertion → env-var override → SKILL.md doc.What would a senior reviewer challenge? Three plausible pushbacks:
determinePhasesForIssue(line 174) and the runtime-injection block (line 641). Audit whether testgen needs both because of resume-after-spec semantics; security-review may need the same. Document in PR.auth/securitylabels already insertsecurity-review(phase-mapper.ts:84-88). The flag is the explicit-override path; ensure idempotent insertion (don't duplicate).--phases ...,security-review?" — Out of scope;--phasesremains the power-user/resume escape hatch.Feature Quality Planning
All standard checks pass. Notable items:
auth/securitylabels can both fire. Test must verifysecurity-reviewappears exactly once.batch-executor.ts:641-656— getting this wrong silently breaks--security-reviewfor resumed workflows..claude/skills/,templates/skills/,skills/. The existing 3-dir-sync test (assess-skill.test.ts:155-164) is the safety net.Derived ACs
determinePhasesForIssueis idempotent whensecurityReview=trueAND security labels presentOpen Questions
batch-executor.ts:641-656has its own testgen-injection block separate fromdeterminePhasesForIssue. Recommendation: mirror exactly whatever--testgendoes; do not refactor in this PR. Impact: if missed,--security-reviewwon't apply to resumed workflows."Run security-review phase after spec". Recommendation: use verbatim. Impact: low.Recommended Workflow
Phases: spec → exec → qa
Quality Loop: enabled (per /assess marker)
Reasoning: Matches /assess recommendation. ACs are largely Integration/Unit —
testgenskipped because the test extension is a one-line addition to an existing test (not a stub-needing greenfield). No UI; notestphase. Not security-sensitive code; nosecurity-reviewphase.Label Review
Current:
enhancement,cliRecommended:
enhancement,cli,plannedReason: Labels accurately describe scope. Adding
plannedto mark spec completion.Quality Loop: Enabled per /assess marker (
<!-- assess:quality-loop=true -->); not auto-triggered by labels (nocomplex/refactor/breakingpresent).→
gh issue edit 559 --add-label plannedConflict Risk Analysis
feature/551-...— independent (modifiesqa/SKILL.mdreview patterns; no overlap withassess/SKILL.mdor CLI). Safe to run in parallel per /assess comment.assess/SKILL.mdacross 3 mirrors. feat(cli): add --security-review additive flag for symmetry with --testgen #559 must land first, or feat(assess): predict file-collision between PROCEED issues from body content #556 will hit merge conflicts on Rule 8 / the:386example.--- DRAFT GITHUB ISSUE COMMENT (PLAN) ---
Plan:
--security-reviewadditive flagWorkflow: spec → exec → qa (quality loop enabled). Single PR.
Acceptance Criteria
--security-reviewregistered inbin/cli.ts:208next to--testgen. (Integration Test — Commander option present; help text "Run security-review phase after spec")RunOptions.securityReview?: booleanadded insrc/lib/workflow/types.ts:190; env overrideSEQUANT_SECURITY_REVIEWmirrored inbatch-executor.ts:296-298. (Integration Test — flag reachesdeterminePhasesForIssue)phase-mapper.determinePhasesForIssueinsertssecurity-reviewafterspecwhenoptions.securityReviewset. Idempotent vs label-based auto-detection. (Unit Test)authlabel → exactly onesecurity-reviewphase. (Unit Test):251) updated across all 3 mirrors — list--security-reviewas second additive flag, drop asymmetry clause. (Integration Test — 3-dir sync test enforces):406and:414annotation switch to--security-review. (Integration Test)assess-skill.test.ts:141-152extended withexpect(line).not.toMatch(/--phases\s+\S*\bsecurity-review\b/). (Unit Test)[Unreleased] / ### Addedreferencing feat(cli): add --security-review additive flag for symmetry with --testgen #559. (Manual)Implementation Order
Phase 1 (TS wiring):
types.ts→phase-mapper.ts(interface + branch) →bin/cli.ts→batch-executor.ts(env override + verify resume-injection block).Phase 2 (3-mirror docs): Edit Rule 8 + example + annotation across
.claude/skills/,templates/skills/,skills/. 3-dir sync test = safety net.Phase 3 (tests + CHANGELOG).
Key Decisions
--testgenmechanically.auth/securitylabels already auto-insertsecurity-reviewviaphase-mapper.ts:84-88. Flag must not duplicate when both present.--testgendoes inbatch-executor.ts:641-656(runtime injection during resume),--security-reviewmust do the same — audit before mirroring.Open Questions
determinePhasesForIssue(line 174) vs runtime-injection block (line 641). Default: mirror whatever--testgendoes today.assess/SKILL.mdRule 8 across 3 mirrors.admarble commentedon May 3, 2026
--- DRAFT GITHUB ISSUE COMMENT (PROGRESS UPDATE) ---
/exec Progress Update
PR: #567
AC Coverage
--security-reviewregistered inbin/cli.tsbin/cli.ts:209, verified via--helpRunOptions.securityReviewplumbed end-to-endtypes.ts:191, env overridebatch-executor.ts:300-302phase-mapper.determinePhasesForIssueinserts after specphase-mapper.ts:184-190phase-mapper.test.ts:170-178:251; 3-dir sync test passes:301,:313,:406,:414(also covered earlier #412 example)assess-skill.test.tsextended:151— caught my missed:301example on first run[Unreleased]/AddedFiles Changed
bin/cli.ts— register--security-reviewnext to--testgensrc/lib/workflow/types.ts— addRunOptions.securityReviewsrc/lib/workflow/phase-mapper.ts— extendPhaseMapperOptions, insert phase after specsrc/lib/workflow/phase-mapper.test.ts— 5 new tests (insertion, idempotency, composition, no-spec, control)src/lib/workflow/batch-executor.ts— env override + runtime-injection block (resume after spec already ran)src/lib/__tests__/assess-skill.test.ts— extend rejection regex for--phases ...,security-review.claude/skills/assess/SKILL.md,skills/assess/SKILL.md,templates/skills/assess/SKILL.md— Rule 8 rewrite + 2 example switches in eachdocs/features/assess-minimal-flags.md— table row + troubleshooting copy updatedCHANGELOG.md—[Unreleased]/AddedentryQuality Plan Alignment
!phases.includes("security-review")guard + dedicated testbatch-executor.ts:660-674)Derived ACs: 1/1 addressed (AC-3.1)
Build / Lint / Test Results
npm run build— passes (no TypeScript errors)npm run lint— passes (0 warnings, 0 errors,--max-warnings 0)npx vitest run src/lib/workflow/ src/lib/__tests__/— 832 passed across 34 test filesnpx tsx bin/cli.ts run --help— shows--security-review Run security-review phase after specauthlabel, composes with--testgen, no-op when spec absentPre-PR Confidence Check
--testgenisspec → security-review → testgen → exec → qa(security-review inserted at index 1 after testgen lands there, pushing testgen down). Test asserts both phases appear once and security-review is at index 1, but this ordering is incidental rather than designed — if a future change reorders insertion, the composition test will catch it but no doc states the intent.SEQUANT_SECURITY_REVIEW=true), but it's a 3-line mirror of the existing testgen env override which has identical structure and no integration test either. Acceptable per existing pattern.PR Status
Created: #567
Notes
assess/SKILL.mdRule 8 across 3 mirrors).admarble commentedon May 3, 2026
QA Review for Issue #559
PR: #567 —
c2ddf72AC Coverage
--security-reviewflag inbin/cli.tsbin/cli.ts:209, help text "Run security-review phase after spec" verbatim per spec; verified vianpx tsx bin/cli.ts run --helpRunOptions.securityReviewplumbed end-to-endtypes.ts:191; env overrideSEQUANT_SECURITY_REVIEW=trueatbatch-executor.ts:300-302mirrors testgenphase-mapper.determinePhasesForIssueinserts after specphase-mapper.ts:182-188;!phases.includes("security-review")guard for idempotencyphase-mapper.test.ts:170-178— flag + auto-detected phases → exactly onesecurity-reviewassess/SKILL.md:251rewritten in all 3 mirrors; asymmetry clause removed;--security-reviewlisted as second additive flag; 3-dir syncdiff -qpassesFlags:annotations simplified from--phases ...,security-reviewto--security-reviewassess-skill.test.tsextended:151addsexpect(line).not.toMatch(/--phases\s+\S*\bsecurity-review\b/); test renamed to cover both flags[Unreleased]/AddedCoverage: 8/8 AC items fully met (7 original + 1 derived)
Original ACs: 7/7 met
Derived ACs: 1/1 met
Quality Plan Verification
batch-executor.ts:662-674)Quality Plan Status: Complete
CI Status
build (20.x)build (22.x)typecheckvalidate-skillsvalidate-pluginPlugin Structure ValidationSetup Directory CreationHooks ValidationCI Summary: 8 passed, 0 pending, 0 failed
Stale Branch Check
Quality Metrics
any)Test Coverage Analysis
bin/cli.tsassess-skill.test.ts(regex-based flag presence checks)src/lib/workflow/types.tssrc/lib/workflow/phase-mapper.tsphase-mapper.test.ts:148-193(5 new tests)src/lib/workflow/batch-executor.tssrc/lib/__tests__/assess-skill.test.ts.claude/skills/assess/SKILL.md(×3)docs/features/assess-minimal-flags.mdCHANGELOG.mdCoverage: Critical paths covered. The env-override + resume-injection in
batch-executor.tsis a 3-line/12-line mirror of identical testgen blocks — accepting same coverage posture as the existing testgen pattern (acknowledged in /exec progress note).Code Review
Strengths:
--testgenpattern — same shape across all 5 layers (CLI option → RunOptions field → PhaseMapperOptions field → phase-mapper splice → batch-executor env override + runtime injection).!phases.includes("security-review")in bothphase-mapper.ts:186andbatch-executor.ts:665).specAlreadyRan,phases.unshift("security-review")puts the phase at the front of the remaining list — symmetric with the testgen handling 17 lines above.--testgen.diff -q.spec → security-review → testgen → exec → qaordering (security-review at index 1, testgen pushed to index 2) — incidental but pinned by test.Issues:
Suggestions:
phase-mapper.ts(planning) andbatch-executor.ts(resume runtime) is an established pattern with--testgen. If future changes drift one without the other, the existing tests should catch it.Test Quality Review
Anti-Pattern Detection
Code Patterns
No critical patterns detected. Diff is small, no
anycasts, no empty catches, no hardcoded secrets, no SQL.Critical Issues: 0
Warnings: 0
Call-Site Review
New exported functions detected: 0 (only added a property to existing
RunOptionsinterface andPhaseMapperOptionsinterface; modified existingdeterminePhasesForIssueandrunIssueWithLoggingpaths)N/A — no new exported functions to call-site review.
Execution Evidence
npx tsx bin/cli.ts run --help | grep security-review--security-review Run security-review phase after specnpm run buildnpx vitest run src/lib/workflow/phase-mapper.test.ts src/lib/__tests__/assess-skill.test.tsnpx vitest run src/lib/workflow/ src/lib/__tests__/diff -q .claude/skills/assess/SKILL.md skills/assess/SKILL.md && diff -q .claude/skills/assess/SKILL.md templates/skills/assess/SKILL.mdEvidence status: Complete
Skill Command Verification
Skill files changed: 3 (all
assess/SKILL.mdmirrors).claude/skills/assess/SKILL.mdnpx sequant run ... --security-review--help)skills/assess/SKILL.mdtemplates/skills/assess/SKILL.mdCommands Verified:
npx sequant run 412 -q --security-review→ flag valid (verified vianpx tsx bin/cli.ts run --help)npx sequant run 500 -q --security-review→ flag valid (same)Verification Status: Passed
CLI Registration Verification
Option files modified: Yes (
bin/cli.ts,src/lib/workflow/types.ts,src/lib/workflow/batch-executor.ts)securityReviewmergedOptions.securityReviewflow →phase-mapper.ts:184,batch-executor.ts:663--security-reviewatbin/cli.ts:209Verification Status: Passed
Skill Change Review
npx tsx bin/cli.ts run --help;--security-reviewshows up with correct text.--phasesfallback retained for power-user workflows.Smoke Test
npx tsx bin/cli.ts run --help | grep security-reviewnpm run buildnpx vitest run src/lib/workflow/ src/lib/__tests__/Smoke Test Status: Complete
CHANGELOG Verification
[Unreleased]entryResult: CHANGELOG requirements met
Self-Evaluation
--help, build, and full test suite in the worktree; verified 3-mirror byte-identical sync; verified 8/8 CI checks green on PR feat(#559): add --security-review additive CLI flag #567.--testgen --security-review.batch-executor.ts:645-674if a future change updates one without the other. Mitigated by adjacent placement in code and parallel test coverage.Verdict: READY_FOR_MERGE
All 8 ACs (7 original + 1 derived) are MET. CI is green (8/8). Build passes, full test suite passes (832/832), 3-mirror SKILL.md sync verified, CHANGELOG present, help text matches spec verbatim, env override and resume injection mirror testgen exactly.
Documentation: Before merging, run
/docs <issue>to generate feature documentation (or note thatdocs/features/assess-minimal-flags.mdis already updated as part of this PR — no additional docs needed).Conflict reminder: Per /spec, this PR must merge before #556 (both edit
assess/SKILL.mdRule 8 across the 3 mirrors).Next Steps
feat(#559): add --security-review additive CLI flag