You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[0.38] fix(install): first upgrade adopts a migrated skill dir for a target sharing it (#4813) - #4868
The first upgraded apm install -g (from 0.37) skipped an edited user-root skill when the run switched between targets that share a skills directory. Copilot and Codex both deploy to ~/.agents/skills. #4684 adopts lockless 0.37 user-root receipts, but skill_dir_entry resolved the skill directory entry only for targets selected in the current run. A Copilot receipt therefore adopted its member file but not its directory under install -g --target codex, and the directory collision gate skipped the edited skill.
Fix at the owner, src/apm_cli/install/deployed_paths.pyskill_dir_entry (called by DeploymentMaterializationSession.adopt_root_receipts):
The receipt's own target is resolved at user scope even when it is not selected (KNOWN_TARGETS[name].for_scope(user_scope=True)).
Its directory is adopted only for a selected target whose skills destination resolves to the same root, and the entry is attributed to that selected target.
A target with a different skills root (Claude, ~/.claude/skills) adopts nothing, and non-skill receipts are unchanged. core/deployment_ledger.py is untouched.
Human scope-approval comment: the accepted record on #4813 (status/accepted, milestone 0.38.0).
This PR completes the issue.
Type of change
Bug fix
New feature
Documentation
Maintenance / refactor
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
Local pytest is suspended for this team (rule 17); the evidence is PR CI and ci-integration. Failing-before is shown by reasoning: before this change skill_dir_entry returned no entry when Copilot was not selected. The directory gate then skipped the skill, so the regression's "no skipped", "Version two" and lock-entry assertions all fail. A direct call to the new helper returns ('.agents/skills/research',) for Copilot to Codex, and () for Copilot to Claude and for a non-skill member.
promise: P-INV-I1/I2 -- a first upgraded install -g updates an APM-owned user-root skill and records it, whichever target sharing its directory is selected (source: #4813 record)
cell: OP=install SRC=root-local PRIM=skill SCOPE=user LOCK=absent(0.37 receipt) TGT=copilot->codex owner: install/deployed_paths.py skill_dir_entry
instrument: today test -> tests/integration/test_user_root_primitives_lockfile_lifecycle.py::test_first_upgrade_switching_to_a_target_sharing_the_skills_dir_updates_it (extends the #3772 module)
oracles: [no skip line, deployed SKILL.md holds the edited source, user lock records .agents/skills/research]
ledger: tests/fixtures/lifecycle_bug_ledger/bugs/4813.json
Lint mirror clean locally: ruff check/format (0.15.12), pylint R0801, lint-auth-signals, complexity ratchet, assertion-quality ratchet, tm006, architecture boundaries, lifecycle generator --check, Mode B (19 lines, under the threshold).
Changelog
One fragment per section, changelog.d/<pr>.<section>.md, holding
one line: user-visible effect first, 25 words or fewer, ending with (#PR); breaking changes only under upgrade notes; no Highlights; no
new lines under ## [Unreleased]. See changelog.d/README.md and .github/instructions/changelog.instructions.md.
…tination (#4813)
skill_dir_entry resolved a 0.37 receipt's skill directory only for targets
selected this run, so a first install -g --target codex over a Copilot
receipt (both ~/.agents/skills) adopted the member but not its directory
and skipped the edited skill. The receipt's target is now resolved at user
scope even when unselected, and its directory is adopted, attributed to the
selected target, only when that target deploys skills to the same place.
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
An uncaught PathTraversalError from a lockless Copilot receipt with a relative COPILOT_HOME can abort an otherwise valid Codex install even though Copilot is not selected.
This PR extends the user-root receipt migration from #4684 to address #4813: the first upgrade from 0.37 should update an edited skill when switching between targets that share its deployment directory.
Changes:
Resolve the receipt’s original target and adopt its skill directory for a selected target sharing that destination.
Add a Copilot-to-Codex lifecycle regression checking updated content, no skips, and lockfile ownership.
Record the regression in the lifecycle bug ledger.
…pting a skill dir (#4813)
A relative COPILOT_HOME made skill_dir_entry raise PathTraversalError
while resolving the unselected Copilot receipt target, aborting an
otherwise valid install -g --target codex. Resolve it through
scoped_profile_or_none so an inactive, unresolvable profile adopts
nothing.
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The new tests leave cross-target receipt rejection and non-skill-member no-adoption behavior unprotected, allowing a destination-equality regression to pass unnoticed.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Add cross-root receipt and non-skill-member controls
The new tests do not exercise a valid receipt whose skills root differs from the selected target's root. Removing the destination-equality check would still pass them while allowing a Copilot receipt to claim a directory under Claude's skills root. Add a Copilot-to-Claude control asserting (), plus a non-skill-member control to protect the helper's no-adoption cases.
…ill receipts (#4813)
A Copilot receipt adopts nothing under another target's skills root,
outside any skills root, or at a skills-root file; a mutation that
drops the destination-equality check now fails.
apm-spec-waiver: bug fix restoring user-root skill receipt migration; no new OpenAPM behaviour
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The first upgraded
apm install -g(from 0.37) skipped an edited user-root skill when the run switched between targets that share a skills directory. Copilot and Codex both deploy to~/.agents/skills. #4684 adopts lockless 0.37 user-root receipts, butskill_dir_entryresolved the skill directory entry only for targets selected in the current run. A Copilot receipt therefore adopted its member file but not its directory underinstall -g --target codex, and the directory collision gate skipped the edited skill.Fix at the owner,
src/apm_cli/install/deployed_paths.pyskill_dir_entry(called byDeploymentMaterializationSession.adopt_root_receipts):KNOWN_TARGETS[name].for_scope(user_scope=True)).~/.claude/skills) adopts nothing, and non-skill receipts are unchanged.core/deployment_ledger.pyis untouched.Issue and approved scope
Issue: Fixes #4813
Human scope-approval comment: the accepted record on #4813 (status/accepted, milestone 0.38.0).
This PR completes the issue.
Type of change
Testing
Local pytest is suspended for this team (rule 17); the evidence is PR CI and ci-integration. Failing-before is shown by reasoning: before this change
skill_dir_entryreturned no entry when Copilot was not selected. The directory gate then skipped the skill, so the regression's "no skipped", "Version two" and lock-entry assertions all fail. A direct call to the new helper returns('.agents/skills/research',)for Copilot to Codex, and()for Copilot to Claude and for a non-skill member.Lint mirror clean locally: ruff check/format (0.15.12), pylint R0801, lint-auth-signals, complexity ratchet, assertion-quality ratchet, tm006, architecture boundaries, lifecycle generator
--check, Mode B (19 lines, under the threshold).Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regeneratedapm-spec-waiver: bug fix restoring user-root skill receipt migration; no new OpenAPM behaviour