Repository navigation
fix: link sibling skills from skills to the deployed copy (#5733) - #5741
Merged
Daniel Meppiel (danielmeppiel) merged 20 commits intoDec 2, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 20 commits into
Daniel Meppiel (danielmeppiel) merged 20 commits into
Conversation
…nds (#5531) Signed-off-by: Yshuro <yshuro1080@gmail.com>
Signed-off-by: Yshuro <yshuro1080@gmail.com>
Red-first cells for #5733 and #5531: skills, instructions, prompts and commands that link to a sibling skill deployed into the same harness folder must link the deployed copy (fragment kept) and survive a fresh clone; non-deployed files and siblings deployed only to another folder keep the apm_modules link. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Skills, instructions, prompts and commands now get the deployed-file map agents got in #5529: a link to a file this install deploys into the same harness skills folder names the deployed copy, fragment kept; other in-package links keep the apm_modules link. - instruction, prompt and command integrators pass target, source plan, pairing and skill targets to init_link_resolver (rule preflight too) - skill promotion builds the map once per distinct skills root - skill collision preflight renders with the same per-root map, so identical files are adopted, not refused - the earlier-version projection re-roots the map, so a ref bump on a fresh clone still adopts committed output Closes #5733, closes #5531. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
apm-spec-waiver: deployed-copy link rendering is not normed by any OpenAPM v0.1 requirement Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Link-rendering mismatches for renamed assets and legacy output can cause installs or updates to reject untouched, lock-claimed skills when deployment receipts are absent.
2 open issues
What changed in this PR
Extends deployed sibling-skill links from agents to skills, instructions, prompts, and commands, addressing #5531 and #5733 so committed output works without apm_modules/.
Changes:
- Threads target selection through shared link rendering.
- Aligns skill preflight and locked-source replay with deployed links.
- Adds lifecycle coverage, documentation, and a changelog entry.
| File | Description |
|---|---|
| tests/integration/test_sibling_skill_agent_link_lifecycle.py | Covers primitive links, pairing, and fresh clones. |
| tests/integration/test_lock_derived_expected_state_lifecycle.py | Updates ref-bump link expectations. |
| tests/integration/test_architecture_owner_rule_mutations.py | Adjusts the skills-root mutation. |
| tests/fixtures/lifecycle_bug_ledger/bugs/5733.json | Records skill-link regression coverage. |
| tests/fixtures/lifecycle_bug_ledger/bugs/5531.json | Records other primitive-link coverage. |
| src/apm_cli/integration/skill_preflight.py | Uses per-folder link maps for comparisons. |
| src/apm_cli/integration/skill_integrator.py | Shares distinct-root promotion setup. |
| src/apm_cli/integration/prompt_integrator.py | Passes skill selection into prompt rendering. |
| src/apm_cli/integration/instruction_integrator.py | Configures target-aware instruction rendering. |
| src/apm_cli/integration/command_integrator.py | Configures target-aware command rendering. |
| src/apm_cli/integration/base_integrator.py | Re-roots link maps for locked-source replay. |
| src/apm_cli/install/template.py | Passes pairing into skill preflight. |
| src/apm_cli/install/services.py | Threads pairing through primitive dispatch. |
| docs/src/content/docs/producer/write-primitives.md | Documents deployed-copy links and fallback. |
| changelog.d/5741.fixed.md | Announces the sibling-link fix. |
Review effort: Balanced
An unreceipted skill tree in the pre-fix apm_modules link form is adopted and re-rendered; a user-edited link, a mixed-form tree and an unclaimed identical tree are refused and kept. audit --ci and install --frozen agree before and after. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- BaseIntegrator.init_target_link_resolver is the one entry the target-driven integrators share (removes the duplicated preamble) - adoption of an unreceipted, claimed skill tree also accepts the exact bytes of the pre-fix rendering (sibling links through apm_modules), one rendering per tree, ownership still required; anything else is refused as before - re-render the repository's own .agents/skills/docs-sync/SKILL.md - the cold-restore fixture keeps its sibling link and adds a link that is still rewritten - changelog: run apm install once after upgrading apm-spec-waiver: deployed-copy link rendering is not normed by any OpenAPM v0.1 requirement Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ntry - drop the bin/ link threading (skip_bin): out of scope for #5531; the planned skill map keeps excluding bin/ as before - BaseIntegrator.init_target_link_resolver is the one entry the agent, instruction, prompt and command integrators use (no duplicated preamble) - lifecycle cells for instructions, prompts and commands: fresh-clone oracle, a non-deployed file and an other-harness sibling keep the apm_modules link, reinstall and audit --ci converge - docs: links from every primitive name the deployed sibling copy - lifecycle bug-ledger row for #5531 apm-spec-waiver: deployed-copy link rendering is not normed by any OpenAPM v0.1 requirement Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> # Conflicts: # docs/src/content/docs/producer/write-primitives.md # src/apm_cli/install/services.py # src/apm_cli/integration/base_integrator.py # src/apm_cli/integration/instruction_integrator.py # tests/fixtures/lifecycle_bug_ledger/bugs/5531.json # tests/integration/test_sibling_skill_agent_link_lifecycle.py
Every primitive of a package asks for the same target's deployed-skill map; memoising it per live source plan (cleared when the plan is collected) walks the skill trees once per target, as agents alone did before, instead of once per primitive. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The memoised deployed-skill map is returned as a read-only mapping and keyed by the package install path too. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> # Conflicts: # docs/src/content/docs/producer/write-primitives.md # src/apm_cli/integration/base_integrator.py # src/apm_cli/integration/skill_preflight.py # tests/integration/test_sibling_skill_agent_link_lifecycle.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The projection uses the current file inventory, so a ref bump that renames or removes a linked sibling can produce an incorrect link and reject an unchanged fresh clone without receipts.
2 open issues
1 resolved since last review
Review effort: Balanced
- projected_resolve_links(deployed_links=True) renders the locked source with the deployed-sibling map of the locked plan (LockedSkillSources), using the link scope init_link_resolver records; no locked plan means no projection, so adoption keeps refusing. A ref bump that renames the linked sibling no longer refuses committed output on a fresh clone. - collision preflight caches each skills folder's resolver with its scope - cells: ref bump renaming a linked sibling (red-first); ref-bump mixed-form, unclaimed and unpinned trees refuse and keep their bytes - mixed-case lifecycle: every primitive links the deployed skill; a non-deployed file keeps the mixed-case apm_modules link for the stale-casing repair path (#5539 change; Integration never ran on it) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-pgm-engineer-sibling-links
branch
December 2, 2026 13:53
Merged
5 of 10 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes #5733; follows #5539.
#5539 (for #5531) made agents, instructions, prompts and commands link a sibling skill to its deployed copy. This PR does the same for skills: a Markdown link inside a skill that targets a file the same install deploys into the same harness skills folder now points at the deployed copy, and the
#fragmentis kept. Any other in-package link keeps theapm_modules/link (the #1160 fallback). Before, committed.agents/skills/linked into gitignoredapm_modules/and broke on a fresh clone.SkillIntegrator._distinct_skill_rootsbuilds the deployed-skill map once per distinct skills folder in both promotion paths, using the effective pairing and the full skill target list. It replaces the two copies of the per-root loop.skill_preflight.find_unmanaged_conflictsrenders each destination with the same per-folder map (one resolver per folder), so identical files are adopted instead of refused as false collisions.projected_resolve_links(deployed_links=True, source_plan=locked)renders the locked source with the locked plan's own deployed-sibling map, using the link scope (target, pairing, skill targets) thatinit_link_resolverrecords. A ref bump on a fresh clone therefore adopts committed output in the new link form, also when the new version renames or drops the linked sibling file. Collision preflight caches each folder's resolver together with its scope.apm_modules/, fromBaseIntegrator.legacy_resolve_links). One rendering per tree; the ownership check is unchanged. The second render runs only after the receipt short-circuit and an empty first compare. An edited link, a mixed-form tree or an unclaimed tree is refused as before.planned_skill_files(fix: resolve sibling skill links for instructions, prompts, and commands (#5531) #5539) is now returned as a read-onlyMappingProxyTypeand also keyed by the package install path.test_mixed_case_materialization_lifecycle(Integration, never run on the fork PR) now accepts the deployed skill copy for every primitive, and adds a non-deployed link so a mixed-caseapm_modules/link still carries the stale-casing step..agents/skills/docs-sync/SKILL.mdis re-rendered (two lockfile hash lines), andtest_governance_consumersnow checks it against the deployed-sibling rendering, still byte-exact.Upgrade note:
apm auditreports committed pre-fix sibling links as drift until the nextapm installre-renders them (regent ruling: no audit tolerance).Out of scope:
bin/links; compile-time AGENTS.md links.Issue and approved scope
Issue: Fixes #5733
Human scope-approval comment: #5733 (comment) (
scripts/governance/eligibility.cjs: record-present, review contact danielmeppiel).This PR completes #5733. #5531 was completed by #5539.
Type of change
Testing
Perf (security co-owns perf; macOS, measure mode, main vs head): fs.stat_calls is at or below main on every install journey, for example install-g-50-skills 9145 -> 9142 and install-cold 12455 -> 12452.
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)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.
apm-spec-waiver: deployed-copy link rendering is not normed by any OpenAPM v0.1 requirement
Agent assessment