# tsubasa-kaede/runtime-neutral-agent-engineering architecture

> Architecture diagram of the GitHub repository tsubasa-kaede/runtime-neutral-agent-engineering, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tsubasa-kaede/runtime-neutral-agent-engineering
- Repository: https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering

## Overview

dual-agent is a runtime-neutral orchestration layer for coding-agent CLIs. Its principal workflow discovers runtimes, qualifies them with evidence, selects verified capabilities, and executes bounded single- or multi-agent work with structured handoffs and provenance. The README also documents a live collaboration cockpit for monitoring and steering runs. Edges reflect the README and sampled source; some subsystem wiring is not shown in the excerpts, so uncertain links are omitted.

Main entry points: [`dual-agent-development/scripts/cli.py`](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/cli.py) (CLI commands), [`dual-agent-development/scripts/execution_engine.py`](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/execution_engine.py) (Execution gates), [`dual-agent-development/scripts/collaboration_session.py`](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/collaboration_session.py) (Collaboration session), [`dual-agent-development/scripts/collaboration_orchestrator.py`](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/collaboration_orchestrator.py) (Collaboration routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Host and CLI"]
  node_host["Host composition<br/>[host_entry.py]"]
  node_cli["CLI commands<br/>[cli.py]"]
end

subgraph group_qualification["Qualification and Selection"]
  node_discovery["Runtime discovery"]
  node_qualification_run["Runtime validation"]
  node_evidence[("Qualification evidence<br/>[evidence_store.py]")]
  node_pool["Verified runtime pool"]
  node_selector["Verified stage selection"]
end

subgraph group_execution["Orchestration and Execution"]
  node_router["Collaboration routing"]
  node_verified_orchestrator["Verified orchestration"]
  node_engine["Execution gates"]
  node_budget["Budget control<br/>[task_budget.py]"]
  node_loop_guard["Loop protection<br/>[loop_guard.py]"]
end

subgraph group_collaboration["Collaboration and Control"]
  node_collaboration_session["Collaboration session"]
  node_packets["Structured packets"]
  node_transport["Handoff transport"]
  node_cockpit["Live cockpit<br/>[cockpit_entry.py]"]
  node_security["Content safety<br/>[content_safety.py]"]
end

subgraph group_integrations["Runtime Integrations"]
  node_adapters["Runtime adapters"]
  node_agent_cli["Agent CLIs"]
end

node_user(("User"))

node_user -->|"invokes"| node_host
node_host -->|"injects facade"| node_cli
node_cli -->|"discovers runtimes"| node_discovery
node_cli -->|"qualifies"| node_qualification_run
node_qualification_run -->|"persists evidence"| node_evidence
node_cli -->|"reads evidence"| node_evidence
node_evidence -->|"admits verified"| node_pool
node_pool -->|"provides candidates"| node_selector
node_cli -->|"runs task"| node_router
node_router -->|"delegates single path"| node_verified_orchestrator
node_router -->|"runs dual path"| node_collaboration_session
node_verified_orchestrator -->|"plans stages"| node_selector
node_verified_orchestrator -->|"executes plan"| node_engine
node_engine -->|"reserves calls"| node_budget
node_engine -->|"checks loops"| node_loop_guard
node_engine -->|"invokes agents"| node_adapters
node_adapters -->|"drives runtime"| node_agent_cli
node_collaboration_session -->|"invokes agents"| node_adapters
node_collaboration_session -->|"validates handoffs"| node_packets
node_collaboration_session -->|"sends handoffs"| node_transport
node_cli -->|"opens cockpit"| node_cockpit
node_cockpit -->|"controls collaboration"| node_router
node_cockpit -->|"scans content"| node_security

click node_host "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/host_entry.py"
click node_cli "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/cli.py"
click node_discovery "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/runtime_discovery.py"
click node_qualification_run "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/real_validation_executor.py"
click node_evidence "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/evidence_store.py"
click node_pool "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/verified_runtime_pool.py"
click node_selector "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/verified_stage_selector.py"
click node_router "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/collaboration_orchestrator.py"
click node_verified_orchestrator "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/verified_orchestrator.py"
click node_engine "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/execution_engine.py"
click node_budget "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/task_budget.py"
click node_loop_guard "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/loop_guard.py"
click node_adapters "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/external_agent_adapter.py"
click node_collaboration_session "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/collaboration_session.py"
click node_packets "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/structured_packets.py"
click node_transport "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/remote_transport.py"
click node_cockpit "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/cockpit_entry.py"
click node_security "https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/content_safety.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_host,node_cli,node_user toneBlue
class node_discovery,node_qualification_run,node_evidence,node_pool,node_selector toneAmber
class node_router,node_verified_orchestrator,node_engine,node_budget,node_loop_guard toneMint
class node_collaboration_session,node_packets,node_transport,node_cockpit,node_security toneRose
class node_adapters,node_agent_cli toneIndigo
```

## Components

### Host and CLI

- [Host composition](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/host_entry.py): `dual-agent-development/scripts/host_entry.py`
- [CLI commands](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/cli.py): `dual-agent-development/scripts/cli.py`

### Qualification and Selection

- [Runtime discovery](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/runtime_discovery.py): `dual-agent-development/scripts/runtime_discovery.py`
- [Runtime validation](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/real_validation_executor.py): `dual-agent-development/scripts/real_validation_executor.py`
- [Qualification evidence](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/evidence_store.py): `dual-agent-development/scripts/evidence_store.py`
- [Verified runtime pool](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/verified_runtime_pool.py): `dual-agent-development/scripts/verified_runtime_pool.py`
- [Verified stage selection](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/verified_stage_selector.py): `dual-agent-development/scripts/verified_stage_selector.py`

### Orchestration and Execution

- [Collaboration routing](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/collaboration_orchestrator.py): `dual-agent-development/scripts/collaboration_orchestrator.py`
- [Verified orchestration](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/verified_orchestrator.py): `dual-agent-development/scripts/verified_orchestrator.py`
- [Execution gates](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/execution_engine.py): `dual-agent-development/scripts/execution_engine.py`
- [Budget control](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/task_budget.py): `dual-agent-development/scripts/task_budget.py`
- [Loop protection](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/loop_guard.py): `dual-agent-development/scripts/loop_guard.py`

### Collaboration and Control

- [Collaboration session](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/collaboration_session.py): `dual-agent-development/scripts/collaboration_session.py`
- [Structured packets](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/structured_packets.py): `dual-agent-development/scripts/structured_packets.py`
- [Handoff transport](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/remote_transport.py): `dual-agent-development/scripts/remote_transport.py`
- [Live cockpit](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/cockpit_entry.py): `dual-agent-development/scripts/cockpit_entry.py`
- [Content safety](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/content_safety.py): `dual-agent-development/scripts/content_safety.py`

### Runtime Integrations

- [Runtime adapters](https://github.com/tsubasa-kaede/runtime-neutral-agent-engineering/blob/feature/dual-agent-development/dual-agent-development/scripts/external_agent_adapter.py): `dual-agent-development/scripts/external_agent_adapter.py`
- **Agent CLIs**

### Other components

- **User**

## Connections

- User → Host composition: invokes
- Host composition → CLI commands: injects facade
- CLI commands → Runtime discovery: discovers runtimes
- CLI commands → Runtime validation: qualifies
- Runtime validation → Qualification evidence: persists evidence
- CLI commands → Qualification evidence: reads evidence
- Qualification evidence → Verified runtime pool: admits verified
- Verified runtime pool → Verified stage selection: provides candidates
- CLI commands → Collaboration routing: runs task
- Collaboration routing → Verified orchestration: delegates single path
- Collaboration routing → Collaboration session: runs dual path
- Verified orchestration → Verified stage selection: plans stages
- Verified orchestration → Execution gates: executes plan
- Execution gates → Budget control: reserves calls
- Execution gates → Loop protection: checks loops
- Execution gates → Runtime adapters: invokes agents
- Runtime adapters → Agent CLIs: drives runtime
- Collaboration session → Runtime adapters: invokes agents
- Collaboration session → Structured packets: validates handoffs
- Collaboration session → Handoff transport: sends handoffs
- CLI commands → Live cockpit: opens cockpit
- Live cockpit → Collaboration routing: controls collaboration
- Live cockpit → Content safety: scans content
