Skip to content

chore(layering): drop unused agent-knowledge peerDep + correct the layering diagram#383

Merged
drewstone merged 1 commit into
mainfrom
chore/drop-agent-knowledge-peerdep
Jun 24, 2026
Merged

chore(layering): drop unused agent-knowledge peerDep + correct the layering diagram#383
drewstone merged 1 commit into
mainfrom
chore/drop-agent-knowledge-peerdep

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

Makes agent-runtime's layering truly one-way.

  • Remove the unused @tangle-network/agent-knowledge peerDependency (and its peerDependenciesMeta entry) from package.json, plus the matching pnpm-lock.yaml entries.
  • Correct the CLAUDE.md repo-layering diagram to the real dependency shape.

Why

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 }) (see src/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.ts imports @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)

Gate Result
CI=true pnpm install --frozen-lockfile exit 0, lockfile up to date
pnpm run build exit 0
pnpm run typecheck exit 0 (src + examples)
pnpm run lint exit 0 (339 files, no fixes)
pnpm test 117 files, 1131 passed / 2 skipped
pnpm run docs:check 0 errors; freshness OK — 3 substrate peers present + accurate

Removing an unused peerDep breaks nothing; the lockfile delta only drops the agent-knowledge resolution.

…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 tangletools 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.

✅ 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

@drewstone drewstone merged commit 85f23c0 into main Jun 24, 2026
1 check failed
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.

2 participants