pantheon-opencode 1.6.0-beta.1 → 1.6.0-beta.10

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.
Files changed (120) hide show
  1. package/AGENTS.global.md +182 -0
  2. package/AGENTS.md +10 -891
  3. package/CHANGELOG.md +326 -0
  4. package/README.md +496 -32
  5. package/README.pt-BR.md +285 -20
  6. package/bin/pantheon-init.mjs +26 -3
  7. package/commands/pantheon-audit.md +7 -1
  8. package/commands/pantheon-consolidate.md +1 -1
  9. package/commands/pantheon-deepwork.md +14 -3
  10. package/commands/pantheon-focus.md +17 -0
  11. package/commands/pantheon-vision.md +61 -12
  12. package/package.json +21 -14
  13. package/plugin.json +2 -2
  14. package/pyproject.toml +8 -6
  15. package/scripts/build-agents-md.mjs +374 -56
  16. package/scripts/changelog-merge.mjs +161 -0
  17. package/scripts/{code_mode_server.py → code_mode.py} +3 -3
  18. package/scripts/cost.mjs +244 -41
  19. package/scripts/doctor.mjs +151 -1
  20. package/scripts/install/agents-md.mjs +4 -4
  21. package/scripts/install/config-migration.mjs +317 -4
  22. package/scripts/install/health-check.mjs +21 -19
  23. package/scripts/install/interactive.mjs +1 -1
  24. package/scripts/install/opencode-version.mjs +246 -4
  25. package/scripts/install/opencode.mjs +627 -179
  26. package/scripts/install/plugin.mjs +43 -9
  27. package/scripts/install/shared.mjs +120 -12
  28. package/scripts/install/vision-prompt.mjs +161 -0
  29. package/scripts/install-mcp.mjs +28 -9
  30. package/scripts/{mcp_persistence_server.py → mcp_persistence.py} +2 -2
  31. package/{src/mcp/mcp_resources_server.py → scripts/mcp_resources.py} +2 -2
  32. package/scripts/{memory_mcp_server.py → memory_mcp.py} +2 -2
  33. package/scripts/probe-context-rehydrate.mjs +8 -2
  34. package/scripts/probe-pantheon-cost.mjs +71 -15
  35. package/scripts/run-node-tests.mjs +189 -0
  36. package/scripts/sync-artifacts.mjs +26 -13
  37. package/scripts/sync-tui.mjs +24 -3
  38. package/scripts/test-opencode-v2-sandbox.sh +180 -26
  39. package/scripts/validate-routing.mjs +3 -3
  40. package/scripts/validate-sandbox-install.mjs +138 -0
  41. package/scripts/versioning.mjs +13 -1
  42. package/scripts/vision-status.mjs +682 -0
  43. package/skills-lock.json +8 -8
  44. package/src/agents/aphrodite.md +20 -37
  45. package/src/agents/apollo.md +7 -3
  46. package/src/agents/athena.md +63 -35
  47. package/src/agents/demeter.md +8 -28
  48. package/src/agents/gaia.md +1 -1
  49. package/src/agents/hephaestus.md +10 -21
  50. package/src/agents/hermes.md +15 -38
  51. package/src/agents/iris.md +1 -1
  52. package/src/agents/mnemosyne.md +18 -54
  53. package/src/agents/nyx.md +1 -1
  54. package/src/agents/prometheus.md +16 -20
  55. package/src/agents/talos.md +10 -2
  56. package/src/agents/themis.md +5 -5
  57. package/src/agents/zeus.md +99 -129
  58. package/src/instructions/agent-return-format.instructions.md +18 -3
  59. package/src/instructions/backend-standards.instructions.md +2 -0
  60. package/src/instructions/frontend-standards.instructions.md +3 -1
  61. package/src/instructions/memory-protocol.instructions.md +11 -110
  62. package/src/instructions/zeus-anti-stall.instructions.md +14 -61
  63. package/src/instructions/zeus-communication-rules.instructions.md +0 -1
  64. package/src/instructions/zeus-council-synthesis.instructions.md +32 -260
  65. package/src/instructions/zeus-memory-operations.instructions.md +26 -0
  66. package/src/instructions/zeus-timeout-retry.instructions.md +40 -87
  67. package/src/mcp/{code_mode_server.py → code_mode.py} +3 -3
  68. package/src/mcp/eval_store.py +2 -2
  69. package/src/mcp/{mcp_persistence_server.py → mcp_persistence.py} +2 -2
  70. package/{scripts/mcp_resources_server.py → src/mcp/mcp_resources.py} +2 -2
  71. package/src/mcp/{memory_mcp_server.py → memory_mcp.py} +2 -2
  72. package/src/mcp/{pantheon_vision_server.py → pantheon_vision.py} +286 -42
  73. package/src/mcp/requirements-mcp.txt +6 -4
  74. package/src/mcp/requirements-vision.txt +2 -2
  75. package/src/pantheon/cost-command.ts +399 -101
  76. package/src/pantheon/delegation-enforce.ts +10 -1
  77. package/src/pantheon/presets.d.mts +0 -8
  78. package/src/pantheon/presets.mjs +5 -32
  79. package/src/pantheon/v2-bounded-read.ts +640 -0
  80. package/src/pantheon/v2-delegation-enforce.ts +214 -0
  81. package/src/pantheon/v2-execute-after.ts +186 -0
  82. package/src/pantheon/v2-tools.ts +429 -0
  83. package/src/pantheon/v2-unsupported.d.mts +11 -0
  84. package/src/pantheon/v2-unsupported.mjs +90 -0
  85. package/src/pantheon/v2-vision.ts +622 -0
  86. package/src/pantheon/vision-local.ts +531 -0
  87. package/src/pantheon/vision.ts +1160 -115
  88. package/src/plugin-v2.ts +1145 -219
  89. package/src/plugin.ts +12 -9
  90. package/src/plugins/tui/dist/server.d.ts +1 -2
  91. package/src/plugins/tui/dist/server.d.ts.map +1 -1
  92. package/src/plugins/tui/dist/tui-v2.d.ts +154 -0
  93. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
  94. package/src/plugins/tui/dist/tui-v2.js +659 -0
  95. package/src/plugins/tui/dist/tui-v2.js.map +1 -0
  96. package/src/plugins/tui/dist/tui.d.ts +85 -82
  97. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  98. package/src/plugins/tui/dist/tui.js +72 -59
  99. package/src/plugins/tui/index-v2.ts +6 -0
  100. package/src/plugins/tui/package-lock.json +5516 -1353
  101. package/src/plugins/tui/package.json +22 -12
  102. package/src/plugins/tui/src/index-v2.tsx +734 -0
  103. package/src/plugins/tui/src/index.tsx +106 -85
  104. package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
  105. package/src/plugins/tui/tsconfig.build.json +5 -0
  106. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  107. package/src/plugins/tui/tsdown.config.ts +22 -2
  108. package/src/plugins/tui/tui-v2.ts +2 -0
  109. package/src/plugins/tui/tui.ts +3 -0
  110. package/src/routing.yml +11 -21
  111. package/src/skills/README.md +3 -3
  112. package/src/skills/agent-coordination/SKILL.md +7 -2
  113. package/src/skills/artifact-management/SKILL.md +12 -5
  114. package/src/skills/auto-continue/SKILL.md +39 -30
  115. package/src/skills/code-review-checklist/SKILL.md +5 -5
  116. package/src/skills/context-compression/SKILL.md +26 -879
  117. package/src/skills/session-goal/SKILL.md +14 -5
  118. package/src/skills/spec-driven-development/SKILL.md +3 -1
  119. package/src/skills/tdd-with-agents/SKILL.md +18 -10
  120. package/opencode.json +0 -58
@@ -18,16 +18,16 @@ Disciplined automatic continuation through multi-step tasks. Eliminates unnecess
18
18
 
19
19
  ---
20
20
 
21
- ## Mandatory Gates (ALWAYS STOP)
21
+ ## Risk-Proportional Gates
22
22
 
23
23
  | Gate | Trigger | What happens |
24
24
  |---|---|---|
25
- | **GATE 0 — Agora Gate** | Agora outputs `AWAITING_APPROVAL` OR `## 🏛️ Agora Council` synthesis block appears | **HARD STOP.** Do not call any tool, do not continue any todo, do not suggest next steps. Wait for user to type: APPROVE / REQUEST CHANGES / DISCARD. "ok", "yes", "sure", "continue" are NOT valid. |
26
- | **GATE 1 — Plan Approval** | Athena generates a plan | User confirms scope before code is written |
27
- | **GATE 2 — Phase Review** | Themis reviews implementation | User sees changes before next phase |
28
- | **GATE 3 — Git Commit** | After each phase is approved | User controls git history; no auto-commit |
25
+ | **GATE 0 — Explicit Council** | User explicitly invokes council and it returns `AWAITING_APPROVAL` | Stop and follow the approval the council requests; do not launch a council automatically for ordinary implementation. |
26
+ | **GATE 1 — Plan Approval** | A plan was requested or scope/risk makes planning necessary | Ask before implementation only when the plan introduces a material choice or risk; omit this gate for a bounded, clear fix. |
27
+ | **GATE 2 — Risk Review** | Auth/security, data/schema/migration, API contract, production configuration, or other material risk | Themis review and human approval before sensitive or irreversible action. For a trivial, isolated, reversible edit, provide a concise result instead of manufacturing a review phase. |
28
+ | **GATE 3 — Git / External Action** | Commit, push, merge, production deploy, destructive operation, global configuration, or broad permission change | Always stop for explicit human approval. Full-auto never authorizes these actions by implication. |
29
29
 
30
- > **Agora is always GATE 0**: any response containing `AWAITING_APPROVAL` or a `## 🏛️ Agora Council` block overrides all auto-continue rules.
30
+ An explicit `AWAITING_APPROVAL` from an invoked council remains a hard stop. Authentication/security and data/schema changes retain their review and approval gates even in full-auto.
31
31
 
32
32
  ---
33
33
 
@@ -36,28 +36,31 @@ Disciplined automatic continuation through multi-step tasks. Eliminates unnecess
36
36
  **Continue automatically when:**
37
37
  - Next todo is a direct consequence of the current one
38
38
  - Action is reversible (file edits, tests, linting)
39
- - Scope is within the approved plan
39
+ - Scope is within the user's explicitly authorized task (a prior plan is not required for a small clear fix)
40
40
  - No new ambiguity has emerged
41
41
 
42
42
  **Stop and ask when:**
43
43
  - A todo requires a decision not covered by the plan
44
44
  - An unexpected error changes the approach
45
45
  - A dependency is missing or broken
46
- - A task would exceed remaining `steps` budget
46
+ - Remaining context is too thin to carry the task through — write an explicit handoff instead
47
+ - The task reaches a sensitive gate in the table above; full-auto does not override it
47
48
 
48
- ---
49
+ ### Full-auto Authorization
50
+
51
+ Full-auto may continue only within a task and scope the user explicitly authorized. It may run reversible edits and proportionate verification; it must stop for auth/security, data/schema changes with risk, destructive or global changes, broad permissions, deploy, push, or merge. Never infer permission to expand the scope from a full-auto request.
49
52
 
50
53
  ---
51
54
 
52
55
  ## Implementation Pattern
53
56
 
54
57
  ```
55
- 1. Create todos for all steps at start
58
+ 1. Create todos only for multi-step work; a one-step fix needs no todo ceremony
56
59
  2. Mark first todo in_progress
57
60
  3. Complete work → mark completed immediately
58
61
  4. Mark next todo in_progress → repeat
59
62
  5. Do NOT ask "should I continue?" between clear steps
60
- 6. Stop at Gate 1, 2, or 3
63
+ 6. Stop at any applicable risk gate; do not require a plan/review gate for a low-risk edit
61
64
  7. After gate approval, resume with next todo
62
65
  ```
63
66
 
@@ -70,7 +73,7 @@ Disciplined automatic continuation through multi-step tasks. Eliminates unnecess
70
73
  - [ ] Previous step completed successfully (tests pass, no errors)
71
74
  - [ ] Next step is within approved plan scope
72
75
  - [ ] No new blocking issues emerged
73
- - [ ] `steps` counter has sufficient budget remaining
76
+ - [ ] Remaining context can carry the next step, or an explicit handoff will be written
74
77
 
75
78
  ---
76
79
 
@@ -89,9 +92,9 @@ Phase N complete. Summary:
89
92
 
90
93
  ### Cooldown Rules
91
94
  1. **Between parallel waves (no dependency):** No cooldown needed — wave results are independent
92
- 2. **Between sequential waves (with dependency):** Always run cooldown — dependencies may have changed context
93
- 3. **After Themis review (GATE 2):** Cooldown is mandatory — review findings may change the plan
94
- 4. **Session reuse check:** Before starting next phase, check if a specialist session from a previous phase can be reused (see session-goal skill)
95
+ 2. **Between sequential phases:** Summarize when dependencies or risk changed; skip ceremony for one-step work
96
+ 3. **After required Themis review:** Reassess findings before continuing
97
+ 4. **Session reuse check:** Reuse a prior specialist session only when it reduces real context duplication
95
98
 
96
99
  ### Abbreviated Cooldown
97
100
  When auto-continuing between sequential non-gated phases, the cooldown is abbreviated to one line:
@@ -163,19 +166,25 @@ Should I now run the migration tests? [waiting]
163
166
  Session state is **not** file-based. It lives in **pantheon-persistence** under the
164
167
  `checkpoint:<slug>` namespace and is cleaned up automatically by a 4h TTL.
165
168
 
166
- Write state with `context_save(slug, key, value, session_id=...)` and read it back with
167
- `context_get(slug, "latest", session_id=...)`. Capture `session_id` from the first `context_save`
168
- of the session and reuse it for the rest of the session, so the `latest` pointer survives
169
- compaction.
169
+ Use checkpoints only when `context_save` and `context_get` are explicitly
170
+ present in the active session's tool list. If unavailable, do not attempt a
171
+ checkpoint or guess a session ID; carry the handoff in the normal response.
172
+
173
+ When available, call `context_save` with `content=JSON.stringify(state)` and an
174
+ explicit `session_id`. A successful save needs no immediate `context_get`; read
175
+ only when resuming or when the save result is uncertain. Reuse the same session
176
+ ID so the `latest` pointer survives compaction. `state` must be an object — never pass a bare string as `content`: its
177
+ `goal`/`phase`/`delegations`/`heartbeat` values are objects and `tail` is an array.
178
+ `goal` is optional; when unset, omit the key rather than passing a string placeholder.
170
179
 
171
180
  ### Heartbeat Check
172
- - If `context_get(slug, "heartbeat")` returns a checkin older than 300s, log a stall warning and resume
173
- - Write a heartbeat after every anti-stall recovery action
181
+ - Check heartbeat only when checkpoint tools are available and the workflow needs a durable resume.
182
+ - Write a heartbeat after anti-stall recovery only when the current session exposes checkpoint tools.
174
183
 
175
184
  ### Checkpoint Rules
176
- 1. Save a checkpoint before **every** delegate dispatch and after every agent returns
177
- 2. Include current phase, turn count, and remaining tasks
178
- 3. On resume: `context_get(slug, "latest")` restores the most recent checkpoint
185
+ 1. Save checkpoints only for long-running/multi-phase work, context-loss risk, or substantive parallel work — not a one-off command or bounded fix
186
+ 2. Include current phase and remaining tasks when a checkpoint is warranted
187
+ 3. On resume, read the latest checkpoint only with a known session ID; otherwise request the missing handoff context.
179
188
 
180
189
  > Do not create `heartbeat.json`, `checkpoint-<N>.json`, or `session.json` under
181
190
  > `.pantheon/deepwork/`. That file-based mechanism is retired — TTL handles cleanup, and reading
@@ -189,10 +198,10 @@ Configurable gates for different platforms and risk levels:
189
198
 
190
199
  | Gate | Default | Auto-Approval Condition |
191
200
  |------|---------|------------------------|
192
- | GATE 0 — Council/Plan | Always Ask | N/A — always requires human |
193
- | GATE 1 — Plan Approval | Always Ask | Plan matches acceptance criteria + no risks flagged |
194
- | GATE 2 — Themis Review | Ask by Default | Auto-approve if: Themis APPROVED + no CRITICAL/HIGH issues + coverage ≥80% |
195
- | GATE 3 — Git Commit | Never Auto | N/A — always manual |
201
+ | Council | Only when explicitly invoked | Never auto-start a council for ordinary implementation |
202
+ | Plan approval | Only for requested or risk-required plans | Skip for bounded, clear work |
203
+ | Themis review | Required for sensitive/material changes | May omit for trivial isolated edits; never auto-bypass required findings |
204
+ | Git / external actions | Never Auto | Commit, push, merge, deploy, destructive/global changes require explicit approval |
196
205
  | Deploy | Always Ask | N/A — always requires human |
197
206
  | Destructive DB Ops | Always Ask | N/A — always requires human |
198
207
 
@@ -205,8 +214,8 @@ auto-continue:
205
214
  idle_stall: 120 # seconds before stall detection
206
215
  idle_pause: 300 # seconds before auto-pause
207
216
  gates:
208
- plan_approval: always_ask
209
- themis_review: auto_approve_if_clean
217
+ plan_approval: when_required_by_scope_or_risk
218
+ themis_review: required_for_sensitive_or_material_changes
210
219
  git_commit: never_auto
211
220
  deploy: always_ask
212
221
  destructive_ops: always_ask
@@ -52,11 +52,11 @@ biome check --write --unsafe <files>
52
52
  - [ ] Proper file sizes (<300 lines)
53
53
 
54
54
  ### Testing
55
- - [ ] Unit tests written
56
- - [ ] Coverage ≥80%
57
- - [ ] Integration tests for workflows
58
- - [ ] Edge cases tested
59
- - [ ] Error conditions tested
55
+ - [ ] Tests cover the changed behavior where meaningful; documentation/format-only changes do not need invented tests
56
+ - [ ] Apply an explicit repository coverage threshold only when measurable and relevant to the changed code
57
+ - [ ] Integration tests where the change crosses workflow boundaries
58
+ - [ ] Relevant edge cases tested for the changed behavior/risk
59
+ - [ ] Relevant error conditions tested
60
60
 
61
61
  ### Security (OWASP Top 10)
62
62
  - [ ] Input validation present