pantheon-opencode 1.5.0-beta.2 → 1.5.0-beta.20

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 (107) hide show
  1. package/.pantheon/code-mode/manifest.json +21 -0
  2. package/AGENTS.md +14 -63
  3. package/CHANGELOG.md +1260 -0
  4. package/README.md +162 -23
  5. package/README.pt-BR.md +104 -19
  6. package/bin/pantheon-init.mjs +178 -21
  7. package/commands/pantheon.md +1 -35
  8. package/package.json +23 -15
  9. package/plugin.json +1 -1
  10. package/pyproject.toml +62 -0
  11. package/scripts/code_mode_server.py +431 -55
  12. package/scripts/doctor.mjs +207 -9
  13. package/scripts/install/cli-ui.mjs +17 -11
  14. package/scripts/install/config-migration.mjs +4 -6
  15. package/scripts/install/opencode.mjs +137 -35
  16. package/scripts/install/plugin.mjs +12 -45
  17. package/scripts/install/shared.mjs +43 -2
  18. package/scripts/install/strings.mjs +129 -0
  19. package/scripts/install-mcp.mjs +1 -0
  20. package/scripts/manifest-inventory.mjs +410 -0
  21. package/scripts/mcp_persistence_server.py +536 -164
  22. package/scripts/package-evidence.mjs +242 -0
  23. package/scripts/probe-pantheon-cost.mjs +10 -1
  24. package/scripts/release-beta-version.mjs +56 -60
  25. package/scripts/sync-artifacts.mjs +169 -0
  26. package/scripts/sync-tui.mjs +129 -64
  27. package/scripts/test-opencode-v1-v2-sandbox.sh +79 -161
  28. package/scripts/validation-policy.mjs +7 -7
  29. package/scripts/version-check.mjs +113 -108
  30. package/scripts/versioning.mjs +230 -86
  31. package/src/agents/apollo.md +1 -0
  32. package/src/agents/gaia.md +1 -0
  33. package/src/agents/mnemosyne.md +1 -1
  34. package/src/agents/zeus.md +11 -54
  35. package/src/instructions/memory-protocol.instructions.md +6 -3
  36. package/src/instructions/zeus-anti-stall.instructions.md +2 -4
  37. package/src/instructions/zeus-council-synthesis.instructions.md +3 -28
  38. package/src/instructions/zeus-timeout-retry.instructions.md +3 -28
  39. package/src/mcp/code_mode_server.py +431 -55
  40. package/src/mcp/mcp_persistence_server.py +536 -164
  41. package/src/mcp/toon_codec.py +2 -4
  42. package/src/pantheon/background-job-board.ts +47 -5
  43. package/src/pantheon/{delegation-compaction.ts → compaction-context.ts} +10 -100
  44. package/src/pantheon/cost-command.ts +309 -44
  45. package/src/pantheon/delegation-enforce.ts +59 -14
  46. package/src/pantheon/file-persistence-salvage.ts +64 -0
  47. package/src/pantheon/file-persistence.ts +194 -45
  48. package/src/pantheon/goal-loop.ts +1 -1
  49. package/src/pantheon/goal-store.ts +1 -1
  50. package/src/pantheon/idle-continuation.ts +4 -6
  51. package/src/pantheon/model-command.ts +1 -2
  52. package/src/pantheon/native-task-status.ts +139 -0
  53. package/src/pantheon/presets.d.mts +0 -20
  54. package/src/pantheon/presets.mjs +0 -64
  55. package/src/pantheon/session-guard.ts +2 -2
  56. package/src/pantheon/session-id.ts +30 -0
  57. package/src/pantheon/shared-board.ts +37 -0
  58. package/src/pantheon/task-result-guard.ts +106 -0
  59. package/src/pantheon/todo-enforcer.ts +3 -3
  60. package/src/pantheon/tool-ceiling.ts +159 -0
  61. package/src/pantheon/tool-context.ts +23 -0
  62. package/src/pantheon/v2-bridge.ts +1 -4
  63. package/src/plugin-v2.ts +8 -21
  64. package/src/plugin.ts +83 -251
  65. package/src/plugins/pantheon-hooks.ts +51 -0
  66. package/src/plugins/tui/dist/server.d.ts +1 -1
  67. package/src/plugins/tui/dist/server.d.ts.map +1 -1
  68. package/src/plugins/tui/dist/server.js +1 -1
  69. package/src/plugins/tui/dist/server.js.map +1 -1
  70. package/src/plugins/tui/dist/tui.d.ts +261 -77
  71. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  72. package/src/plugins/tui/dist/tui.js +640 -234
  73. package/src/plugins/tui/dist/tui.js.map +1 -1
  74. package/src/plugins/tui/package-lock.json +2 -2
  75. package/src/plugins/tui/package.json +2 -2
  76. package/src/plugins/tui/src/index.tsx +872 -226
  77. package/src/routing.yml +0 -16
  78. package/src/skills/context-compression/SKILL.md +1 -1
  79. package/scripts/generate-preset-docs.mjs +0 -300
  80. package/scripts/generate-prompts.sh +0 -222
  81. package/scripts/hash_verify.py +0 -192
  82. package/scripts/install/component.mjs +0 -24
  83. package/scripts/install/migrate-config.mjs +0 -302
  84. package/scripts/test-context-compression.sh +0 -169
  85. package/src/pantheon/auto-wake.ts +0 -89
  86. package/src/pantheon/chat-reminders.ts +0 -9
  87. package/src/pantheon/comment-checker.ts +0 -48
  88. package/src/pantheon/compaction-assert.ts +0 -160
  89. package/src/pantheon/cost-tracker.ts +0 -108
  90. package/src/pantheon/delegate-manager.ts +0 -669
  91. package/src/pantheon/delegation-classifier.ts +0 -307
  92. package/src/pantheon/delegation-finalize.ts +0 -374
  93. package/src/pantheon/delegation-notify.ts +0 -212
  94. package/src/pantheon/delegation-toast.ts +0 -73
  95. package/src/pantheon/delegation.ts +0 -1120
  96. package/src/pantheon/dispatch-guard.ts +0 -109
  97. package/src/pantheon/permission-eval.ts +0 -284
  98. package/src/pantheon/preemptive-compact.ts +0 -76
  99. package/src/pantheon/retry-policy.ts +0 -212
  100. package/src/pantheon/step-cap.ts +0 -110
  101. package/src/pantheon/token-opt.ts +0 -781
  102. package/src/pantheon/toon-codec.ts +0 -481
  103. package/src/pantheon/v2-events.ts +0 -131
  104. package/src/pantheon/v2-hooks.ts +0 -287
  105. package/src/pantheon/v2-tool-definitions.ts +0 -331
  106. package/src/pantheon/zeus-delegate-with-retry.ts +0 -406
  107. package/src/plugins/tui/dist/tui.tsx +0 -2605
@@ -0,0 +1,21 @@
1
+ {
2
+ "version": 1,
3
+ "scripts": {
4
+ "checkpoint-session.py": "b70f6667ba287622d6353ada2612c7f2fb70d4ee170d456ecd7ee2b6ead891aa",
5
+ "checkpoint-session.sh": "5b07e7c6c309e1db5c63f1f409eeb300a446bb9598899d94fdb13d94b56eb5f1",
6
+ "checkpoint_session.py": "8c52919eae450147742553f11faa347644c9e79f7acffa2fcc4452a5ed294a0a",
7
+ "compress-inline.py": "d3185cef07ff8b57d5a98d6c06a5b71504186ad2112fdb5a1ff48b0214d9cd3c",
8
+ "eval-llm-judge.py": "6d25df589c0f6cffa4766d0ad8eb86ac958960bc8c0f59e93098c7bf8effbbe8",
9
+ "eval-monte-carlo.py": "64c5eba9b072bec1f3eb713654da7edb9df46041395fdc4cb65730720135f8b1",
10
+ "eval-run.py": "5abfdac7d67d66838dd7ee402383e205ae39c0d912deb8a3a9a9a9c4d05952f5",
11
+ "eval-static.py": "33573295cf82a3c98e5f4c230ac376a40d1286ac16ff3aa031987396cde083b5",
12
+ "example-sync.sh": "7fce84c8dc5a9d25d441a4cb59549a2731910e72d6ef82df45ac5ca6ea66c729",
13
+ "session-end-save.py": "11088a722642d022e5e2ebad78292db4aa4803087b32e261b6eb069e9b991c48",
14
+ "session-end-save.sh": "5fb410143bf62ed7d7c912805b00ae79171127b1b8ff0825db0eb4bf03b595a8",
15
+ "test-allowed.sh": "723b116490044ffb403092c74b6bb94ee37330fecf453241f4cca22977ae8cdf",
16
+ "test-auto-continue-checkpoint.sh": "de2641a4da0f26e9653f320d44763e5b5ed698cf9c701c103c5c82f91175376f",
17
+ "test-env.sh": "6ea48a044451e5938e28fcb709368a7249a7d1b42615b190e40682ad26d4d1f9",
18
+ "test-prlimit.sh": "a82bca59d3c7a8b7c2b273622dc89762bd6a02e155629567a6c5b9aab4b92761",
19
+ "test-timeout.sh": "55d8b580983c2b4b27cad7d1c0ae1ba0c238ae53d2114b14c6b236b421c8ba6d"
20
+ }
21
+ }
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`, dispatch to fallback agent, report to user |
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** → DO NOT retry a third time blindly. Instead:
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
- Before any dispatch: `memory_search(query, top_k=2, namespace="council_decisions")`
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 these structured fields in their response:
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
- Expect a `subtask_summary` response with:
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 parcial is ONLY for read-only, independent agents:
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
- Maintain awareness of in-flight delegations:
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.