docs(templates): clarify /constitution's Sync Impact Report is temporary, review-only material (#4431) - #4432
Conversation
…ithub#4431) Step 4 of the constitution command only said to prepend the Sync Impact Report as an HTML comment, with no instruction to remove a previous one. Each run therefore added another report block on top of the last, growing the raw file (and the token cost of reading it) without bound. Now the step explicitly requires removing any existing report comment before adding the new one. Assisted-by: Claude (model: claude-sonnet-5, autonomous)
mnriem
left a comment
There was a problem hiding this comment.
As indicated by the comment on the issue please change this to a documentation issue
Per review on github#4432/github#4431: the growth this fixed isn't a functional bug in the intended workflow — the report is scratch material for human review and is expected to be removed before the constitution file is committed. Step 4 now says so explicitly, alongside the existing replace-not-stack instruction for runs where a prior report was left in place.
|
Agreed, retitled as a docs clarification. Pushed 609dc58: Step 4 now states explicitly that the Sync Impact Report is temporary, review-only material expected to be removed before the constitution file is committed, alongside the existing replace-not-stack instruction for runs where a report was left in place ( |
There was a problem hiding this comment.
🟡 Changes recommended
The removal instruction can delete unrelated leading HTML comments.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Clarifies that /constitution Sync Impact Reports are temporary and must be replaced rather than stacked.
Changes:
- Adds replacement guidance to the constitution command template.
- Adds a regression test for the guidance.
File summaries
| File | Description |
|---|---|
templates/commands/constitution.md |
Documents report replacement and removal. |
tests/test_constitution_template_sync_report.py |
Verifies prior-report removal guidance. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - If the file already starts with an HTML comment (e.g. a Sync Impact Report left over because | ||
| it was not removed before a prior commit), remove it entirely before adding the new one. The | ||
| file must never carry more than one Sync Impact Report; replace, never stack. |
|
Thanks for adding the lifecycle wording — that part is exactly right. But I'd like this to be documentation-only, and right now it still carries the behavioral change I was pushing back on. Two requests:
"If the file already starts with an HTML comment … remove it entirely before adding the new one. The file must never carry more than one Sync Impact Report; replace, never stack." In the intended workflow the Sync Impact Report is temporary scratch material that's removed before the amended constitution is committed, so
Net: Step 4 gains only the clarification that the report is temporary and removed before commit; no new agent behavior. Re-request review once that's in. |
Per review, Step 4 should stay documentation-only: the report is temporary, review-only material removed before commit, so /constitution shouldn't auto-strip a pre-existing HTML comment (which could delete unrelated leading content). Retarget the regression test to pin the documented lifecycle instead of the removed de-dupe behavior.
|
Pushed e3870d6: removed the de-dupe bullet from Step 4 (no more auto-stripping a leading HTML comment), keeping only the temporary/removed-before-commit lifecycle wording. Retargeted |
Fixes #4431
Problem
templates/commands/constitution.md(Step 4 of the Outline section) instructedagents to "prepend" the Sync Impact Report as an HTML comment at the top of
.specify/memory/constitution.md, with no instruction to remove a previousreport first. Because HTML comments are invisible in rendered Markdown but
fully present in the raw file, every
/constitutionrun stacked another<!-- ... -->report block on top of the last one. Any agent or extensionhook that loads the raw constitution file at runtime (
/specify,/review,before_constitution/after_constitutionhooks, etc.) pays a growing,unbounded token cost reading historical changelog data that has no
governance value at inference time.
Fix
Step 4 now explicitly instructs the agent to remove any existing HTML
comment at the top of the file before adding the new Sync Impact Report,
so the file never carries more than one report — it is replaced, not
stacked.
This is a one-line-of-behavior instruction change to the command template
(
templates/commands/constitution.md); no other copies of this text existin the repo.
Test plan
Added
tests/test_constitution_template_sync_report.py, which asserts theStep 4 instructions require removing any prior Sync Impact Report comment
rather than only prepending.
(
git checkout HEAD~1 -- templates/commands/constitution.md):uv run --extra test pytest -qAI disclosure
This change, including the code, tests, and this PR description, was
generated autonomously by an AI coding agent (Claude, model: claude-sonnet-5)
acting on behalf of the repository owner, with no line-by-line human review
prior to commit.
Assisted-by: Claude (model: claude-sonnet-5, autonomous)