Skip to content

feat(prime): finish AgentProfile coverage — wire verified dimensions, reject the rest loudly - #123

Merged
drewstone merged 1 commit into
mainfrom
feat/prime-dimensions
Aug 6, 2026
Merged

feat(prime): finish AgentProfile coverage — wire verified dimensions, reject the rest loudly#123
drewstone merged 1 commit into
mainfrom
feat/prime-dimensions

Conversation

@drewstone

Copy link
Copy Markdown
Owner

What

Completes AgentProfile coverage in the prime backend on agent-interface 0.45.0.

Wired, each with fork file:line proof (pinned clone v0.7.0 be9e2fa0):

  • harness: "prime" accepted (explicit tests both ways — "pi" still refuses).
  • prompt.instructions + resources.instructions → agent-dir AGENTS.md — the fork loads a global context file from the agent dir on both the default and --system-prompt prompt paths (resource-loader.ts, system-prompt.ts); no caller-workspace writes.
  • resources.skills (inline) → agent-dir skills/<name>/SKILL.md, auto-discovered and prompt-injected; name rules mirrored as bridge validation; description-required satisfied via normalizeSkillMd.
  • subagents (description/prompt/metadata) → global continual-harness store entries; shape satisfies both the host reader and the kernel's Python reader.
  • Pre-existing from feat(backends): add prime-agent as a first-class backend #122: model/provider/reasoningEffort, prompt replace/append.

Rejected loudly with evidence: mcp (settings.json mcpServers never becomes model-visible in the fork), permissions/tools/hooks, subagent model/tools/permissions/maxSteps.

Proof

  • tests/prime-backend.test.ts: 40 passed | 1 skipped (gated real-binary smoke).
  • Full suite: 707 passed | 11 failed — all 11 verified pre-existing (prompt-intent.test.ts, the PR feat(backends): honor replace-vs-append prompt intent, or refuse it loudly #120 appendSystemPrompt gap; upstream fix belongs in agent-profile-materialize, which lacks the field through published 0.10.3). tsc: exactly the 6 pre-existing errors, none in prime files.
  • Independent verifier: clean; it additionally scratch-tested the subagent tools/permissions rejections (throw correctly; suite coverage noted as a nit).
  • git merge-tree clean into main.

Upstream debt (named, not smuggled)

agent-profile-materialize needs a prime HarnessId and appendSystemPrompt on WorkspacePlan/Receipt — both belong in agent-sdk; the prime dimension wiring here folds into the shared materializer when that lands.

… reject the rest loudly

Bump @tangle-network/agent-interface to 0.45.0, whose harness enum now
carries 'prime'; a profile pinned to harness 'prime' runs and any other
pin still refuses.

Wire the three dimensions the pinned fork clone (v0.7.0, be9e2fa0)
verifiably loads from the per-run agent dir in --mode rpc:

- prompt.instructions + resources.instructions -> <agentDir>/AGENTS.md
  (global context file, core/resource-loader.ts:58-90, injected on both
  prompt paths, core/system-prompt.ts:76-82/150-156)
- inline resources.skills -> <agentDir>/skills/<name>/SKILL.md
  (auto-discovered, core/package-manager.ts:2171/2240-2246; frontmatter
  normalized because a description-less SKILL.md is silently dropped,
  core/skills.ts:415-417)
- subagents -> merge-seeded global entries in
  <agentDir>/harness/harness_state.json (loaded on every system-prompt
  build, core/refinement/refinement.ts:269-283 +
  core/agent-session.ts:4288; kernel reads the same file,
  rlm/harness.py:77-90), tagged source=cli-bridge-profile so
  re-provisioning replaces exactly its own entries and the agent's
  self-created state survives

A bridge-owned manifest prunes stale bridge-written files on session
re-provision, with a path guard so a tampered manifest cannot delete
outside the agent dir. A corrupt harness_state.json refuses the run
instead of resetting agent self-modification state. Persistent
operator agent dirs are never rewritten: profile material there is
refused.

Every dimension without a verified fork loader is now rejected loudly
instead of silently dropped: permissions, tools, hooks, modes,
connections, confidential, resources.files/tools/agents/commands,
GitHub-backed refs, subagent model/tools/permissions/maxSteps pins,
unknown extensions.prime keys, and profile-scoped MCP (kernel MCP
tools exist only as installed Python McpIntegration skill packages;
core/mcp/mcp-manager.ts:73 skips non-http settings entries outright).
@drewstone
drewstone merged commit 205aa20 into main Aug 6, 2026
1 check failed
@drewstone
drewstone deleted the feat/prime-dimensions branch August 6, 2026 17:47
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.

1 participant