research specs #2
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_archive_claude#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
research how this tool works
give me specs
how do we drive claude?
what API can we use
can we test this using openrpc
are there integration tests?
Research Spec for Issue #2 — hero_claude Architecture & Testing
1. Architecture Overview
hero_claude is a Rust workspace with 5 crates:
hero_claudehero_proc; provides--start/--stophero_claude_serverhero_claude_sdkhero_claude_ui/rpcto server sockethero_claude_examplesRuntime topology:
2. How Claude Is Driven
@anthropic-ai/claude-code) in headless mode inside Docker containersclaude --print --output-format=text "$SESSION_TASK"~/.claudecredentials are mounted read-only for Claude Max subscriptionSession lifecycle:
3. Available APIs
JSON-RPC 2.0 (16 methods at
POST /rpc):server.info,server.healthsession.create,session.start,session.stop,session.finish,session.destroysession.sync,session.list,session.info,session.logs,session.execrepo.list,repo.infologs.get,logs.clearMCP at
POST /mcp— same methods as MCP tools (protocol 2024-11-05)Typed Rust SDK — auto-generated from OpenRPC spec via
openrpc_client!macroFull OpenRPC 1.3.2 spec served at
GET /openrpc.json4. Can We Test Using OpenRPC?
Yes. The system is fully OpenRPC-testable:
/openrpc.jsonrpc.discovermethod returns the live speccurl --unix-socketor any JSON-RPC client5. Integration Tests
3 integration tests in
crates/hero_claude_examples/tests/integration.rs:test_server_health— starts service stack, callsserver.healthvia SDKtest_rpc_discover— validates OpenRPC spec has non-empty methodstest_session_list— verifiessession.listsucceeds0 unit tests currently exist.
Prerequisites:
hero_procrunning, binaries in~/hero/bin/,CODEROOT/BUILDDIRenv vars set.6. Key Dependencies
hero_proc_sdk— process supervisorhero_rpc_derive—openrpc_client!andopenrpc_proxy!macroshero_rpc_openrpc— OpenRPC Unix socket transportaxum+hyper_util— HTTP over Unix socketstokio— async runtimeImplementation Summary
Changes Made
docs/ARCHITECTURE.md— comprehensive architecture and API reference documentWhat It Covers
Files
docs/ARCHITECTURE.md(new)