feat(presets): add opt-in constitution-sync preset (import of github/spec-kit#3873) - #140
Open
one-kash wants to merge 6 commits into
Open
feat(presets): add opt-in constitution-sync preset (import of github/spec-kit#3873)#140one-kash wants to merge 6 commits into
one-kash wants to merge 6 commits into
Conversation
Follow-up to github#3790, which removed the consistency-propagation pass from the core /constitution command in favor of runtime resolution. Teams that treat materialized plan/spec/tasks templates as reviewed, committed artifacts lost the auto-sync of amended constitutional guidance on a non-forced upgrade. Add a bundled, opt-in `constitution-sync` preset that restores that behavior via a wrap-strategy override of speckit.constitution (composes on {CORE_TEMPLATE} so it stays forward-compatible). It only writes into the project's own .specify/templates scaffolds and installed command files, never into stack-owned template layers. - presets/constitution-sync/: preset.yml (requires >=0.14.4), wrap command, README documenting the tension between auto-propagation and the resolution stack - presets/catalog.json: bundled entry - docs/upgrade.md: document the 0.14.4 behavior change and the opt-in - tests/test_presets.py: structural + composition coverage (TestConstitutionSyncPreset) Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: afa7c1d2-147b-4f62-a6fc-a2cc824cfa3e
…ssert composition Address review feedback on github#3873: - pyproject.toml: force-include presets/constitution-sync into the wheel's core_pack so `_locate_bundled_preset` resolves it in a released install; the bundled advertisement was otherwise unshippable. - tests/contract/test_wheel_bundled_presets.py: new contract test asserting every bundled preset in presets/catalog.json is force-included (guards lean too). - commands/speckit.constitution.md: explicitly state the propagation section supersedes the core Scope Guard, which otherwise says dependent templates are not modified here. - tests/test_presets.py: assert resolve_content substitutes {CORE_TEMPLATE} and the effective command embeds both the core body and the sync pass. Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: afa7c1d2-147b-4f62-a6fc-a2cc824cfa3e
… test Address review feedback on github#3873: assert `strategy: wrap` structurally by parsing the Markdown frontmatter as YAML (instead of a substring match that could false-positive on body text), and assert {CORE_TEMPLATE} in the body section only. Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: afa7c1d2-147b-4f62-a6fc-a2cc824cfa3e
…aveats Rework the preset's user-facing docs to describe what it does, what it does not do, and the caveats you take on — rather than leading with version/origin history. The preset stack is the project's forward direction, so the README no longer positions this as "restoring pre-0.14.4 behavior." Also make the edit-in-place vs. composition conflict explicit and consistent across the wrapper command and docs: propagation into command files/templates that are provided or wrapped by a preset/extension is clobbered on stack reconciliation (integration use/upgrade, preset/extension install/remove), so the wrapper restricts propagation to project-local artifacts the team owns. - README: forward-looking "What it does / does not do / When to use / Caveats" - speckit.constitution.md: step 4 no longer hand-edits composed command files; closing caveat covers command files too - docs/upgrade.md: note the composition-model conflict in the opt-in section - tests: assert the updated closing-caveat wording Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: afa7c1d2-147b-4f62-a6fc-a2cc824cfa3e
Phrase the default-behavior note as "the current version of Spec Kit" and rewrap the opening paragraph. Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: afa7c1d2-147b-4f62-a6fc-a2cc824cfa3e
…EADME Avoid **bold** spans broken across soft line breaks (runtime resolution, reviewed committed artifacts) so they render consistently. Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: afa7c1d2-147b-4f62-a6fc-a2cc824cfa3e
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.
Imported from upstream PR github#3873
Original author: @mnriem
Original head branch:
mnriem-feat-constitution-sync-presetSummary
Follow-up to github#3790, which removed the consistency-propagation pass from the core
/constitutioncommand in favor of runtime resolution. This adds a bundled, opt-inconstitution-syncpreset that restores the pre-0.14.4 propagation behavior for teams that treat materializedplan/spec/taskstemplates as reviewed, committed artifacts.Background
Through 0.14.3,
/constitutionran a "consistency propagation checklist" that materialized amended constitutional guidance into the scaffolded templates and installed command files. github#3790 (shipped in 0.14.4) removed that in favor of runtime resolution —plan,tasks, andanalyzeread.specify/memory/constitution.mdlive on every run, so templates only need to carry a pointer.For the default workflow this is strictly better and not a breaking change:
/constitutionstill works, and materialized templates are preserved on a non-forced upgrade (divergent hashes classify them as customizations). What teams lose is the automatic propagation of amended guidance into those materialized templates. This preset is the supported escape hatch for teams that depend on that.What's included
presets/constitution-sync/—preset.yml(requires.speckit_version: ">=0.14.4"), awrap-strategy override ofspeckit.constitutioncomposing on{CORE_TEMPLATE}(forward-compatible with core changes), and a README.presets/catalog.json— bundled catalog entry.docs/upgrade.md— documents the 0.14.4 behavior change, why it isn't a functional break, the non-forced-upgrade behavior, the optional pointer-reset cleanup, and the opt-in.tests/test_presets.py—TestConstitutionSyncPreset: structural coverage (manifest, wrapper content, catalog integrity) plus a composition test asserting the wrap layer resolves atop the bundled core.Design notes
The wrapper only writes into the project's own
.specify/templates/scaffolds and installed command files — never into stack-owned template layers. The README documents the underlying tension explicitly: auto-propagation materializes/freezes guidance into files, while the resolution stack recomputes templates from package layers on demand, so propagating into a stack-owned template would be clobbered on the next reconciliation. The preset is for project-local governed scaffolds; teams whose templates come from other presets/extensions should stay on runtime resolution.Testing
tests/test_presets.py— 507 passed (including 4 newTestConstitutionSyncPresetcases).🤖 This PR was authored by GitHub Copilot (model: Claude Opus 4.8) on behalf of @mnriem, under human supervision. Commits carry an
Assisted-by:trailer.