Skip to content

feat(agent): Claude drives QuantumOS via the frozen MCP tools (BYO key) - #231

Merged
NickFlach merged 3 commits into
mainfrom
feat/claude-agent
Jul 15, 2026
Merged

feat(agent): Claude drives QuantumOS via the frozen MCP tools (BYO key)#231
NickFlach merged 3 commits into
mainfrom
feat/claude-agent

Conversation

@NickFlach

Copy link
Copy Markdown
Collaborator

A bring-your-own-key agent that lets Claude run experiments on a live QuantumOS VM through its frozen MCP tool surface (ADR-0020 lane B, contracts/mcp/v1-tools.json).

Claude is exactly the external consumer that freeze was built for — so scripts/qos_claude_agent.py reuses scripts/qos_mcp.py verbatim through the Anthropic SDK's MCP conversion helpers + tool runner. Zero tool duplication; the golden file is the integration boundary. Everything is local: the key never leaves the machine, the VM never leaves the machine; the MCP server is spawned over stdio and inherits QOS_KERNEL.

make kernel
export ANTHROPIC_API_KEY=sk-ant-...        # or: ant auth login
pip install -r requirements-claude-agent.txt
make qos-claude TASK="Boot a 3-node society and show me the aggregates each node received"
make qos-claude-list        # zero-cost sanity check: lists all 22 tools, no key, no API call
  • Credentials: bare AsyncAnthropic() resolves ANTHROPIC_API_KEY or an ant auth login profile; clear error if neither is present.
  • Model: claude-opus-4-8 default (--model / QOS_CLAUDE_MODEL; claude-fable-5 for the hardest reasoning); adaptive thinking + effort high.
  • Honesty baked in: the system prompt frames Claude as a field-society experimentalist and carries qos_mcp.py's attestation note (verified ≠ live-now) so results are never overstated.
  • Not a CI dependency — dev tool; deps float in requirements-claude-agent.txt (the mcp-schema freeze gate keeps its own exact pins).

Verification

--list-tools runs the full spawn → initialize → enumerate handshake locally (WSL) and returns all 22 frozen tools. The live Claude loop needs a user key and was not run in CI.

🤖 Generated with Claude Code

flaukowski and others added 3 commits July 15, 2026 07:37
scripts/qos_claude_agent.py — a bring-your-own-key agent that lets Claude
run field-society / associative-memory experiments on a live QuantumOS VM
through its FROZEN MCP surface (ADR-0020 lane B, contracts/mcp/v1-tools.json).

Claude is exactly the external consumer that freeze was built for, so the
agent REUSES scripts/qos_mcp.py verbatim through the anthropic SDK's MCP
conversion helpers (async_mcp_tool) + tool runner — zero tool duplication,
one source of truth. Everything is local: the key never leaves the machine,
the VM never leaves the machine; the MCP server is spawned over stdio and
inherits QOS_KERNEL so Claude boots the guest you built.

- credentials: bare AsyncAnthropic() resolves ANTHROPIC_API_KEY or an
  `ant auth login` profile; clear message if neither is present
- model: claude-opus-4-8 default (--model / QOS_CLAUDE_MODEL; claude-fable-5
  for the hardest reasoning); adaptive thinking + effort high
- system prompt frames Claude as a field-society experimentalist AND carries
  qos_mcp.py's attestation-honesty note (verified != live-now) so results are
  never overstated
- --list-tools self-test proves the Claude->MCP->qos_bridge handshake with no
  API call and no key
- Makefile: qos-claude (TASK=...) and qos-claude-list; deps in
  requirements-claude-agent.txt (anthropic[mcp], mcp; not a CI dependency)

Verified locally (WSL): --list-tools enumerates all 22 frozen tools end to
end. The live Claude loop needs a user key and was not run.

Co-Authored-By: Claude Fable 5 <[email protected]>
- --experiment {recall,society,quantum,explore}: curated on-ramp goals (each a
  goal, not a recipe — Claude designs the tool sequence). Free-form TASK still
  overrides. Makefile qos-claude takes EXPERIMENT=... alongside TASK=...
- --max-turns (default 40): hard cap so a runaway agent loop can't silently
  burn the user's key
- guaranteed cleanup: qos_shutdown + qos_society_shutdown (idempotent) run in a
  finally around the runner loop, so a booted guest is never orphaned — on
  normal completion, the turn cap, a refusal, an error, or Ctrl-C

Re-verified (WSL): --list-tools still enumerates all 22 tools; new flags parse.

Co-Authored-By: Claude Fable 5 <[email protected]>
A routable one-pager for reaching out about the Claude integration: what
QuantumOS is (capability security + wave-interference memory field + N-node
societies), why the fit is unusual (the agent surface was frozen as a versioned
MCP contract BEFORE any model touched it, and Claude reuses it verbatim), how
to run it (local, BYO key), and a modest, honestly-scoped ask. Carries the same
attestation-honesty caveat the agent enforces — verified != live-now; claims
limited to what the CI gates demonstrate.

Co-Authored-By: Claude Fable 5 <[email protected]>
@NickFlach
NickFlach merged commit 2cf275f into main Jul 15, 2026
27 checks passed
@NickFlach
NickFlach deleted the feat/claude-agent branch July 15, 2026 16:46
NickFlach pushed a commit that referenced this pull request Jul 21, 2026
The BYO-key agent (#231) was Claude-only. The frozen MCP surface (ADR-0020)
was built for ANY external consumer, so the agent now is too:

- scripts/qos_agent.py — provider-agnostic entrypoint. --provider anthropic
  (default, Claude via tool_runner + MCP helpers, unchanged behavior) or
  --provider openai: ANY OpenAI-compatible /chat/completions endpoint
  (OpenAI, OpenRouter, Groq, DeepSeek, LM Studio, llama.cpp, keyless local
  Ollama via --base-url). The openai path converts the same 22 frozen MCP
  tools to function-calling schemas directly — still zero tool duplication —
  and feeds tool errors back to the model instead of dying. Credentials are
  resolved BEFORE any VM spawns; the guaranteed-shutdown finally and the
  --max-turns key-burn guard cover both providers.
- scripts/qos_claude_agent.py — compat shim; old CLI works verbatim.
- requirements-agent.txt (anthropic[mcp] + openai + mcp); the old
  requirements-claude-agent.txt now -r-includes it.
- Makefile: qos-agent / qos-agent-list (PROVIDER/MODEL/BASE_URL knobs);
  qos-claude / qos-claude-list kept as aliases.
- README post-launch refresh: the roadmap still listed ADR-0019/0020/0021 as
  planned — all three shipped in v0.5; new Done block + honest Next (N=5,
  audit actor attribution). MCP tool count corrected 21 -> 22 and the BYO
  agent surfaced in "What runs today".

Verified (WSL): py_compile both entrypoints; --list-tools enumerates all 22
tools through qos_agent.py AND the shim; missing-key/missing-model guards
exit cleanly before any VM boot; MCP->OpenAI schema conversion of the real
22-tool list is well-formed and JSON-serializable. Live loops remain BYO-key.

Co-Authored-By: Claude Fable 5 <[email protected]>
NickFlach added a commit that referenced this pull request Jul 21, 2026
…ace (#232)

The BYO-key agent (#231) was Claude-only. The frozen MCP surface (ADR-0020)
was built for ANY external consumer, so the agent now is too:

- scripts/qos_agent.py — provider-agnostic entrypoint. --provider anthropic
  (default, Claude via tool_runner + MCP helpers, unchanged behavior) or
  --provider openai: ANY OpenAI-compatible /chat/completions endpoint
  (OpenAI, OpenRouter, Groq, DeepSeek, LM Studio, llama.cpp, keyless local
  Ollama via --base-url). The openai path converts the same 22 frozen MCP
  tools to function-calling schemas directly — still zero tool duplication —
  and feeds tool errors back to the model instead of dying. Credentials are
  resolved BEFORE any VM spawns; the guaranteed-shutdown finally and the
  --max-turns key-burn guard cover both providers.
- scripts/qos_claude_agent.py — compat shim; old CLI works verbatim.
- requirements-agent.txt (anthropic[mcp] + openai + mcp); the old
  requirements-claude-agent.txt now -r-includes it.
- Makefile: qos-agent / qos-agent-list (PROVIDER/MODEL/BASE_URL knobs);
  qos-claude / qos-claude-list kept as aliases.
- README post-launch refresh: the roadmap still listed ADR-0019/0020/0021 as
  planned — all three shipped in v0.5; new Done block + honest Next (N=5,
  audit actor attribution). MCP tool count corrected 21 -> 22 and the BYO
  agent surfaced in "What runs today".

Verified (WSL): py_compile both entrypoints; --list-tools enumerates all 22
tools through qos_agent.py AND the shim; missing-key/missing-model guards
exit cleanly before any VM boot; MCP->OpenAI schema conversion of the real
22-tool list is well-formed and JSON-serializable. Live loops remain BYO-key.

Co-authored-by: The Hand <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
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