Skip to content

Commit 5febd3e

Browse files
author
chenbo
committed
Add OpenCode sidecar architecture diagram
1 parent 5836760 commit 5febd3e

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

README.en.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,31 @@ opencode-plusplus --pure # plain OpenCode without OpenCode++
7171

7272
`opencode-plusplus` runs preflight, ensures `.agent-context`, writes `.opencode/plugins/opencode-plusplus.ts`, prepares OpenCode commands/agent files, prints a compact 3-line readiness summary, then opens the OpenCode TUI for the current repository. The sidecar listens for `tool.execute.before`, `tool.execute.after`, `file.edited`, and `session.idle`: it blocks dangerous or hallucinated commands before execution, records command result evidence after tool execution, and runs dirty/debounced incremental verification when OpenCode becomes idle.
7373

74+
```mermaid
75+
flowchart TD
76+
User["User"] --> CLI["opencode-plusplus"]
77+
CLI --> TUI["OpenCode TUI"]
78+
TUI --> Plugin[".opencode/plugins/opencode-plusplus.ts"]
79+
80+
Plugin --> Before["tool.execute.before"]
81+
Plugin --> After["tool.execute.after"]
82+
Plugin --> Idle["session.idle"]
83+
84+
Before --> CommandGuard["Command Guard"]
85+
Before --> BoundaryGuard["Boundary Guard"]
86+
After --> EvidenceRecorder["Evidence Recorder"]
87+
Idle --> IncrementalVerify["Incremental Verify"]
88+
89+
CommandGuard --> Latest[".agent-context/sidecar/latest.md"]
90+
BoundaryGuard --> Latest
91+
EvidenceRecorder --> Latest
92+
IncrementalVerify --> Latest
93+
94+
Latest --> Report["opencode-plusplus report"]
95+
Latest --> Status["opencode-plusplus status"]
96+
Latest --> Doctor["opencode-plusplus doctor"]
97+
```
98+
7499
## Advanced Usage
75100

76101
The README main path intentionally recommends only `opencode-plusplus`. Batch Harness Mode, CI-like executors, manual `verify / policy / impact`, MCP, and retrieval commands are still available for advanced users:

docs/concepts/architecture.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,35 @@ The generated context remains important, but it is one part of the enhancement l
1212

1313
Current boundary: this is not a fully autonomous coding agent. It is a context, policy, trace, and runtime-state control plane with a bounded harness-led loop. The controller consumes repository state and trace evidence, persists `.agent-context/runs/<task-id>/state.json`, and reports the next allowed action, while an external coding agent or user still executes edits and commands. Harness-led mode can invoke an executor, but the real code changes still happen inside that external executor.
1414

15+
## OpenCode Sidecar Flow
16+
17+
```mermaid
18+
flowchart TD
19+
User["User"] --> CLI["opencode-plusplus"]
20+
CLI --> TUI["OpenCode TUI"]
21+
TUI --> Plugin[".opencode/plugins/opencode-plusplus.ts"]
22+
23+
Plugin --> Before["tool.execute.before"]
24+
Plugin --> After["tool.execute.after"]
25+
Plugin --> Idle["session.idle"]
26+
27+
Before --> CommandGuard["Command Guard"]
28+
Before --> BoundaryGuard["Boundary Guard"]
29+
After --> EvidenceRecorder["Evidence Recorder"]
30+
Idle --> IncrementalVerify["Incremental Verify"]
31+
32+
CommandGuard --> Latest[".agent-context/sidecar/latest.md"]
33+
BoundaryGuard --> Latest
34+
EvidenceRecorder --> Latest
35+
IncrementalVerify --> Latest
36+
37+
Latest --> Report["opencode-plusplus report"]
38+
Latest --> Status["opencode-plusplus status"]
39+
Latest --> Doctor["opencode-plusplus doctor"]
40+
```
41+
42+
This is the default product path: OpenCode owns chat, code reading, edits, and tool execution; OpenCode++ owns the surrounding sidecar, evidence, guards, verification reports, and diagnostics.
43+
1544
## Reliability Layer Model
1645

1746
OpenCode++ is organized as a set of Guard modules around existing coding agents:

docs/integrations/opencode-sidecar.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,31 @@ The sidecar stays quiet by default. It only surfaces a TUI message when a blocke
4949

5050
## Workflow
5151

52+
```mermaid
53+
flowchart TD
54+
User["User"] --> CLI["opencode-plusplus"]
55+
CLI --> TUI["OpenCode TUI"]
56+
TUI --> Plugin[".opencode/plugins/opencode-plusplus.ts"]
57+
58+
Plugin --> Before["tool.execute.before"]
59+
Plugin --> After["tool.execute.after"]
60+
Plugin --> Idle["session.idle"]
61+
62+
Before --> CommandGuard["Command Guard"]
63+
Before --> BoundaryGuard["Boundary Guard"]
64+
After --> EvidenceRecorder["Evidence Recorder"]
65+
Idle --> IncrementalVerify["Incremental Verify"]
66+
67+
CommandGuard --> Latest[".agent-context/sidecar/latest.md"]
68+
BoundaryGuard --> Latest
69+
EvidenceRecorder --> Latest
70+
IncrementalVerify --> Latest
71+
72+
Latest --> Report["opencode-plusplus report"]
73+
Latest --> Status["opencode-plusplus status"]
74+
Latest --> Doctor["opencode-plusplus doctor"]
75+
```
76+
5277
```txt
5378
opencode-plusplus
5479
-> preflight

0 commit comments

Comments
 (0)