[Bug]: Preset-overridden skill hashes are not synchronized in integration manifest during integration upgrade
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
調査の方向性
The bug is in src/specify_cli/integrations/command_upgrade.py. Start by reading the _register_presets_for_agent function and how it interacts with new_manifest. Look at PresetManager.register_enabled_presets_for_agent to see how it writes skill files. After preset registration, you need to update new_manifest with the new file hashes for preset-overridden skills. Check how manifest.record_existing works. A test can be run by reproducing the steps in the bug description and verifying specify integration status reports OK after the fix.
索引モデルが issue の本文から書いたものです。
説明
Bug Description
When an enabled preset overrides a core command that is rendered as an agent skill (such as for codex in .agents/skills/<name>/SKILL.md), running specify integration upgrade <agent> --force succeeds, but the integration manifest .specify/integrations/<agent>.manifest.json retains the hash of the base/default template.
Because command_upgrade.py invokes new_manifest.save() before calling _register_presets_for_agent(), the preset's re-registration overwrites the skill file on disk with the preset content without updating the manifest.
As a result:
specify integration statusimmediately reports the skill file asmodifiedwith findingmanifest-file-modified.- Any subsequent
specify integration upgrade <agent>(without--force) is blocked bycheck_modified().
Steps to Reproduce
-
Initialize a new project with an agent integration that uses skills (e.g.,
codex):specify init --here --integration codex specify integration status # Status: OK (0 modified, 0 missing) -
Add a local preset that wraps or overrides a core command (e.g.
speckit.tasksorspeckit.specify):
Createtest-preset/preset.yml:schema_version: "1.0" preset: id: "test-task-preset" name: "Test Task Preset" version: "1.0.0" description: "Test preset overriding speckit.tasks" requires: speckit_version: ">=0.1.0" provides: templates: - type: "command" name: "speckit.tasks" file: "commands/speckit.tasks.md" strategy: "wrap"Install the preset:
specify preset add --dev ./test-preset -
Upgrade the integration with
--force:specify integration upgrade codex --forceOutput reports:
✓ Integration 'Codex' upgraded successfully. -
Check integration status:
specify integration status
Expected Behavior
specify integration upgrade codex --force should re-baseline or synchronize the hashes of skills written by active presets into .specify/integrations/codex.manifest.json.
After upgrade completes, specify integration status should report OK with 0 modified managed files.
Actual Behavior
specify integration status reports Modified managed files: 1 and status WARNING:
- Finding:
manifest-file-modified (codex): .agents/skills/speckit-tasks/SKILL.md was modified after installation.
Subsequent specify integration upgrade codex without --force fails with:
1 file(s) have been modified since installation... Use --force to overwrite modified files.
Specify CLI Version
1.0.10
AI Agent
Codex CLI
Operating System
macOS (Darwin arm64)
Python Version
Python 3.12
Error Logs
$ specify integration status
Integration status: WARNING
Default integration: codex
Installed integrations: codex
Multi-install safe: yes
Shared templates target alignment: none
Modified managed files: 1
Missing managed files: 0
Invalid manifest paths: 0
Unchecked manifests: 0
Findings:
- warning manifest-file-modified (codex): .agents/skills/speckit-tasks/SKILL.md was modified after installation.
Suggestion: Run `specify integration upgrade codex` or reinstall the integration.
Additional Context
Root Cause Analysis
In src/specify_cli/integrations/command_upgrade.py:
# Phase 1: Setup writes default skills and records their hashes
integration.setup(
project_root,
new_manifest,
...
)
...
# Manifest is saved to disk with base skill hashes
new_manifest.save()
_write_integration_json(project_root, installed_key, installed_keys, settings)
...
# Phase 2: Presets are re-registered AFTER manifest was saved!
if key == installed_key:
_register_extensions_for_agent(...)
_register_presets_for_agent(
project_root,
key,
continuing="The integration was upgraded, but installed presets may need re-registration.",
)
_register_presets_for_agent() calls PresetManager.register_enabled_presets_for_agent(agent_key).
This regenerates and writes the preset-overridden content to .agents/skills/<name>/SKILL.md (with frontmatter source: "preset:<preset_id>").
However, new_manifest is never updated with these newly written preset file hashes.
Suggested Fix Shape
After _register_presets_for_agent() completes, if any preset was registered, inspect skills tracked in both the preset registry and new_manifest. When a skill file on disk has matching provenance (e.g. source == f"preset:{preset_id}"), update new_manifest.record_existing(relative) and save new_manifest.
This ensures that legitimate preset overrides are recognized as the clean baseline, while preserving tamper detection for manual edits.
AI Disclosure
AI assistance (Antigravity) supervised by human maintainer was used to trace the execution path in command_upgrade.py and draft this bug report. All code paths and CLI behaviors were verified against a clean reproduction environment.
- 主要言語
- Python
- スター
- 138k
- フォーク
- 12.4k
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 169
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/spec-kit のほかの issue
-
enhancement needs-triage triage-can-wait
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
preset-submission triage-must-have validation-passed
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
extension-submission triage-must-have validation-passed
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
extension-submission triage-can-wait validation-passed
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
enhancement needs-triage triage-can-wait
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/spec-kit の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
instance instance add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
searxng/searx-instances#939 · コメント 1 件 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100