pantheon-opencode 1.0.6 → 1.1.0

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.
@@ -64,7 +64,7 @@ async function main() {
64
64
  const target = isProject ? process.cwd() : undefined;
65
65
  installOpenCode(target, isDryRun, forceReinstall, components);
66
66
  } catch (err) {
67
- console.error(`❌ Installation failed:\n${err.stack}`);
67
+ console.error(`❌ Installation failed: ${err.message}\n Run with --no-mcp to skip Python dependencies:\n npx pantheon-opencode init --no-mcp\n Or retry with --force to recreate the venv:\n npx pantheon-opencode init --force`);
68
68
  process.exit(1);
69
69
  }
70
70
 
package/opencode.json CHANGED
@@ -4,9 +4,8 @@
4
4
  "subagent_depth": 2,
5
5
  "agent": {},
6
6
  "permission": {
7
- "skill": {
8
- "*": "allow"
9
- },
7
+ "skill": { "*": "allow" },
8
+ "websearch": "deny",
10
9
  "bash": {
11
10
  "git *": "allow",
12
11
  "npm *": "allow",
@@ -21,5 +20,14 @@
21
20
  "src/instructions/*.instructions.md"
22
21
  ],
23
22
  "plugin": [],
24
- "mcp": {}
25
- }
23
+ "mcp": {
24
+ "bifrost": {
25
+ "type": "remote",
26
+ "url": "https://llm.ofertachina.cloud/mcp",
27
+ "enabled": true,
28
+ "headers": {
29
+ "x-bf-vk": "sk-bf-a5a9b5b0-45fc-414d-8e4d-f9beb8c49a6d"
30
+ }
31
+ }
32
+ }
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "description": "Multi-agent orchestration for OpenCode — 14 specialized agents, TDD, Themis review gates.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -3,7 +3,7 @@
3
3
  * opencode.mjs — OpenCode platform installer
4
4
  */
5
5
 
6
- import { chmodSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync } from 'node:fs'
6
+ import { chmodSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
7
7
  import { homedir } from 'node:os'
8
8
  import { join, resolve } from 'node:path'
9
9
  import { healthCheck } from './health-check.mjs'
@@ -687,7 +687,7 @@ export function installOpenCode(
687
687
  // -----------------------------------------------------------------------
688
688
  if (componentSet.has('runtime')) {
689
689
  try {
690
- setupVenv(target, { dryRun })
690
+ setupVenv(target, { dryRun, force: clean })
691
691
  const health = healthCheck(target, { dryRun })
692
692
 
693
693
  // Print health summary
@@ -702,7 +702,7 @@ export function installOpenCode(
702
702
  }
703
703
  } catch (err) {
704
704
  console.error(` ❌ Setup failed: ${err.message}`)
705
- stats.errors++
705
+ throw err // Fatal — abort installation
706
706
  }
707
707
  }
708
708
  }
@@ -10,7 +10,7 @@
10
10
  */
11
11
 
12
12
  import { spawnSync } from 'node:child_process'
13
- import { existsSync } from 'node:fs'
13
+ import { existsSync, rmSync } from 'node:fs'
14
14
  import { dirname, join } from 'node:path'
15
15
  import { fileURLToPath } from 'node:url'
16
16
 
@@ -21,14 +21,23 @@ const ROOT = join(__dirname, '..', '..')
21
21
  * Set up a Python virtual environment and install MCP dependencies.
22
22
  *
23
23
  * @param {string} target - Target installation directory (e.g. ~/.config/opencode)
24
- * @param {{ dryRun?: boolean, skipInstall?: boolean }} [options]
24
+ * @param {{ dryRun?: boolean, skipInstall?: boolean, force?: boolean }} [options]
25
25
  * @returns {{ venvPath: string, python: string }}
26
26
  */
27
- export function setupVenv(target, { dryRun = false, skipInstall = false } = {}) {
27
+ export function setupVenv(target, { dryRun = false, skipInstall = false, force = false } = {}) {
28
28
  const venvPath = join(target, '.venv')
29
29
  const pythonBin = join(venvPath, 'bin', 'python3')
30
30
 
31
- // Step 1: Create venv if not exists
31
+ // Step 1: Force recreate venv if --force
32
+ if (force && existsSync(venvPath)) {
33
+ if (!dryRun) {
34
+ console.log(' Removing existing .venv (--force)...')
35
+ rmSync(venvPath, { recursive: true })
36
+ }
37
+ console.log(' ✅ .venv removed')
38
+ }
39
+
40
+ // Step 1b: Create venv if not exists
32
41
  if (!existsSync(pythonBin)) {
33
42
  if (!dryRun) {
34
43
  console.log(' Creating .venv...')
@@ -58,28 +67,34 @@ export function setupVenv(target, { dryRun = false, skipInstall = false } = {})
58
67
 
59
68
  if (!dryRun) {
60
69
  // Upgrade pip first (avoids resolver warnings)
70
+ // Ensure PIP_USER=0 to install into venv, not user site-packages
71
+ const pipEnv = { ...process.env, PIP_USER: '0' }
72
+
61
73
  spawnSync(pip, ['install', '--upgrade', 'pip'], {
62
74
  stdio: 'ignore',
63
75
  timeout: 30_000,
76
+ env: pipEnv,
64
77
  })
65
78
 
66
- // Install requirements
79
+ // Install requirements — attempt 1: normal
67
80
  const r = spawnSync(pip, ['install', '-r', reqFile], {
68
81
  stdio: 'inherit',
69
82
  timeout: 120_000,
83
+ env: pipEnv,
70
84
  })
71
85
 
72
86
  if (r.status !== 0) {
73
- // If failed, try with --break-system-packages (PEP 668 workaround)
87
+ // Attempt 2: --break-system-packages (PEP 668 / externally-managed)
74
88
  console.log(' ⚠️ First attempt failed, retrying with --break-system-packages...')
75
89
  const r2 = spawnSync(pip, ['install', '-r', reqFile, '--break-system-packages'], {
76
90
  stdio: 'inherit',
77
91
  timeout: 120_000,
92
+ env: pipEnv,
78
93
  })
79
94
  if (r2.status !== 0) {
80
95
  throw new Error(
81
96
  'Failed to install MCP dependencies. ' +
82
- 'Try: pip install -r src/mcp/requirements-mcp.txt --break-system-packages'
97
+ 'Try: PIP_USER=0 ' + pip + ' install -r ' + reqFile + ' --break-system-packages'
83
98
  )
84
99
  }
85
100
  }
@@ -101,9 +116,10 @@ function main() {
101
116
  const target = targetIdx !== -1 ? args[targetIdx + 1] : process.cwd()
102
117
  const dryRun = args.includes('--dry-run')
103
118
  const skipInstall = args.includes('--skip-install')
119
+ const force = args.includes('--force')
104
120
 
105
121
  try {
106
- const result = setupVenv(target, { dryRun, skipInstall })
122
+ const result = setupVenv(target, { dryRun, skipInstall, force })
107
123
  console.log(` 📍 Python: ${result.python}`)
108
124
  } catch (err) {
109
125
  console.error(`\n ❌ ${err.message}`)
@@ -21,6 +21,51 @@ For investigation agents (Apollo, Athena), return structured findings with:
21
21
  - File paths with line numbers
22
22
  - Relevant code snippets (max 3 lines each)
23
23
 
24
+ ## Council Specialist Response Format
25
+
26
+ When responding to a `/pantheon` council synthesis invocation, specialists MUST return this structured format:
27
+
28
+ ```
29
+ ## specialist_response
30
+ **position:** <clear one-sentence position answering the question>
31
+ **reasoning:** <2-4 sentences with logical chain>
32
+ **trade_offs:** <what's gained vs lost, specific>
33
+ **risks:** <what could go wrong, max 3 items>
34
+ **confidence:** High | Medium | Low
35
+ **agreement_signals:** agree:@agent1 on <issue>, agree:@agent2 on <issue> | disagree:@agent3 on <issue>
36
+ **specific_claims:** <count of specific factual claims in response>
37
+ ```
38
+
39
+ ### Field Rules
40
+
41
+ | Field | Required | Validation |
42
+ |-------|----------|------------|
43
+ | position | ✅ | Single sentence, must directly answer the question |
44
+ | reasoning | ✅ | 2-4 sentences with logical chain |
45
+ | trade_offs | ✅ | At least one gain and one loss, specific to context |
46
+ | risks | ✅ | Max 3 bullet points |
47
+ | confidence | ✅ | One of: High, Medium, Low |
48
+ | agreement_signals | Optional | Format: `agree:@agent on issue \| disagree:@agent on issue`. Use only when you can reference other specialists expected positions. |
49
+ | specific_claims | ✅ | Integer count of verifiable factual statements in the response |
50
+
51
+ ### Confidence Guidelines
52
+
53
+ - **High**: Position backed by 3+ specific claims with evidence or direct experience
54
+ - **Medium**: Position backed by 1-2 specific claims
55
+ - **Low**: Position is opinion-based or speculative
56
+
57
+ ### Example
58
+ ```
59
+ ## specialist_response
60
+ **position:** The BackgroundJobBoard should be used for council crash recovery
61
+ **reasoning:** The board already supports running→completed→reconciled state machine with persistence. Registering council dispatches there adds ~50ms overhead but prevents total session loss on context crash. The WAL pattern ensures no data loss on restart.
62
+ **trade_offs:** Gain: crash recovery for multi-minute council sessions. Lose: ~50ms registration overhead per council.
63
+ **risks:** Board persistence failure could block council start — implement with fire-and-forget error handling
64
+ **confidence:** High
65
+ **agreement_signals:** agree:@themis on persist-before-notify
66
+ **specific_claims:** 3
67
+ ```
68
+
24
69
  ## Memory Context
25
70
  If this agent used `memory_recall` or `memory_search`, include the relevant memory entries
26
71
  used as context for the response.
@@ -65,3 +65,55 @@ Para otimizar decisoes de delegacao e reduzir gasto de tokens:
65
65
  5. **kv_get("deleg:<pattern>")** para reusar decisoes ja tomadas
66
66
 
67
67
  Isso elimina ~300 tokens de reasoning por delegacao quando o cache acerta.
68
+
69
+ ## Council Decisions Namespace
70
+
71
+ Council synthesis decisions are persisted in a dedicated `council_decisions` namespace for precedent fast-path retrieval:
72
+
73
+ ### Write Path
74
+ After every `/pantheon` council synthesis completes, Zeus stores:
75
+ ```
76
+ memory_store({
77
+ namespace: "council_decisions",
78
+ key: "council:<yyyy-mm-dd>:<slug>",
79
+ value: {
80
+ question: "original question",
81
+ specialists: ["@agent1", "@agent2"],
82
+ recommendation: "final recommendation",
83
+ confidence: "High|Medium|Low",
84
+ agreements: ["point1", "point2"],
85
+ divergences: [{"issue": "...", "resolution": "..."}],
86
+ response_rate: "X of Y",
87
+ themis_audit: "approved|issues"
88
+ },
89
+ metadata: {
90
+ type: "council_decision",
91
+ specialist_count: N,
92
+ model_tier_used: "premium|default|fast"
93
+ }
94
+ })
95
+ ```
96
+
97
+ ### Read Path (Precedent Fast-Path)
98
+ Before dispatching a new council, Zeus runs:
99
+ ```
100
+ memory_search(question, top_k=2, namespace="council_decisions")
101
+ ```
102
+
103
+ Result interpretation:
104
+ | Score | Age | Action |
105
+ |-------|-----|--------|
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 |
108
+ | 0.5 - 0.85 | Any | Include as context for specialists but still dispatch council |
109
+ | < 0.5 | Any | Ignore, proceed with fresh council |
110
+
111
+ ### TTL & Maintenance
112
+ - Council decisions are LONG-TERM (no TTL or TTL = 365 days)
113
+ - Stale decisions (age > 90 days) should be flagged but NOT deleted — they remain as historical record
114
+ - Purge only via explicit namespace cleanup when decisions are superseded by ADRs
115
+
116
+ ### When NOT to Use
117
+ - Routine task summaries → use `default` namespace (auto-store by Zeus)
118
+ - Sprint/progress tracking → use `session` namespace
119
+ - ADR-level architecture decisions → delegate to @mnemosyne for permanent documentation
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Council synthesis — dispatch 2-4 specialists inline for multi-perspective decisions"
2
+ description: "Council synthesis — dispatch 2-4 specialists inline for multi-perspective decisions with precedent fast-path, confidence cross-validation, rebuttal rounds, and Themis audit gate"
3
3
  name: "Zeus Council Synthesis"
4
4
  applyTo: "agents/zeus.agent.md"
5
5
  ---
@@ -26,39 +26,197 @@ config:
26
26
  sequenceDiagram
27
27
  participant U as User
28
28
  participant Z as Zeus
29
+ participant M as Memory (Precedent)
30
+ participant A as Apollo (Research)
31
+ participant B as BackgroundJobBoard
29
32
  participant S1 as Specialist 1
30
33
  participant S2 as Specialist 2
31
34
  participant S3 as Specialist 3
35
+ participant W as Web Search
36
+ participant T as Themis (Audit + Moderator)
32
37
 
33
- U->>Z: /pantheon question
34
- Note over Z: Detect multi-perspective trigger
35
- Z->>Z: Select 2-4 specialists
36
- par Dispatch all specialists
37
- Z->>S1: Domain-specific query
38
- Z->>S2: Domain-specific query
39
- Z->>S3: Domain-specific query
38
+ U->>Z: /pantheon [--research] question
39
+ Z->>M: memory_search(council_decisions)
40
+ alt Precedent found (score > 0.85)
41
+ M-->>Z: ⚠️ Cached decision
42
+ Z->>U: Fast-path precedent
43
+ else No precedent
44
+ opt --research flag
45
+ Z->>A: 30s pre-scan
46
+ A-->>Z: Context brief
47
+ end
48
+ Z->>B: registerLaunch({council session})
49
+ par Dispatch all specialists
50
+ Z->>S1: Domain query + shared context
51
+ Z->>S2: Domain query + shared context
52
+ Z->>S3: Domain query + shared context
53
+ end
54
+ par Collect responses
55
+ S1-->>Z: Structured response
56
+ S2-->>Z: Structured response
57
+ S3-->>Z: Structured response
58
+ end
59
+ Note over Z: Cross-validate confidence
60
+ alt Agreement rate < 50%
61
+ Z->>S1: Rebuttal round
62
+ Z->>S2: Rebuttal round
63
+ Z->>S3: Rebuttal round
64
+ S1-->>Z: Refined response
65
+ S2-->>Z: Refined response
66
+ S3-->>Z: Refined response
67
+ Note over Z: Ainda divergência?
68
+ alt Agreement rate STILL < 50%
69
+ Z->>W: browser_search() for each divergence point
70
+ W-->>Z: Evidence brief with sources
71
+ Z->>T: Dispatches as moderator
72
+ Note over T: Reviews evidence + specialist responses
73
+ T-->>Z: Moderator verdict
74
+ end
75
+ end
76
+ Z->>Z: Synthesize (with evidence if tie-broken)
77
+ Z->>T: Audit synthesis fidelity
78
+ T-->>Z: ✅ / ⚠️ Issues
79
+ Z->>M: Store decision
80
+ Z->>B: Mark reconciled
81
+ Z->>U: 🏛️ Council Synthesis
40
82
  end
41
- par Collect responses
42
- S1-->>Z: Position + trade-offs
43
- S2-->>Z: Position + trade-offs
44
- S3-->>Z: Position + trade-offs
45
- end
46
- Note over Z: Synthesize agreements + divergences + recommendation
47
- Z->>U: 🏛️ Council Synthesis
48
83
  ```
49
84
 
50
- ## Dispatch with Timeout
85
+ ## Dispatch Sequence (9-Step Protocol)
86
+
87
+ ### Step 0 — Precedent Fast-Path (Fase 1)
88
+ Before any dispatch: `memory_search(query, top_k=2, namespace="council_decisions")`
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
92
+
93
+ ### Step 0b — Apollo Pre-Scan (Fase 2, --research flag)
94
+ If `/pantheon --research <question>`: dispatch @apollo with 30s timeout. Inject findings as `shared_context` into ALL specialist prompts. Skip if flag absent.
95
+
96
+ ### Step 1 — Register on BackgroundJobBoard (Fase 1)
97
+ Before dispatching specialists:
98
+ ```
99
+ board.registerLaunch({
100
+ taskID: "council:<uuid>",
101
+ parentSessionID: "<session-id>",
102
+ agent: "zeus",
103
+ description: "Council: <question>",
104
+ objective: "Synthesize specialist recommendations"
105
+ })
106
+ ```
107
+ Enables crash recovery — if context is lost mid-synthesis, the board preserves session state.
108
+
109
+ ### Step 2 — Select Specialists
110
+ Use domain-to-specialist mapping table (below). Max 3 specialists.
111
+
112
+ ### Step 3 — Dispatch ALL task() calls in ONE message
113
+ Each specialist prompt MUST include:
114
+ - Structured output template (see Specialist Output Format below)
115
+ - `shared_context` if Apollo pre-scan was done
116
+ - Timeout per role: 120s for reviewers, 60s for explorers/implementers
117
+
118
+ ### Step 4 — Collect Responses
119
+ Wait for all responses. Note TIMEOUT agents. Partial results OK only for read-only specialists (@apollo, @gaia).
120
+
121
+ ### Step 5 — Confidence Cross-Validation (Fase 2)
122
+ For each specialist response, validate confidence claims:
51
123
 
52
- Send ALL `task()` calls in a single message. Each specialist must respond concisely (2-4 sentences).
124
+ | Reported | Minimum Required | Action |
125
+ |----------|-----------------|--------|
126
+ | High | ≥ 3 specific claims | If fewer → downgrade to Medium, annotate "(auto-downgraded from High: only N specific claims)" |
127
+ | Medium | ≥ 1 specific claim | Pass |
128
+ | Low | Any response | Pass |
53
129
 
54
- ⚠️ **TIMEOUT RULE:** If a specialist does not respond after other specialists have responded, proceed with partial results. Do NOT wait indefinitely.
130
+ "Specific claim" = statement with evidence, data point, or verifiable fact (not opinion).
55
131
 
56
- 1. Detect multi-perspective trigger pattern
57
- 2. Select 2-4 specialists based on domain (see tables below)
58
- 3. Dispatch ALL `task()` calls in ONE message
59
- 4. Wait for responses — note any specialists that don't respond as TIMEOUT
60
- 5. Synthesize: include "X of Y specialists responded" in output
61
- 6. Adjust confidence: down if key specialists timed out
132
+ ### Step 6 — Divergence-Gated Rebuttal Round (Fase 2, conditional)
133
+ Calculate agreement rate = `min(agreements, divergences) / total_points` from structured `agreement_signals`. If < 50% agreement:
134
+ - Dispatch ONE rebuttal round: specialists see ALL other responses and refine their own
135
+ - Updated responses treated as final
136
+ - Hard cap: MAX 3 total rounds (initial + 2 rebuttals)
137
+ - Skip if any TIMEOUT occurred (can't rebuttal without all voices)
138
+
139
+ ### Step 6b — Modo Desempate com Evidência (Fase 2, conditional)
140
+
141
+ If after Step 6 the agreement rate is STILL < 50% (rebuttal did not resolve divergence):
142
+
143
+ 1. **Identify divergence points** — Parse all specialist responses (initial + rebuttal) and extract specific issues where positions differ
144
+ 2. **Web research** — For EACH divergence point, Zeus calls `browser_search()` or `webfetch()` to find factual evidence:
145
+ - Benchmarks, documentation, GitHub issues, official sources
146
+ - At least 2 independent sources per point when possible
147
+ - Focus on factual data, not opinion
148
+ 3. **Compile Evidence Brief** — Structure findings as:
149
+ ```
150
+ ## evidence_brief
151
+ **divergence_point_1:** <description>
152
+ **evidence_found:** <facts from web, max 3 sentences>
153
+ **sources:** [URL1, URL2]
154
+
155
+ **divergence_point_2:** ...
156
+ ```
157
+ 4. **Dispatch @themis as moderator** — Send ONE task with:
158
+ - All specialist responses (initial + rebuttal)
159
+ - The evidence brief
160
+ - Prompt: "Act as impartial moderator. These specialists disagree on [points]. Here is web evidence on each point. Issue a final verdict for each divergence point, citing specific evidence. Return structured verdict."
161
+ 5. **Themis returns moderator verdict** in this format:
162
+ ```
163
+ ## moderator_verdict
164
+ **divergence_points_analyzed:** <count>
165
+ **verdicts:**
166
+ - <point 1>: <decision> — evidence: <citation>
167
+ - <point 2>: <decision> — evidence: <citation>
168
+ **overall_direction:** <which approach is better supported by evidence>
169
+ **confidence:** High | Medium | Low
170
+ **unresolved:** <any points still unclear despite evidence>
171
+ ```
172
+ 6. **Zeus incorporates verdict** into synthesis (Step 7), showing which evidence supported which conclusion
173
+
174
+ **Rules:**
175
+ - Only triggers when agreement rate < 50% AFTER rebuttal round
176
+ - Skip if NO divergence points are web-researchable (purely subjective/opinion-based disagreements)
177
+ - Max 3 web searches per council (prevents runaway)
178
+ - If Themis confidence is Low or points remain unresolved, note this explicitly in synthesis
179
+ - Themis moderator role is SEPARATE from the Themis Audit Gate (Step 8) — they serve different functions
180
+
181
+ ### Step 7 — Zeus Synthesize
182
+ Use structured `agreement_signals` to auto-detect agreements/divergences. Output synthesis template (see below).
183
+
184
+ ### Step 8 — Themis Audit Gate (Fase 1)
185
+ Post-synthesis, dispatch @themis:
186
+ ```
187
+ task(subagent_type: "themis", prompt: "Audit this council synthesis for fidelity. Compare raw specialist responses against the synthesized output. Check: (1) Any specialist misrepresented? (2) Divergences hidden or softened? (3) Confidence claims match response specificity? Return ✅ or list specific issues.")
188
+ ```
189
+ - If ✅ → proceed
190
+ - If issues → fix each issue before delivering to user
191
+
192
+ ### 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
+ ```
205
+
206
+ ## Specialist Output Format (Fase 1 — machine-parseable structured fields)
207
+
208
+ Specialists MUST return these structured fields in their response:
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
+ ```
62
220
 
63
221
  ## Domain-to-Specialist Mapping
64
222
 
@@ -73,7 +231,7 @@ Send ALL `task()` calls in a single message. Each specialist must respond concis
73
231
  | Observability | nyx, hermes |
74
232
  | General | athena, themis, hermes |
75
233
 
76
- ## Synthesis Output Template
234
+ ## Synthesis Output Template (enhanced)
77
235
 
78
236
  ```
79
237
  ## 🏛️ Council Synthesis
@@ -82,6 +240,8 @@ Send ALL `task()` calls in a single message. Each specialist must respond concis
82
240
  **Date:** <date>
83
241
  **Response rate:** X of Y specialists responded
84
242
  **Timed out:** @agent1, @agent2 (if any)
243
+ **Precedent used:** yes/no (which one, date)
244
+ **Research context:** <shared_context summary> (if --research)
85
245
 
86
246
  ### Specialist Perspectives
87
247
  | Agent | Position | Trade-offs | Confidence |
@@ -95,11 +255,70 @@ Send ALL `task()` calls in a single message. Each specialist must respond concis
95
255
  | Issue | Side A | Side B | Resolution |
96
256
  |-------|--------|--------|------------|
97
257
 
258
+ ### Evidence & Moderation (if tie-break activated)
259
+ **Divergence points researched:** <list>
260
+ **Evidence summary:** <key findings from web>
261
+ **Moderator verdict:** <Themis final determination>
262
+ **Sources:** <citations>
263
+
98
264
  ### Recommendation
99
265
  <decisive conclusion>
100
266
 
267
+ ### Audit Gate
268
+ **Status:** ✅ Themis approved | ⚠️ Issues corrected
269
+
101
270
  ### Decision Gate
102
271
  **Confidence:** High/Medium/Low (adjusted for response rate)
103
272
  ```
104
273
 
105
- > **Note**: The user can explicitly invoke this via `/pantheon <question>`. The command dispatches to Zeus who runs the council inline.
274
+ ## Themis Audit Gate Rules (Fase 1)
275
+
276
+ 1. Every specialist mentioned in synthesis? → ✅
277
+ 2. Divergences from raw responses preserved (not softened/hidden)? → ✅
278
+ 3. No specialist attributed a position they didn't state? → ✅
279
+ 4. Confidence claims match response specificity? → ✅
280
+ 5. If any ❌, list specific issues for Zeus to fix before delivery
281
+
282
+ ## Rebuttal Round Rules (Fase 2)
283
+
284
+ 1. Only triggers when agreement rate < 50%
285
+ 2. MAX 3 rounds total (including initial dispatch)
286
+ 3. Skip if any TIMEOUT (can't rebuttal without all voices)
287
+ 4. Each rebuttal round: specialist sees ALL other responses + current synthesis draft
288
+ 5. Refined responses replace originals for the final synthesis
289
+ 6. If agreement rate STILL < 50% after rebuttal → Step 6b (Modo Desempate com Evidência)
290
+
291
+ ## Crash Recovery via BackgroundJobBoard (Fase 1)
292
+
293
+ If Zeus context crashes mid-council:
294
+ 1. On restart, `board.recoverRunningJobs()` marks running jobs as error
295
+ 2. Check `board.formatForPrompt()` for unreconciled terminal jobs
296
+ 3. Re-dispatch council with same question, noting: "⚠️ Retry — previous council session crashed. Using same question."
297
+
298
+ ## Performance Budget
299
+
300
+ | Step | Latency | Phase |
301
+ |------|---------|-------|
302
+ | Precedent fast-path | < 500ms | Fase 1 |
303
+ | Apollo pre-scan | +30s (optional, --research) | Fase 2 |
304
+ | Specialist dispatch | bounded by slowest (60-120s) | — |
305
+ | Rebuttal round | +60s (conditional, < 50% agreement) | Fase 2 |
306
+ | Web search (tie-break) | +15s (conditional, < 50% after rebuttal) | Fase 2 |
307
+ | Themis moderator | +15s (conditional, tie-break activated) | Fase 2 |
308
+ | Themis audit | +15s | Fase 1 |
309
+ | **Total worst case** (research + rebuttal + tie-break) | ~255s | — |
310
+ | **Total typical** (no research, no rebuttal, no tie-break) | ~45-90s | — |
311
+
312
+ > **Note**: The user can explicitly invoke this via `/pantheon <question>`. The `--research` flag adds Apollo pre-scan. All decisions are stored in `council_decisions` memory namespace for fast-path retrieval on future councils.
313
+
314
+ ## Modo Desempate Rules (Fase 2)
315
+
316
+ 1. Only triggers when agreement rate < 50% AFTER rebuttal round
317
+ 2. If no divergence points are web-researchable (pure opinion disagreement), skip — Zeus synthesizes with lower confidence
318
+ 3. Max 3 web searches per council invocation
319
+ 4. Themis moderator role is DISTINCT from Themis audit gate:
320
+ - Moderator: resolves substantive disagreement between specialists (reads evidence, gives verdict)
321
+ - Audit gate: checks synthesis fidelity against raw responses (quality assurance)
322
+ Both run in the same council invocation, at different steps
323
+ 5. If Themis moderator confidence is Low, mark as "unresolved tie" in the synthesis output
324
+ 6. Evidence from web search must be cited with source URL or document reference — no anonymous claims
package/src/plugin.ts CHANGED
@@ -1,4 +1,42 @@
1
1
  import type { PluginConfig } from 'opencode'
2
+ import { BackgroundJobBoard } from './pantheon/background-job-board.ts'
3
+ import { FilePersistenceAdapter } from './pantheon/file-persistence.ts'
4
+
5
+ // ─── Background Job Board Singleton ────────────────────────────────────
6
+
7
+ const board = new BackgroundJobBoard({
8
+ maxConcurrentPerAgent: 3,
9
+ signalDir: '.pantheon/deepwork/board-signals',
10
+ })
11
+
12
+ // Wire up file-based persistence and recover orphaned jobs from crashes
13
+ const persistence = new FilePersistenceAdapter('.pantheon/board/state.json')
14
+ board.setPersistence(persistence)
15
+
16
+ // Recover on startup — any jobs left in "running" state become "error"
17
+ board.recoverRunningJobs().catch((err) =>
18
+ console.error('[Pantheon Plugin] Failed to recover running jobs:', err),
19
+ )
20
+
21
+ // Log board state changes to console for observability
22
+ board.onTerminal((taskID: string) => {
23
+ const job = board.get(taskID)
24
+ if (job) {
25
+ console.log(
26
+ `[Pantheon Plugin] Board terminal: [${job.alias}] ${job.description} → ${job.state}${job.resultSummary ? ` — ${job.resultSummary}` : ''}`,
27
+ )
28
+ }
29
+ })
30
+
31
+ /**
32
+ * Get the global BackgroundJobBoard singleton.
33
+ *
34
+ * All modules (Zeus, auto-wake, etc.) should access the board through this
35
+ * function to ensure a single consistent state machine across the plugin.
36
+ */
37
+ export function getBackgroundJobBoard(): BackgroundJobBoard {
38
+ return board
39
+ }
2
40
 
3
41
  export default {
4
42
  name: 'pantheon',
package/src/routing.yml CHANGED
@@ -1,251 +1,218 @@
1
- # routing.yml — Canonical Routing Source for Pantheon
2
- # Version: 1.0 — Agent routing, delegation rules, and handoff contracts
3
1
  version: 1.0
4
-
5
- # Primary Delegation Flow
6
- # ```mermaid
7
- # flowchart LR
8
- # Z[Zeus] --> A[Athena] --> AP[Apollo]
9
- # Z --> H[Hermes] --> T[Themis]
10
- # Z --> PH[Aphrodite] --> T
11
- # Z --> D[Demeter] --> T
12
- # Z --> R[Prometheus]
13
- # Z --> HE[Hephaestus]
14
- # Z --> N[Nyx]
15
- # Z --> G[Gaia]
16
- # # Z --> I[Iris] --> M[Mnemosyne]
17
- # Z --> M
18
- # Z -.-> TA[Talos]
19
- # T --> I
20
- # T --> M
21
- # ```
22
- # Removed agents: argus, chiron, echo (merged/deprecated)
23
-
24
- # AGENT REGISTRY — 14 active agents
25
2
  agents:
26
3
  zeus:
27
- role: "Central orchestrator"
28
- model_tier: default
4
+ role: Central orchestrator
5
+ model_tier: code
29
6
  reasoning_effort: medium
30
7
  user_invocable: true
31
8
  can_delegate: true
32
9
  can_receive_delegation: true
33
10
  capabilities:
34
- - orchestration
35
- - delegation
36
- - context_conservation
37
- - context_compression
38
- - phase_management
39
- - quality_gate_enforcement
40
- - memory_recall
41
- - pantheon_resources
42
- - pantheon_code_mode
43
- - pantheon_deepwork
11
+ - orchestration
12
+ - delegation
13
+ - context_conservation
14
+ - context_compression
15
+ - phase_management
16
+ - quality_gate_enforcement
17
+ - memory_recall
18
+ - pantheon_resources
19
+ - pantheon_code_mode
20
+ - pantheon_deepwork
44
21
  subagent_can_delegate_to:
45
- - athena
46
- - apollo
47
- - hermes
48
- - aphrodite
49
- - demeter
50
- - themis
51
- - prometheus
52
- - hephaestus
53
- - nyx
54
- - iris
55
- - mnemosyne
56
- - talos
22
+ - athena
23
+ - apollo
24
+ - hermes
25
+ - aphrodite
26
+ - demeter
27
+ - themis
28
+ - prometheus
29
+ - hephaestus
30
+ - nyx
31
+ - iris
32
+ - mnemosyne
33
+ - talos
57
34
  skills:
58
- - agent-coordination
59
- - session-goal
60
- - artifact-management
61
- - context-compression
62
- - auto-continue
63
- - orchestration-workflow
64
- - incremental-implementation
65
-
35
+ - agent-coordination
36
+ - session-goal
37
+ - artifact-management
38
+ - context-compression
39
+ - auto-continue
40
+ - orchestration-workflow
41
+ - incremental-implementation
66
42
  athena:
67
- role: "Strategic planner"
43
+ role: Strategic planner
68
44
  model_tier: premium
69
45
  reasoning_effort: high
70
46
  user_invocable: true
71
47
  can_delegate: true
72
48
  can_receive_delegation: true
73
49
  capabilities:
74
- - strategic_planning
75
- - tdd_planning
76
- - architectural_design
77
- - root_cause_analysis
78
- - risk_assessment
79
- - memory_recall
80
- - pantheon_resources
50
+ - strategic_planning
51
+ - tdd_planning
52
+ - architectural_design
53
+ - root_cause_analysis
54
+ - risk_assessment
55
+ - memory_recall
56
+ - pantheon_resources
81
57
  subagent_can_delegate_to:
82
- - apollo
58
+ - apollo
83
59
  skills:
84
- - spec-driven-development
85
- - memory-bank
86
-
60
+ - spec-driven-development
61
+ - memory-bank
87
62
  apollo:
88
- role: "Investigation scout"
89
- model_tier: fast
63
+ role: Investigation scout
64
+ model_tier: free
90
65
  reasoning_effort: low
91
66
  user_invocable: false
92
67
  can_delegate: false
93
68
  can_receive_delegation: true
94
69
  capabilities:
95
- - codebase_discovery
96
- - pattern_discovery
97
- - dependency_research
98
- - parallel_search
99
- - codemap_generation
100
- - memory_search
101
- - pantheon_resources
70
+ - codebase_discovery
71
+ - pattern_discovery
72
+ - dependency_research
73
+ - parallel_search
74
+ - codemap_generation
75
+ - memory_search
76
+ - pantheon_resources
102
77
  subagent_can_delegate_to: []
103
78
  skills:
104
- - auto-continue
105
-
79
+ - auto-continue
106
80
  hermes:
107
- role: "Backend specialist"
108
- model_tier: default
81
+ role: Backend specialist
82
+ model_tier: code
109
83
  reasoning_effort: medium
110
84
  user_invocable: true
111
85
  can_delegate: true
112
86
  can_receive_delegation: true
113
87
  capabilities:
114
- - backend_implementation
115
- - api_development
116
- - service_layer
117
- - async_programming
118
- - obsolete_lib_detection
119
- - memory_store
120
- - pantheon_code_mode
88
+ - backend_implementation
89
+ - api_development
90
+ - service_layer
91
+ - async_programming
92
+ - obsolete_lib_detection
93
+ - memory_store
94
+ - pantheon_code_mode
121
95
  skills:
122
- - tdd-with-agents
123
- - file-prompts
124
- - streaming-patterns
125
- - git-workflow-and-versioning
126
- - incremental-implementation
127
-
96
+ - tdd-with-agents
97
+ - file-prompts
98
+ - streaming-patterns
99
+ - git-workflow-and-versioning
100
+ - incremental-implementation
128
101
  aphrodite:
129
- role: "Frontend specialist"
130
- model_tier: default
102
+ role: Frontend specialist
103
+ model_tier: code
131
104
  reasoning_effort: medium
132
105
  user_invocable: true
133
106
  can_delegate: false
134
107
  can_receive_delegation: true
135
108
  capabilities:
136
- - frontend_implementation
137
- - ui_component_design
138
- - accessibility_audit
139
- - responsive_design
140
- - deprecated_npm_detection
141
- - memory_store
142
- - pantheon_resources_memory_bank
109
+ - frontend_implementation
110
+ - ui_component_design
111
+ - accessibility_audit
112
+ - responsive_design
113
+ - deprecated_npm_detection
114
+ - memory_store
115
+ - pantheon_resources_memory_bank
143
116
  skills:
144
- - tdd-with-agents
145
- - visual-review-pipeline
146
- - file-prompts
147
-
117
+ - tdd-with-agents
118
+ - visual-review-pipeline
119
+ - file-prompts
148
120
  demeter:
149
- role: "Database specialist"
150
- model_tier: default
121
+ role: Database specialist
122
+ model_tier: code
151
123
  reasoning_effort: medium
152
124
  user_invocable: true
153
125
  can_delegate: false
154
126
  can_receive_delegation: true
155
127
  capabilities:
156
- - database_migration
157
- - schema_design
158
- - query_optimization
159
- - n_plus_one_prevention
160
- - index_strategy
161
- - memory_store
162
- - memory_recall
128
+ - database_migration
129
+ - schema_design
130
+ - query_optimization
131
+ - n_plus_one_prevention
132
+ - index_strategy
133
+ - memory_store
134
+ - memory_recall
163
135
  skills:
164
- - tdd-with-agents
165
- - incremental-implementation
166
-
136
+ - tdd-with-agents
137
+ - incremental-implementation
167
138
  themis:
168
- role: "Quality gate"
139
+ role: Quality gate
169
140
  model_tier: premium
170
141
  reasoning_effort: high
171
142
  user_invocable: true
172
143
  can_delegate: true
173
144
  can_receive_delegation: true
174
145
  capabilities:
175
- - code_review
176
- - security_audit
177
- - test_coverage_validation
178
- - quality_gate
179
- - dead_code_detection
180
- - deprecation_audit
181
- - memory_search
182
- - pantheon_resources
146
+ - code_review
147
+ - security_audit
148
+ - test_coverage_validation
149
+ - quality_gate
150
+ - dead_code_detection
151
+ - deprecation_audit
152
+ - memory_search
153
+ - pantheon_resources
183
154
  subagent_can_delegate_to:
184
- - mnemosyne
155
+ - mnemosyne
185
156
  skills:
186
- - code-review-checklist
187
- - security-hardening
188
- - tdd-with-agents
189
- - context-compression
190
-
157
+ - code-review-checklist
158
+ - security-hardening
159
+ - tdd-with-agents
160
+ - context-compression
191
161
  prometheus:
192
- role: "Infrastructure specialist"
193
- model_tier: default
162
+ role: Infrastructure specialist
163
+ model_tier: code
194
164
  reasoning_effort: medium
195
165
  user_invocable: true
196
166
  can_delegate: false
197
167
  can_receive_delegation: true
198
168
  capabilities:
199
- - infrastructure_as_code
200
- - docker_configuration
201
- - ci_cd_pipelines
202
- - deployment_strategy
203
- - container_optimization
204
- - pantheon_code_mode
205
- - memory_store
169
+ - infrastructure_as_code
170
+ - docker_configuration
171
+ - ci_cd_pipelines
172
+ - deployment_strategy
173
+ - container_optimization
174
+ - pantheon_code_mode
175
+ - memory_store
206
176
  skills:
207
- - git-workflow-and-versioning
208
- - incremental-implementation
209
-
177
+ - git-workflow-and-versioning
178
+ - incremental-implementation
210
179
  hephaestus:
211
- role: "AI pipelines"
212
- model_tier: default
180
+ role: AI pipelines
181
+ model_tier: code
213
182
  reasoning_effort: medium
214
183
  user_invocable: true
215
184
  can_delegate: false
216
185
  can_receive_delegation: true
217
186
  capabilities:
218
- - rag_pipeline_design
219
- - langchain_workflow
220
- - vector_store_integration
221
- - embedding_strategy
222
- - ai_workflow_composition
223
- - memory_search
187
+ - rag_pipeline_design
188
+ - langchain_workflow
189
+ - vector_store_integration
190
+ - embedding_strategy
191
+ - ai_workflow_composition
192
+ - memory_search
224
193
  skills:
225
- - tdd-with-agents
226
- - auto-continue
227
-
194
+ - tdd-with-agents
195
+ - auto-continue
228
196
  nyx:
229
- role: "Observability"
230
- model_tier: fast
197
+ role: Observability
198
+ model_tier: free
231
199
  reasoning_effort: low
232
200
  user_invocable: true
233
201
  can_delegate: false
234
202
  can_receive_delegation: true
235
203
  capabilities:
236
- - opentelemetry_setup
237
- - token_cost_tracking
238
- - agent_performance_analytics
239
- - alerting
240
- - monitoring_dashboards
241
- - pantheon_resources_routing
204
+ - opentelemetry_setup
205
+ - token_cost_tracking
206
+ - agent_performance_analytics
207
+ - alerting
208
+ - monitoring_dashboards
209
+ - pantheon_resources_routing
242
210
  skills:
243
- - security-hardening
244
- - auto-continue
245
-
211
+ - security-hardening
212
+ - auto-continue
246
213
  gaia:
247
214
  role: Remote sensing domain specialist
248
- model_tier: fast
215
+ model_tier: free
249
216
  reasoning_effort: low
250
217
  user_invocable: false
251
218
  can_delegate: false
@@ -257,183 +224,175 @@ agents:
257
224
  - ml_classification
258
225
  skills:
259
226
  - auto-continue
260
-
261
227
  iris:
262
- role: "GitHub operations"
263
- model_tier: fast
228
+ role: GitHub operations
229
+ model_tier: free
264
230
  reasoning_effort: low
265
231
  user_invocable: true
266
232
  can_delegate: false
267
233
  can_receive_delegation: true
268
234
  capabilities:
269
- - branch_management
270
- - pull_request_creation
271
- - issue_tracking
272
- - release_management
273
- - changelog_generation
274
- - pantheon_resources
235
+ - branch_management
236
+ - pull_request_creation
237
+ - issue_tracking
238
+ - release_management
239
+ - changelog_generation
240
+ - pantheon_resources
275
241
  subagent_can_delegate_to:
276
- - mnemosyne
242
+ - mnemosyne
277
243
  skills:
278
- - git-workflow-and-versioning
279
- - artifact-management
280
-
244
+ - git-workflow-and-versioning
245
+ - artifact-management
281
246
  mnemosyne:
282
- role: "Memory bank"
283
- model_tier: fast
247
+ role: Memory bank
248
+ model_tier: free
284
249
  reasoning_effort: low
285
250
  user_invocable: true
286
251
  can_delegate: true
287
252
  can_receive_delegation: true
288
253
  capabilities:
289
- - memory_bank_management
290
- - artifact_persistence
291
- - adr_writing
292
- - project_initialization
293
- - sprint_documentation
294
- - context_compression
295
- - memory_store
296
- - memory_recall
297
- - pantheon_resources_memory_bank
254
+ - memory_bank_management
255
+ - artifact_persistence
256
+ - adr_writing
257
+ - project_initialization
258
+ - sprint_documentation
259
+ - context_compression
260
+ - memory_store
261
+ - memory_recall
262
+ - pantheon_resources_memory_bank
298
263
  subagent_can_delegate_to: []
299
264
  skills:
300
- - artifact-management
301
- - memory-bank
302
- - context-compression
303
- - session-goal
304
-
265
+ - artifact-management
266
+ - memory-bank
267
+ - context-compression
268
+ - session-goal
305
269
  talos:
306
- role: "Hotfix agent"
307
- model_tier: fast
270
+ role: Hotfix agent
271
+ model_tier: free
308
272
  reasoning_effort: low
309
273
  user_invocable: true
310
274
  can_delegate: false
311
275
  can_receive_delegation: true
312
276
  capabilities:
313
- - rapid_repair
314
- - css_fix
315
- - typo_correction
316
- - minor_bug_fix
317
- - escalation_detection
318
- - pantheon_code_mode
277
+ - rapid_repair
278
+ - css_fix
279
+ - typo_correction
280
+ - minor_bug_fix
281
+ - escalation_detection
282
+ - pantheon_code_mode
319
283
  subagent_can_delegate_to: []
320
284
  skills:
321
- - incremental-implementation
322
-
323
- # AUTO-CONTINUE CONFIGURATION
324
- # Checkpoint and heartbeat settings for autonomous sessions
285
+ - incremental-implementation
325
286
  auto_continue:
326
- checkpoint_script: ".pantheon/code-mode/checkpoint-session.sh"
287
+ checkpoint_script: .pantheon/code-mode/checkpoint-session.sh
327
288
  heartbeat_interval: 5
328
289
  idle:
329
290
  warning: 60
330
291
  stall: 120
331
292
  pause: 300
332
-
333
- # DELEGATION RULES
334
- # Implicit default: any agent can delegate to apollo for codebase discovery.
335
- # Overrides are listed in agent subagent_can_delegate_to fields above.
336
- # See instructions/zeus-timeout-retry.instructions.md for timeout/retry defaults.
337
- # INTENT GATE — Heuristic request classification (zero LLM)
338
- # Zeus classifies the request BEFORE delegating to the correct agent.
339
- # Patterns are matched by keyword, not LLM call.
340
293
  intent_gate:
341
294
  fix:
342
- patterns: ["bug", "error", "crash", "broken", "fail", "wrong", "incorrect"]
295
+ patterns:
296
+ - bug
297
+ - error
298
+ - crash
299
+ - broken
300
+ - fail
301
+ - wrong
302
+ - incorrect
343
303
  target: talos
344
304
  research:
345
- patterns: ["how", "what", "why", "where", "find", "search", "lookup", "documentation"]
305
+ patterns:
306
+ - how
307
+ - what
308
+ - why
309
+ - where
310
+ - find
311
+ - search
312
+ - lookup
313
+ - documentation
346
314
  target: apollo
347
315
  investigate:
348
- patterns: ["compare", "vs", "trade.?off", "should", "which", "risk", "impact"]
316
+ patterns:
317
+ - compare
318
+ - vs
319
+ - trade.?off
320
+ - should
321
+ - which
322
+ - risk
323
+ - impact
349
324
  target: athena
350
325
  plan:
351
- patterns: ["plan", "roadmap", "architecture", "design", "proposal", "strategy"]
326
+ patterns:
327
+ - plan
328
+ - roadmap
329
+ - architecture
330
+ - design
331
+ - proposal
332
+ - strategy
352
333
  target: athena
353
334
  implement:
354
335
  patterns: []
355
- target: hermes # default fallback
356
-
336
+ target: hermes
357
337
  delegation:
358
338
  zeus:
359
- - target: athena
360
- - target: apollo
361
- - target: hermes
362
- - target: aphrodite
363
- - target: demeter
364
- - target: themis
365
- - target: prometheus
366
- - target: hephaestus
367
- - target: nyx
368
- - target: gaia
369
- - target: iris
370
- - target: mnemosyne
371
- - target: talos
372
-
373
- # Delegation conventions (documentation only — not programmatically enforced):
374
- # - Implementers → themis for code review
375
- # - Themis → zeus (blockers/escalation) or mnemosyne (documentation)
376
- # - Others → zeus or athena as appropriate
377
-
378
- # HANDOFF DEFINITIONS — named contracts for delegation
339
+ - target: athena
340
+ - target: apollo
341
+ - target: hermes
342
+ - target: aphrodite
343
+ - target: demeter
344
+ - target: themis
345
+ - target: prometheus
346
+ - target: hephaestus
347
+ - target: nyx
348
+ - target: gaia
349
+ - target: iris
350
+ - target: mnemosyne
351
+ - target: talos
379
352
  handoffs:
380
353
  zeus:
381
354
  compress_context:
382
- label: "🗜️ Compress Context"
383
- description: "Compress completed subtask_summaries and archive IMPL/REVIEW artifacts after Themis approval"
355
+ label: 🗜️ Compress Context
356
+ description: Compress completed subtask_summaries and archive IMPL/REVIEW artifacts
357
+ after Themis approval
384
358
  agent: mnemosyne
385
- prompt: "Compress completed phase artifacts (Level 2): create ZZ-phase{N}-context.md with priority-scored entries, write compressed entries to 01-active-context.md (priority-aware, budget-allocated), archive IMPL/REVIEW to 02-progress-log.md, update _xref/index.md cross-references."
386
-
387
- # PLATFORM TOOL MAPPINGS
359
+ prompt: 'Compress completed phase artifacts (Level 2): create ZZ-phase{N}-context.md
360
+ with priority-scored entries, write compressed entries to 01-active-context.md
361
+ (priority-aware, budget-allocated), archive IMPL/REVIEW to 02-progress-log.md,
362
+ update _xref/index.md cross-references.'
388
363
  platforms:
389
364
  opencode:
390
- display_name: "OpenCode"
365
+ display_name: OpenCode
391
366
  tools:
392
- delegate_agent: "agent"
393
- delegate_subagent: "task"
394
- ask_user: "question"
395
- search_codebase: "grep"
396
- search_files: "glob"
397
- read_file: "read"
398
- run_bash: "bash"
399
- web_fetch: "webfetch"
400
- web_search: "websearch"
367
+ delegate_agent: agent
368
+ delegate_subagent: task
369
+ ask_user: question
370
+ search_codebase: grep
371
+ search_files: glob
372
+ read_file: read
373
+ run_bash: bash
374
+ web_fetch: webfetch
375
+ web_search: websearch
401
376
  capabilities:
402
- - agent_delegation
403
- - subagent_delegation
404
- - bash_execution
405
- - web_fetch
406
- - web_search
407
-
408
- # ARTIFACT LIFECYCLE
409
- # See skill: artifact-management for full lifecycle rules.
410
- # Summary: PLAN, IMPL, REVIEW, DISC → .pantheon/memory-bank/.tmp/ (ephemeral, sprint-scoped).
411
- # ADR → .pantheon/memory-bank/_notes/ (permanent). Subtask → inline, no artifact.
412
-
413
- # MODEL FALLBACK CHAINS
414
- # When an agent's primary model is rate-limited (429) or unavailable,
415
- # the platform should attempt the next model in the chain.
416
- # Chain pattern: Primary → Secondary → Emergency
417
- # These chains are advisory — the platform's model routing determines
418
- # actual fallback behavior at runtime.
377
+ - agent_delegation
378
+ - subagent_delegation
379
+ - bash_execution
380
+ - web_fetch
381
+ - web_search
419
382
  fallback_chains:
420
383
  premium_agents:
421
- primary: "anthropic/claude-sonnet-4-20250514"
422
- secondary: "openai/gpt-5.1"
423
- emergency: "deepseek/deepseek-v4-pro"
424
-
425
- default_agents:
426
- primary: "anthropic/claude-sonnet-4-20250514"
427
- secondary: "openai/gpt-4o"
428
- emergency: "deepseek/deepseek-v4-pro"
429
-
430
- fast_agents:
431
- primary: "deepseek/deepseek-v4-pro"
432
- secondary: "anthropic/claude-haiku-4-20250514"
433
- emergency: "openai/gpt-4o-mini"
434
-
435
- agent_overrides:
436
- gaia:
437
- primary: "anthropic/claude-sonnet-4-20250514"
438
- secondary: "openai/gpt-4o"
439
- emergency: "deepseek/deepseek-v4-pro"
384
+ primary: deepseek/deepseek-v4-pro
385
+ secondary: mimo/v2.5
386
+ emergency: deepseek/deepseek-v4-pro
387
+ code_agents:
388
+ primary: deepseek/deepseek-v4-flash
389
+ secondary: mimo/v2.5
390
+ emergency: deepseek/deepseek-v4-flash
391
+ free_agents:
392
+ primary: deepseek/deepseek-v4-flash
393
+ secondary: mimo/v2.5
394
+ emergency: deepseek/deepseek-v4-flash
395
+ background_job_board:
396
+ max_concurrent_per_agent: 3
397
+ signal_dir: .pantheon/deepwork/board-signals/
398
+ persistence_dir: .pantheon/board/jobs/