Skip to content

feat(presets): add opt-in constitution-sync preset (import of github/spec-kit#3873) - #140

Open
one-kash wants to merge 6 commits into
mainfrom
import/pr-3873
Open

feat(presets): add opt-in constitution-sync preset (import of github/spec-kit#3873)#140
one-kash wants to merge 6 commits into
mainfrom
import/pr-3873

Conversation

@one-kash

Copy link
Copy Markdown

Imported from upstream PR github#3873
Original author: @mnriem
Original head branch: mnriem-feat-constitution-sync-preset


Summary

Follow-up to github#3790, which removed the consistency-propagation pass from the core /constitution command in favor of runtime resolution. This adds a bundled, opt-in constitution-sync preset that restores the pre-0.14.4 propagation behavior for teams that treat materialized plan/spec/tasks templates as reviewed, committed artifacts.

Background

Through 0.14.3, /constitution ran 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 resolutionplan, tasks, and analyze read .specify/memory/constitution.md live on every run, so templates only need to carry a pointer.

For the default workflow this is strictly better and not a breaking change: /constitution still 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"), a wrap-strategy override of speckit.constitution composing 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.pyTestConstitutionSyncPreset: 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 new TestConstitutionSyncPreset cases).


🤖 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.

mnriem and others added 6 commits July 30, 2026 10:24
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants