Skip to content

fix: resolve sibling skill links for instructions, prompts, and commands (#5531) - #5539

Merged
Daniel Meppiel (danielmeppiel) merged 6 commits into
microsoft:mainfrom
Yshuro:fix/5531-sibling-skill-links
Dec 2, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 6 commits into
microsoft:mainfrom
Yshuro:fix/5531-sibling-skill-links

Conversation

@Yshuro

Copy link
Copy Markdown
Contributor

Closes #5531

  • Pass \ arget, \source_plan, \skill_pairing, \skill_targets, and \skip_bin\ to \BaseIntegrator.init_link_resolver\ from \InstructionIntegrator, \PromptIntegrator, and \CommandIntegrator\ (matching \AgentIntegrator), and thread \skip_bin\ from \install/services.py\ into \planned_skill_files.
  • Add unit regression tests in \ ests/unit/integration/test_sibling_skill_links.py\ covering instructions, prompts, commands, and \skip_bin.
  • Add changelog fragment \changelog.d/5531.bugfix.md.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved link-rewriting defects remain, and the invalid changelog fragment and missing test metadata block release assembly and the taxonomy check.

4 open issues
What changed in this PR

This PR addresses #5531 by extending the sibling-skill link resolution used by agents to instructions, prompts, and commands, so they can reference deployed skills instead of gitignored package sources.

Changes:

  • Passes target, skill-selection, and deployment context into primitive link resolvers.
  • Threads skip_bin through link planning to reflect executable deployment decisions.
  • Adds regression tests for selected and excluded skills, executable filtering, and a changelog fragment.
File Description
tests/​unit/​integration/​test_sibling_skill_links.py Adds sibling-skill link and skip_bin regression cases.
src/​apm_cli/​integration/​skill_preflight.py Applies the supplied skip_bin decision when projecting deployed files.
src/​apm_cli/​integration/​prompt_integrator.py Forwards skill deployment context to prompt link resolution.
src/​apm_cli/​integration/​instruction_integrator.py Initializes instruction link resolution with target and skill context.
src/​apm_cli/​integration/​command_integrator.py Initializes command link resolution with target and skill context.
src/​apm_cli/​integration/​base_integrator.py Forwards skip_bin to the shared skill-file projection.
src/​apm_cli/​integration/​agent_integrator.py Adds executable filtering context to agent link resolution.
src/​apm_cli/​install/​services.py Supplies skill-selection and executable context to all four primitive integrators.
changelog.d/​5531.bugfix.md Adds a release-note fragment describing the link-resolution change.

Review effort: Balanced

Comment thread changelog.d/5531.bugfix.md Resolved
Sami (Yshuro) and others added 3 commits November 27, 2026 11:49
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…esolver entry

- drop the bin/ link threading (skip_bin): out of scope for microsoft#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 microsoft#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>
@danielmeppiel

Copy link
Copy Markdown
Collaborator

Thanks Sami (@Yshuro) for this fix, and for the Gemini command link rendering, which we kept.

I pushed one commit on top of your two (your history is unchanged) to fit the approved scope for #5531:

  • bin/ links are dropped for now. The [BUG] Instruction, prompt and command links to sibling deployed skills still rewrite to gitignored apm_modules/ #5531 scope record covers links from instructions, prompts and commands to a sibling deployed in the same harness folder. Threading skip_bin into the planned skill map touches the executables trust gate, which needs its own review, so the map keeps excluding bin/ as before. If you'd like to pick that up, we're happy to take it as a follow-up issue.
  • The agent, instruction, prompt and command integrators now share one helper, BaseIntegrator.init_target_link_resolver, which removes a duplicated block flagged by the R0801 lint.
  • Lifecycle cells cover instructions, prompts and commands: a fresh clone without apm_modules/, a non-deployed file, a sibling deployed only for another harness, and reinstall plus apm audit --ci. The commit also updates the docs and adds a bug-ledger row.

Your skip_bin unit test was removed with the scope change; the other unit tests are kept.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The cache can reuse destinations from a different target layout, while missing rendering inputs in overwrite preflight can falsely block reinstalls that should preserve user edits.

2 open issues
4 resolved since last review

Review effort: Balanced

Comment on lines +542 to 544
if _prim_name in ("agents", "instructions", "prompts", "commands"):
_call_kwargs["skill_pairing"] = skill_pairing
_call_kwargs["skill_targets"] = projection_targets
Comment on lines +99 to +104
key = (
target.name,
str(project_root),
skill_pairing,
tuple(profile.name for profile in skill_targets or ()),
)
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 62329d6 into microsoft:main Dec 2, 2026
57 checks passed
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 2, 2026
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
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 2, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 2, 2026
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Instruction, prompt and command links to sibling deployed skills still rewrite to gitignored apm_modules/

3 participants