spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

fix: register extensions for the active integration only

Open marcelsafin opened this issue 4 months ago • 16 comments

Fixes #2948

Root cause

Extension and preset registration paths wrote artifacts for every detected integration, even though projects have one active integration. In multi-integration projects, inactive agents accumulated commands or skills they had not selected, and preset skill tracking lacked per-agent provenance for reliable switching/removal.

Maintainer direction in #2948: treat the project as single-active. Add/install operations register for the active integration only; integration use / switch and active upgrades are the activation and rescaffold points.

Changes

  • extension add and enabled-preset registration restrict command output to the active integration while preserving existing detection and missing-directory safeguards.
  • integration use / switch and active integration upgrade rescaffold enabled artifacts for the active integration, then reconcile compositions and project overrides.
  • Command-backed integrations using skills mode produce only skill artifacts; same-agent command/skills toggles remove stale opposite-mode extension and preset artifacts.
  • Preset registered_skills tracking now uses {agent_name: [skill_name, ...]}. Legacy flat lists migrate by inferring existing preset-owned skills from on-disk source: preset:<id> metadata before fallback attribution, so removal restores every directory a preset wrote to.
  • integration upgrade leaves non-active integrations untouched, removing the previous back-fill behavior.

Before / after

Action Before After
extension add git with claude active and codex installed registers both registers claude only
add/restore an enabled preset writes detected inactive integrations too writes the active integration only
integration use codex rescaffolds extensions only rescaffolds extensions and enabled presets
toggle active Copilot between command and skills mode can leave both artifact types removes stale opposite-mode extension and preset artifacts
integration upgrade codex while inactive back-fills artifacts leaves inactive integration untouched

Tests

Regression coverage includes active-only extension/preset registration, use/switch/active-upgrade rescaffolding, project-override reconciliation after partial failures, command/skills mode toggles, symlink guards, and provenance-safe legacy registered_skills migration.

AI assistance

GitHub Copilot was used for implementation, tests, and review-feedback analysis. Agent-authored review-round comments and commits are disclosed separately per repository policy.

marcelsafin avatar Jul 10 '26 18:07 marcelsafin

Addressed the remaining review findings in 5b0e559 and b9d9053: preset command tracking is persisted before fallible skill registration, and same-agent command/skills mode toggles now remove stale opposite-mode artifacts and tracking. Full suite: 3937 passed, 109 skipped. Posted on behalf of @marcelsafin by GitHub Copilot (model: GPT-5.6 Sol). @copilot review

marcelsafin avatar Jul 11 '26 00:07 marcelsafin

Fixed legacy registered_skills migration in 3a1e749 and updated the PR description to disclose preset active-only registration, use/switch rescaffolding, mode toggles, and per-agent provenance. Full suite: 3938 passed, 109 skipped. Posted on behalf of @marcelsafin by GitHub Copilot (model: GPT-5.6 Sol). @copilot review

marcelsafin avatar Jul 11 '26 06:07 marcelsafin

Fixed the latest review findings in 1bdb5b3 and ee03a50: reconciliation survives a fallible skills phase, legacy preset skill provenance is inferred across native and command-backed skills agents, and active extension mode toggles remove stale opposite-mode artifacts. Full suite: 3944 passed, 109 skipped. Posted on behalf of @marcelsafin by GitHub Copilot (model: GPT-5.6 Sol). @copilot review

marcelsafin avatar Jul 11 '26 07:07 marcelsafin

Fixed the latest extension-skill tracking and path-safety findings in 37cceb7 and 28561e6: global tracking now preserves mirrors across agent directories, and every extension skill probe/delete path rejects symlinked candidate roots before touching files. Full suite: 3948 passed, 109 skipped. Posted on behalf of @marcelsafin by GitHub Copilot (model: GPT-5.6 Sol). @copilot review

marcelsafin avatar Jul 11 '26 08:07 marcelsafin

Addressed the 2 latest findings plus follow-up cross-agent tracking regressions in 1d8f9e3, 0ab9a5f, and 31c9b97: full removal scans all safe mirrors, direct legacy preset removal infers provenance, and agent-scoped cleanup preserves other agents’ files and global tracking. Full suite: 3952 passed, 109 skipped; changed files pass ruff. Posted on behalf of @marcelsafin by GitHub Copilot (model: GPT-5.6 Sol). @copilot review

marcelsafin avatar Jul 11 '26 09:07 marcelsafin

Addressed all 3 latest findings in ab6c28c: preset removal now reconciles the surviving stack across every historical command/skill directory it touched, while per-skill child symlinks are rejected before ownership checks or deletion. Full suite: 3957 passed, 109 skipped; changed files pass ruff. Posted on behalf of @marcelsafin by GitHub Copilot (model: GPT-5.6 Sol). @copilot review

marcelsafin avatar Jul 11 '26 11:07 marcelsafin

Addressed all 5 latest findings in f19225a: historical reconciliation now persists the winning preset’s command/skill provenance, command-to-skills toggles retain the old artifact until replacement succeeds, and registry-provided skill names are validated before path use. Full suite: 3964 passed, 109 skipped; changed files pass ruff. Posted on behalf of @marcelsafin by GitHub Copilot (model: GPT-5.6 Sol). @copilot review

marcelsafin avatar Jul 11 '26 12:07 marcelsafin

Addressed all 4 latest findings in d0d152e: destructive command/skills toggle cleanup is now gated per artifact on the replacement actually returned by registration, preserving unreplaced files and tracking during empty or partial results in both presets and extensions. Full suite: 3972 passed, 109 skipped; changed files pass ruff. Posted on behalf of @marcelsafin by GitHub Copilot (model: GPT-5.6 Sol). @copilot review

marcelsafin avatar Jul 11 '26 13:07 marcelsafin

@copilot review

marcelsafin avatar Jul 11 '26 14:07 marcelsafin

@copilot review

marcelsafin avatar Jul 11 '26 15:07 marcelsafin

@copilot review

marcelsafin avatar Jul 11 '26 15:07 marcelsafin

@copilot review

marcelsafin avatar Jul 11 '26 15:07 marcelsafin

@copilot review @codex review

marcelsafin avatar Jul 11 '26 16:07 marcelsafin

@copilot review @codex review

marcelsafin avatar Jul 11 '26 16:07 marcelsafin

@copilot review

marcelsafin avatar Jul 11 '26 16:07 marcelsafin

@copilot review

marcelsafin avatar Jul 13 '26 22:07 marcelsafin

Please address Copilot feedback

mnriem avatar Jul 14 '26 12:07 mnriem

@copilot review

marcelsafin avatar Jul 14 '26 13:07 marcelsafin

@copilot review

marcelsafin avatar Jul 14 '26 13:07 marcelsafin

@copilot review

marcelsafin avatar Jul 14 '26 14:07 marcelsafin