Repository navigation
feat: gate the Feature Flow on the consistency analysis (#27) - #30
Merged
Merged
Conversation
added 2 commits
October 18, 2026 14:27
The analyze step could not influence anything: no gate followed it, core speckit.analyze is strictly read-only so it wrote no report, and the engine persists no stdout for command steps. Its findings therefore reached neither a decision point nor a durable artifact. Persist the report and gate on it: - Add the analysis-report preset, which wraps speckit.analyze so its report is written to FEATURE_DIR/analysis.md. The wrapper supersedes the command's read-only constraint for that single file. A preset may declare a given command only once, so a third layer for speckit.analyze requires a third preset; it is installed at priority 5 so the wrap encloses the runtime and delegation prepends rather than the reverse. - Add analyze-gate to the Feature Flow between analyze and implement. analysis.md is a run artifact and finish removes it with the rest of the feature directory, like review-findings.md and doc-check.md.
The wrapper restated what the analyze command already defines (FEATURE_DIR, its read-only contract, the artifact list) and repeated the flow rationale that docs/reference.md owns. Keep only the write target and the override, plus a length guard so it stays that way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #27. In the Feature Flow,
analyzecould not influence anything: no gate followed it, corespeckit.analyzeis strictly read-only so it wrote no report, and the engine persists no stdout forcommandsteps. The cross-artifact consistency check — the last safety net before code is written — was unreachable, and nothing survived the run.This persists the report and gates on it.
Changes
analysis-report. Wrapsspeckit.analyzeso its report is written toFEATURE_DIR/analysis.md, explicitly superseding the command's read-only constraint for that single file.wrap, not a third prepend: the command's own contract has to change, and the wrap composes as the outermost layer so the persistence instruction is the last thing the command reads.Duplicate template name 'speckit.analyze'). Both the main preset andsub-agent-delegationalready declare it.10, so the wrap encloses the runtime and delegation prepends rather than the reverse.analyze-gateinworkflows/workflow.yml, betweenanalyzeandimplement, shaped exactly likespec-gateandplan-gate.bundle.yml,catalog/preset-catalog.json,scripts/build-catalog.py,scripts/check-release.py,scripts/release-version.py.docs/flows.md,docs/reference.md,README.md,AGENTS.md.analysis.mdis a run artifact:finishremoves it with the rest of the feature directory, likereview-findings.mdanddoc-check.md. It exists to be read at the gate, not to outlive the run.No new runtime scripts. No hand-edited versions —
release-version.pyowns those.Testing
python3 -m unittest discover -s tests -t .→ 74 passed (was 69; +5).New coverage:
AnalysisReportStaticContracts:speckit.analyzedeclared exactly once withwrap; wrapper carries{CORE_TEMPLATE},FEATURE_DIR/analysis.md, and the supersede clause; bundle priority< 10; gate and preset documented.analyze→analyze-gate→implement, withoptions: [approve, reject]andon_reject: abort.bundle.ymlpin count 8, new catalog pin.Verified against real
specify 1.0.13in a scratch project:Composed file order: persistence head → runtime preamble → delegation preamble → core read-only clause → core report format → persistence tail.
The Feature Flow installs as 16 steps with
analyze-gatebetweenanalyzeandimplement.python3 scripts/check-release.py 0.20.0passes.Not covered by an automated end-to-end run: the gate actually pausing in a live Feature Flow run — that needs a dispatched agent session.
Documentation
docs/flows.mdgains the gate in the mermaid diagram and step table, and its "human gates let you inspect and approve each phase" claim is now true.docs/reference.mdgains a### Analysis reportsection covering the wrap/prepend choice, the priority constraint, and the artifact lifecycle.README.mdgains a feature bullet and the manual-install step.AGENTS.mdrecords the new component and the split between preset and gate.Closes #27