A project override silently turns off presets for that template

Aperta Adatta ai principianti
#5,337 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
73/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

La issue indica preset resolve e la documentazione dei preset come punti di partenza; leggi come artifact info segnala le modifiche nascoste ai preset e trova la documentazione che spiega le sovrascritture dei template di progetto. Documenta che una sovrascrittura nasconde le modifiche al preset e fai in modo che preset resolve segnali il preset nascosto, se questo comportamento rientra nell’ambito. Il lavoro è completato quando gli utenti possono scoprire perché il contenuto del preset è assente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

triage-can-wait

What happens (v1.2.6)
A team installs a preset that adds a section to the plan template. Later, a developer copies the plan template into .specify/templates/overrides/ to tweak one line. From then on, the preset's section is gone from every plan, and nothing says so:

  • specify preset resolve plan-template shows only the override.
  • specify preset list still shows the preset as enabled.
  • Only specify artifact info plan-template --kind template --json reveals it, as hidden: true.

This matches the rule that project overrides always win, so it isn't a bug. It's just invisible.

Reproduction script
#!/usr/bin/env bash
# u5: a project override on a template silently drops every preset layer on it, and the CLI says nothing.
# A team preset that appends a section (the documented "append" strategy), plus a developer's own
# override of the same template (the documented .specify/templates/overrides/ folder). Stock CLI only.
set -uo pipefail
REF="${REF:-v1.2.6}"
WORK="$(mktemp -d)"
cd "$WORK"
SPECIFY=(uvx -q --from "git+https://github.com/github/spec-kit.git@$REF" specify)
"${SPECIFY[@]}" init --here --force --non-interactive --integration claude --script sh --ignore-agent-tools >/dev/null 2>&1 || { echo "init failed"; exit 2; }
echo "spec-kit $REF in $WORK"

mkdir -p preset-src/templates
cat > preset-src/preset.yml <<'YML'
schema_version: "1.0"
preset:
  id: "team-governance"
  name: "Team Governance"
  version: "0.1.0"
  description: "Appends a compliance appendix to every plan"
  author: "repro"
requires:
  speckit_version: ">=1.2.0"
provides:
  templates:
    - type: "template"
      name: "plan-template"
      file: "templates/plan-template.md"
      strategy: "append"
      description: "Compliance appendix appended to the plan"
tags: ["governance"]
YML
printf '\n## Compliance Appendix\n\nList every regulated data field the change touches.\n' > preset-src/templates/plan-template.md

echo "1. team installs the preset"
"${SPECIFY[@]}" preset add --dev ./preset-src </dev/null 2>&1 | tail -1
echo "   preset resolve plan-template:"
"${SPECIFY[@]}" preset resolve plan-template 2>&1 | sed 's/^/     /'

echo "2. a developer overrides the plan template for this project (copies it and edits a line)"
mkdir -p .specify/templates/overrides
sed 's/^# Implementation Plan/# Implementation Plan (our team)/' .specify/templates/plan-template.md > .specify/templates/overrides/plan-template.md
echo "   preset resolve plan-template:"
"${SPECIFY[@]}" preset resolve plan-template 2>&1 | sed 's/^/     /'
echo "   artifact info plan-template --kind template:"
"${SPECIFY[@]}" artifact info plan-template --kind template --json 2>&1 | python3 -c "import json,sys;d=json.load(sys.stdin);print(json.dumps(d,indent=1)[:1500])" 2>&1 | sed 's/^/     /'
echo "   preset list:"
"${SPECIFY[@]}" preset list 2>&1 | sed 's/^/     /' | head -8

o=.specify/templates/overrides/plan-template.md
if [ -f "$o" ] && [ "$(awk '/Compliance Appendix/{n++} END{print n+0}' "$o")" = "0" ]; then
  echo "RESULT: plan-template now resolves to $o, which has no Compliance Appendix. Read the output above for any warning that the preset is hidden."
fi

Suggested fix (small)

  1. One sentence in the presets docs: a project override replaces the template and hides every preset change to it.
  2. One line from preset resolve when that happens, for example "team-governance (append) is hidden by a project override". The information is already computed for artifact info, so this is a few lines. Happy to open a PR for it if that direction works for you.

AI disclosure: drafted with Claude Code (Claude Opus 5.5, default settings) from runs in a throwaway sandbox; I checked it before filing.

Lingua principale
Python
Stelle
149k
Fork
13.4k
Merge medio
1g 5h
PR unite (30g)
223

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/spec-kit

Tutte le issue di github/spec-kit

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.