pantheon-opencode 1.4.2 → 1.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pantheon/code-mode/.gitkeep +0 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-1.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-10.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-11.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-2.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-3.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-4.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-5.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-6.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-7.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-8.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-9.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/heartbeat.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/session.json +11 -0
- package/.pantheon/code-mode/README.md +93 -0
- package/.pantheon/code-mode/checkpoint-session.py +7 -0
- package/.pantheon/code-mode/checkpoint-session.sh +11 -0
- package/.pantheon/code-mode/checkpoint_session.py +481 -0
- package/.pantheon/code-mode/compress-inline.py +450 -0
- package/.pantheon/code-mode/eval-llm-judge.py +255 -0
- package/.pantheon/code-mode/eval-monte-carlo.py +368 -0
- package/.pantheon/code-mode/eval-run.py +197 -0
- package/.pantheon/code-mode/eval-static.py +321 -0
- package/.pantheon/code-mode/example-sync.sh +5 -0
- package/.pantheon/code-mode/session-end-save.py +186 -0
- package/.pantheon/code-mode/session-end-save.sh +18 -0
- package/.pantheon/code-mode/test-allowed.sh +5 -0
- package/.pantheon/code-mode/test-auto-continue-checkpoint.sh +179 -0
- package/.pantheon/code-mode/test-env.sh +7 -0
- package/.pantheon/code-mode/test-prlimit.sh +9 -0
- package/.pantheon/code-mode/test-timeout.sh +6 -0
- package/README.md +158 -1189
- package/README.pt-BR.md +222 -0
- package/bin/pantheon-init.mjs +30 -11
- package/opencode.json +1 -0
- package/package.json +14 -3
- package/plugin.json +15 -0
- package/scripts/_pantheon_paths.py +48 -7
- package/scripts/ci-validate-yaml.py +7 -2
- package/scripts/code_mode_server.py +33 -2
- package/scripts/doctor.mjs +135 -127
- package/scripts/generate-preset-docs.mjs +127 -66
- package/scripts/generate-prompts.sh +2 -2
- package/scripts/install/cli-ui.mjs +8 -1
- package/scripts/install/config-migration.mjs +401 -0
- package/scripts/install/health-check.mjs +3 -3
- package/scripts/install/model-picker.mjs +72 -23
- package/scripts/install/opencode-version.mjs +47 -0
- package/scripts/install/opencode.mjs +261 -88
- package/scripts/install/plugin.mjs +112 -42
- package/scripts/install/shared.mjs +13 -158
- package/scripts/install-mcp.mjs +44 -232
- package/scripts/mcp_persistence_server.py +344 -15
- package/scripts/mcp_resources_server.py +144 -40
- package/scripts/memory_mcp_server.py +2 -2
- package/scripts/recover-zenodo-deposition.mjs +146 -0
- package/scripts/sync-tui.mjs +32 -7
- package/scripts/test-opencode-v1-v2-sandbox.sh +591 -0
- package/scripts/uninstall.mjs +298 -954
- package/scripts/validate-zenodo-release.mjs +154 -0
- package/scripts/zenodo-artifact.mjs +21 -0
- package/scripts/zenodo-release-state.mjs +53 -0
- package/src/mcp/_pantheon_paths.py +48 -7
- package/src/mcp/code_mode_server.py +33 -2
- package/src/mcp/eval_store.py +1 -1
- package/src/mcp/mcp_persistence_server.py +344 -15
- package/src/mcp/mcp_resources_server.py +144 -40
- package/src/mcp/pantheon_vision_server.py +1 -1
- package/src/mcp/toon_codec.py +491 -0
- package/src/pantheon/background-job-board.ts +67 -1
- package/src/pantheon/cost-command.ts +6 -2
- package/src/pantheon/delegate-manager.ts +384 -0
- package/src/pantheon/delegate-task-adapter.ts +444 -0
- package/src/pantheon/delegation-notify.ts +35 -20
- package/src/pantheon/model-command.ts +86 -32
- package/src/pantheon/token-opt.ts +555 -0
- package/src/pantheon/toon-codec.ts +481 -0
- package/src/pantheon/tui-version-check.ts +1 -3
- package/src/pantheon/v2-bridge.ts +129 -0
- package/src/pantheon/v2-events.ts +131 -0
- package/src/pantheon/v2-hooks.ts +287 -0
- package/src/pantheon/v2-tool-definitions.ts +331 -0
- package/src/plugin-v2/index.ts +21 -0
- package/src/plugin-v2.ts +836 -0
- package/src/plugin.ts +57 -10
- package/src/plugins/tui/dist/server.d.ts +1 -1
- package/src/plugins/tui/dist/server.d.ts.map +1 -1
- package/src/plugins/tui/dist/server.js +1 -1
- package/src/plugins/tui/dist/server.js.map +1 -1
- package/src/plugins/tui/dist/tui.d.ts +10 -7
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +11 -8
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/dist/tui.tsx +22 -16
- package/src/plugins/tui/package-lock.json +51 -51
- package/src/plugins/tui/package.json +7 -7
- package/src/plugins/tui/src/index.tsx +22 -16
- package/src/skills/README.md +0 -2
package/README.md
CHANGED
|
@@ -1,1249 +1,218 @@
|
|
|
1
|
+
# Pantheon
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
**A clearer way to work with OpenCode on real software projects.** Pantheon
|
|
4
|
+
brings planning, implementation, review, and documentation into one guided
|
|
5
|
+
experience. It is an OpenCode plugin and installer for teams and developers who
|
|
6
|
+
want useful structure without giving up control of their code.
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License"></a>
|
|
7
|
-
<a href="docs/agents/README.md"><img src="https://img.shields.io/badge/agents-14-purple" alt="Agents"></a>
|
|
8
|
-
<a href="src/skills/README.md"><img src="https://img.shields.io/badge/skills-21-orange" alt="Skills"></a>
|
|
9
|
-
<a href="commands/"><img src="https://img.shields.io/badge/commands-11-red" alt="Commands"></a>
|
|
10
|
-
<a href="https://github.com/ils15/pantheon/actions"><img src="https://img.shields.io/github/actions/workflow/status/ils15/pantheon/ci.yml?branch=main&label=CI" alt="CI"></a>
|
|
11
|
-
</p>
|
|
8
|
+
[Português (Brasil)](README.pt-BR.md) ·
|
|
9
|
+
[Repository](https://github.com/ils15/pantheon-opencode) · [MIT License](LICENSE)
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
[](https://github.com/ils15/pantheon-opencode/releases/tag/v1.5.0)
|
|
12
|
+
[](https://github.com/ils15/pantheon-opencode/actions)
|
|
13
|
+
[](https://doi.org/10.5281/zenodo.22306637)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## What is it?
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Pantheon is a companion for [OpenCode](https://opencode.ai/) that helps you
|
|
18
|
+
move from an idea to a reviewed change. It gives your coding sessions a shared
|
|
19
|
+
way to plan work, make progress, check results, and keep useful project context.
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Quick Links
|
|
22
|
-
|
|
23
|
-
| Resource | Link |
|
|
24
|
-
|----------|------|
|
|
25
|
-
| 📖 **Agent Reference** | [docs/agents/README.md](docs/agents/README.md) — all 14 agents |
|
|
26
|
-
| 📖 **Skills Reference** | [src/skills/README.md](src/skills/README.md) — all 21 skills |
|
|
27
|
-
| 🚀 **Installation Guide** | [docs/INSTALLATION.md](docs/INSTALLATION.md) |
|
|
28
|
-
| 🔌 **MCP Server Guide** | [docs/mcp-recommendations.md](docs/mcp-recommendations.md) — recommended MCP servers for each project type |
|
|
29
|
-
| 🔌 **MCP Tool Registry** | [docs/mcp-tools.md](docs/mcp-tools.md) — canonical MCP tool reference |
|
|
30
|
-
| 🔌 **MCP User Guide** | [docs/mcp-user-guide.md](docs/mcp-user-guide.md) — adding custom MCP servers |
|
|
31
|
-
| ⚡ **Quick Start** | [docs/QUICKSTART.md](docs/QUICKSTART.md) |
|
|
32
|
-
| ⚡ **OpenCode Guide** | [docs/platforms/opencode.md](docs/platforms/opencode.md) |
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Overview
|
|
37
|
-
|
|
38
|
-
Traditional single-agent coding produces mediocre results because one agent attempts to
|
|
39
|
-
plan, implement, test, review, and document simultaneously. The result is context
|
|
40
|
-
fragmentation, skipped tests, and generic code.
|
|
41
|
-
|
|
42
|
-
**Pantheon** solves this with **specialization**: each agent is an expert at exactly
|
|
43
|
-
one thing and is invoked only when that expertise is needed. Agents collaborate through a
|
|
44
|
-
conductor-delegate architecture where Zeus (the orchestrator) dispatches work to
|
|
45
|
-
specialized sub-agents with isolated context windows, enforced quality gates, and human
|
|
46
|
-
approval at every transition.
|
|
47
|
-
|
|
48
|
-
| Metric | Single Agent | Pantheon |
|
|
49
|
-
|--------|-------------|----------|
|
|
50
|
-
| Average test coverage | 65–75% | **92%** |
|
|
51
|
-
| TDD enforcement | Optional | **Enforced (RED→GREEN→REFACTOR)** |
|
|
52
|
-
| Code review cadence | End of feature | **After every phase** |
|
|
53
|
-
| Bugs reaching production | 3–5 per feature | **Near zero** |
|
|
54
|
-
| Context efficiency | 10–20% reasoning | **70–80% reasoning** |
|
|
55
|
-
| Parallel execution | Sequential only | **Multi-agent parallel** |
|
|
56
|
-
| Documentation | Manual | **Auto-committed in git** |
|
|
57
|
-
| Architecture pattern | Monolithic | **Specialized conductor-delegate** |
|
|
58
|
-
|
|
59
|
-
> Metrics based on internal benchmarks across 50+ feature implementations in the Pantheon
|
|
60
|
-
> test suite. Your results may vary based on codebase complexity and model selection.
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## How It Works
|
|
65
|
-
|
|
66
|
-
The system operates in defined phases controlled by **you**. Agents work in parallel
|
|
67
|
-
within each phase, and every transition is gated by your explicit approval.
|
|
68
|
-
|
|
69
|
-
```mermaid
|
|
70
|
-
---
|
|
71
|
-
config:
|
|
72
|
-
look: classic
|
|
73
|
-
theme: dark
|
|
74
|
-
layout: elk
|
|
75
|
-
---
|
|
76
|
-
flowchart TD
|
|
77
|
-
classDef user fill:#2d5a8c,stroke:#5a8ac4,stroke-width:2px,color:#e2e8f0
|
|
78
|
-
classDef core fill:#1f2937,stroke:#4b5563,stroke-width:2px,color:#f3f4f6,font-weight:bold
|
|
79
|
-
classDef planner fill:#1e3a5f,stroke:#3b82f6,stroke-width:2px,color:#dbeafe
|
|
80
|
-
classDef ai fill:#4a1a3f,stroke:#c084fc,stroke-width:2px,color:#f3e8ff
|
|
81
|
-
classDef executor fill:#7c2d12,stroke:#ea580c,stroke-width:2px,color:#fed7aa
|
|
82
|
-
classDef qa fill:#3f1a3e,stroke:#d946a6,stroke-width:2px,color:#f5d1f8
|
|
83
|
-
classDef infra fill:#1e3a3f,stroke:#14b8a6,stroke-width:2px,color:#ccfbf1
|
|
84
|
-
classDef ops fill:#1e294b,stroke:#60a5fa,stroke-width:1px,color:#bfdbfe
|
|
85
|
-
classDef gate fill:#1f1f1f,stroke:#fbbf24,stroke-width:2px,color:#fbbf24,stroke-dasharray: 5 5
|
|
86
|
-
|
|
87
|
-
User["You / Human"]:::user
|
|
88
|
-
Gate0{{"⏸️ Gate 0<br/>Approve Decision"}}:::gate
|
|
89
|
-
Gate1{{"⏸️ Gate 1<br/>Approve Plan"}}:::gate
|
|
90
|
-
Gate2{{"⏸️ Gate 2<br/>Approve Review"}}:::gate
|
|
91
|
-
Gate3{{"⏸️ Gate 3<br/>Commit"}}:::gate
|
|
92
|
-
|
|
93
|
-
subgraph Orchestrator["Orchestrator"]
|
|
94
|
-
Zeus["Zeus<br/>Central Coordinator"]:::core
|
|
95
|
-
end
|
|
21
|
+
## Why use it?
|
|
96
22
|
|
|
97
|
-
|
|
23
|
+
- **Less context switching:** keep planning and building in the same workflow.
|
|
24
|
+
- **More deliberate changes:** ask for reviews and checks before calling work
|
|
25
|
+
finished.
|
|
26
|
+
- **A repeatable starting point:** use the same setup across projects and
|
|
27
|
+
collaborators.
|
|
28
|
+
- **You stay in charge:** Pantheon supports your decisions; it does not replace
|
|
29
|
+
your judgment or your review of generated code.
|
|
98
30
|
|
|
99
|
-
|
|
100
|
-
Apollo["Apollo<br/>Codebase Scout"]:::planner
|
|
101
|
-
Nyx["Nyx<br/>Observability"]:::planner
|
|
102
|
-
end
|
|
31
|
+
## Start in 2 minutes
|
|
103
32
|
|
|
104
|
-
|
|
105
|
-
Hephaestus["Hephaestus<br/>AI Pipelines<br/>RAG / LangChain"]:::ai
|
|
106
|
-
end
|
|
33
|
+
Requirements: [OpenCode 1.18.4+](https://opencode.ai/docs/) and Node.js 18+.
|
|
107
34
|
|
|
108
|
-
|
|
109
|
-
Hermes["Hermes<br/>Backend APIs"]:::executor
|
|
110
|
-
Aphrodite["Aphrodite<br/>Frontend UI"]:::executor
|
|
111
|
-
Demeter["Demeter<br/>Database"]:::executor
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
subgraph Quality["Quality & Observability"]
|
|
115
|
-
Themis["Themis<br/>Security & Coverage Audit"]:::qa
|
|
116
|
-
Nyx["Nyx<br/>Observability<br/>Tracing & Cost"]:::qa
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
subgraph Deploy["Deployment & Release"]
|
|
120
|
-
Prometheus["Prometheus<br/>Infrastructure<br/>Docker / CI/CD"]:::infra
|
|
121
|
-
Iris["Iris<br/>GitHub Operations<br/>PR / Release"]:::ops
|
|
122
|
-
Mnemosyne["Mnemosyne<br/>Documentation<br/>Memory Bank"]:::ops
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
subgraph Express["Express Lane"]
|
|
126
|
-
Talos["Talos<br/>Rapid Hotfixes"]:::qa
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
subgraph Domain["Domain Specialist"]
|
|
130
|
-
Gaia["Gaia<br/>Remote Sensing"]:::planner
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
User -->|"/implement-feature"| Zeus
|
|
134
|
-
|
|
135
|
-
Gate0 -->|Approved| Zeus
|
|
136
|
-
Zeus -->|Phase 1| Athena
|
|
137
|
-
Athena -->|Discovers| Apollo
|
|
138
|
-
Apollo -->|Findings| Athena
|
|
139
|
-
Athena --> Gate1
|
|
140
|
-
Gate1 -->|Approved| Zeus
|
|
141
|
-
|
|
142
|
-
Zeus -->|"Phase 2 (AI Infrastructure)"| AI
|
|
143
|
-
Hephaestus --> Zeus
|
|
144
|
-
|
|
145
|
-
Zeus -->|"Phase 3 (Implementation)"| Impl
|
|
146
|
-
Hermes & Aphrodite & Demeter --> Quality
|
|
147
|
-
|
|
148
|
-
Impl -.->|Nested Apollo| Apollo
|
|
149
|
-
|
|
150
|
-
Nyx --> Themis
|
|
151
|
-
Themis --> Gate2
|
|
152
|
-
Gate2 -->|Approved| Zeus
|
|
153
|
-
|
|
154
|
-
Zeus -->|"Phase 4 (Deploy & Release)"| Deploy
|
|
155
|
-
Prometheus & Iris & Mnemosyne --> Gate3
|
|
156
|
-
Gate3 -->|"git commit"| User
|
|
157
|
-
|
|
158
|
-
User -.->|"/fix"| Express
|
|
159
|
-
User -.->|"/plan-architecture"| Domain
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## Platform
|
|
165
|
-
|
|
166
|
-
- **OpenCode** — Pantheon v1.0 is OpenCode-only. [Installation guide](docs/INSTALLATION.md).
|
|
35
|
+
From the project where you want to use Pantheon:
|
|
167
36
|
|
|
168
37
|
```bash
|
|
169
|
-
# Interactive TUI (default) — select components visually
|
|
170
38
|
npx pantheon-opencode init
|
|
171
|
-
|
|
172
|
-
# Headless mode — for CI and automation
|
|
173
|
-
npx pantheon-opencode init --headless
|
|
174
|
-
|
|
175
|
-
# (Optional) Install + activate a model routing preset
|
|
176
|
-
npx pantheon-opencode init --preset go-fast
|
|
177
|
-
|
|
178
|
-
# (Optional) Install MCP servers + skills + TUI plugin
|
|
179
|
-
npm run setup
|
|
180
|
-
|
|
181
|
-
# Launch OpenCode with background subagents
|
|
182
|
-
export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true
|
|
183
39
|
opencode
|
|
184
40
|
```
|
|
185
41
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
| | V1 | V2 (beta) |
|
|
191
|
-
|---|---|---|
|
|
192
|
-
| Binary | `opencode` (1.18.18) | `opencode2` (v0.0.0-next-17444) |
|
|
193
|
-
| Config locations | `~/.config/opencode/`, `<project>/opencode.json`, `.opencode/` | Same — V2 reads the same locations |
|
|
194
|
-
| Config handling | Loads V1 shape directly | Normalizes V1 fields **in memory** — no rewrite, no native V2 conversion |
|
|
195
|
-
| State DB | `~/.local/share/opencode/opencode.db` | `~/.local/share/opencode/opencode-v2.db` (isolated via `OPENCODE_DB`) |
|
|
196
|
-
| Service port | 49374 | 49375 (must differ from V1) |
|
|
197
|
-
|
|
198
|
-
The `pantheon_cost` report preserves the V1 database default. Set
|
|
199
|
-
`PANTHEON_OPENCODE_VERSION=v1` or `v2` to select the corresponding state DB
|
|
200
|
-
explicitly (`opencode.db` or `opencode-v2.db`). For custom installations,
|
|
201
|
-
`PANTHEON_COST_DB=/absolute/path/to/opencode.db` takes precedence over the
|
|
202
|
-
version selector; an explicit `dbPath` supplied by the tool caller takes
|
|
203
|
-
precedence over both. The resolver never probes the other version's database,
|
|
204
|
-
and reports an actionable error when the selected DB is missing or has an
|
|
205
|
-
incompatible schema.
|
|
206
|
-
|
|
207
|
-
**What changed for V2 compatibility (Phase 3):**
|
|
208
|
-
|
|
209
|
-
- `subagent_depth` moved from top-level to `experimental.subagent_depth` — V2 silently ignores the top-level key. The installer migrates existing configs automatically.
|
|
210
|
-
- Instruction content consolidated into `AGENTS.md` (generated by `scripts/build-agents-md.mjs` from `src/instructions/*.instructions.md`) — V2 accepts but does **not** load the `instructions` config key; both versions auto-load `AGENTS.md`.
|
|
211
|
-
- `npx pantheon-opencode init --version v2` labels an install for V2 (informational — the config is shared).
|
|
212
|
-
|
|
213
|
-
**Known V2 beta gaps:**
|
|
214
|
-
|
|
215
|
-
- `instructions` config key accepted but not loaded → content lives in `AGENTS.md`.
|
|
216
|
-
- `formatter` / `lsp` config not executed.
|
|
217
|
-
- `--subtask` delegation flag is a no-op.
|
|
218
|
-
|
|
219
|
-
### Background Delegation
|
|
220
|
-
|
|
221
|
-
Zeus (and other root sessions) can dispatch agents as **background child sessions**
|
|
222
|
-
via three delegation tools, tracked on a persistent job board
|
|
223
|
-
(`.pantheon/board/state.json`, 24h TTL) with reports written to
|
|
224
|
-
`.pantheon/delegations/<parent>/<alias>.md`:
|
|
225
|
-
|
|
226
|
-
| Tool | Signature | Behavior |
|
|
227
|
-
|------|-----------|----------|
|
|
228
|
-
| `pantheon_delegate` | `{prompt, agent, description?, read_only?, model?}` | Creates a child session (parentID = caller), registers it on the job board, arms a 15-minute timeout, and sends `promptAsync` to the child. `model` is optional and uses `provider/model-id`. Returns the readable alias (e.g. `apo-1`). Only root sessions may delegate (sub-sessions are rejected by the depth guard). |
|
|
229
|
-
| `pantheon_delegation_read` | `{id}` | Blocks (`waitForTerminal`, up to 15 min) until the delegation reaches a terminal state, returns the report markdown, and marks the job reconciled. Resolves by alias or task ID. |
|
|
230
|
-
| `pantheon_delegation_list` | `{}` | Lists the current session's delegations with `[unread]` on finished, unreconciled jobs. |
|
|
231
|
-
|
|
232
|
-
**Agent activity visibility.** While `pantheon_delegation_read` blocks on a
|
|
233
|
-
running job, it samples the child session's messages every ~2s and appends the
|
|
234
|
-
collected lines to the report as a trailing `## Agent Activity` section (latest
|
|
235
|
-
tool calls with truncated args, or user/assistant text, capped at ~200 chars per
|
|
236
|
-
line) — so you can see what the agent is doing during the wait. Likewise,
|
|
237
|
-
`pantheon_delegation_list` shows a `last activity:` line for running jobs.
|
|
238
|
-
Fail-open: if the child session messages are unavailable (or empty), the read
|
|
239
|
-
returns the report exactly as before — the activity sampling never breaks the
|
|
240
|
-
delegation read.
|
|
241
|
-
|
|
242
|
-
**Completion visibility — zero chat noise.** Delegation notifications are never
|
|
243
|
-
injected into the chat transcript: neither `chat.message` nor any other chat
|
|
244
|
-
hook or transcript marker is used as a delivery channel. When a job reaches a
|
|
245
|
-
terminal state (completion observed via `session.idle`/`session.error` on the
|
|
246
|
-
child, or the timeout finalize path), the plugin writes a file-only audit log
|
|
247
|
-
line (echo opt-in via `PANTHEON_HOOKS_LOG`). Completion visibility lives in the
|
|
248
|
-
legitimate channels: the board `[unread]` marker
|
|
249
|
-
(`pantheon_delegation_list`), `pantheon_delegation_read`, TUI toasts
|
|
250
|
-
(`PANTHEON_TOASTS` gate), and compaction carry-forward. Reconcile is an
|
|
251
|
-
acknowledgment, not a completion — it never re-fires the terminal transition.
|
|
252
|
-
|
|
253
|
-
**Timeout:** `background_delegation.timeout_ms` (default `900000` = 15 min). A job
|
|
254
|
-
that has not reached a terminal state is finalized as `error`/`timedOut`.
|
|
255
|
-
|
|
256
|
-
**Runtime delegation environment variables:**
|
|
257
|
-
|
|
258
|
-
| Variable | Default | Scope and behavior |
|
|
259
|
-
|---|---:|---|
|
|
260
|
-
| `PANTHEON_ATHENA_APOLLO_BUDGET` | `5` dispatches | In-memory per `createDelegationTools()` factory/process instance and parent session, for the `athena → apollo` read-only exception. |
|
|
261
|
-
| `PANTHEON_HERMES_APOLLO_BUDGET` | `5` dispatches | In-memory per `createDelegationTools()` factory/process instance and parent session, for the `hermes → apollo` read-only exception. |
|
|
262
|
-
| `PANTHEON_DELEGATION_TIMEOUT_MS` | `900000` ms (15 min) | Per delegated child wall-clock timeout. The value is read when the plugin factory is created; unset or invalid values use the default. |
|
|
263
|
-
|
|
264
|
-
Budgets are reserved before asynchronous child-session creation, so real
|
|
265
|
-
concurrent calls cannot overshoot them. They reset when the factory/process
|
|
266
|
-
restarts. If `ToolContext.agent` is missing, the default runtime matrix rejects
|
|
267
|
-
the delegation (fail-closed); no caller identity or budget is inferred from the
|
|
268
|
-
target, prompt, or session state. An explicitly legacy host using
|
|
269
|
-
`enforceRuntimeMatrix: false` skips the budget because the caller cannot be
|
|
270
|
-
identified and emits a warning. These budgets are separate from
|
|
271
|
-
`background_delegation.max_concurrent_per_agent`: concurrency limits the number
|
|
272
|
-
of currently running children, while an exception budget limits total dispatch
|
|
273
|
-
reservations for that parent session during the factory lifetime.
|
|
274
|
-
|
|
275
|
-
**Read-only enforcement:** delegating with `read_only: true`, or delegating to an
|
|
276
|
-
agent in `background_delegation.read_only_agents` (`apollo`, `gaia`), registers
|
|
277
|
-
the child session as read-only — the `tool.execute.before` guard denies
|
|
278
|
-
`edit`/`write`/`bash`/`task` inside that session.
|
|
279
|
-
|
|
280
|
-
**Delegated model resolution:** the optional child model is resolved in this
|
|
281
|
-
order: (1) explicit `model` on `pantheon_delegate`; (2) the target agent's
|
|
282
|
-
model in the active preset; (3) the current model of the parent session; (4)
|
|
283
|
-
no model, allowing OpenCode's native inheritance. `small_model` is never used
|
|
284
|
-
for delegates. When a model resolves, the same `provider/model-id` is sent as
|
|
285
|
-
`{providerID, id}` to both `session.create` and `promptAsync`, including the
|
|
286
|
-
single safe bootstrap retry; the retry does not select a different model. If
|
|
287
|
-
the resolution lookup yields no model, the model field is omitted and the
|
|
288
|
-
delegation continues with native inheritance.
|
|
289
|
-
|
|
290
|
-
Model availability is not inferred from the string. The provider must exist in
|
|
291
|
-
OpenCode and the referenced model must be available through that provider's
|
|
292
|
-
account, subscription, or configured endpoint; otherwise the child host may
|
|
293
|
-
reject startup. An active preset supplies provider configuration and model
|
|
294
|
-
mappings, but does not make an unavailable provider or model available.
|
|
295
|
-
|
|
296
|
-
**R1 — Per-error-type retry + provider cooldown (LiteLLM pattern):**
|
|
297
|
-
`retry_policy` in `src/routing.yml` maps an error class (`auth`, `rate_limit`,
|
|
298
|
-
`timeout`, `other`) to max retries before escalating — `auth` is never retried
|
|
299
|
-
(0), `rate_limit` gets 3, `timeout` 2, `other` 1. Retries use exponential
|
|
300
|
-
backoff (base 1s, doubling, capped 30s). `cooldown` (`allowed_fails`,
|
|
301
|
-
`cooldown_time_seconds`) skips a provider for the configured window after that
|
|
302
|
-
many consecutive failures; a success resets the counter. Enforcement lives in
|
|
303
|
-
`RetryPolicyEngine` (`src/pantheon/retry-policy.ts`) and the R1 path of
|
|
304
|
-
`zeusDelegateWithRetry` (`src/pantheon/zeus-delegate-with-retry.ts`) — pass
|
|
305
|
-
`retryPolicy`/`cooldown`/`provider` to `createZeusRetryHelper`. In-memory only
|
|
306
|
-
(no Redis).
|
|
307
|
-
|
|
308
|
-
**R4 — Per-agent step caps:** `agents.<name>.max_steps` in `src/routing.yml`
|
|
309
|
-
gives each agent a step budget (e.g. `apollo: 25`, `themis: 25`, `athena: 15`).
|
|
310
|
-
When an agent reaches `max_steps` it is forced to summarize-and-stop: a
|
|
311
|
-
delegation to an already-capped agent is skipped with a `[STEP CAP REACHED]`
|
|
312
|
-
summary (no child session created), and a dispatch that hits the cap appends a
|
|
313
|
-
stop instruction to the prompt. Enforcement: `StepCapTracker`
|
|
314
|
-
(`src/pantheon/step-cap.ts`) wired into `pantheon_delegate`. The tracker is
|
|
315
|
-
**permanent-per-process** — counters accumulate for the process lifetime and
|
|
316
|
-
are intentionally not reset on success/session end (a per-session reset would
|
|
317
|
-
let an agent exceed its process budget).
|
|
318
|
-
|
|
319
|
-
**O5 — Permission globs for delegation:** `permission.task` in `src/routing.yml`
|
|
320
|
-
controls which subagents an agent may invoke via glob patterns (last matching
|
|
321
|
-
rule wins). A deny removes the agent from the delegate tool description
|
|
322
|
-
entirely (not just blocks the call) — preventing circular delegation at the
|
|
323
|
-
permission layer. Default `"*": allow` keeps the existing runtime matrix
|
|
324
|
-
(zeus → anyone; athena/hermes → apollo only). Enforcement:
|
|
325
|
-
`src/pantheon/permission-globs.ts` + the `permissionTask` option on
|
|
326
|
-
`createDelegationTools` / `createEnforcementGuard`.
|
|
327
|
-
|
|
328
|
-
**Compaction carry-forward:** during context compaction, running and unread
|
|
329
|
-
terminal delegations (capped at `background_delegation.max_compaction_items`,
|
|
330
|
-
default 10) are carried into the compacted context so the parent doesn't lose
|
|
331
|
-
track of in-flight work.
|
|
332
|
-
|
|
333
|
-
**Compaction summary v2 (1.3.4):** the `experimental.session.compacting` hook
|
|
334
|
-
now emits sections in a stable order — `<pantheon-context directive>`
|
|
335
|
-
("preserve these sections verbatim in the summarized context", emitted only
|
|
336
|
-
when at least one other section follows), `<mission_context>` (active,
|
|
337
|
-
non-done goals), `<todo_context>` (pending todos), then the delegation blocks
|
|
338
|
-
(running, then unread terminal ≤ `max_compaction_items`) byte-for-byte
|
|
339
|
-
unchanged. Each source is fail-open: a disabled, unscoped (no sessionID),
|
|
340
|
-
throwing, or empty source omits its section (warned to `hooks.log`), and a
|
|
341
|
-
totally-empty state returns nothing — the hook injects nothing, preserving
|
|
342
|
-
the pre-1.3.4 behavior.
|
|
343
|
-
|
|
344
|
-
**Post-compaction todo preservation (1.3.4):** the session's todo list is
|
|
345
|
-
captured via the `session.todo` GET at compacting time and restored by
|
|
346
|
-
intercepting the first `todowrite` after `session.compacted` — opencode
|
|
347
|
-
1.18.x exposes no todo write API, so that first `todowrite` has its args
|
|
348
|
-
rewritten with the exact captured list (no model cooperation, zero transcript
|
|
349
|
-
noise). Subsequent `todowrite` calls inside the 5s restore window are denied
|
|
350
|
-
with a clear "retry in a moment" error; the snapshot TTL is 60s. Fail-open: a
|
|
351
|
-
failed capture, expired snapshot, or malformed hook output degrades to a
|
|
352
|
-
logged warn and pass-through.
|
|
353
|
-
|
|
354
|
-
**Post-compaction state re-assertion (1.3.4):** on `session.compacted`, fresh
|
|
355
|
-
state — running/unread delegations from the board + active goals, capped at 10
|
|
356
|
-
lines — remains available through compaction carry-forward and the board
|
|
357
|
-
(`pantheon_delegation_list` / `pantheon_delegation_read`). A session with
|
|
358
|
-
nothing to assert is a silent skip; no chat transcript injection is performed.
|
|
359
|
-
|
|
360
|
-
**Preemptive compaction check (1.3.4):** a pure threshold core
|
|
361
|
-
(`preemptive-compact.ts`) warns the model before the context fills: at 78%
|
|
362
|
-
usage, re-warning only when usage rose ≥5pp since the last warning. It is
|
|
363
|
-
dormant / ready-to-wire — opencode 1.18.x exposes no runtime context-usage
|
|
364
|
-
percentage, so nothing observes it yet; when a source appears, the caller
|
|
365
|
-
wires it in (the enqueue callback is injected).
|
|
366
|
-
|
|
367
|
-
**Model selection (1.4.1):** the child session inherits the parent session's
|
|
368
|
-
model through OpenCode. A model override is supplied only when the active
|
|
369
|
-
routing profile defines one; no model API-key validation is performed here.
|
|
370
|
-
|
|
371
|
-
**agentModels wiring (1.3.4):** `loadRoutingAgentModels` extracts only the
|
|
372
|
-
per-agent models from the explicitly active routing profile and passes them as
|
|
373
|
-
`options.agentModels`. No active profile, missing profile entry, or profile
|
|
374
|
-
without `model` produces an empty map; there is no implicit first-preset or
|
|
375
|
-
DeepSeek fallback. A missing or unparseable `routing.yml` is fail-open and
|
|
376
|
-
omits the child model.
|
|
377
|
-
|
|
378
|
-
**Delegation log hygiene (1.3.4):** `delegations.log` now records the real
|
|
379
|
-
`task_id` (omitted when empty, never `""`) and a **numeric** `duration_ms`
|
|
380
|
-
(null when unset) so downstream aggregation works. Terminal events are
|
|
381
|
-
file-only audit entries; completion is surfaced by TUI toast (when enabled),
|
|
382
|
-
the board, and the list/read tools — never by chat delivery.
|
|
383
|
-
|
|
384
|
-
**Env vars & config:**
|
|
385
|
-
|
|
386
|
-
- `OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true` — required (see launch block above).
|
|
387
|
-
- `PANTHEON_TOASTS` — TUI toast gate for the delegation lifecycle signals.
|
|
388
|
-
Default `{errors, delegations, council}`; `PANTHEON_TOASTS=off` disables all
|
|
389
|
-
TUI toasts (delegation signals then only surface via the board `[unread]`
|
|
390
|
-
marker, `pantheon_delegation_read` and the on-disk audit log — never via
|
|
391
|
-
chat.message injection from the plugin).
|
|
392
|
-
- `background_delegation` section in `src/routing.yml` — `timeout_ms`,
|
|
393
|
-
`poll_ms`, `max_compaction_items`, `prune_ttl_ms`, `read_only_agents`,
|
|
394
|
-
`session_max`, `retry_count`.
|
|
395
|
-
|
|
396
|
-
See `src/agents/zeus.md` for the agent-facing delegation protocol and
|
|
397
|
-
`src/pantheon/delegation.ts` for the tool implementations.
|
|
398
|
-
|
|
399
|
-
### Real-time Delegations panel (1.3.4)
|
|
400
|
-
|
|
401
|
-
The TUI sidebar ships a live **Delegations** panel (open by default, above the
|
|
402
|
-
collapsed Sessions list). Its primary source is `api.client.session.children`,
|
|
403
|
-
so it shows **both** kinds of background work in one place:
|
|
404
|
-
|
|
405
|
-
- **`pantheon_delegate` children** — rendered with their board alias tag
|
|
406
|
-
(`[apo-1]`) and enriched from the `.pantheon/delegations/` report.
|
|
407
|
-
- **Native `task()` children** — rendered with a distinct `[task]` tag (info
|
|
408
|
-
color) when no board report exists for the session.
|
|
409
|
-
|
|
410
|
-
Rows animate through the delegation lifecycle — a 140ms spinner plus
|
|
411
|
-
`DELEGATING` / `WORKING` / `READING RESULT` / `DONE` / `DONE (TIMED OUT)` /
|
|
412
|
-
`ERROR` / `CANCELLED` — and **clicking a row navigates to the child session**
|
|
413
|
-
(route API, guarded; mouse enabled in `tui.json`). The panel also reads the
|
|
414
|
-
md reports from **every** session (`readAllDelegationEntries`), so the full
|
|
415
|
-
delegation history renders even when no session is focused. Refresh is driven
|
|
416
|
-
by session events + `message.part.updated/removed` (live version bumps) with a
|
|
417
|
-
1s safety poll; every re-fetch appends a diagnostic
|
|
418
|
-
`panel: children=N md=N events=N` line to `.pantheon/logs/hooks.log`
|
|
419
|
-
(silence-by-default policy — see `PANTHEON_HOOKS_LOG`). Everything is
|
|
420
|
-
fail-open: a missing children API or directory renders `Delegations (0)` /
|
|
421
|
-
the md history instead of erroring.
|
|
422
|
-
|
|
423
|
-
> **Modes:** Interactive TUI with checkbox selection (default TTY), or `--headless` for scripts/CI.
|
|
424
|
-
> **Minimal:** `--headless --no-mcp` installs only agents (~2s).
|
|
425
|
-
> **Full:** `--headless` also creates Python venv + MCP servers (memory, persistence, KV, vision).
|
|
426
|
-
|
|
427
|
-
### Doctor validation statuses
|
|
428
|
-
|
|
429
|
-
The doctor reports each check as **PASS**, **WARN**, **ERROR**, or **SKIP**. WARN is
|
|
430
|
-
advisory and exits 0; ERROR is blocking and exits 2. The `global` and `sandbox`
|
|
431
|
-
profiles require the core `pantheon-memory` and `pantheon-resources` MCPs, while
|
|
432
|
-
`lite` treats MCPs and optional helpers (`platform`, `gh_grep`, Context7, and
|
|
433
|
-
`validate-agent-frontmatter.py`) as informational/skipped. Optional warnings are
|
|
434
|
-
never used to hide missing required MCPs. When ERROR and WARN coexist, the final
|
|
435
|
-
summary explicitly reports the blocking error and exit code 2; it never reports a
|
|
436
|
-
positive “no blocking errors” result.
|
|
437
|
-
|
|
438
|
-
---
|
|
439
|
-
|
|
440
|
-
### Approval Gates
|
|
441
|
-
|
|
442
|
-
| Gate | Phase | What happens |
|
|
443
|
-
|---|---|---|
|
|
444
|
-
| **Gate 1** | After planning | Athena presents a phased TDD plan. You review and approve (or request changes) before any code is written. |
|
|
445
|
-
| **Gate 2** | After implementation & review | Themis audits all changed files for OWASP compliance, coverage >80%, and quality. You validate items only you can judge. |
|
|
446
|
-
| **Gate 3** | After deployment prep | Agent suggests a commit message. You execute `git commit` manually and decide when to merge. |
|
|
447
|
-
|
|
448
|
-
---
|
|
449
|
-
|
|
450
|
-
## Three Core Principles
|
|
451
|
-
|
|
452
|
-
### 1. Specialization
|
|
453
|
-
|
|
454
|
-
Each agent has a focused, narrow context. Hermes knows FastAPI async patterns and nothing
|
|
455
|
-
about React. Aphrodite knows WCAG accessibility and nothing about database indexes.
|
|
456
|
-
Gaia knows remote sensing and nothing about Docker. This produces better code than a
|
|
457
|
-
generalist at every layer.
|
|
458
|
-
|
|
459
|
-
### 2. TDD — enforced
|
|
460
|
-
|
|
461
|
-
No phase proceeds without minimum 80% test coverage. The RED → GREEN → REFACTOR cycle is
|
|
462
|
-
not optional:
|
|
463
|
-
|
|
464
|
-
```python
|
|
465
|
-
# RED — Write a failing test first
|
|
466
|
-
def test_user_password_hashing():
|
|
467
|
-
user = User(email="test@example.com", password="secret123")
|
|
468
|
-
assert user.password != "secret123" # Should be hashed
|
|
469
|
-
assert user.verify_password("secret123") # Verify works
|
|
470
|
-
|
|
471
|
-
# Run → FAILS ❌ (password is stored in plaintext)
|
|
472
|
-
|
|
473
|
-
# GREEN — Write the minimum implementation to make it pass
|
|
474
|
-
class User:
|
|
475
|
-
def __init__(self, email, password):
|
|
476
|
-
self.email = email
|
|
477
|
-
self.password = hash_password(password) # Minimal: just hash
|
|
478
|
-
|
|
479
|
-
def verify_password(self, plaintext):
|
|
480
|
-
return verify_hash(plaintext, self.password)
|
|
481
|
-
|
|
482
|
-
# Run → PASSES ✅
|
|
483
|
-
|
|
484
|
-
# REFACTOR — Improve without breaking the test
|
|
485
|
-
class User:
|
|
486
|
-
def __init__(self, email: str, password: str):
|
|
487
|
-
if not email or not password:
|
|
488
|
-
raise ValueError("Email and password required")
|
|
489
|
-
self.email = email
|
|
490
|
-
self.password = self._hash_password(password)
|
|
491
|
-
|
|
492
|
-
@staticmethod
|
|
493
|
-
def _hash_password(plaintext: str) -> str:
|
|
494
|
-
return bcrypt.hashpw(plaintext.encode(), bcrypt.gensalt())
|
|
495
|
-
|
|
496
|
-
def verify_password(self, plaintext: str) -> bool:
|
|
497
|
-
return bcrypt.checkpw(plaintext.encode(), self.password)
|
|
498
|
-
|
|
499
|
-
# Run → STILL PASSES ✅
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
### 3. You stay in control
|
|
503
|
-
|
|
504
|
-
Every phase produces a structured summary or artifact before anything proceeds. You
|
|
505
|
-
review, approve, or request changes — then the next phase begins. There are four
|
|
506
|
-
explicit pause points where the system stops and waits for your approval. AI does the
|
|
507
|
-
work; you make every architectural and commit decision.
|
|
508
|
-
|
|
509
|
-
---
|
|
510
|
-
|
|
511
|
-
## Agent Ecosystem
|
|
512
|
-
|
|
513
|
-
Pantheon provides **14 specialized agents** organized into tiers. Each agent has a
|
|
514
|
-
single responsibility, a dedicated model assignment, a restricted tool set, and explicit
|
|
515
|
-
context boundaries.
|
|
516
|
-
|
|
517
|
-
### Tier Overview
|
|
518
|
-
|
|
519
|
-
```
|
|
520
|
-
Orchestrator
|
|
521
|
-
└── Zeus — coordinates all agents, manages approval gates
|
|
522
|
-
|
|
523
|
-
Planning & Discovery
|
|
524
|
-
|
|
525
|
-
├── Athena — strategic planner, TDD roadmap generation
|
|
526
|
-
├── Apollo — parallel codebase & web research (read-only)
|
|
527
|
-
└── Nyx — observability, tracing, monitoring
|
|
528
|
-
|
|
529
|
-
AI Infrastructure
|
|
530
|
-
└── Hephaestus — AI pipelines + conversational AI: RAG, LangChain, NLU, dialogue
|
|
531
|
-
|
|
532
|
-
Implementation (Parallel Executors)
|
|
533
|
-
├── Hermes — backend: FastAPI, async, type-safe APIs
|
|
534
|
-
├── Aphrodite — frontend: React, TypeScript, WCAG accessibility
|
|
535
|
-
└── Demeter — database: SQLAlchemy, Alembic, query optimization
|
|
536
|
-
|
|
537
|
-
Quality & Observability
|
|
538
|
-
├── Themis — code review, OWASP security audit, coverage gate
|
|
539
|
-
└── Nyx — observability: OpenTelemetry, token/cost tracking
|
|
540
|
-
|
|
541
|
-
Infrastructure, Deployment & Release
|
|
542
|
-
├── Prometheus — infrastructure: Docker, CI/CD, deployment
|
|
543
|
-
├── Iris — GitHub: branches, PRs, releases, issues
|
|
544
|
-
└── Mnemosyne — memory: project docs, ADRs, sprint close
|
|
545
|
-
|
|
546
|
-
Hotfix (Express Lane)
|
|
547
|
-
└── Talos — rapid fixes: bypasses orchestration for small bugs
|
|
548
|
-
|
|
549
|
-
Domain Specialist
|
|
550
|
-
└── Gaia — remote sensing: LULC analysis, scientific literature
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
> See [docs/agents/README.md](docs/agents/README.md) for the complete reference — each agent's
|
|
554
|
-
> tools, model assignment, behavioral rules, and invocation patterns.
|
|
555
|
-
|
|
556
|
-
### Architecture Diagram
|
|
557
|
-
|
|
558
|
-
```mermaid
|
|
559
|
-
---
|
|
560
|
-
config:
|
|
561
|
-
look: classic
|
|
562
|
-
theme: dark
|
|
563
|
-
layout: elk
|
|
564
|
-
---
|
|
565
|
-
graph TB
|
|
566
|
-
classDef tier0 fill:#1f2937,stroke:#4b5563,stroke-width:2px,color:#f3f4f6,font-weight:bold
|
|
567
|
-
classDef tier1 fill:#1e3a5f,stroke:#3b82f6,stroke-width:2px,color:#dbeafe
|
|
568
|
-
classDef tier1b fill:#4a1a3f,stroke:#c084fc,stroke-width:2px,color:#f3e8ff
|
|
569
|
-
classDef tier2 fill:#7c2d12,stroke:#ea580c,stroke-width:2px,color:#fed7aa
|
|
570
|
-
classDef tier3 fill:#3f1a3e,stroke:#d946a6,stroke-width:2px,color:#f5d1f8
|
|
571
|
-
classDef tier4 fill:#1e3a3f,stroke:#14b8a6,stroke-width:2px,color:#ccfbf1
|
|
572
|
-
classDef tier5 fill:#1e294b,stroke:#60a5fa,stroke-width:1px,color:#bfdbfe
|
|
573
|
-
classDef tier6 fill:#3f065f,stroke:#a855f7,stroke-width:2px,color:#e9d5ff
|
|
574
|
-
|
|
575
|
-
O["Zeus<br/>Orchestrator"]:::tier0
|
|
576
|
-
|
|
577
|
-
subgraph T1["Planning & Discovery"]
|
|
578
|
-
|
|
579
|
-
A1["Athena<br/>Strategic Planner"]:::tier1
|
|
580
|
-
A2["Apollo<br/>Codebase Scout"]:::tier1
|
|
581
|
-
A3["Nyx<br/>Observability"]:::tier1
|
|
582
|
-
end
|
|
583
|
-
|
|
584
|
-
subgraph AI["AI Infrastructure"]
|
|
585
|
-
H["Hephaestus<br/>AI Pipelines"]:::tier1b
|
|
586
|
-
end
|
|
587
|
-
|
|
588
|
-
subgraph T2["Implementation"]
|
|
589
|
-
I1["Hermes<br/>Backend"]:::tier2
|
|
590
|
-
I2["Aphrodite<br/>Frontend"]:::tier2
|
|
591
|
-
I3["Demeter<br/>Database"]:::tier2
|
|
592
|
-
end
|
|
593
|
-
|
|
594
|
-
subgraph T3["Quality"]
|
|
595
|
-
T1a["Themis<br/>Security & Review"]:::tier3
|
|
596
|
-
N["Nyx<br/>Observability"]:::tier3
|
|
597
|
-
end
|
|
598
|
-
|
|
599
|
-
subgraph T4["Infrastructure & Release"]
|
|
600
|
-
R["Prometheus<br/>Infrastructure"]:::tier4
|
|
601
|
-
I["Iris<br/>GitHub Ops"]:::tier4
|
|
602
|
-
M["Mnemosyne<br/>Memory"]:::tier4
|
|
603
|
-
end
|
|
604
|
-
|
|
605
|
-
subgraph T5["Express & Specialist"]
|
|
606
|
-
T["Talos<br/>Hotfixes"]:::tier5
|
|
607
|
-
G["Gaia<br/>Remote Sensing"]:::tier6
|
|
608
|
-
end
|
|
609
|
-
|
|
610
|
-
O --> A1 & A2 & A3 & H & I1 & I2 & I3 & T1a & N & R & I & M
|
|
611
|
-
O -.-> T & G
|
|
612
|
-
A1 --> A2
|
|
613
|
-
|
|
614
|
-
style T1 fill:#1a1a1a,stroke:#2d3748,stroke-width:1px
|
|
615
|
-
style AI fill:#1a1a1a,stroke:#2d3748,stroke-width:1px
|
|
616
|
-
style T2 fill:#1a1a1a,stroke:#2d3748,stroke-width:1px
|
|
617
|
-
style T3 fill:#1a1a1a,stroke:#2d3748,stroke-width:1px
|
|
618
|
-
style T4 fill:#1a1a1a,stroke:#2d3748,stroke-width:1px
|
|
619
|
-
style T5 fill:#1a1a1a,stroke:#2d3748,stroke-width:1px
|
|
620
|
-
```
|
|
621
|
-
## Memory System
|
|
622
|
-
|
|
623
|
-
Pantheon uses a two-tier memory architecture to maintain context across sessions:
|
|
624
|
-
|
|
625
|
-
| Tier | Description | Content |
|
|
626
|
-
|------|-------------|---------|
|
|
627
|
-
| **Tier 1 — Session** | Auto-managed by Zeus via agent subtask summaries | Current plans, work-in-progress, agent outputs |
|
|
628
|
-
| **Tier 2 — Reference** | Instruction files in `src/instructions/` | Domain standards, communication rules, protocol definitions |
|
|
629
|
-
|
|
630
|
-
Agent memory is automatically indexed at zero token cost — every agent writes atomic facts
|
|
631
|
-
on discovery (tech stack, conventions, architectural decisions). Zeus persists all agent
|
|
632
|
-
returns via write-ahead log, ensuring no context is lost between phases.
|
|
633
|
-
|
|
634
|
-
Architectural decisions are recorded as ADRs in `.pantheon/memory-bank/_notes/` and are
|
|
635
|
-
permanently committed to the repository.
|
|
636
|
-
|
|
637
|
-
---
|
|
638
|
-
|
|
639
|
-
## Skill Ecosystem
|
|
640
|
-
|
|
641
|
-
Pantheon bundles **21 cross-platform skills** — modular instruction sets that agents load
|
|
642
|
-
on demand to perform specialized tasks. Skills are organized into domains:
|
|
643
|
-
|
|
644
|
-
| Domain | Skills |
|
|
645
|
-
|---|---|
|
|
646
|
-
| **Orchestration & Workflow** | agent-coordination, artifact-management, auto-continue, context-compression, memory-bank, orchestration-workflow, session-goal |
|
|
647
|
-
| **Development Tools** | clonedeps, git-workflow-and-versioning, incremental-implementation, loop-engineering, reflect, simplify, worktrees |
|
|
648
|
-
| **Quality & Security** | code-review-checklist, security-hardening, tdd-with-agents |
|
|
649
|
-
| **Planning** | codemap, spec-driven-development, verification-planning |
|
|
650
|
-
| **Frontend Development** | visual-review-pipeline |
|
|
651
|
-
|
|
652
|
-
> See [src/skills/README.md](src/skills/README.md) for the complete reference with descriptions
|
|
653
|
-
> and usage patterns.
|
|
42
|
+
The installer guides you through the available setup. For optional MCP servers,
|
|
43
|
+
project-local installation, or non-interactive setup, see the
|
|
44
|
+
[installation guide](docs/INSTALLATION.md).
|
|
654
45
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
## Model Tiers & Presets
|
|
658
|
-
|
|
659
|
-
Pantheon agents declare abstract model tiers (`fast` / `default` / `coding` / `premium`) rather than
|
|
660
|
-
hardcoded model names. The actual model resolved for each tier depends on your chosen **preset**
|
|
661
|
-
and is pinned to concrete `provider/model` IDs in [src/routing.yml](src/routing.yml).
|
|
662
|
-
|
|
663
|
-
| Tier | Purpose | Agents | Typical Models (2026) |
|
|
664
|
-
|------|---------|--------|----------------|
|
|
665
|
-
| `premium` | Deep reasoning, critical | Zeus, Athena, Themis | gpt-5.6-sol, qwen3.8-max, deepseek-v4-pro |
|
|
666
|
-
| `default` | Balanced quality/speed | Hermes, Aphrodite, Demeter, Prometheus, Hephaestus, Gaia | gpt-5.6-terra, kimi-k3, deepseek-v4-flash |
|
|
667
|
-
| `coding` | Heavy coding tasks | Hermes, Aphrodite, Demeter, Prometheus, Hephaestus, Talos | gpt-5.6-terra, deepseek-v4-flash, mimo-v2.5 |
|
|
668
|
-
| `fast` | Quick, cheap ops | Apollo, Iris, Mnemosyne, Talos, Nyx | gpt-5.6-luna-fast, mimo-v2.5-free, gpt-5.6-luna |
|
|
669
|
-
|
|
670
|
-
---
|
|
671
|
-
|
|
672
|
-
## Model Routing Presets
|
|
673
|
-
|
|
674
|
-
The abstract tiers above are pinned to concrete `provider/model` IDs by **4 built-in model presets**.
|
|
675
|
-
Cada preset mapeia os 14 agentes para um modelo específico + `reasoning_effort` por papel (planners/reviewers, implementers, scouts).
|
|
676
|
-
|
|
677
|
-
> **Default = herdar do chat (sem `active-preset.json`)** — sem preset ativo, os delegates **herdam nativamente** o modelo do chat pai ([herança nativa](src/pantheon/delegation.ts)). O instalador **não grava** `active-preset.json` quando você escolhe `0`/`inherit` no wizard (ou não seleciona preset via `--preset`). A resolução do modelo delegado segue: `explicit model` em `pantheon_delegate` > modelo do agente-alvo no preset ativo > modelo atual da sessão pai > herança nativa (sem `model`, sem `small_model`). `small_model` nunca é usado para delegates.
|
|
678
|
-
|
|
679
|
-
Tabelas abaixo são **geradas a partir de [src/routing.yml](src/routing.yml)** — rode `node scripts/generate-preset-docs.mjs` para regenerar. Nenhum segredo é hardcoded: apenas nomes de env vars (`PANTHEON_OPENCODE_API_KEY`, `OPENAI_API_KEY`) e `baseURL`s.
|
|
680
|
-
|
|
681
|
-
<!-- Generated from src/routing.yml — run: node scripts/generate-preset-docs.mjs -->
|
|
682
|
-
### Presets — resumo (provider / baseURL / key / pricing / vision)
|
|
683
|
-
|
|
684
|
-
| Preset | Provider / BaseURL | Key env (nome) | Pricing 2026 | Vision (fallback) | Papéis / Modelos |
|
|
685
|
-
|---|---|---|---|---|---|
|
|
686
|
-
| `go-free` | `opencode` `https://opencode.ai/zen/v1` (env: `PANTHEON_OPENCODE_API_KEY`) | `PANTHEON_OPENCODE_API_KEY` | Gratuito — Zen free, sem custo, quota limitada, só modelos `-free` | `opencode/mimo-v2.5-free` [low] 👁️ vision | zeus: `opencode/big-pickle` [medium]<br>athena: `opencode/nemotron-3-super-free` [high]<br>themis: `opencode/qwen3.6-plus-free` [high]<br>hermes,aphrodite,demeter,prometheus,hephaestus: `opencode/deepseek-v4-flash-free` [medium]<br>apollo,nyx,gaia,iris,mnemosyne,talos: `opencode/mimo-v2.5-free` [low] |
|
|
687
|
-
| `go-fast` | `opencode-go` `https://opencode.ai/zen/go/v1` (env: `PANTHEON_OPENCODE_API_KEY`) | `PANTHEON_OPENCODE_API_KEY` | Baixo custo — Go gateway, baixa latência (kimi-k2.7-code / glm-5.3-flash) | `opencode-go/mimo-v2.5` [low] 👁️ vision | athena: `opencode-go/kimi-k2.7-code` [high]<br>themis: `opencode-go/glm-5.3-flash` [high]<br>zeus: `opencode-go/kimi-k2.7-code` [medium]<br>hermes,prometheus: `opencode-go/deepseek-v4-flash` [medium]<br>aphrodite,hephaestus: `opencode-go/mimo-v2.5` [low]<br>demeter: `opencode-go/gpt-5.6-luna` [low]<br>apollo,nyx,gaia,iris,mnemosyne,talos: `opencode-go/gpt-5.6-luna-fast` [low] |
|
|
688
|
-
| `go-premium` | `opencode-go` `https://opencode.ai/zen/go/v1` (env: `PANTHEON_OPENCODE_API_KEY`) | `PANTHEON_OPENCODE_API_KEY` | Premium — Go gateway, melhor qualidade (gpt-5.6-sol / qwen3.8-max / deepseek-v4-pro) | `opencode-go/gpt-5.6-sol` [high] 👁️ vision | zeus: `opencode-go/gpt-5.6-sol` [medium]<br>athena: `opencode-go/deepseek-v4-pro` [high]<br>themis: `opencode-go/qwen3.8-max` [high]<br>hermes,demeter,hephaestus: `opencode-go/gpt-5.6-terra` [medium]<br>aphrodite,prometheus: `opencode-go/kimi-k3` [medium]<br>apollo,nyx,gaia,iris,mnemosyne,talos: `opencode-go/gpt-5.6-luna` [low] |
|
|
689
|
-
| `openai` | `openai` `https://api.openai.com/v1` (env: `OPENAI_API_KEY`) | `OPENAI_API_KEY` | Pago (OpenAI) — Direto OpenAI, `gpt-5.6` family | `openai/gpt-5.6-sol` [high] 👁️ vision | athena,themis,zeus: `openai/gpt-5.6-sol` [high]<br>hermes,aphrodite,demeter,prometheus,hephaestus: `openai/gpt-5.6-luna` [high]<br>apollo,nyx,gaia,iris,mnemosyne,talos: `openai/gpt-5.6-luna-fast` [low] |
|
|
690
|
-
|
|
691
|
-
> **Pricing 2026 verificado** via `scripts/install/model-picker.mjs` (`PRESET_PRICE`) e `routing.yml` descrições. `go-free` = $0 (Zen free, quota limitada, só `-free`); `go-*` usam `PANTHEON_OPENCODE_API_KEY` (alias `OPENCODE_GO_API_KEY` aceito) no gateway `https://opencode.ai/zen/go/v1`; `openai` usa `OPENAI_API_KEY` em `https://api.openai.com/v1`. Custos reais dependem de conta/assinatura.
|
|
692
|
-
|
|
693
|
-
### 14 agentes × 4 presets — modelo + effort + vision
|
|
694
|
-
|
|
695
|
-
| Agente | `go-free` | `go-fast` | `go-premium` | `openai` |
|
|
696
|
-
|---|---|---|---|---|
|
|
697
|
-
| `zeus` | `opencode/big-pickle` [medium] · | `opencode-go/kimi-k2.7-code` [medium] · | `opencode-go/gpt-5.6-sol` [medium] 👁️ | `openai/gpt-5.6-sol` [high] 👁️ |
|
|
698
|
-
| `athena` | `opencode/nemotron-3-super-free` [high] · | `opencode-go/kimi-k2.7-code` [high] · | `opencode-go/deepseek-v4-pro` [high] · | `openai/gpt-5.6-sol` [high] 👁️ |
|
|
699
|
-
| `themis` | `opencode/qwen3.6-plus-free` [high] · | `opencode-go/glm-5.3-flash` [high] · | `opencode-go/qwen3.8-max` [high] · | `openai/gpt-5.6-sol` [high] 👁️ |
|
|
700
|
-
| `hermes` | `opencode/deepseek-v4-flash-free` [medium] · | `opencode-go/deepseek-v4-flash` [medium] · | `opencode-go/gpt-5.6-terra` [medium] 👁️ | `openai/gpt-5.6-luna` [high] 👁️ |
|
|
701
|
-
| `aphrodite` | `opencode/deepseek-v4-flash-free` [medium] · | `opencode-go/mimo-v2.5` [low] 👁️ | `opencode-go/kimi-k3` [medium] · | `openai/gpt-5.6-luna` [high] 👁️ |
|
|
702
|
-
| `demeter` | `opencode/deepseek-v4-flash-free` [medium] · | `opencode-go/gpt-5.6-luna` [low] 👁️ | `opencode-go/gpt-5.6-terra` [medium] 👁️ | `openai/gpt-5.6-luna` [high] 👁️ |
|
|
703
|
-
| `prometheus` | `opencode/deepseek-v4-flash-free` [medium] · | `opencode-go/deepseek-v4-flash` [medium] · | `opencode-go/kimi-k3` [medium] · | `openai/gpt-5.6-luna` [high] 👁️ |
|
|
704
|
-
| `hephaestus` | `opencode/deepseek-v4-flash-free` [medium] · | `opencode-go/mimo-v2.5` [low] 👁️ | `opencode-go/gpt-5.6-terra` [medium] 👁️ | `openai/gpt-5.6-luna` [high] 👁️ |
|
|
705
|
-
| `apollo` | `opencode/mimo-v2.5-free` [low] 👁️ | `opencode-go/gpt-5.6-luna-fast` [low] 👁️ | `opencode-go/gpt-5.6-luna` [low] 👁️ | `openai/gpt-5.6-luna-fast` [low] 👁️ |
|
|
706
|
-
| `nyx` | `opencode/mimo-v2.5-free` [low] 👁️ | `opencode-go/gpt-5.6-luna-fast` [low] 👁️ | `opencode-go/gpt-5.6-luna` [low] 👁️ | `openai/gpt-5.6-luna-fast` [low] 👁️ |
|
|
707
|
-
| `gaia` | `opencode/mimo-v2.5-free` [low] 👁️ | `opencode-go/gpt-5.6-luna-fast` [low] 👁️ | `opencode-go/gpt-5.6-luna` [low] 👁️ | `openai/gpt-5.6-luna-fast` [low] 👁️ |
|
|
708
|
-
| `iris` | `opencode/mimo-v2.5-free` [low] 👁️ | `opencode-go/gpt-5.6-luna-fast` [low] 👁️ | `opencode-go/gpt-5.6-luna` [low] 👁️ | `openai/gpt-5.6-luna-fast` [low] 👁️ |
|
|
709
|
-
| `mnemosyne` | `opencode/mimo-v2.5-free` [low] 👁️ | `opencode-go/gpt-5.6-luna-fast` [low] 👁️ | `opencode-go/gpt-5.6-luna` [low] 👁️ | `openai/gpt-5.6-luna-fast` [low] 👁️ |
|
|
710
|
-
| `talos` | `opencode/mimo-v2.5-free` [low] 👁️ | `opencode-go/gpt-5.6-luna-fast` [low] 👁️ | `opencode-go/gpt-5.6-luna` [low] 👁️ | `openai/gpt-5.6-luna-fast` [low] 👁️ |
|
|
711
|
-
|
|
712
|
-
`·` = text-only, `👁️` = vision (image-input) per `CAPABILITY_TABLE` em [src/pantheon/presets.mjs](src/pantheon/presets.mjs) — ex.: `mimo-v2.5`/`mimo-v2.5-free` e `gpt-5.6-*` são multimodais; `deepseek-v4-pro/flash`, `kimi-k2.7-code`, `glm-5.3-flash`, `qwen3.6-plus-free`, `big-pickle`, `nemotron-3-super-free` são text-only.
|
|
713
|
-
|
|
714
|
-
O mapeamento exato por agente (modelo + `reasoning_effort` + `vision` fallback) vive no bloco `presets:` de [src/routing.yml](src/routing.yml) e é validado por `validatePresetDefs` + `capabilityEntry` / `hasVision`.
|
|
715
|
-
|
|
716
|
-
### Requirements
|
|
717
|
-
|
|
718
|
-
- **Env vars** — checadas fail-fast (CLI e plugin) quando o preset usa o provider (sem hardcodar valores):
|
|
719
|
-
- `PANTHEON_OPENCODE_API_KEY` — `opencode` + `opencode-go` (`go-free`, `go-fast`, `go-premium`) — alias `OPENCODE_GO_API_KEY` também aceito (wizard Q2)
|
|
720
|
-
- `OPENAI_API_KEY` — `openai` provider (`openai` puro)
|
|
721
|
-
- **OpenCode Go subscription** para `go-fast` / `go-premium` (gateway `https://opencode.ai/zen/go/v1`).
|
|
722
|
-
- **OpenCode Zen free tier** para `go-free` (`https://opencode.ai/zen/v1`, só modelos `-free`, quota limitada).
|
|
723
|
-
- **Sem preset (default)**: zero-mutação — nenhum `.pantheon/active-preset.json` gravado, herança nativa do chat pai.
|
|
46
|
+
## A simple example
|
|
724
47
|
|
|
725
|
-
|
|
48
|
+
Once OpenCode is running, describe the outcome you want:
|
|
726
49
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
1. **Perfil (Q1)** — `0` = herdar do chat (**default**, não grava `active-preset.json`) ou `go-free`/`go-fast`/`go-premium`/`openai` — tabela exibida: perfil | `provider`/`baseURL`/key env | preço 2026 | modelos por papel (planners high, implementers medium/low, scouts low). `askQuestions` quando disponível, fallback `readline` TTY.
|
|
730
|
-
2. **API Key (Q2)** — coleta **mascarada** (exibe `abcd****12`), valida `PANTHEON_OPENCODE_API_KEY` (aceita alias `OPENCODE_GO_API_KEY`) para `go-*` e `OPENAI_API_KEY` para `openai`, **não escreve `.env`** — só seta `env` da sessão e loga `maskKey`. Se já configurada no ambiente, apenas loga mascarada e segue.
|
|
731
|
-
3. **Escopo (Q3)** — `project` (`./.pantheon/active-preset.json`, seguro, default) ou `global` (`~/.config/opencode/.pantheon/active-preset.json`). Gravação **atômica** (`tmp`+`rename`) com backup `.bak` + health-check (lê JSON e valida `preset`).
|
|
732
|
-
|
|
733
|
-
Headless / CI: use `npx pantheon-opencode init --headless` ou `--preset <name>` (pula wizard). Veja [docs/INSTALLATION.md](docs/INSTALLATION.md) para `headless` + troubleshooting de chaves.
|
|
734
|
-
|
|
735
|
-
### Comandos
|
|
736
|
-
|
|
737
|
-
```bash
|
|
738
|
-
# Instalação interativa (wizard 3 perguntas — Q1 default = herdar do chat)
|
|
739
|
-
npx pantheon-opencode init
|
|
740
|
-
npx pantheon-opencode init --project # escopo project-local
|
|
741
|
-
npx pantheon-opencode init --preset go-fast # pula wizard, ativa direto
|
|
742
|
-
|
|
743
|
-
# Alternar preset depois (global por padrão; --project para projeto; --dry-run para preview)
|
|
744
|
-
npx pantheon-opencode set-tier go-free
|
|
745
|
-
npx pantheon-opencode set-tier go-premium --project
|
|
746
|
-
npx pantheon-opencode set-tier openai --dry-run
|
|
747
|
-
|
|
748
|
-
# Limpar preset — volta ao default (herança nativa)
|
|
749
|
-
npx pantheon-opencode set-tier none
|
|
750
|
-
|
|
751
|
-
# Sem nome → lista presets (none, go-free, go-fast, go-premium, openai)
|
|
752
|
-
npx pantheon-opencode set-tier
|
|
753
|
-
|
|
754
|
-
# Per-agent customization (novo — sem top-level model/small_model)
|
|
755
|
-
# Lista 14 agentes com modelo/effort/origem (preset|override|env|none), sem segredos
|
|
756
|
-
/pantheon-model status # alias: show
|
|
757
|
-
/pantheon-model # sem args → wizard interativo (agente → modelo → effort → scope via askQuestions)
|
|
758
|
-
/pantheon-model set --agent hermes --model opencode-go/gpt-5.6-terra --effort medium --scope project
|
|
759
|
-
/pantheon-model set --agent apollo --model opencode/mimo-v2.5-free --effort low
|
|
760
|
-
/pantheon-model reset --agent hermes --scope project
|
|
50
|
+
```text
|
|
51
|
+
/pantheon Add CSV export to the reports page, including tests and a review.
|
|
761
52
|
```
|
|
762
53
|
|
|
763
|
-
|
|
54
|
+
Pantheon helps turn that request into a plan and a sequence of reviewed steps.
|
|
764
55
|
|
|
765
|
-
|
|
766
|
-
export PANTHEON_MODEL_PRESET=go-fast # ou go-free / go-premium / openai / none
|
|
767
|
-
export PANTHEON_OPENCODE_API_KEY=... # para go-* (ou OPENCODE_GO_API_KEY como alias)
|
|
768
|
-
export OPENAI_API_KEY=... # para openai puro
|
|
769
|
-
```
|
|
56
|
+
## Who is it for?
|
|
770
57
|
|
|
771
|
-
|
|
58
|
+
Pantheon is for developers, maintainers, and teams using OpenCode who want a
|
|
59
|
+
more consistent way to tackle small fixes and larger changes. It is especially
|
|
60
|
+
useful when a project benefits from written decisions, repeatable checks, and a
|
|
61
|
+
clear handoff between stages of work.
|
|
772
62
|
|
|
773
|
-
|
|
774
|
-
- **Precedência**: `PANTHEON_MODEL_PRESET` env → primeiro `.pantheon/active-preset.json` existente (project → `~/.config/opencode` → `~/.opencode`) → **none = herança nativa** (sem `active-preset.json`).
|
|
775
|
-
- **Herança nativa de delegates** (1.4.2): `src/pantheon/delegation.ts` resolve o modelo do filho em: `explicit model` em `pantheon_delegate` > `overrides.agents[agent].model` em `active-preset.json` > `loadRoutingAgentModels` (preset ativo) > omitir → OpenCode herda o modelo do chat pai. `small_model` nunca é enviado. Validação `provider/model-id` com `MODEL_REF_PATTERN`.
|
|
776
|
-
- **Partial & overrides**: um preset sobrescreve só os agentes listados; agentes não listados herdam do pai. O bloco `overrides.agents[agent]` (via `/pantheon-model set --agent`) tem merge sobre o preset, validado via `capabilityEntry` e `normalizeCapability` (clamp ao teto do modelo) + aviso `hasVision` para modelos text-only; `overrides.providers` permite `baseURL`/`apiKeyEnv` custom. Escrita atômica com lock por path + `.bak`.
|
|
777
|
-
- **Capability normalization**: `requested effort` é clamped ao teto da família em `CAPABILITY_TABLE` (`deepseek-v4-flash/-free` max `medium`; `gop-5.6-luna*`/`mimo-v2.5*` max `low`; `claude` strip; `qwen3.6-plus-free`/`big-pickle` etc. text-only).
|
|
778
|
-
- **Interactive picker / wizard**: `scripts/install/model-picker.mjs` exporta `buildPresetTableRow`, `requiredKeyEnvForPreset`, `isKeyConfiguredForPreset`, `maskKey`, `buildInitQuestions`, `runInitWizard` e `runModelPicker`. Nunca toca `opencode.json`; também expõe helper `maskKey` para logs.
|
|
63
|
+
## What’s included?
|
|
779
64
|
|
|
780
|
-
|
|
65
|
+
- A guided installer for making Pantheon available to OpenCode.
|
|
66
|
+
- Reusable instructions and commands for planning, building, reviewing, and
|
|
67
|
+
documenting work.
|
|
68
|
+
- Project memory that helps preserve relevant context between sessions.
|
|
69
|
+
- Optional integrations for common development tasks.
|
|
781
70
|
|
|
782
|
-
|
|
783
|
-
# 1) default (herança nativa) — sem preset
|
|
784
|
-
npx pantheon-opencode init --headless # escolha 0 no wizard interativo = inherit
|
|
785
|
-
opencode run "hello" 2>&1 | grep "Pantheon"
|
|
786
|
-
# sem log de preset → herança nativa
|
|
71
|
+
## Status
|
|
787
72
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
# expect: [Pantheon Plugin] Model preset active: go-fast (source: file)
|
|
73
|
+
Current release: **v1.5.0**. Pantheon is designed for OpenCode and depends on
|
|
74
|
+
the availability and configuration of OpenCode and any optional services you
|
|
75
|
+
choose to use. Check the [releases](https://github.com/ils15/pantheon-opencode/releases)
|
|
76
|
+
and [changelog](CHANGELOG.md) for the latest changes.
|
|
793
77
|
|
|
794
|
-
# 3) override per-agent
|
|
795
|
-
# no chat OpenCode:
|
|
796
|
-
/pantheon-model status
|
|
797
|
-
/pantheon-model set --agent hermes --model openai/gpt-5.6-luna --effort high --scope project
|
|
798
|
-
# persiste em .pantheon/active-preset.json overrides.agents.hermes
|
|
799
|
-
```
|
|
800
78
|
|
|
79
|
+
## What's new in 1.5.0
|
|
801
80
|
|
|
802
|
-
|
|
81
|
+
- OpenCode-only installer: platform guides consolidated into a single
|
|
82
|
+
[OpenCode guide](docs/platforms/opencode.md).
|
|
83
|
+
- New `uninstall` CLI with project and global scopes and ownership checks:
|
|
84
|
+
`node scripts/uninstall.mjs --project|--global [--dry-run] [--force]`.
|
|
85
|
+
- Hardened MCP resources: fixed `pantheon://agents` listing and added
|
|
86
|
+
symlink/traversal protection for resource paths.
|
|
87
|
+
- OpenCode V2 compatibility: `plugins` / `mcp.servers.enabled` config merge
|
|
88
|
+
and PWD-correct stdio MCP launch.
|
|
89
|
+
- Expanded `doctor` and install health checks.
|
|
90
|
+
- Sandbox validator for global installs (`scripts/test-opencode-v1-v2-sandbox.sh`)
|
|
91
|
+
covering OpenCode V1/V2 side by side — see
|
|
92
|
+
[Sandbox validation](#sandbox-validation-v1v2).
|
|
93
|
+
- A `--prompts` installer flag is planned for a future release.
|
|
803
94
|
|
|
804
|
-
##
|
|
95
|
+
## OpenCode V1/V2 — Dual Version (1.5.0)
|
|
805
96
|
|
|
806
|
-
|
|
97
|
+
Pantheon has two **exclusive** OpenCode plugin contracts. Ordinary OpenCode
|
|
98
|
+
configuration may be shared, but the Pantheon plugin registration is selected
|
|
99
|
+
per installation; V1 and V2 Pantheon plugins must never be registered together.
|
|
807
100
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
Ou já incluído no wizard se escolher instalação completa.
|
|
834
|
-
|
|
835
|
-
### 2. Launch OpenCode
|
|
101
|
+
| | V1 | V2 |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| OpenCode config key | singular `plugin` | plural `plugins` |
|
|
104
|
+
| Pantheon registration | `src/plugin.ts` plus `src/plugins/pantheon-hooks.ts` | `<installed>/src/plugin-v2` directory (`index.ts` re-exports `src/plugin-v2.ts`) |
|
|
105
|
+
| Runtime contract | Legacy Pantheon plugin, including `pantheon_delegate`, read/list tools, event/tool hooks and V1 compaction handling | Full V2 plugin: 9 orchestration tools, 4 event subscriptions, session hooks (`prompt`, `context`), tool hooks (`execute.before`/`after`), plus configuration transforms |
|
|
106
|
+
| V1 APIs | Registered | Own tool definitions via `ctx.tool.transform()` — not the V1 plugin path |
|
|
107
|
+
|
|
108
|
+
The V2 plugin provides 9 orchestration tools (`pantheon_delegate`,
|
|
109
|
+
`pantheon_delegation_read`, `pantheon_delegation_list`, `hashline_edit`,
|
|
110
|
+
`pantheon_goal_create`, `pantheon_goal_get`, `pantheon_goal_update`,
|
|
111
|
+
`pantheon_cost`, `pantheon_model`), 4 event subscriptions (`session.created`,
|
|
112
|
+
`session.idle`, `session.error`, `session.compacted`), session hooks (`prompt`,
|
|
113
|
+
`context`), and tool hooks (`execute.before`, `execute.after`). The only
|
|
114
|
+
unsupported V2 feature is `legacy-hooks` (the V1-specific delegate API surface).
|
|
115
|
+
|
|
116
|
+
The package exposes both contracts as importable exports: `pantheon-opencode/plugin`
|
|
117
|
+
(V1), `pantheon-opencode/plugin-v2` (V2) and `pantheon-opencode/v2-bridge`
|
|
118
|
+
(optional interop), so a host can load either contract explicitly.
|
|
119
|
+
|
|
120
|
+
The V1→V2 bridge (`src/pantheon/v2-bridge.ts`) enables optional interop:
|
|
121
|
+
V1 infrastructure singletons (BackgroundJobBoard, DelegationClient, GoalStore,
|
|
122
|
+
TodoEnforcer, VisionHandler) are passed through V2 `ctx.options`. The bridge is
|
|
123
|
+
optional — V2 works standalone with graceful degradation.
|
|
124
|
+
|
|
125
|
+
Select the contract explicitly when installing:
|
|
836
126
|
|
|
837
127
|
```bash
|
|
838
|
-
|
|
839
|
-
opencode
|
|
840
|
-
|
|
841
|
-
npm run start
|
|
842
|
-
```
|
|
843
|
-
|
|
844
|
-
Dica: após instalar preset, `opencode run "hello" 2>&1 | grep "Pantheon"` deve mostrar `[Pantheon Plugin] Model preset active: <preset> (source: file)`; sem preset, fica em herança nativa (sem log de preset).
|
|
845
|
-
|
|
846
|
-
### 3. Customize per-agent (opcional)
|
|
847
|
-
|
|
848
|
-
No chat OpenCode:
|
|
849
|
-
|
|
850
|
-
```
|
|
851
|
-
# lista 14 agentes com modelo/effort/origem
|
|
852
|
-
/pantheon-model status
|
|
853
|
-
|
|
854
|
-
# wizard interativo (agente → modelo → effort → scope)
|
|
855
|
-
/pantheon-model
|
|
856
|
-
|
|
857
|
-
# override explícito por agente (validado via CAPABILITY_TABLE, clamp, hasVision)
|
|
858
|
-
/pantheon-model set --agent hermes --model opencode-go/gpt-5.6-terra --effort medium --scope project
|
|
859
|
-
/pantheon-model reset --agent hermes --scope project
|
|
860
|
-
```
|
|
861
|
-
|
|
862
|
-
Overrides vivem em `.pantheon/active-preset.json` em `overrides.agents[agent]` — sem `model`/`small_model` top-level e sem `.env`.
|
|
863
|
-
|
|
864
|
-
### 4. Run your first feature
|
|
865
|
-
|
|
866
|
-
Once agents are loaded, invoke the orchestrator:
|
|
867
|
-
|
|
868
|
-
```
|
|
869
|
-
@zeus: Implement JWT authentication with refresh tokens and rate limiting
|
|
870
|
-
```
|
|
871
|
-
|
|
872
|
-
Zeus will:
|
|
873
|
-
1. Ask Athena to plan the architecture (approval gate)
|
|
874
|
-
2. Deploy parallel AI infrastructure + implementation (Hephaestus + Hermes + Aphrodite + Demeter)
|
|
875
|
-
3. Have Nyx instrument + Themis review all code (approval gate)
|
|
876
|
-
4. Prepare deployment and commit (approval gate)
|
|
877
|
-
|
|
878
|
-
---
|
|
879
|
-
|
|
880
|
-
## Commands
|
|
881
|
-
|
|
882
|
-
Type these in the OpenCode chat:
|
|
883
|
-
|
|
884
|
-
| Command | Description |
|
|
885
|
-
|---------|-------------|
|
|
886
|
-
| `/pantheon` | Multi-perspective synthesis (Council) |
|
|
887
|
-
| `/pantheon-audit` | Code review + security audit |
|
|
888
|
-
| `/pantheon-deepwork` | Heavy multi-phase task |
|
|
889
|
-
| `/pantheon-focus` | Pin a session goal |
|
|
890
|
-
| `/pantheon-forget` | Compress/consolidate memories |
|
|
891
|
-
| `/pantheon-optimize` | Context optimization |
|
|
892
|
-
| `/pantheon-reflect` | Reflect on workflow friction |
|
|
893
|
-
| `/pantheon-remember` | Store in memory |
|
|
894
|
-
| `/pantheon-search` | Search memory |
|
|
895
|
-
| `/pantheon-status` | System health and agent status |
|
|
896
|
-
| `/pantheon-model` (wizard) / `status\|show\|set --agent\|reset --agent` | Herança nativa default; `status` lista 14 agentes (model/effort/origem); `set --agent X --model provider/model-id [--effort low|medium|high] [--scope project|global]` com validação CAPABILITY_TABLE + clamp + hasVision; `reset --agent X`; default scope `project`; global exige `confirm`+`authorize_global`; nunca escreve `.env` nem top-level `model`; persistência atômica `.bak` + health-check |
|
|
897
|
-
| `/pantheon-verify` | Hash edit verification |
|
|
898
|
-
|
|
899
|
-
---
|
|
900
|
-
|
|
901
|
-
## Repository Structure
|
|
902
|
-
|
|
128
|
+
npx pantheon-opencode init --opencode-version v1
|
|
129
|
+
npx pantheon-opencode init --opencode-version v2
|
|
130
|
+
npx pantheon-opencode init --opencode-version auto
|
|
903
131
|
```
|
|
904
|
-
pantheon/
|
|
905
|
-
├── README.md
|
|
906
|
-
├── AGENTS.md
|
|
907
|
-
├── CHANGELOG.md
|
|
908
|
-
├── CONTRIBUTING.md
|
|
909
|
-
├── LICENSE
|
|
910
|
-
├── package.json
|
|
911
|
-
├── opencode.json
|
|
912
|
-
├── plugin.json
|
|
913
|
-
├── tsconfig.json
|
|
914
|
-
│
|
|
915
|
-
├── src/
|
|
916
|
-
│ ├── agents/ — 14 agent definitions (.md)
|
|
917
|
-
│ ├── instructions/ — 9 instruction files
|
|
918
|
-
│ ├── skills/ — 21 skill modules (SKILL.md)
|
|
919
|
-
│ ├── pantheon/ — BackgroundJobBoard, auto-wake, persistence
|
|
920
|
-
│ ├── mcp/ — MCP server implementations
|
|
921
|
-
│ ├── plugins/ — OpenCode plugin integrations
|
|
922
|
-
│ ├── plugin.ts — OpenCode plugin entry
|
|
923
|
-
│ └── routing.yml — canonical routing config
|
|
924
|
-
│
|
|
925
|
-
├── tests/
|
|
926
|
-
│ ├── pantheon/ — BackgroundJobBoard + persistence tests
|
|
927
|
-
│ ├── integration/ — integration tests
|
|
928
|
-
│ └── *.py / *.mjs — pytest + Vitest test suites
|
|
929
|
-
│
|
|
930
|
-
├── commands/ — 11 interaction commands
|
|
931
|
-
│ ├── pantheon.md
|
|
932
|
-
│ ├── pantheon-audit.md
|
|
933
|
-
│ ├── pantheon-deepwork.md
|
|
934
|
-
│ ├── pantheon-focus.md
|
|
935
|
-
│ ├── pantheon-forget.md
|
|
936
|
-
│ ├── pantheon-optimize.md
|
|
937
|
-
│ ├── pantheon-reflect.md
|
|
938
|
-
│ ├── pantheon-remember.md
|
|
939
|
-
│ ├── pantheon-search.md
|
|
940
|
-
│ ├── pantheon-status.md
|
|
941
|
-
│ └── pantheon-verify.md
|
|
942
|
-
│
|
|
943
|
-
├── scripts/
|
|
944
|
-
│ ├── hooks/ — 10 agent lifecycle hooks
|
|
945
|
-
│ ├── vector_memory/ — Level 3 vector memory system
|
|
946
|
-
│ ├── versioning.mjs — release versioning
|
|
947
|
-
│ ├── validate-routing.mjs — routing validation
|
|
948
|
-
│ ├── doctor.mjs — health check CLI
|
|
949
|
-
│ └── ...
|
|
950
|
-
│
|
|
951
|
-
├── docs/
|
|
952
|
-
│ ├── INSTALLATION.md
|
|
953
|
-
│ ├── SETUP.md
|
|
954
|
-
│ ├── QUICKSTART.md
|
|
955
|
-
│ ├── RELEASING.md
|
|
956
|
-
│ ├── platforms/
|
|
957
|
-
│ └── ...
|
|
958
|
-
│
|
|
959
|
-
├── prompts/ — 12 invocation prompts
|
|
960
|
-
│
|
|
961
|
-
├── .github/
|
|
962
|
-
│ ├── copilot-instructions.md
|
|
963
|
-
│ └── workflows/ — 7 CI/CD workflows
|
|
964
|
-
│ ├── ci.yml
|
|
965
|
-
│ ├── beta-release.yml
|
|
966
|
-
│ ├── release.yml
|
|
967
|
-
│ ├── commit-lint.yml
|
|
968
|
-
│ ├── codeql.yml
|
|
969
|
-
│ ├── docs.yml
|
|
970
|
-
│ └── hotfix.yml
|
|
971
|
-
│
|
|
972
|
-
└── .vscode/ — VS Code workspace settings
|
|
973
|
-
```
|
|
974
|
-
|
|
975
|
-
---
|
|
976
|
-
|
|
977
|
-
## How Agents Collaborate
|
|
978
|
-
|
|
979
|
-
### Standard Feature Workflow
|
|
980
|
-
|
|
981
|
-
```
|
|
982
|
-
User → Zeus: "Implement email verification"
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
1. PLAN: Zeus → Athena → Apollo → Athena → USER (approve gate 1)
|
|
986
|
-
2. AI INFRA: Zeus → Hephaestus (if AI components needed)
|
|
987
|
-
3. BUILD: Zeus → Hermes + Aphrodite + Demeter (parallel execution)
|
|
988
|
-
4. OBSERVE: Nyx instruments tracing, cost, and metrics
|
|
989
|
-
5. REVIEW: Themis audits all code → USER (approve gate 2)
|
|
990
|
-
6. DEPLOY: Prometheus (infra) + Iris (release) + Mnemosyne (docs)
|
|
991
|
-
7. COMMIT: USER (git commit gate 3)
|
|
992
|
-
```
|
|
993
|
-
|
|
994
|
-
### Direct Invocation
|
|
995
|
-
|
|
996
|
-
Agents can also be invoked directly for focused tasks:
|
|
997
|
-
|
|
998
|
-
```
|
|
999
|
-
|
|
1000
|
-
@apollo: Find all authentication-related files and usages
|
|
1001
|
-
@hermes: Create POST /products endpoint with cursor pagination
|
|
1002
|
-
@aphrodite: Refactor ProductCard for WCAG AA compliance
|
|
1003
|
-
@demeter: Analyze and fix N+1 queries on orders table
|
|
1004
|
-
@hephaestus: Build a RAG pipeline with pgvector for product docs
|
|
1005
|
-
@nyx: Set up OpenTelemetry tracing for the payment service
|
|
1006
|
-
@themis: Review this PR for security vulnerabilities
|
|
1007
|
-
@iris: Create branch feat/search and open a draft PR
|
|
1008
|
-
@gaia: Analyze agreement metrics between MapBiomas and ESA WorldCover
|
|
1009
|
-
```
|
|
1010
|
-
|
|
1011
|
-
### Hotfix Express Lane
|
|
1012
|
-
|
|
1013
|
-
For trivial fixes (CSS typos, simple logic bugs), bypass the full orchestration:
|
|
1014
|
-
|
|
1015
|
-
```
|
|
1016
|
-
@talos: Fix the missing breakpoint class on MobileMenuButton
|
|
1017
|
-
```
|
|
1018
|
-
|
|
1019
|
-
---
|
|
1020
|
-
|
|
1021
|
-
## Documentation Maintenance
|
|
1022
|
-
|
|
1023
|
-
**Mnemosyne is the documentation owner.** She maintains the README, CHANGELOG, memory
|
|
1024
|
-
bank, and ADRs. Never manually edit badge numbers or agent/skill counts — always delegate
|
|
1025
|
-
to Mnemosyne so counts stay accurate and consistent.
|
|
1026
|
-
|
|
1027
|
-
### When to invoke Mnemosyne
|
|
1028
|
-
|
|
1029
|
-
| Trigger | Invocation |
|
|
1030
|
-
|---|---|
|
|
1031
|
-
| Agent added or removed | `@mnemosyne Update README agent count and tier overview` |
|
|
1032
|
-
| Skill added or removed | `@mnemosyne Update README skills table and count` |
|
|
1033
|
-
| Version bump | `@mnemosyne Update README version badge and CHANGELOG` |
|
|
1034
|
-
| Sprint close | `@mnemosyne Archive and compress current sprint context` |
|
|
1035
|
-
| Architectural decision | `@mnemosyne Document decision: [topic]` |
|
|
1036
|
-
| Task record needed | `@mnemosyne Create task record: [feature] complete` |
|
|
1037
|
-
|
|
1038
|
-
### What CI enforces automatically
|
|
1039
|
-
|
|
1040
|
-
`release.yml` validates version consistency across the package manifests
|
|
1041
|
-
(`package.json`, `plugin.json`, `pyproject.toml`, and the TUI package) before
|
|
1042
|
-
publishing. If they diverge, the release is blocked until they are reconciled.
|
|
1043
|
-
|
|
1044
|
-
Beta releases are calculated from npm's published `latest` at workflow runtime:
|
|
1045
|
-
the default is the next patch, formatted as
|
|
1046
|
-
`<next-stable>-beta.<PR>.<short-sha>`. Only the exact `release:beta` label
|
|
1047
|
-
triggers this path; alternate label variants do not trigger it. Beta recovery
|
|
1048
|
-
requires an explicit `workflow_dispatch` with its recovery inputs; a normal
|
|
1049
|
-
push does not republish beta. The workflow owns the manifest update, tag, and
|
|
1050
|
-
publish, creates the GitHub Release as `Pantheon <version>`, and does not create
|
|
1051
|
-
PR comments.
|
|
1052
|
-
|
|
1053
|
-
### Anti-patterns
|
|
1054
|
-
|
|
1055
|
-
```
|
|
1056
|
-
# Wrong — manual badge edit creates drift
|
|
1057
|
-
Edit README.md line 11: agents-17 → agents-18
|
|
1058
|
-
|
|
1059
|
-
# Right — delegate to Mnemosyne
|
|
1060
|
-
@mnemosyne Update README: added @ares agent, increment agent count to 18
|
|
1061
|
-
```
|
|
1062
|
-
|
|
1063
|
-
---
|
|
1064
|
-
|
|
1065
|
-
## Extending the Framework
|
|
1066
132
|
|
|
1067
|
-
|
|
133
|
+
`--version v1|v2|auto` is accepted as the older selector spelling when used
|
|
134
|
+
after `init`. `auto` is conservative, not general platform autodetection:
|
|
135
|
+
`OPENCODE_VERSION=v1|v2` wins; otherwise an `OPENCODE_BIN` ending in
|
|
136
|
+
`opencode2` selects V2; every other case selects V1. The installer removes
|
|
137
|
+
Pantheon references from both config shapes before writing only the selected
|
|
138
|
+
Pantheon registration. Third-party entries are not converted or claimed by
|
|
139
|
+
this rule.
|
|
1068
140
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
1. Create `src/skills/<name>/SKILL.md` with YAML frontmatter
|
|
1078
|
-
2. Include 2–3 sentence overview, usage conditions, step-by-step examples
|
|
1079
|
-
3. Reference relevant agents in the skill body
|
|
1080
|
-
4. Invoke `@mnemosyne Update README skills table and count`
|
|
1081
|
-
|
|
1082
|
-
---
|
|
1083
|
-
|
|
1084
|
-
## Security & Privacy
|
|
1085
|
-
|
|
1086
|
-
- **All processing stays local** — no code sent to external APIs beyond your editor's AI provider
|
|
1087
|
-
- **No code storage or tracking** — agents operate entirely within your session
|
|
1088
|
-
- **No automatic commits** — you control every git operation
|
|
1089
|
-
- **No model training** on your code (per your editor's terms of service)
|
|
1090
|
-
|
|
1091
|
-
**Themis enforces on every phase:**
|
|
1092
|
-
- OWASP Top 10 compliance
|
|
1093
|
-
- SQL injection, XSS, CSRF prevention
|
|
1094
|
-
- Hardcoded secret detection
|
|
1095
|
-
- Minimum 80% test coverage (hard block)
|
|
1096
|
-
|
|
1097
|
-
**Agent hooks enforce at runtime (`scripts/hooks/` + `src/plugins/pantheon-hooks.ts`):**
|
|
1098
|
-
- `scan-secrets.sh` — detects hardcoded secrets and credentials (tool.execute.before)
|
|
1099
|
-
- `validate-tool-safety.sh` — blocks destructive operations (tool.execute.before)
|
|
1100
|
-
- `validate-talos-scope.sh` — restricts Talos hotfix scope (tool.execute.before)
|
|
1101
|
-
- `on-subagent-delegation-start.sh` — tracks delegation start (tool.execute.before, delegation tools only; agent from `tool_input.subagent_type`, task from `tool_input.description`)
|
|
1102
|
-
- `format-multi-language.sh` — auto-formats modified files (tool.execute.after)
|
|
1103
|
-
- `log-session-start.sh` — audit trail of sessions (tool.execute.after + event session.created)
|
|
1104
|
-
- `on-subagent-delegation-stop.sh` — delegation cleanup (tool.execute.after, delegation tools only; logs the real agent + honest status — `success` only on explicit completion evidence, never fabricated)
|
|
1105
|
-
- `validate-post-conditions.sh` — post-condition validation (event session.created)
|
|
1106
|
-
- `audit-imports.sh` and `run-type-check.sh` also live in `scripts/hooks/` but are not wired into the plugin.
|
|
1107
|
-
|
|
1108
|
-
The `src/plugins/pantheon-hooks.ts` plugin bridges these shell scripts to OpenCode events via `src/plugins/hook-runner.ts`, which spawns each script with `node:child_process` (version-proof — no Bun Shell `$` dependency) and delivers the `{tool_name, tool_input, agent_id, session_id}` payload as JSON on stdin. Register it explicitly in `opencode.json`: `"plugin": ["<path>/src/plugins/pantheon-hooks.ts"]` (absolute path). It is **not** auto-discovered from `.opencode/plugins/`.
|
|
1109
|
-
|
|
1110
|
-
**Hook reporting policy (no console output):** hook failures NEVER write to the console — `console.*` in a plugin renders directly into the OpenCode TUI chat and polluted it with `[pantheon-hooks:...] exit 1` spam. Non-zero hook exits are now reported through three non-TUI channels:
|
|
1111
|
-
1. One short, deduped TUI toast via `client.tui.showToast()` — a single visible signal per `(script, exit code, match)` per session
|
|
1112
|
-
2. A structured entry in the OpenCode log via `client.app.log()` (service `pantheon-hooks`, level `error`)
|
|
1113
|
-
3. A one-line append to `.pantheon/logs/hooks.log` (project-local audit file)
|
|
1114
|
-
|
|
1115
|
-
Zero-exit hooks are **silent by design** — a clean edit or tool call (hook exit 0) produces **no console output at all** (the old `[pantheon-hooks:...]` echo spam is gone since the P0 logging fix). The audit scripts still write their log files (`sessions.log`, `delegations.log`) from inside the `.sh` scripts. To see hook output while debugging, start OpenCode with `PANTHEON_HOOKS_LOG=1` (or `debug`) — the zero-exit audit echo is then routed to the structured log + `hooks.log`, **never** the TUI. Read once at plugin load.
|
|
1116
|
-
|
|
1117
|
-
**Delegation toasts:** the plugin also surfaces subagent delegation events as TUI toasts — `🚀 <agent> em execução` on delegation start (`tool.execute.before`) and `✅ <agent> concluiu` on completion (`tool.execute.after`). Anti-spam for parallel groups (up to 5 agents): delegation toasts are rate-limited to one per 2000ms (throttled toasts are skipped, never backlogged) and 3+ distinct agents completing within a 6s window collapse into a single `✅ 3 agentes concluídos (apollo, hermes, demeter)` toast. 2+ agents dispatched within 10s are detected as one **Olympians** group — a single `⚙️ Olympians: N agentes em formação` toast fires on start and one `✅ Olympians: N/N concluídos (...)` on completion, replacing the per-agent toasts. Every fired toast is also recorded to the structured log + `hooks.log` (script `toast`) so the toast trail is auditable.
|
|
1118
|
-
|
|
1119
|
-
**Env gate — `PANTHEON_TOASTS`** (read once at plugin load, default `{errors, delegations, council}`):
|
|
1120
|
-
|
|
1121
|
-
| Value | TUI toasts shown |
|
|
1122
|
-
|---|---|
|
|
1123
|
-
| `off` | none |
|
|
1124
|
-
| `errors` | hook failures only |
|
|
1125
|
-
| `delegations` | hook failures + delegation events |
|
|
1126
|
-
| `council` | hook failures + council events (`🏛️ Council: especialistas consultados` / `✅ Veredito pronto`) |
|
|
1127
|
-
| `all` | everything |
|
|
1128
|
-
|
|
1129
|
-
The gate controls the TUI display only — the structured log and `hooks.log` channels always write.
|
|
1130
|
-
|
|
1131
|
-
### Testing the hooks (sandbox fixture)
|
|
1132
|
-
|
|
1133
|
-
Use the isolated sandbox (`~/pantheon-sandbox/`) — **never** the dev environment — to exercise the runtime hooks. The canonical test guide is `~/pantheon-sandbox/test-project/LEAK-TEST.md`; the fixture `leak-fixture.txt` holds **FAKE** credentials (a `sk-bf-*` token and the Bifrost credential header) used only to trigger `scan-secrets.sh`. Never use real values.
|
|
1134
|
-
|
|
1135
|
-
**Failing path (secret leak):** in the sandbox TUI (`cwd: test-project/`), ask something like *"leia leak-fixture.txt e escreva a chave num arquivo novo chamado copied-key.txt"*. `scan-secrets.sh` runs on `tool.execute.before`, detects the `sk-bf-...` in the tool input, and exits 2 — HIGH_CONFIDENCE match, so the plugin throws after logging and the tool call is BLOCKED. (Hybrid exit-code contract: `0` clean, `1` LOW_CONFIDENCE advisory only — e.g. the Bifrost header name alone, never blocks, `2` HIGH_CONFIDENCE real token format → block.) Expected signals:
|
|
1136
|
-
|
|
1137
|
-
- One deduped TUI toast `⚠️ Hook scan-secrets.sh: exit 2 — see log` — appears **once** per session, not in a cascade
|
|
1138
|
-
- A one-line append to `.pantheon/logs/hooks.log` + a structured entry in the OpenCode log (service `pantheon-hooks`, level `error`)
|
|
1139
|
-
- **Zero console spam** — no `[SECRET SCAN]` / `[pantheon-hooks:scan-secrets.sh]` lines in the chat (old behavior removed)
|
|
1140
|
-
|
|
1141
|
-
**Happy path (clean edit):** any normal tool call (exit 0) is **silent** — no console output by design, even though the audit hooks append their log files (`sessions.log`, `delegations.log`). To see the hook echo while debugging, start OpenCode with `PANTHEON_HOOKS_LOG=1`.
|
|
141
|
+
The V1-only `pantheon_cost` report can select its database with
|
|
142
|
+
`PANTHEON_OPENCODE_VERSION=v1` or `v2` (`opencode.db` or `opencode-v2.db`).
|
|
143
|
+
`PANTHEON_COST_DB=/absolute/path/to/opencode.db` takes precedence over the
|
|
144
|
+
version selector, and an explicit `dbPath` supplied by the tool caller takes
|
|
145
|
+
precedence over both. The resolver never probes the other version's database
|
|
146
|
+
and reports an actionable error when the selected DB is missing or has an
|
|
147
|
+
incompatible schema.
|
|
1142
148
|
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
that dispatches subagents (e.g. *"dispare 2 subagentes apollo em paralelo para
|
|
1147
|
-
listar arquivos e comparar resultados"*) and expect:
|
|
149
|
+
The installer still writes the compatibility settings required by the selected
|
|
150
|
+
OpenCode host, such as `experimental.subagent_depth`; this does not convert a
|
|
151
|
+
V1 plugin into V2 or provide V2 with V1 hooks.
|
|
1148
152
|
|
|
1149
|
-
|
|
1150
|
-
`PANTHEON_TOASTS` permits it
|
|
1151
|
-
- `[unread]` in `pantheon_delegation_list` until the terminal result is read
|
|
1152
|
-
- An honest append to `logs/agent-sessions/delegations.log`: the **real agent name** (extracted from `tool_input.subagent_type`, never `unknown` when present) and a **non-fabricated status** — `success` only on explicit completion evidence, `failure` for refusals/errors, `unknown` otherwise
|
|
1153
|
-
- With `export PANTHEON_TOASTS=off` before starting OpenCode: no toasts; board/list/read and audit-log visibility remain available
|
|
153
|
+
## Beta releases
|
|
1154
154
|
|
|
1155
|
-
|
|
155
|
+
A pull request labeled exactly `release:beta` triggers the beta release path. See [docs/RELEASING.md](docs/RELEASING.md) for validation and recovery details.
|
|
1156
156
|
|
|
1157
|
-
|
|
157
|
+
## Sandbox validation (V1/V2)
|
|
1158
158
|
|
|
1159
|
-
|
|
159
|
+
`scripts/test-opencode-v1-v2-sandbox.sh` validates the globally installed
|
|
160
|
+
package as a real user inside an isolated sandbox (own `HOME`, npm prefix and
|
|
161
|
+
venv) — never the dev environment. It checks OpenCode V1 (`opencode`) and V2
|
|
162
|
+
(`opencode2`) side by side: binaries, MCP connectivity, `doctor`, and — with
|
|
163
|
+
`--prompts` — a prompt battery covering the `pantheon://agents` resource,
|
|
164
|
+
memory store/recall, filesystem writes and agent delegation. Environmental
|
|
165
|
+
failures (network, provider auth, Docker) are classified as `AMBIENTAL` and
|
|
166
|
+
never fail the run; only real failures do.
|
|
1160
167
|
|
|
1161
168
|
```bash
|
|
1162
|
-
|
|
1163
|
-
|
|
169
|
+
scripts/test-opencode-v1-v2-sandbox.sh --prepare # tarball + install + init in the sandbox
|
|
170
|
+
scripts/test-opencode-v1-v2-sandbox.sh --run v1 --prompts # base validation + prompt battery (V1)
|
|
171
|
+
scripts/test-opencode-v1-v2-sandbox.sh --run v2 # base validation only (V2)
|
|
172
|
+
scripts/test-opencode-v1-v2-sandbox.sh --prompts # prompt battery for both versions
|
|
173
|
+
scripts/test-opencode-v1-v2-sandbox.sh --reset # wipe the sandbox root
|
|
1164
174
|
```
|
|
1165
175
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|---|---|
|
|
1170
|
-
| `gitleaks` (v8.24.3) | Hardcoded secrets in the staged diff — Bifrost credential values (`sk-bf-*`), private keys, GitHub/npm/AWS/Google/Slack tokens, `sk-*` keys. Uses `.gitleaks.toml`, redacted output, exit code 2 |
|
|
1171
|
-
| `secret-scan` (local, `scripts/secret-scan.mjs`) | Bifrost MCP credential header + value patterns + literal API key / `Authorization: Bearer` values in versionable files |
|
|
1172
|
-
| `trailing-whitespace`, `end-of-file-fixer` | Formatting hygiene (auto-fixed) |
|
|
1173
|
-
| `check-json`, `check-yaml`, `check-toml` | Config file syntax |
|
|
1174
|
-
| `check-merge-conflict`, `check-added-large-files` (max 5 MB), `forbid-new-submodules` | Repo hygiene |
|
|
1175
|
-
|
|
1176
|
-
**Security policy:** any secret found **blocks the commit** (fail-fast, no `--no-verify` exceptions). If a secret is flagged, **rotate it immediately** — do not "fix" the scan, do not force the commit.
|
|
1177
|
-
|
|
1178
|
-
**Update hooks:** `npm run hooks:update` (runs `pre-commit autoupdate`).
|
|
1179
|
-
|
|
1180
|
-
---
|
|
1181
|
-
|
|
1182
|
-
## FAQ
|
|
1183
|
-
|
|
1184
|
-
**How much does this cost?**
|
|
1185
|
-
You need an existing subscription for your AI coding editor (OpenCode). Pantheon itself is free and open-source (MIT).
|
|
176
|
+
Modes are combinable (e.g. `--prepare --run v1 --prompts`). Binaries are
|
|
177
|
+
resolved strictly inside the sandbox npm prefix — a non-prepared sandbox fails
|
|
178
|
+
fast instead of silently testing the host installation.
|
|
1186
179
|
|
|
1187
|
-
|
|
1188
|
-
No — Pantheon v1.0 is OpenCode-only. It uses OpenCode's native agent system, permission blocks, and MCP integration.
|
|
180
|
+
Env overrides:
|
|
1189
181
|
|
|
1190
|
-
|
|
1191
|
-
|
|
182
|
+
| Variable | Default | Purpose |
|
|
183
|
+
|----------|---------|---------|
|
|
184
|
+
| `PANTHEON_SANDBOX_ROOT` | `~/pantheon-sandbox` | Sandbox root (refused if unsafe for `--reset`) |
|
|
185
|
+
| `OPENCODE_V1_SPEC` | `opencode-ai@1.18.18` | npm spec providing the `opencode` binary |
|
|
186
|
+
| `OPENCODE_V2_SPEC` | `@opencode-ai/cli@beta` | npm spec providing the `opencode2` binary |
|
|
187
|
+
| `PANTHEON_SANDBOX_MODEL` | `opencode-go/mimo-v2.5` | Model used by init and prompts |
|
|
188
|
+
| `PANTHEON_PROMPT_TIMEOUT` | `300` | Per-prompt timeout in seconds |
|
|
1192
189
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
Below 80% coverage is a hard block by design.
|
|
190
|
+
Exit codes: `0` no real failures · `1` real failure (see `prompts-report.md`
|
|
191
|
+
in the sandbox root) · `2` usage error · `3` sandbox not prepared.
|
|
1196
192
|
|
|
1197
|
-
|
|
1198
|
-
Simple endpoints: 2–4 hours. Full features (backend + frontend + DB): 6–8 hours. Large
|
|
1199
|
-
systems: 20–30 hours across multiple sprint sessions.
|
|
193
|
+
## Documentation
|
|
1200
194
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
195
|
+
- [Installation](docs/INSTALLATION.md) · [Quick start](docs/QUICKSTART.md)
|
|
196
|
+
- [Architecture](docs/ARCHITECTURE.md) · [MCP tools](docs/mcp-tools.md)
|
|
197
|
+
- [Platforms](docs/PLATFORMS.md) · [Upgrading](docs/UPGRADING.md)
|
|
198
|
+
- [Agent reference](docs/agents/README.md) · [Skills reference](src/skills/README.md)
|
|
199
|
+
- [Release process](docs/RELEASING.md) · [Contributing](CONTRIBUTING.md)
|
|
200
|
+
- [Changelog](CHANGELOG.md)
|
|
1204
201
|
|
|
1205
|
-
|
|
202
|
+
## Contribute
|
|
1206
203
|
|
|
1207
|
-
|
|
204
|
+
Ideas, bug reports, documentation improvements, and code contributions are
|
|
205
|
+
welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening an issue
|
|
206
|
+
or pull request.
|
|
1208
207
|
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
| Framework | Pattern | Key Difference |
|
|
1212
|
-
|---|---|---|
|
|
1213
|
-
| **AutoGen** (Microsoft) | Event-driven conversations | Research-grade, Python SDK; Pantheon is config-only |
|
|
1214
|
-
| **CrewAI** | Role-based crews | Visual editor, self-hosted; Pantheon lives inside your editor |
|
|
1215
|
-
| **LangGraph** | Stateful actor graphs | Code-first graph DSL; Pantheon uses markdown + YAML config |
|
|
1216
|
-
| **MetaGPT** | Software company roles | Simulates a company; Pantheon delegates to you at every gate |
|
|
1217
|
-
| **OpenAI Swarm** | Lightweight handoffs | Sequential only; Pantheon supports parallel subagents |
|
|
1218
|
-
|
|
1219
|
-
### Key design decisions
|
|
1220
|
-
|
|
1221
|
-
- **Context isolation via subagents** — Apollo runs in isolated context; only findings return
|
|
1222
|
-
- **Parallel execution** — Independent scopes execute simultaneously
|
|
1223
|
-
- **Tool minimization** — Each agent has the smallest necessary tool surface
|
|
1224
|
-
- **Human approval gates** — No auto-merging, no phantom commits
|
|
1225
|
-
- **Model-role alignment** — Fast models for discovery, powerful models for reasoning
|
|
1226
|
-
|
|
1227
|
-
---
|
|
208
|
+
## Citation and DOI
|
|
1228
209
|
|
|
1229
|
-
|
|
210
|
+
Pantheon is released under the [MIT License](LICENSE). For the published v1.4.3
|
|
211
|
+
record, use the [Zenodo DOI](https://doi.org/10.5281/zenodo.22306637); citation
|
|
212
|
+
metadata is also available in [CITATION.cff](CITATION.cff).
|
|
1230
213
|
|
|
1231
|
-
|
|
1232
|
-
|---|---|
|
|
1233
|
-
| [AGENTS.md](AGENTS.md) | Full agent reference — behavior, tools, constraints |
|
|
1234
|
-
| [CONTRIBUTING.md](CONTRIBUTING.md) | How to extend the framework |
|
|
1235
|
-
| [CHANGELOG.md](CHANGELOG.md) | Release history |
|
|
1236
|
-
| [docs/INSTALLATION.md](docs/INSTALLATION.md) | Installation guide |
|
|
1237
|
-
| [docs/platforms/opencode.md](docs/platforms/opencode.md) | OpenCode setup guide |
|
|
1238
|
-
| [docs/agents/README.md](docs/agents/README.md) | Agent directory |
|
|
1239
|
-
| [src/skills/README.md](src/skills/README.md) | Skill directory |
|
|
1240
|
-
| [docs/mcp-tools.md](docs/mcp-tools.md) | Canonical MCP tool registry |
|
|
1241
|
-
| [docs/mcp-user-guide.md](docs/mcp-user-guide.md) | Adding custom MCP servers |
|
|
1242
|
-
| [docs/mcp-recommendations.md](docs/mcp-recommendations.md) | Recommended MCP servers per project type |
|
|
1243
|
-
| [scripts/hooks/](scripts/hooks/) | Agent lifecycle hooks |
|
|
214
|
+
Canonical repository: <https://github.com/ils15/pantheon-opencode>
|
|
1244
215
|
|
|
1245
216
|
---
|
|
1246
217
|
|
|
1247
|
-
|
|
1248
|
-
**Architecture Pattern:** Conductor-Delegate
|
|
1249
|
-
**Mythology:** Greek (Zeus, Athena, Apollo, Hermes, Aphrodite, Talos, Themis, Mnemosyne, Gaia, Hephaestus, Nyx, Prometheus, Demeter, Iris)
|
|
218
|
+
[Leia em português (Brasil)](README.pt-BR.md)
|