pantheon-opencode 1.5.0-beta.15 → 1.5.0-beta.17
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/AGENTS.md +14 -63
- package/CHANGELOG.md +55 -0
- package/README.md +14 -27
- package/README.pt-BR.md +5 -6
- package/commands/pantheon.md +1 -35
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/mcp_persistence_server.py +1 -1
- package/src/agents/apollo.md +1 -0
- package/src/agents/gaia.md +1 -0
- package/src/agents/zeus.md +8 -29
- package/src/instructions/memory-protocol.instructions.md +6 -3
- package/src/instructions/zeus-anti-stall.instructions.md +2 -4
- package/src/instructions/zeus-council-synthesis.instructions.md +3 -28
- package/src/instructions/zeus-timeout-retry.instructions.md +3 -28
- package/src/mcp/mcp_persistence_server.py +1 -1
- package/src/mcp/toon_codec.py +2 -4
- package/src/pantheon/{delegation-compaction.ts → compaction-context.ts} +10 -100
- package/src/pantheon/cost-command.ts +1 -2
- package/src/pantheon/delegation-enforce.ts +59 -14
- package/src/pantheon/goal-loop.ts +1 -1
- package/src/pantheon/goal-store.ts +1 -1
- package/src/pantheon/idle-continuation.ts +4 -6
- package/src/pantheon/model-command.ts +1 -2
- package/src/pantheon/native-task-status.ts +2 -2
- package/src/pantheon/session-id.ts +30 -0
- package/src/pantheon/task-result-guard.ts +2 -3
- package/src/pantheon/todo-enforcer.ts +3 -3
- package/src/pantheon/tool-context.ts +23 -0
- package/src/pantheon/v2-bridge.ts +1 -4
- package/src/plugin-v2.ts +4 -15
- package/src/plugin.ts +61 -245
- package/src/plugins/tui/dist/tui.d.ts +33 -64
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +30 -177
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/index.tsx +67 -277
- package/src/skills/context-compression/SKILL.md +1 -1
- package/scripts/dev-tui.sh +0 -48
- package/scripts/generate-preset-docs.mjs +0 -300
- package/scripts/generate-prompts.sh +0 -222
- package/scripts/install/component.mjs +0 -24
- package/scripts/install/migrate-config.mjs +0 -302
- package/src/pantheon/delegate-manager.ts +0 -851
- package/src/pantheon/delegation-classifier.ts +0 -306
- package/src/pantheon/delegation-finalize.ts +0 -468
- package/src/pantheon/delegation-notify.ts +0 -212
- package/src/pantheon/delegation-toast.ts +0 -73
- package/src/pantheon/delegation.ts +0 -1349
- package/src/pantheon/native-probe.ts +0 -234
- package/src/pantheon/step-cap.ts +0 -110
- package/src/pantheon/toon-codec.ts +0 -481
package/AGENTS.md
CHANGED
|
@@ -301,7 +301,9 @@ memory_store({
|
|
|
301
301
|
agreements: ["point1", "point2"],
|
|
302
302
|
divergences: [{"issue": "...", "resolution": "..."}],
|
|
303
303
|
response_rate: "X of Y",
|
|
304
|
-
themis_audit: "approved|issues"
|
|
304
|
+
themis_audit: "approved|issues",
|
|
305
|
+
precedent_used: false,
|
|
306
|
+
timestamp: "<ISO-8601>"
|
|
305
307
|
},
|
|
306
308
|
metadata: {
|
|
307
309
|
type: "council_decision",
|
|
@@ -310,6 +312,7 @@ memory_store({
|
|
|
310
312
|
}
|
|
311
313
|
})
|
|
312
314
|
```
|
|
315
|
+
`value` is JSON-serialized before storing (the MCP `memory_store.value` argument is a string).
|
|
313
316
|
|
|
314
317
|
### Read Path (Precedent Fast-Path)
|
|
315
318
|
Before dispatching a new council, Zeus runs:
|
|
@@ -320,8 +323,8 @@ memory_search(question, top_k=2, namespace="council_decisions")
|
|
|
320
323
|
Result interpretation:
|
|
321
324
|
| Score | Age | Action |
|
|
322
325
|
|-------|-----|--------|
|
|
323
|
-
| > 0.85 | < 30 days | Return precedent as fast-path answer. Skip council dispatch entirely. |
|
|
324
|
-
| > 0.85 | >= 30 days | Return with warning "Reavaliar se contexto mudou" + proceed with council |
|
|
326
|
+
| > 0.85 | < 30 days | Return precedent verbatim (note "⚠️ Decisão de [data] — reavaliar se contexto mudou") as fast-path answer. Skip council dispatch entirely. |
|
|
327
|
+
| > 0.85 | >= 30 days | Return with warning "Reavaliar se contexto mudou — decisão tem mais de 30 dias" + proceed with council |
|
|
325
328
|
| 0.5 - 0.85 | Any | Include as context for specialists but still dispatch council |
|
|
326
329
|
| < 0.5 | Any | Ignore, proceed with fresh council |
|
|
327
330
|
|
|
@@ -371,7 +374,7 @@ You MUST self-monitor for these stall conditions:
|
|
|
371
374
|
| Symptom | Detection Rule | Recovery Action |
|
|
372
375
|
|---------|---------------|-----------------|
|
|
373
376
|
| Silent loop | 3+ consecutive turns with no tool call AND no visible progress | Output `[STALL_DETECTED]` and re-read your task definition. If still stuck, escalate to user with: "I appear to be stuck on [task]. Options: (1) retry with different approach, (2) delegate to specialist, (3) simplify scope." |
|
|
374
|
-
| Delegation black hole | Agent dispatched but no response after 2x the timeout from routing.yml | Log the hang, cancel via `cancel_task`,
|
|
377
|
+
| Delegation black hole | Agent dispatched but no response after 2x the timeout from routing.yml | Log the hang, cancel via `cancel_task`, then follow the fallback chain in `## ⏱️ Timeout & Retry Enforcement` |
|
|
375
378
|
| Circular delegation | Same specialist re-dispatched for same task 2+ times without progress | Break cycle: dispatch to different specialist OR escalate to user |
|
|
376
379
|
| Idle after completion | All background tasks completed but no synthesis/next step for 2+ turns | Force synthesis: summarize all completed results and propose next action |
|
|
377
380
|
| Context thrash | Re-reading same files repeatedly without new action | Stop re-reading. State: "Already have context on [file]. Proceeding with [action]." |
|
|
@@ -397,9 +400,7 @@ When a delegation fails (timeout, empty response, error):
|
|
|
397
400
|
|
|
398
401
|
2. **Retry ONCE** with rephrased prompt — add: "Previous attempt failed with: [error]. Adjusted approach: [what changed]."
|
|
399
402
|
|
|
400
|
-
3. **If retry also fails** →
|
|
401
|
-
- Dispatch to fallback agent (from routing.yml)
|
|
402
|
-
- If no fallback, escalate to user with: "Task [X] failed after retry. Options: (a) simplify, (b) different agent, (c) manual intervention."
|
|
403
|
+
3. **If retry also fails** → do NOT retry blindly; follow the fallback chain and escalation protocol in `## ⏱️ Timeout & Retry Enforcement`.
|
|
403
404
|
|
|
404
405
|
## Progress Checkpoint
|
|
405
406
|
|
|
@@ -564,10 +565,7 @@ sequenceDiagram
|
|
|
564
565
|
## Dispatch Sequence (9-Step Protocol)
|
|
565
566
|
|
|
566
567
|
### Step 0 — Precedent Fast-Path (Fase 1)
|
|
567
|
-
|
|
568
|
-
- Score > 0.85 AND age < 30 days → return precedent verbatim with note "⚠️ Decisão de [data] — reavaliar se contexto mudou". SKIP entire dispatch.
|
|
569
|
-
- Score > 0.85 AND age > 30 days → return precedent with ⚠️ "Reavaliar se contexto mudou — decisão tem mais de 30 dias"
|
|
570
|
-
- Else → proceed to Step 0b
|
|
568
|
+
Run the precedent read path defined in `## Memory Protocol > Council Decisions Namespace` (`memory_search(query, top_k=2, namespace="council_decisions")`). If no precedent applies, proceed to Step 0b.
|
|
571
569
|
|
|
572
570
|
### Step 0b — Apollo Pre-Scan (Fase 2, --research flag)
|
|
573
571
|
If `/pantheon --research <question>`: dispatch @apollo with 30s timeout. Inject findings as `shared_context` into ALL specialist prompts. Skip if flag absent.
|
|
@@ -669,33 +667,11 @@ task(subagent_type: "themis", prompt: "Audit this council synthesis for fidelity
|
|
|
669
667
|
- If issues → fix each issue before delivering to user
|
|
670
668
|
|
|
671
669
|
### Step 9 — Persist & Reconcile (Fase 1)
|
|
672
|
-
|
|
673
|
-
memory_store({
|
|
674
|
-
namespace: "council_decisions",
|
|
675
|
-
key: "council:<yyyy-mm-dd>:<slug>",
|
|
676
|
-
value: JSON.stringify({
|
|
677
|
-
question, specialists, recommendation, confidence,
|
|
678
|
-
agreements, divergences, precedent_used, timestamp
|
|
679
|
-
}),
|
|
680
|
-
metadata: {type: "council_decision", specialist_count: N}
|
|
681
|
-
})
|
|
682
|
-
board.markReconciled("<task-id>")
|
|
683
|
-
```
|
|
670
|
+
Persist the decision using the write path in `## Memory Protocol > Council Decisions Namespace`, then `board.markReconciled("<task-id>")`.
|
|
684
671
|
|
|
685
672
|
## Specialist Output Format (Fase 1 — machine-parseable structured fields)
|
|
686
673
|
|
|
687
|
-
Specialists MUST return
|
|
688
|
-
|
|
689
|
-
```
|
|
690
|
-
## specialist_response
|
|
691
|
-
**position:** <clear one-sentence position>
|
|
692
|
-
**reasoning:** <2-4 sentences>
|
|
693
|
-
**trade_offs:** <what's gained vs lost>
|
|
694
|
-
**risks:** <what could go wrong>
|
|
695
|
-
**confidence:** High | Medium | Low
|
|
696
|
-
**agreement_signals:** agree: @agent1, @agent2 on [issue] | disagree: @agent3 on [issue]
|
|
697
|
-
**specific_claims:** <count of specific factual claims in response>
|
|
698
|
-
```
|
|
674
|
+
Specialists MUST return the structured `## specialist_response` format (position, reasoning, trade_offs, risks, confidence, agreement_signals, specific_claims) defined in `## Agent Return Format > Council Specialist Response Format`.
|
|
699
675
|
|
|
700
676
|
## Domain-to-Specialist Mapping
|
|
701
677
|
|
|
@@ -928,39 +904,14 @@ ANY NO → full task (IMPL artifact + Themis review mandatory)
|
|
|
928
904
|
3. **No Themis dependency** — output doesn't feed into a phase that requires review
|
|
929
905
|
|
|
930
906
|
## Subtask Return Format
|
|
931
|
-
|
|
932
|
-
```
|
|
933
|
-
## subtask_summary
|
|
934
|
-
**files_changed:** [paths]
|
|
935
|
-
**summary:** What was done
|
|
936
|
-
**tests:** ✅ or N/A
|
|
937
|
-
**status:** complete | partial | escalated
|
|
938
|
-
```
|
|
907
|
+
Return the standard `## subtask_summary` defined in `## Agent Return Format` (files_changed, summary, tests, coverage, tokens, status, blockers).
|
|
939
908
|
|
|
940
909
|
## Timeout Parcial (Partial Results)
|
|
941
910
|
|
|
942
|
-
Timeout
|
|
943
|
-
- ✅ @apollo — can return partial file list ("found 7 of 12 files before timeout")
|
|
944
|
-
- ✅ @gaia — can return partial literature findings
|
|
945
|
-
|
|
946
|
-
- ✅ @talos — can confirm progress if hotfix times out
|
|
947
|
-
- ❌ Never for implementers or reviewers — must complete or fail
|
|
948
|
-
|
|
949
|
-
When dispatching with partial-OK, set expectation:
|
|
950
|
-
```
|
|
951
|
-
@apollo Search for auth files. Timeout parcial OK — return whatever you have.
|
|
952
|
-
```
|
|
911
|
+
Only agents marked ✅ in the Timeout Behavior table above may return partial results: @apollo (partial file list, e.g. "found 7 of 12 files before timeout"), @gaia (partial literature findings) and @talos (confirm progress if a hotfix times out). Never for implementers or reviewers — they must complete or fail. When dispatching with partial-OK, set the expectation: `@apollo Search for auth files. Timeout parcial OK — return whatever you have.`
|
|
953
912
|
|
|
954
913
|
---
|
|
955
914
|
|
|
956
915
|
# 📊 TIMEOUT TRACKING
|
|
957
916
|
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
| Agent | Timeout | Status | Partial OK? |
|
|
961
|
-
|-------|---------|--------|-------------|
|
|
962
|
-
| @apollo | 60s | ✅ complete | ✅ |
|
|
963
|
-
| @hermes | 180s | ⏳ in progress | ❌ |
|
|
964
|
-
| @themis | 120s | ⏳ in progress | ❌ |
|
|
965
|
-
|
|
966
|
-
Log timeouts to `/memories/session/timeout-log.md` for later analysis.
|
|
917
|
+
Track in-flight delegations against the Timeout Behavior table above. Log timeouts to `/memories/session/timeout-log.md` for later analysis.
|
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,61 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
18
18
|
|
|
19
19
|
## ✅ Closed Issues
|
|
20
20
|
|
|
21
|
+
## [v1.5.0-beta.17] - 2026-09-15
|
|
22
|
+
|
|
23
|
+
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
24
|
+
move this section to a versioned entry and reset the template below. -->
|
|
25
|
+
|
|
26
|
+
## 🆕 What's New
|
|
27
|
+
|
|
28
|
+
- **Delegação nativa no host:** o motor `pantheon_delegate` foi removido
|
|
29
|
+
(~3,9k linhas) junto com as tools `pantheon_delegate`,
|
|
30
|
+
`pantheon_delegation_read` e `pantheon_delegation_list`; a delegação agora usa
|
|
31
|
+
o **`task()` nativo** do host (child sessions). 16 arquivos de teste obsoletos
|
|
32
|
+
removidos.
|
|
33
|
+
- **TUI — painel Delegations lê a sessão nativa:** o painel passa a derivar de
|
|
34
|
+
`session.children` + `session.status` + md (o arquivo de board deixou de ser
|
|
35
|
+
fonte). Mantidas as cores de status, retenção, ceiling, filtro de sessão e
|
|
36
|
+
guards.
|
|
37
|
+
- **Camada fina preservada:** `task-result-guard` (verified completion de child
|
|
38
|
+
vazio), `native-task-status` e guards de enforcement.
|
|
39
|
+
|
|
40
|
+
## 🐞 Fixed
|
|
41
|
+
|
|
42
|
+
- **Read-only enforcement re-apontado para sessões nativas:** aplicado no
|
|
43
|
+
público via hook `chat.params` e `hashline_edit` bloqueado para `apollo`/`gaia`,
|
|
44
|
+
fechando o bypass aberto após a remoção do motor de delegação.
|
|
45
|
+
- **Docs/comentários limpos:** referências aos módulos removidos atualizadas,
|
|
46
|
+
incluindo nits de comentário em `tests/pantheon/tui-delegations.test.ts` e
|
|
47
|
+
`src/pantheon/session-id.ts`.
|
|
48
|
+
|
|
49
|
+
## [v1.5.0-beta.16] - 2026-09-15
|
|
50
|
+
|
|
51
|
+
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
52
|
+
move this section to a versioned entry and reset the template below. -->
|
|
53
|
+
|
|
54
|
+
## 🆕 What's New
|
|
55
|
+
|
|
56
|
+
- **Modernização CI/supply-chain:** 22 actions SHA-pinadas; `gitleaks-action` v3
|
|
57
|
+
(fix crítico — a v2 morria com Node 20 em 2026-09-16) com CLI 8.30.1; cache
|
|
58
|
+
npm/pip; Dependabot; CodeQL `+python` e `codeql-config`; permissões reduzidas
|
|
59
|
+
no `docs.yml`; job `version-check` fundido no `validate`; `upload-artifact` v7
|
|
60
|
+
e `download-artifact` v8.
|
|
61
|
+
- **Lean:** ~17 módulos mortos removidos de `src/pantheon/`, docs/scripts
|
|
62
|
+
obsoletos, `teste/`/`testes/`, `Dockerfile`/`docker-compose` (de outro projeto)
|
|
63
|
+
e caches; ~38% dos arquivos de teste removidos/consolidados; testes mínimos
|
|
64
|
+
readicionados para os módulos vivos (tool-ceiling, native-probe).
|
|
65
|
+
- **Instructions:** deduplicação das instruções compartilhadas — contexto menor
|
|
66
|
+
sem perder nenhuma regra.
|
|
67
|
+
|
|
68
|
+
## 🐞 Fixed
|
|
69
|
+
|
|
70
|
+
- **2 flakes determinísticos eliminados:** TTL do MCP persistence
|
|
71
|
+
(`test_ttl_expiry_real_time`) e `logger.test.mjs` deixaram de depender de
|
|
72
|
+
timing/carga do host.
|
|
73
|
+
- **Refs stale corrigidas:** referências de versão/ambiente atualizadas para
|
|
74
|
+
Node 22+.
|
|
75
|
+
|
|
21
76
|
## [v1.5.0-beta.15] - 2026-09-15
|
|
22
77
|
|
|
23
78
|
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
package/README.md
CHANGED
|
@@ -76,25 +76,14 @@ availability and configuration of OpenCode and any optional services you choose
|
|
|
76
76
|
to use. Check the [releases](https://github.com/ils15/pantheon-opencode/releases)
|
|
77
77
|
and [changelog](CHANGELOG.md) for the latest published changes.
|
|
78
78
|
|
|
79
|
-
## Delegation
|
|
79
|
+
## Delegation (native `task()`)
|
|
80
80
|
|
|
81
|
-
Pantheon
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
does not use foreground fallback, model failover, or retry; it performs a
|
|
88
|
-
lazy capability probe on the first dispatch and includes the resulting
|
|
89
|
-
status in the delegation receipt.
|
|
90
|
-
|
|
91
|
-
Legacy stays the default for v1.5.x; native is not promoted to default until
|
|
92
|
-
v1.6. See [ADR-0011](.pantheon/memory-bank/adr/0011-delegation-engine-contract.md)
|
|
93
|
-
(Proposed) for the engine contract, rationale, and migration prerequisites.
|
|
94
|
-
|
|
95
|
-
**Kill-switch:** set `PANTHEON_DELEGATION=off` (case-insensitive) to disable
|
|
96
|
-
delegation entirely. The switch covers **both** engines — the legacy
|
|
97
|
-
`pantheon_delegate`/read/list tools throw, and the native manager throws too.
|
|
81
|
+
Pantheon delegates exclusively through OpenCode's native `task()` child-session
|
|
82
|
+
engine. The former custom `pantheon_delegate` tool and the V1 delegation engine
|
|
83
|
+
(`delegation.ts`, `delegate-manager.ts` and supporting modules) were removed;
|
|
84
|
+
there is no Pantheon-specific delegation tool surface to configure. See
|
|
85
|
+
[ADR-0011](.pantheon/memory-bank/adr/0011-delegation-engine-contract.md) for the
|
|
86
|
+
historical engine contract.
|
|
98
87
|
|
|
99
88
|
## Cost tool backend
|
|
100
89
|
|
|
@@ -172,8 +161,7 @@ script's SHA-256 without regenerating it.
|
|
|
172
161
|
covering OpenCode V1/V2 side by side — see
|
|
173
162
|
[Sandbox validation](#sandbox-validation-v1v2).
|
|
174
163
|
- Beta2 agent-economy policy: direct native delegation, bounded compaction
|
|
175
|
-
carry-forward, compact context encoding, and quality floors
|
|
176
|
-
[Beta2 agent economy policy](docs/ws3-token-opt-measurements.md#beta2-agent-economy-policy).
|
|
164
|
+
carry-forward, compact context encoding, and quality floors.
|
|
177
165
|
- A `--prompts` installer flag is planned for a future release.
|
|
178
166
|
|
|
179
167
|
## OpenCode V1/V2 — Dual Version (1.5.0-beta.2)
|
|
@@ -186,23 +174,22 @@ per installation; V1 and V2 Pantheon plugins must never be registered together.
|
|
|
186
174
|
|---|---|---|
|
|
187
175
|
| OpenCode config key | singular `plugin` | plural `plugins` |
|
|
188
176
|
| Pantheon registration | `src/plugin.ts` plus `src/plugins/pantheon-hooks.ts` | `<installed>/src/plugin-v2` directory (`index.ts` re-exports `src/plugin-v2.ts`) |
|
|
189
|
-
| Runtime contract |
|
|
177
|
+
| Runtime contract | Pantheon V1 plugin: 6 tools (`hashline_edit`, the 3 goal tools, `pantheon_cost`, `pantheon_model`), event/tool hooks and V1 compaction handling | Full V2 plugin: 6 orchestration tools, 4 event subscriptions, session hooks (`prompt`, `context`), tool hooks (`execute.before`/`after`), plus configuration transforms |
|
|
190
178
|
| V1 APIs | Registered | Own tool definitions via `ctx.tool.transform()` — not the V1 plugin path |
|
|
191
179
|
|
|
192
|
-
The V2 plugin provides
|
|
193
|
-
`pantheon_delegation_read`, `pantheon_delegation_list`, `hashline_edit`,
|
|
180
|
+
The V2 plugin provides 6 orchestration tools (`hashline_edit`,
|
|
194
181
|
`pantheon_goal_create`, `pantheon_goal_get`, `pantheon_goal_update`,
|
|
195
182
|
`pantheon_cost`, `pantheon_model`), 4 event subscriptions (`session.created`,
|
|
196
183
|
`session.idle`, `session.error`, `session.compacted`), session hooks (`prompt`,
|
|
197
184
|
`context`), and tool hooks (`execute.before`, `execute.after`). The only
|
|
198
|
-
unsupported V2 feature is `legacy-hooks` (the V1-specific
|
|
185
|
+
unsupported V2 feature is `legacy-hooks` (the V1-specific hook surface).
|
|
199
186
|
|
|
200
187
|
The package exposes both contracts as importable exports: `pantheon-opencode/plugin`
|
|
201
188
|
(V1), `pantheon-opencode/plugin-v2` (V2) and `pantheon-opencode/v2-bridge`
|
|
202
189
|
(optional interop), so a host can load either contract explicitly.
|
|
203
190
|
|
|
204
191
|
The V1→V2 bridge (`src/pantheon/v2-bridge.ts`) enables optional interop:
|
|
205
|
-
V1 infrastructure singletons (BackgroundJobBoard,
|
|
192
|
+
V1 infrastructure singletons (BackgroundJobBoard, GoalStore,
|
|
206
193
|
TodoEnforcer, VisionHandler) are passed through V2 `ctx.options`. The bridge is
|
|
207
194
|
optional — V2 works standalone with graceful degradation.
|
|
208
195
|
|
|
@@ -340,8 +327,8 @@ child session returns an empty or missing result. Instead of surfacing a silent
|
|
|
340
327
|
`completed` with no payload (which confuses the orchestrator), the guard now
|
|
341
328
|
raises an explicit error. This catches the common free-tier failure mode where a
|
|
342
329
|
child session exceeds the uncached-prefill token budget (`BackendAdmissionRejected`)
|
|
343
|
-
and returns nothing.
|
|
344
|
-
`
|
|
330
|
+
and returns nothing. Prefer `background=true` dispatches with an explicit
|
|
331
|
+
`task_status(wait=true)` fan-in so large payloads are collected deterministically.
|
|
345
332
|
|
|
346
333
|
|
|
347
334
|
## Documentation
|
package/README.pt-BR.md
CHANGED
|
@@ -31,7 +31,7 @@ de planejar o trabalho, avançar, conferir resultados e preservar o contexto
|
|
|
31
31
|
|
|
32
32
|
## Comece em 2 minutos
|
|
33
33
|
|
|
34
|
-
Requisitos: [OpenCode 1.18.4+](https://opencode.ai/docs/) e Node.js
|
|
34
|
+
Requisitos: [OpenCode 1.18.4+](https://opencode.ai/docs/) e Node.js 22+.
|
|
35
35
|
|
|
36
36
|
No projeto em que você quer usar o Pantheon:
|
|
37
37
|
|
|
@@ -130,16 +130,15 @@ registrados juntos.
|
|
|
130
130
|
|---|---|---|
|
|
131
131
|
| Chave de config do OpenCode | `plugin` singular | `plugins` plural |
|
|
132
132
|
| Registro Pantheon | `src/plugin.ts` mais `src/plugins/pantheon-hooks.ts` | `pantheon-opencode/plugin-v2` (`src/plugin-v2.ts`) |
|
|
133
|
-
| Contrato de runtime | Plugin Pantheon
|
|
133
|
+
| Contrato de runtime | Plugin Pantheon V1: 6 ferramentas (`hashline_edit`, as 3 ferramentas de goal, `pantheon_cost`, `pantheon_model`), hooks de evento/ferramenta e tratamento de compactação V1 | Plugin V2 completo: 6 ferramentas de orquestração, 4 assinaturas de eventos, session hooks (`prompt`, `context`), tool hooks (`execute.before`/`after`), além de transforms de configuração |
|
|
134
134
|
| APIs V1 | Registradas | Definições próprias de ferramentas via `ctx.tool.transform()` — não pelo caminho do plugin V1 |
|
|
135
135
|
|
|
136
|
-
O plugin V2 fornece
|
|
137
|
-
`pantheon_delegation_read`, `pantheon_delegation_list`, `hashline_edit`,
|
|
136
|
+
O plugin V2 fornece 6 ferramentas de orquestração (`hashline_edit`,
|
|
138
137
|
`pantheon_goal_create`, `pantheon_goal_get`, `pantheon_goal_update`,
|
|
139
138
|
`pantheon_cost`, `pantheon_model`), 4 assinaturas de eventos (`session.created`,
|
|
140
139
|
`session.idle`, `session.error`, `session.compacted`), session hooks (`prompt`,
|
|
141
140
|
`context`) e tool hooks (`execute.before`, `execute.after`). O único recurso V2
|
|
142
|
-
sem suporte é `legacy-hooks` (a superfície de
|
|
141
|
+
sem suporte é `legacy-hooks` (a superfície de hooks específica do V1).
|
|
143
142
|
|
|
144
143
|
O pacote expõe os dois contratos como exports importáveis:
|
|
145
144
|
`pantheon-opencode/plugin` (V1), `pantheon-opencode/plugin-v2` (V2) e
|
|
@@ -147,7 +146,7 @@ O pacote expõe os dois contratos como exports importáveis:
|
|
|
147
146
|
explicitamente o contrato desejado.
|
|
148
147
|
|
|
149
148
|
A ponte V1→V2 (`src/pantheon/v2-bridge.ts`) habilita interop opcional:
|
|
150
|
-
singletons de infraestrutura V1 (BackgroundJobBoard,
|
|
149
|
+
singletons de infraestrutura V1 (BackgroundJobBoard,
|
|
151
150
|
GoalStore, TodoEnforcer, VisionHandler) são repassados via `ctx.options` do V2.
|
|
152
151
|
A ponte é opcional — o V2 funciona standalone com degradação graciosa.
|
|
153
152
|
|
package/commands/pantheon.md
CHANGED
|
@@ -9,41 +9,7 @@ agent: zeus
|
|
|
9
9
|
**When:** Architecture trade-offs, technology selection, security assessments, multi-stakeholder concerns
|
|
10
10
|
**Returns:** Structured synthesis with recommendation, confidence level, resolved divergences
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Choose 2-3 agents based on domain:
|
|
15
|
-
|
|
16
|
-
| Domain | Specialists |
|
|
17
|
-
|--------|-------------|
|
|
18
|
-
| Architecture | hermes, demeter, themis, athena |
|
|
19
|
-
| Security | themis, hermes, prometheus, nyx |
|
|
20
|
-
| Database | demeter, hermes, prometheus |
|
|
21
|
-
| AI/RAG | hephaestus, nyx |
|
|
22
|
-
| Infrastructure | prometheus, hermes, themis |
|
|
23
|
-
| Frontend/UX | aphrodite, themis, hermes |
|
|
24
|
-
| Observability | nyx, hermes |
|
|
25
|
-
| General | athena, themis, hermes |
|
|
26
|
-
|
|
27
|
-
Send ALL `task()` calls in a single message. Each must return: Recommendation · Reasoning · Trade-offs · Risks · Confidence.
|
|
28
|
-
|
|
29
|
-
## Synthesis Structure
|
|
30
|
-
|
|
31
|
-
After ALL responses arrive, produce EXACTLY this structure:
|
|
32
|
-
|
|
33
|
-
### 📋 Individual Assessments
|
|
34
|
-
For each specialist: Recommendation, Reasoning, Trade-offs, Risks, Confidence
|
|
35
|
-
|
|
36
|
-
### ✅ Agreements
|
|
37
|
-
Where 2+ specialists converge
|
|
38
|
-
|
|
39
|
-
### ⚡ Divergences
|
|
40
|
-
Where they disagree — resolve each one with reasoning
|
|
41
|
-
|
|
42
|
-
### 🔥 Total Divergence
|
|
43
|
-
If ALL specialists disagree on a point, call this out explicitly
|
|
44
|
-
|
|
45
|
-
### 🏆 Recommendation
|
|
46
|
-
Decisive conclusion with confidence level
|
|
12
|
+
Dispatch, specialist selection, and synthesis follow the canonical `## Zeus Council Synthesis` protocol (Steps 0–9: precedent fast-path, dispatch, confidence cross-validation, rebuttal, tie-break, Themis audit, persist). Send ALL `task()` calls in a single message; each specialist returns the `## specialist_response` structure from `## Agent Return Format`.
|
|
47
13
|
|
|
48
14
|
## Question:
|
|
49
15
|
$ARGUMENTS
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon",
|
|
3
3
|
"publisher": "ils15",
|
|
4
|
-
"version": "1.5.0-beta.
|
|
4
|
+
"version": "1.5.0-beta.17",
|
|
5
5
|
"displayName": "Pantheon",
|
|
6
6
|
"description": "Conductor-Delegate orchestration platform with 14 specialized agents, 21 skills, and OpenCode support.",
|
|
7
7
|
"agents": "./src/agents",
|
package/pyproject.toml
CHANGED
|
@@ -1323,7 +1323,7 @@ def build_rehydration_blocks(checkpoint: dict) -> list[str] | None:
|
|
|
1323
1323
|
"""Build deterministic rehydration blocks from a checkpoint dict.
|
|
1324
1324
|
|
|
1325
1325
|
Pure string templating — no LLM, no embeddings. Mirrors the
|
|
1326
|
-
``<mission_context>`` convention of
|
|
1326
|
+
``<mission_context>`` convention of the compaction-context builder: only a
|
|
1327
1327
|
non-done goal is re-emitted. Returns None when nothing critical remains.
|
|
1328
1328
|
"""
|
|
1329
1329
|
if not isinstance(checkpoint, dict) or not checkpoint:
|
package/src/agents/apollo.md
CHANGED
package/src/agents/gaia.md
CHANGED
package/src/agents/zeus.md
CHANGED
|
@@ -144,33 +144,11 @@ task_status(task_id="ses_xxx", wait=true)
|
|
|
144
144
|
-> bloqueia ate completar: { state: "completed", task_result: "..." }
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
###
|
|
147
|
+
### DELEGATION_RULES (native task API)
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
pantheon_delegate({prompt, agent, description?, read_only?})
|
|
153
|
-
-> cria sessao filha, registra no board, retorna alias: [apo-1]
|
|
154
|
-
pantheon_delegation_read({id: "apo-1"})
|
|
155
|
-
-> BLOQUEIA ate o job terminar, retorna o report markdown, marca reconciled
|
|
156
|
-
-> durante a espera, mostra o que o agente esta fazendo: seccao final "## Agent Activity"
|
|
157
|
-
(amostra as messages do child a cada ~2s; tool calls + args truncados / texto)
|
|
158
|
-
pantheon_delegation_list()
|
|
159
|
-
-> lista jobs da sessao, com [unread] para jobs terminados nao lidos
|
|
160
|
-
-> jobs RUNNING mostram "last activity:" (ultima acao visivel do child)
|
|
161
|
-
-> fail-open: sem suporte a messages, formato atual inalterado
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
- **Read-only enforcement:** agentes read-only (apollo, gaia — `read_only_agents` no routing.yml) tem `edit`, `write`, `bash`, `task` NEGADOS dentro da sessao delegada (o guard de `tool.execute.before` THROW com mensagem acionavel). Use `read_only: true` no delegate para qualquer agente de investigacao.
|
|
165
|
-
- **Depth-2 hard-enforced:** sessao read-only NAO cria subagentes (`task` bloqueado) — investigacao nunca vira arvore.
|
|
166
|
-
- **Compactacao:** jobs em voo (running + unread terminal) sao injetados no contexto de compactacao via `experimental.session.compacting` — delegacao em andamento nao se perde ao compactar.
|
|
167
|
-
|
|
168
|
-
### DELEGATION_RULES (plugin path)
|
|
169
|
-
|
|
170
|
-
1. **NUNCA** polle `pantheon_delegation_list` para checar se um job terminou.
|
|
171
|
-
2. Voce NAO recebe notificacao injetada no chat — politica do usuario: ZERO `task-notification` no transcript. Visibilidade de conclusao: marcador `[unread]` em `pantheon_delegation_list`, `pantheon_delegation_read({id})`, toasts TUI (pantheon-hooks) e carry-forward de compactacao.
|
|
172
|
-
3. Use `pantheon_delegation_read({id})` APENAS para fan-in explicito / recuperacao de resultado sob demanda (bloqueia ate o fim).
|
|
173
|
-
4. `pantheon_delegation_list` e para diagnostico, nao para polling.
|
|
149
|
+
1. Todo dispatch usa `task(background=true, subagent_type=..., prompt=...)`.
|
|
150
|
+
2. Recolha com `task_status(task_id=..., wait=true)` — bloqueia ate o fim, sem polling.
|
|
151
|
+
3. Use `task_status(wait=true)` apenas para fan-in explicito / recuperacao sob demanda.
|
|
174
152
|
|
|
175
153
|
### Background (sempre usar)
|
|
176
154
|
- **Apollo, Hermes, Aphrodite, Demeter, Hephaestus, Prometheus**
|
|
@@ -302,9 +280,10 @@ vão a idle com todos incompletos. Guards (todos no `src/pantheon/todo-enforcer.
|
|
|
302
280
|
## Wave 4 (PR #46): Empty-Result Retry + /cost + Themis Tier
|
|
303
281
|
|
|
304
282
|
### Empty-Result Retry (runtime — automatic)
|
|
305
|
-
Empty-response detection
|
|
306
|
-
|
|
307
|
-
|
|
283
|
+
Empty-response detection for native `task()` subagent calls is wired at runtime
|
|
284
|
+
in `task-result-guard.ts` (plugin `tool.execute.after` chain): an
|
|
285
|
+
empty/whitespace-only result is converted into an explicit error so a silent
|
|
286
|
+
child failure is never mistaken for success. No manual retry helper is required.
|
|
308
287
|
|
|
309
288
|
### /cost — pantheon_cost tool (WIRED no plugin)
|
|
310
289
|
`pantheon_cost({ days?: number })` le o `opencode.db` READ-ONLY usando o backend
|
|
@@ -84,7 +84,9 @@ memory_store({
|
|
|
84
84
|
agreements: ["point1", "point2"],
|
|
85
85
|
divergences: [{"issue": "...", "resolution": "..."}],
|
|
86
86
|
response_rate: "X of Y",
|
|
87
|
-
themis_audit: "approved|issues"
|
|
87
|
+
themis_audit: "approved|issues",
|
|
88
|
+
precedent_used: false,
|
|
89
|
+
timestamp: "<ISO-8601>"
|
|
88
90
|
},
|
|
89
91
|
metadata: {
|
|
90
92
|
type: "council_decision",
|
|
@@ -93,6 +95,7 @@ memory_store({
|
|
|
93
95
|
}
|
|
94
96
|
})
|
|
95
97
|
```
|
|
98
|
+
`value` is JSON-serialized before storing (the MCP `memory_store.value` argument is a string).
|
|
96
99
|
|
|
97
100
|
### Read Path (Precedent Fast-Path)
|
|
98
101
|
Before dispatching a new council, Zeus runs:
|
|
@@ -103,8 +106,8 @@ memory_search(question, top_k=2, namespace="council_decisions")
|
|
|
103
106
|
Result interpretation:
|
|
104
107
|
| Score | Age | Action |
|
|
105
108
|
|-------|-----|--------|
|
|
106
|
-
| > 0.85 | < 30 days | Return precedent as fast-path answer. Skip council dispatch entirely. |
|
|
107
|
-
| > 0.85 | >= 30 days | Return with warning "Reavaliar se contexto mudou" + proceed with council |
|
|
109
|
+
| > 0.85 | < 30 days | Return precedent verbatim (note "⚠️ Decisão de [data] — reavaliar se contexto mudou") as fast-path answer. Skip council dispatch entirely. |
|
|
110
|
+
| > 0.85 | >= 30 days | Return with warning "Reavaliar se contexto mudou — decisão tem mais de 30 dias" + proceed with council |
|
|
108
111
|
| 0.5 - 0.85 | Any | Include as context for specialists but still dispatch council |
|
|
109
112
|
| < 0.5 | Any | Ignore, proceed with fresh council |
|
|
110
113
|
|
|
@@ -15,7 +15,7 @@ You MUST self-monitor for these stall conditions:
|
|
|
15
15
|
| Symptom | Detection Rule | Recovery Action |
|
|
16
16
|
|---------|---------------|-----------------|
|
|
17
17
|
| Silent loop | 3+ consecutive turns with no tool call AND no visible progress | Output `[STALL_DETECTED]` and re-read your task definition. If still stuck, escalate to user with: "I appear to be stuck on [task]. Options: (1) retry with different approach, (2) delegate to specialist, (3) simplify scope." |
|
|
18
|
-
| Delegation black hole | Agent dispatched but no response after 2x the timeout from routing.yml | Log the hang, cancel via `cancel_task`,
|
|
18
|
+
| Delegation black hole | Agent dispatched but no response after 2x the timeout from routing.yml | Log the hang, cancel via `cancel_task`, then follow the fallback chain in `## ⏱️ Timeout & Retry Enforcement` |
|
|
19
19
|
| Circular delegation | Same specialist re-dispatched for same task 2+ times without progress | Break cycle: dispatch to different specialist OR escalate to user |
|
|
20
20
|
| Idle after completion | All background tasks completed but no synthesis/next step for 2+ turns | Force synthesis: summarize all completed results and propose next action |
|
|
21
21
|
| Context thrash | Re-reading same files repeatedly without new action | Stop re-reading. State: "Already have context on [file]. Proceeding with [action]." |
|
|
@@ -41,9 +41,7 @@ When a delegation fails (timeout, empty response, error):
|
|
|
41
41
|
|
|
42
42
|
2. **Retry ONCE** with rephrased prompt — add: "Previous attempt failed with: [error]. Adjusted approach: [what changed]."
|
|
43
43
|
|
|
44
|
-
3. **If retry also fails** →
|
|
45
|
-
- Dispatch to fallback agent (from routing.yml)
|
|
46
|
-
- If no fallback, escalate to user with: "Task [X] failed after retry. Options: (a) simplify, (b) different agent, (c) manual intervention."
|
|
44
|
+
3. **If retry also fails** → do NOT retry blindly; follow the fallback chain and escalation protocol in `## ⏱️ Timeout & Retry Enforcement`.
|
|
47
45
|
|
|
48
46
|
## Progress Checkpoint
|
|
49
47
|
|
|
@@ -85,10 +85,7 @@ sequenceDiagram
|
|
|
85
85
|
## Dispatch Sequence (9-Step Protocol)
|
|
86
86
|
|
|
87
87
|
### Step 0 — Precedent Fast-Path (Fase 1)
|
|
88
|
-
|
|
89
|
-
- Score > 0.85 AND age < 30 days → return precedent verbatim with note "⚠️ Decisão de [data] — reavaliar se contexto mudou". SKIP entire dispatch.
|
|
90
|
-
- Score > 0.85 AND age > 30 days → return precedent with ⚠️ "Reavaliar se contexto mudou — decisão tem mais de 30 dias"
|
|
91
|
-
- Else → proceed to Step 0b
|
|
88
|
+
Run the precedent read path defined in `## Memory Protocol > Council Decisions Namespace` (`memory_search(query, top_k=2, namespace="council_decisions")`). If no precedent applies, proceed to Step 0b.
|
|
92
89
|
|
|
93
90
|
### Step 0b — Apollo Pre-Scan (Fase 2, --research flag)
|
|
94
91
|
If `/pantheon --research <question>`: dispatch @apollo with 30s timeout. Inject findings as `shared_context` into ALL specialist prompts. Skip if flag absent.
|
|
@@ -190,33 +187,11 @@ task(subagent_type: "themis", prompt: "Audit this council synthesis for fidelity
|
|
|
190
187
|
- If issues → fix each issue before delivering to user
|
|
191
188
|
|
|
192
189
|
### Step 9 — Persist & Reconcile (Fase 1)
|
|
193
|
-
|
|
194
|
-
memory_store({
|
|
195
|
-
namespace: "council_decisions",
|
|
196
|
-
key: "council:<yyyy-mm-dd>:<slug>",
|
|
197
|
-
value: JSON.stringify({
|
|
198
|
-
question, specialists, recommendation, confidence,
|
|
199
|
-
agreements, divergences, precedent_used, timestamp
|
|
200
|
-
}),
|
|
201
|
-
metadata: {type: "council_decision", specialist_count: N}
|
|
202
|
-
})
|
|
203
|
-
board.markReconciled("<task-id>")
|
|
204
|
-
```
|
|
190
|
+
Persist the decision using the write path in `## Memory Protocol > Council Decisions Namespace`, then `board.markReconciled("<task-id>")`.
|
|
205
191
|
|
|
206
192
|
## Specialist Output Format (Fase 1 — machine-parseable structured fields)
|
|
207
193
|
|
|
208
|
-
Specialists MUST return
|
|
209
|
-
|
|
210
|
-
```
|
|
211
|
-
## specialist_response
|
|
212
|
-
**position:** <clear one-sentence position>
|
|
213
|
-
**reasoning:** <2-4 sentences>
|
|
214
|
-
**trade_offs:** <what's gained vs lost>
|
|
215
|
-
**risks:** <what could go wrong>
|
|
216
|
-
**confidence:** High | Medium | Low
|
|
217
|
-
**agreement_signals:** agree: @agent1, @agent2 on [issue] | disagree: @agent3 on [issue]
|
|
218
|
-
**specific_claims:** <count of specific factual claims in response>
|
|
219
|
-
```
|
|
194
|
+
Specialists MUST return the structured `## specialist_response` format (position, reasoning, trade_offs, risks, confidence, agreement_signals, specific_claims) defined in `## Agent Return Format > Council Specialist Response Format`.
|
|
220
195
|
|
|
221
196
|
## Domain-to-Specialist Mapping
|
|
222
197
|
|
|
@@ -126,39 +126,14 @@ ANY NO → full task (IMPL artifact + Themis review mandatory)
|
|
|
126
126
|
3. **No Themis dependency** — output doesn't feed into a phase that requires review
|
|
127
127
|
|
|
128
128
|
## Subtask Return Format
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
## subtask_summary
|
|
132
|
-
**files_changed:** [paths]
|
|
133
|
-
**summary:** What was done
|
|
134
|
-
**tests:** ✅ or N/A
|
|
135
|
-
**status:** complete | partial | escalated
|
|
136
|
-
```
|
|
129
|
+
Return the standard `## subtask_summary` defined in `## Agent Return Format` (files_changed, summary, tests, coverage, tokens, status, blockers).
|
|
137
130
|
|
|
138
131
|
## Timeout Parcial (Partial Results)
|
|
139
132
|
|
|
140
|
-
Timeout
|
|
141
|
-
- ✅ @apollo — can return partial file list ("found 7 of 12 files before timeout")
|
|
142
|
-
- ✅ @gaia — can return partial literature findings
|
|
143
|
-
|
|
144
|
-
- ✅ @talos — can confirm progress if hotfix times out
|
|
145
|
-
- ❌ Never for implementers or reviewers — must complete or fail
|
|
146
|
-
|
|
147
|
-
When dispatching with partial-OK, set expectation:
|
|
148
|
-
```
|
|
149
|
-
@apollo Search for auth files. Timeout parcial OK — return whatever you have.
|
|
150
|
-
```
|
|
133
|
+
Only agents marked ✅ in the Timeout Behavior table above may return partial results: @apollo (partial file list, e.g. "found 7 of 12 files before timeout"), @gaia (partial literature findings) and @talos (confirm progress if a hotfix times out). Never for implementers or reviewers — they must complete or fail. When dispatching with partial-OK, set the expectation: `@apollo Search for auth files. Timeout parcial OK — return whatever you have.`
|
|
151
134
|
|
|
152
135
|
---
|
|
153
136
|
|
|
154
137
|
# 📊 TIMEOUT TRACKING
|
|
155
138
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
| Agent | Timeout | Status | Partial OK? |
|
|
159
|
-
|-------|---------|--------|-------------|
|
|
160
|
-
| @apollo | 60s | ✅ complete | ✅ |
|
|
161
|
-
| @hermes | 180s | ⏳ in progress | ❌ |
|
|
162
|
-
| @themis | 120s | ⏳ in progress | ❌ |
|
|
163
|
-
|
|
164
|
-
Log timeouts to `/memories/session/timeout-log.md` for later analysis.
|
|
139
|
+
Track in-flight delegations against the Timeout Behavior table above. Log timeouts to `/memories/session/timeout-log.md` for later analysis.
|
|
@@ -1323,7 +1323,7 @@ def build_rehydration_blocks(checkpoint: dict) -> list[str] | None:
|
|
|
1323
1323
|
"""Build deterministic rehydration blocks from a checkpoint dict.
|
|
1324
1324
|
|
|
1325
1325
|
Pure string templating — no LLM, no embeddings. Mirrors the
|
|
1326
|
-
``<mission_context>`` convention of
|
|
1326
|
+
``<mission_context>`` convention of the compaction-context builder: only a
|
|
1327
1327
|
non-done goal is re-emitted. Returns None when nothing critical remains.
|
|
1328
1328
|
"""
|
|
1329
1329
|
if not isinstance(checkpoint, dict) or not checkpoint:
|