[Bug]: `integration switch` leaves the manifest out of date when a preset overrides a core command
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
Rechercherichtung
Beginne mit src/specify_cli/integrations/command_switch.py:380-389 und vergleiche den Ablauf zur Registrierung von Voreinstellungen mit _resync_manifest_after_registration in command_upgrade.py:352 und src/specify_cli/integrations/_helpers.py:486-505. Führe die Reproduktion aus dem Issue aus und prüfe tests/specify_cli/integrations/test_command_upgrade.py:1320-1385 auf die bestehende Regressionserwartung. Als abgeschlossen gilt die Arbeit, wenn der Manifest-Hash nach dem Wechsel mit der neu geschriebenen Voreinstellungsdatei übereinstimmt und das anschließende Upgrade ohne --force erfolgreich ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Bug Description
specify integration switch <target> installs the target integration and saves its manifest (src/specify_cli/integrations/command_switch.py:309-316). It then re-registers installed presets for the target (command_switch.py:380-389). A preset that overrides a core command rewrites a file the manifest already tracks, and the manifest is not re-hashed afterwards. As a result integration status reports the file as modified, and a later integration upgrade without --force refuses to run, even though the user changed nothing.
integration upgrade handles the same situation by calling _resync_manifest_after_registration (command_upgrade.py:352, added for #4696). switch does not call it.
Steps to Reproduce
From the root of a fresh clone, after uv sync, save the script below as repro.py and run it with uv run python repro.py.
import hashlib, json, os, tempfile
from pathlib import Path
from typer.testing import CliRunner
from specify_cli import app
tmp = Path(tempfile.mkdtemp())
project = tmp / "proj"
project.mkdir()
os.chdir(project)
run = lambda *args: CliRunner().invoke(app, list(args))
run("init", "--here", "--integration", "claude", "--script", "sh", "--ignore-agent-tools")
preset = tmp / "tasks-preset"
(preset / "commands").mkdir(parents=True)
(preset / "commands" / "speckit.tasks.md").write_text(
"---\ndescription: Tasks override\n---\nPreset tasks body\n")
(preset / "preset.yml").write_text("""schema_version: '1.0'
preset: {id: tasks-preset, name: Tasks Preset, version: 1.0.0, description: x}
requires: {speckit_version: '>=0.1.0'}
provides:
templates:
- {type: command, name: speckit.tasks, file: commands/speckit.tasks.md}
""")
run("preset", "add", "--dev", str(preset))
r = run("integration", "switch", "codex", "--script", "sh")
print("switch exit code:", r.exit_code)
rel = ".agents/skills/speckit-tasks/SKILL.md"
manifest = json.loads(Path(".specify/integrations/codex.manifest.json").read_text())
on_disk = hashlib.sha256(Path(rel).read_bytes()).hexdigest()
print("preset body in skill:", "Preset tasks body" in Path(rel).read_text())
print("manifest hash matches file:", manifest["files"][rel] == on_disk)
r = run("integration", "upgrade", "codex", "--script", "sh")
print("upgrade exit code:", r.exit_code)
print(r.output.strip())
The script initialises a project with Claude Code, adds a local preset that overrides speckit.tasks, switches to Codex, compares the manifest hash with the file on disk, and then runs integration upgrade codex without --force.
Expected Behavior
After the switch, the manifest hash for .agents/skills/speckit-tasks/SKILL.md matches the file that preset registration wrote, and integration upgrade codex succeeds. The docstring of _resync_manifest_after_registration (src/specify_cli/integrations/_helpers.py:486-505) says files rewritten by registration must be re-hashed "so check_modified() doesn't misreport a legitimate override as tampering", and names switch among the operations it serves. The regression test test_upgrade_force_syncs_manifest_hash_for_preset_overridden_skill (tests/specify_cli/integrations/test_command_upgrade.py:1320-1385) sets the same expectation for upgrade.
Actual Behavior
switch exit code: 0
preset body in skill: True
manifest hash matches file: False
upgrade exit code: 1
⚠ 1 file(s) have been modified since installation:
.agents/skills/speckit-tasks/SKILL.md
Use --force to overwrite modified files, or resolve manually.
Specify CLI Version
1.2.4.dev0 (main at 27d14e2)
AI Agent
Codex CLI
Operating System
Linux 6.18 (Ubuntu container)
Python Version
Python 3.12.3
Error Logs
⚠ 1 file(s) have been modified since installation:
.agents/skills/speckit-tasks/SKILL.md
Use --force to overwrite modified files, or resolve manually.
Additional Context
integration use (src/specify_cli/integrations/command_use.py) also re-registers presets without a manifest resync, so it looks affected in the same way, but I have not reproduced that path. Calling _resync_manifest_after_registration after preset registration in switch (and probably use) would likely fix it.
Also reproduced on macOS (Darwin 25.6, arm64) with Python 3.14.4 and uv run python -I repro.py against 27d14e2; the output matches the above.
AI Disclosure
Found and reproduced with Claude Code (model: Claude Opus 4.8), run autonomously under human supervision. The human reporter re-ran every reproduction above before filing.
- Vorherrschende Sprache
- Python
- Sterne
- 149k
- Forks
- 13.4k
- Ø Merge
- 1 T. 5 Std.
- Gemergte PRs (30 T.)
- 223
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/spec-kit
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
triage-must-have
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Workflow-step verifier test fixture breaks when the checkout path contains whitespace (4 failures on macOS)Evtl. vergeben @mehdikarimi55 hat das vor 3 Tagen übernommen. Offentriage-can-wait
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
Parity tests fail under the documented direct pytest invocation when the ambient python3 lacks PyYAML (11 failures)Evtl. vergeben @mehdikarimi55 hat das vor 3 Tagen übernommen. Offentriage-must-have
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug triage-out-of-scope
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in github/spec-kit
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
glossyio/traffic-monitor#312 ·
Maintainer antworten meist innerhalb von 1 Tag
-
local devenv exampleOffendocumentation enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
es-ude/elastic-ai.creator#1046 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
feature request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
confident-ai/deepteam#306 ·
Maintainer antworten meist innerhalb von 1 Tag
-
SslLibrary crashes with unhandled OSError: port/proto not found on non-standard SSL portsEvtl. vergeben @himanchalkaushale hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
OWASP/Nettacker#1884 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag