chore(layering): drop unused agent-knowledge peerDep + correct the layering diagram#383
Merged
Merged
Conversation
…yering diagram
agent-runtime's src imports @tangle-network/agent-knowledge zero times — it
deliberately avoids it to prevent a dependency cycle; domain stores/tools enter
by injection via createMcpServer({ feedbackStore }) (src/mcp/feedback-store.ts).
The declared peerDependency (and its peerDependenciesMeta entry) was therefore
unused. The real, correct direction is agent-knowledge -> agent-runtime
(agent-knowledge/src/profiles/researcher.ts imports @tangle-network/agent-runtime/loops).
- Remove @tangle-network/agent-knowledge from peerDependencies + peerDependenciesMeta
- Update pnpm-lock.yaml to match
- Correct the CLAUDE.md repo-layering diagram to the true shape and add the
'runtime takes domain stores/tools as injected adapters' rule
tangletools
approved these changes
Jun 24, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved PR — 4e71ed4e
Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-24T20:25:27Z
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.
What
Makes agent-runtime's layering truly one-way.
@tangle-network/agent-knowledgepeerDependency (and itspeerDependenciesMetaentry) frompackage.json, plus the matchingpnpm-lock.yamlentries.Why
agent-runtime's
srcimports@tangle-network/agent-knowledgezero times — it deliberately avoids it to prevent a dependency cycle. Domain stores/tools enter by injection viacreateMcpServer({ feedbackStore })(seesrc/mcp/feedback-store.ts: "The substrate cannot import @tangle-network/agent-knowledge … consumers wire their own adapter").The declared peerDep had nothing importing it. The real, correct direction is agent-knowledge → agent-runtime:
agent-knowledge/src/profiles/researcher.tsimports@tangle-network/agent-runtime/loops.The old diagram drew the two packages as siblings both sitting on agent-eval, which is wrong — agent-knowledge sits above agent-runtime. Corrected, and added the rule: the runtime stays domain-clean by taking domain stores/tools as injected adapters, never importing a domain package. The existing "agent-eval MUST NOT import from agent-runtime" rule is left intact.
Verification (all green)
CI=true pnpm install --frozen-lockfilepnpm run buildpnpm run typecheckpnpm run lintpnpm testpnpm run docs:checkRemoving an unused peerDep breaks nothing; the lockfile delta only drops the agent-knowledge resolution.