fix: guard constitution command against feature execution#3646
Conversation
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be3f0d7d-2774-4ba2-b741-efbb4870148a
There was a problem hiding this comment.
Pull request overview
Adds governance-only scope guards to constitution commands, deferring feature requests to follow-up actions.
Changes:
- Guards core and lean constitution prompts against non-governance work.
- Adds regression assertions for guard wording.
- Preserves constitution-dependent artifact synchronization.
Show a summary per file
| File | Description |
|---|---|
templates/commands/constitution.md |
Adds the core scope guard and deferred actions. |
presets/lean/commands/speckit.constitution.md |
Adds equivalent lean-preset protection. |
tests/test_presets.py |
Verifies both prompts contain guard directives. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Medium
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be3f0d7d-2774-4ba2-b741-efbb4870148a
|
Addressed the review round in commit Posted on behalf of @BenBtg by GitHub Copilot (model: GPT-5.6 Sol, autonomous). |
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be3f0d7d-2774-4ba2-b741-efbb4870148a
|
Addressed the latest review in commit Posted on behalf of @BenBtg by GitHub Copilot (model: GPT-5.6 Sol, autonomous). |
Description
Mixed governance and feature directives can cause
/speckit.constitutionto modify application code while updating project governance. This adds an explicit scope guard to both the default and lean constitution prompts so non-governance intents are deferred to a conditionalNext Actionssection instead of executed.The guard preserves constitution-driven dependent artifact updates and the existing user-controlled handoff. Native per-agent tool restrictions and guards for other commands remain separate follow-up work.
Fixes: #896
Testing
uv run specify --helpuv sync && uv run pytest.venv/bin/python -m pytest tests/test_presets.py -q -k 'constitution_commands_guard or TestLeanPreset'AI Disclosure
Implemented and prepared on behalf of @BenBtg by GitHub Copilot (model: GPT-5.6 Sol, autonomous). Copilot reviewed issue #896, updated the prompts and regression tests, and ran the targeted test suite.