fix(templates): guard constitution command scope#3616
Open
BenBtg wants to merge 22 commits into
Open
Conversation
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Contributor
There was a problem hiding this comment.
Pull request overview
Adds governance-only scope safeguards to the constitution command.
Changes:
- Defers implementation requests to suggested follow-up commands.
- Adds regression coverage for the rendered guard.
Show a summary per file
| File | Description |
|---|---|
templates/commands/constitution.md |
Adds scope and follow-up guidance. |
tests/integrations/test_integration_generic.py |
Verifies rendered guard content. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- 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: 02f9e138-da58-4a60-93b9-eae659d2aa19
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Resolve generated command references with the active agent prefix instead of rewriting all slash-form text during post-processing. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Propagate dollar-style invocation prefixes when installing into projects without a default integration, and restrict constitution synchronization to Spec Kit-managed templates and commands. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Contributor
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (1)
src/specify_cli/shared_infra.py:526
invoke_prefixis applied to token placeholders but not to the dynamic command helpers resolved immediately afterward. For Codex/ZCode installs,setup-tasks.shand the prerequisite scripts therefore still embed/speckit-plan//speckit-specifyeven though$speckit-*is their native syntax. Pass the prefix through_resolve_dynamic_command_refs()and_format_speckit_command()as well, and add the dollar-style counterpart to the shared-script tests.
content = IntegrationBase.resolve_command_refs(
content, invoke_separator, invoke_prefix
)
content = _resolve_dynamic_command_refs(content, invoke_separator)
- Files reviewed: 16/16 changed files
- Comments generated: 1
- Review effort level: Medium
Use agent-native invocation prefixes in extension command registration and dynamic shared-script command hints. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Contributor
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (1)
src/specify_cli/shared_infra.py:532
- The native prefix is still not applied to the supported Python script variant.
install_shared_infra(..., script_type="py")copiesscripts/python/common.pyunchanged, whereformat_speckit_command()hardcodes/;setup_tasks.pyandcheck_prerequisites.pycall it for their recovery hints. Thus Codex/ZCode projects initialized with--script pystill print/speckit-*instead of$speckit-*. Propagate the prefix to the Python helper (or rewrite those calls during installation) and includepyin the regression coverage.
content = _resolve_dynamic_command_refs(
content, invoke_separator, invoke_prefix
)
- Files reviewed: 18/18 changed files
- Comments generated: 1
- 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: 02f9e138-da58-4a60-93b9-eae659d2aa19
This reverts commit 960d8fb.
This reverts commit 3b228c1.
This reverts commit ed0d0de.
This reverts commit 3f4eb01.
This reverts commit 96e669b.
This reverts commit 5ec0599.
This reverts commit 25c36e5.
This reverts commit a31dbbd.
This reverts commit 4e1ba1f.
This reverts commit c4cc889.
Limit synchronization to Spec Kit-managed files and describe deferred follow-ups without coupling the guard to agent-specific command syntax. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 02f9e138-da58-4a60-93b9-eae659d2aa19
Contributor
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (1)
templates/commands/constitution.md:36
- This no longer renders a follow-up command in the integration's native syntax; it delegates syntax selection to the model. The generated constitution prompt therefore contains neither
__SPECKIT_COMMAND_SPECIFY__nor, for Codex/ZCode, the required$speckit-specifyform, despite the PR description explicitly promising native$speckit-*rendering. Please restore a resolvable command-reference token and propagate each integration's invocation prefix through rendering, with rendered Codex/ZCode coverage.
4. Report the out-of-scope intent under **Suggested Follow-ups**, with the appropriate
next command for the active integration (typically its specification command).
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Medium
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.
Description
The constitution command could interpret mixed governance and implementation requests as permission to modify application artifacts. This adds an explicit governance-only scope guard, preserves out-of-scope intent as a suggested follow-up, and keeps follow-up wording integration-neutral so command-syntax behavior remains outside this fix.
Closes #896
Testing
uv run specify --helpuv sync && uv run pytest.venv/bin/python -m pytest tests/integrations/test_integration_generic.py -qAI Disclosure
This change and PR were authored autonomously on behalf of @BenBtg by GitHub Copilot (model: GPT-5.6 Sol).