Skip to content

fix(cli): enable cross-domain referencing for installed knowledges - #94

Closed
MajorLift wants to merge 1 commit into
mainfrom
jongsun/fix/cross-domain-knowledge
Closed

fix(cli): enable cross-domain referencing for installed knowledges#94
MajorLift wants to merge 1 commit into
mainfrom
jongsun/fix/cross-domain-knowledge

Conversation

@MajorLift

Copy link
Copy Markdown
Contributor

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 in domains/testing/knowledge/:

Skill Its domain Cites from
coding-guidelines (mobile overlay, ×3 sites) coding testing
pr-guidelines (mobile overlay) pr-workflow testing
pr-readiness-check (mobile overlay) pr-workflow testing
perps-review-pr perps testing

Six 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>.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 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.md rather than skill.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,testing for metamask-mobile:

before   9/15 knowledge citations resolve
after   15/15

Three tests, all failing against main's installer and passing here:

main    ℹ pass 12   ℹ fail 2
branch  ℹ pass 14   ℹ fail 0
  • a skill receives knowledge it cites from another domain, on all three operator outputs
  • the owning domain still gets its own knowledge
  • an ambiguous filename fails rather than picking one

Notes

@MajorLift MajorLift changed the title fix(cli): deliver knowledge a skill cites from another domain fix(cli): enable cross-domain knowledge references Jul 30, 2026
@MajorLift MajorLift changed the title fix(cli): enable cross-domain knowledge references fix(cli): enable cross-domain referencing for installed knowledges Jul 30, 2026
@MajorLift
MajorLift requested a review from abretonc7s August 3, 2026 10:12
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
MajorLift force-pushed the jongsun/fix/cross-domain-knowledge branch from d81647f to 2d40e44 Compare August 12, 2026 20:11
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.
@MajorLift

Copy link
Copy Markdown
Contributor Author

superseded by #87

@MajorLift MajorLift closed this Aug 20, 2026
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.
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.

Skills cite knowledge files their domain does not ship (cross-domain knowledge is unsupported)

1 participant