fix(cli): enable cross-domain referencing for installed knowledges - #94
Closed
MajorLift wants to merge 1 commit into
Closed
fix(cli): enable cross-domain referencing for installed knowledges#94MajorLift wants to merge 1 commit into
MajorLift wants to merge 1 commit into
Conversation
Knowledge is copied per domain, so a skill could only ever cite its own domain's files. Four skills cite `testing-layers.md`, which lives in `testing`: `coding-guidelines`, `pr-guidelines`, `pr-readiness-check`, and `perps-review-pr`. Six citation sites in total, none of which could resolve for any consumer on any operator — the skill installed fine and the reference dangled. The installer now scans a skill for `knowledge/<file>.md` citations its own domain does not satisfy, and copies the file in from whichever domain owns it. Existing citations start working unchanged; no new syntax, and nothing declares a dependency in frontmatter, so the context an agent must load stays bounded. Both the base skill and the applicable repo overlay are scanned. The overlay is merged into the emitted body, and three of the four cases cite from an overlay rather than from `skill.md` — scanning only the base fixed one of four. Resolution is by filename, which is unambiguous today: ten knowledge files, no name shared across domains. If that stops being true the reference is genuinely ambiguous, so the install fails and names the candidates rather than picking one. Verified against the real corpus: 15/15 knowledge citations resolve after install, from 9/15. Both new tests fail against main's installer.
MajorLift
force-pushed
the
jongsun/fix/cross-domain-knowledge
branch
from
August 12, 2026 20:11
d81647f to
2d40e44
Compare
MajorLift
added a commit
that referenced
this pull request
Aug 20, 2026
Absorbs #94. Knowledge is copied per domain, so a skill citing another domain's file received nothing — four skills across coding, perps and pr-workflow cite testing-layers.md, which lives in testing. resolve_foreign_knowledge() delivers it. The corpus test and the installer fix belong together: the test names those four in KNOWN_UNRESOLVED, and leaving them in separate PRs meant whichever landed second had to reconcile a list the other branch could not see. Its rationale is corrected here rather than the list emptied, because the two are different properties. The corpus rule is a source-tree convention — cite your own domain's knowledge, so the citation reads without knowing the installer. Delivery is what the operator receives. After this commit all four resolve for an operator and still break the convention, and the old comment claimed they could never resolve for any consumer or operator — an impossibility claim falsified by the same change that carried it. Falsifiable: stubbing resolve_foreign_knowledge fails both cross-domain tests; restoring passes 21/21. Suite 74/74, lint 0 errors.
Contributor
Author
|
superseded by #87 |
MajorLift
added a commit
that referenced
this pull request
Aug 20, 2026
Absorbs #103. No file overlap with this branch and no conflict — the two were adjacent in theme rather than entangled, unlike #94, which shared test/cli.test.mjs and the same four citations. Brings three reference checks in the linter: bare lane ids cited without linking the catalog that defines them, [[snake_case]] wiki links from a private authoring vault, and `## Related` entries naming a skill that does not exist on the branch. Plus check-public-refs, which asserts every repository named in the corpus resolves anonymously, and skill-audit. Scope note for reviewers: the lane check has no corpus subject today. Zero matches across 166 skill markdown files here, and zero across 256 non-evidence files on #84's branch, because evidence-catalog.md — the only place [A-G]N vocabulary exists — lives on #84. It is fixture-tested and prospective; it fires the day a non-evidence skill cites a lane. Suite 84/84; lint 52 skills, 0 errors; check-public-refs 6/6 resolve. Falsifiable: stubbing LANE_ID fails 2 lint tests, restoring passes 33/33.
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.
Closes #88.
The defect
Knowledge is copied per domain, so a skill could only ever cite its own domain's files. Four skills cite
testing-layers.md, which lives indomains/testing/knowledge/:coding-guidelines(mobile overlay, ×3 sites)codingtestingpr-guidelines(mobile overlay)pr-workflowtestingpr-readiness-check(mobile overlay)pr-workflowtestingperps-review-prperpstestingSix citation sites, none of which could resolve for any consumer on any operator. The skill installed fine and the reference dangled — no error, the agent simply could not open what the body pointed at.
The fix
The installer scans a skill for
knowledge/<file>.mdcitations its own domain does not satisfy, and copies the file in from whichever domain owns it.Existing citations start working unchanged — no new syntax to learn, and nothing is declared in frontmatter, so the context an agent must load stays bounded. A cross-domain reference remains a body link the agent chooses to follow.
Overlays are scanned too. The repo overlay is merged into the emitted body, so a citation there is just as load-bearing — and three of the four cases cite from
repos/metamask-mobile.mdrather thanskill.md. Scanning only the base fixed one of four, which is how I found it.Ambiguity fails loudly. Resolution is by filename, which is unambiguous today — ten knowledge files, no name shared across domains. If that stops being true the reference is genuinely ambiguous, so the install exits non-zero and names the candidates rather than silently picking one.
Evidence
Real corpus, installing
coding,perps,pr-workflow,testingformetamask-mobile:Three tests, all failing against
main's installer and passing here:Notes
CHANGELOG.mdentry — this is install behavior, so say the word if you want one and which release it lands under.knowledge/citations and cross-skill references resolve #87, which guards thatknowledge/citations resolve after install. That guard is what makes this class visible; this closes the remaining cases it surfaced.