pantheon-opencode 1.5.1 → 1.6.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.pantheon/code-mode/README.md +4 -2
  2. package/.pantheon/code-mode/checkpoint_session.py +138 -102
  3. package/.pantheon/code-mode/compress-inline.py +102 -57
  4. package/.pantheon/code-mode/manifest.json +2 -8
  5. package/CHANGELOG.md +22 -0
  6. package/README.md +86 -52
  7. package/README.pt-BR.md +63 -43
  8. package/commands/pantheon-optimize.md +2 -2
  9. package/package.json +13 -1
  10. package/plugin.json +1 -1
  11. package/pyproject.toml +8 -15
  12. package/scripts/build-agents-md.mjs +2 -2
  13. package/scripts/check-plugin-v2-coverage.mjs +213 -0
  14. package/scripts/ci-validate-yaml.py +7 -5
  15. package/scripts/code_mode_server.py +116 -24
  16. package/scripts/doctor.mjs +85 -28
  17. package/scripts/install/cli-ui.mjs +1 -1
  18. package/scripts/install/config-migration.mjs +2 -2
  19. package/scripts/install/health-check.mjs +6 -19
  20. package/scripts/install/interactive.mjs +6 -6
  21. package/scripts/install/migrate.mjs +1 -1
  22. package/scripts/install/state.mjs +27 -2
  23. package/scripts/mcp_persistence_server.py +390 -76
  24. package/scripts/memory_mcp_server.py +370 -196
  25. package/scripts/postinstall.mjs +0 -7
  26. package/scripts/probe-context-rehydrate.mjs +28 -11
  27. package/scripts/prune.mjs +2 -2
  28. package/scripts/sync-tui.mjs +11 -5
  29. package/scripts/test-opencode-v2-sandbox.sh +1759 -0
  30. package/scripts/validate-routing.mjs +40 -0
  31. package/skills-lock.json +9 -10
  32. package/src/agents/mnemosyne.md +15 -16
  33. package/src/agents/zeus.md +1 -2
  34. package/src/mcp/code_mode_server.py +116 -24
  35. package/src/mcp/mcp_codemap_module.py +559 -129
  36. package/src/mcp/mcp_persistence_server.py +390 -76
  37. package/src/mcp/memory_mcp_server.py +371 -248
  38. package/src/mcp/pantheon_vision_server.py +136 -24
  39. package/src/mcp/requirements-mcp.txt +5 -3
  40. package/src/mcp/requirements-vision.txt +2 -0
  41. package/src/pantheon/model-command.ts +18 -7
  42. package/src/pantheon/todo-enforcer.ts +1 -1
  43. package/src/pantheon/vision.ts +1 -1
  44. package/src/plugin-v2.ts +134 -104
  45. package/src/plugins/tui/dist/tui.js +1 -1
  46. package/src/plugins/tui/package-lock.json +20 -20
  47. package/src/plugins/tui/package.json +12 -12
  48. package/src/routing.yml +0 -1
  49. package/src/skills/README.md +31 -36
  50. package/src/skills/auto-continue/SKILL.md +25 -75
  51. package/.pantheon/code-mode/eval-llm-judge.py +0 -255
  52. package/.pantheon/code-mode/eval-monte-carlo.py +0 -368
  53. package/.pantheon/code-mode/eval-run.py +0 -197
  54. package/.pantheon/code-mode/eval-static.py +0 -321
  55. package/.pantheon/code-mode/session-end-save.py +0 -186
  56. package/.pantheon/code-mode/session-end-save.sh +0 -18
  57. package/scripts/recover-zenodo-deposition.mjs +0 -146
  58. package/scripts/test-opencode-v1-v2-sandbox.sh +0 -862
  59. package/scripts/validate-zenodo-release.mjs +0 -154
  60. package/scripts/zenodo-artifact.mjs +0 -21
  61. package/scripts/zenodo-release-state.mjs +0 -53
  62. package/src/skills/orchestration-workflow/SKILL.md +0 -311
package/README.md CHANGED
@@ -10,7 +10,7 @@ want useful structure without giving up control of their code.
10
10
 
11
11
  [![Version](https://img.shields.io/github/v/release/ils15/pantheon-opencode?label=version)](https://github.com/ils15/pantheon-opencode/releases/latest)
12
12
  [![CI](https://img.shields.io/github/actions/workflow/status/ils15/pantheon-opencode/ci.yml?branch=main&label=CI)](https://github.com/ils15/pantheon-opencode/actions)
13
- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22306637.svg)](https://doi.org/10.5281/zenodo.22306637)
13
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22650136.svg)](https://doi.org/10.5281/zenodo.22650136)
14
14
 
15
15
  ## What is it?
16
16
 
@@ -78,8 +78,8 @@ clear handoff between stages of work.
78
78
 
79
79
  ## Status
80
80
 
81
- Operational checkout version: **v1.5.0-beta.2** (candidate; publication is not
82
- asserted here). Pantheon is designed for OpenCode and depends on the
81
+ Operational checkout version: **v1.6.0-beta.1** (first beta compatible with
82
+ OpenCode 2; publication is not asserted here). Pantheon is designed for OpenCode and depends on the
83
83
  availability and configuration of OpenCode and any optional services you choose
84
84
  to use. Check the [releases](https://github.com/ils15/pantheon-opencode/releases)
85
85
  and [changelog](CHANGELOG.md) for the latest published changes.
@@ -132,6 +132,10 @@ only when they are explicitly approved. Approval is recorded in
132
132
  - **Hash mismatch → `CORRUPT_DATA`.** The SHA-256 of the file on disk must
133
133
  match the manifest entry, so edits after approval are detected.
134
134
 
135
+ Session persistence is provided by the persistence MCP server. The bundled
136
+ code-mode payload contains execution helpers only and does not export or back
137
+ up a database.
138
+
135
139
  Approve or re-approve a script with the `approve_code_script` MCP tool:
136
140
 
137
141
  ```
@@ -153,28 +157,25 @@ once a project directory is selected, a missing or corrupt manifest fails
153
157
  closed instead of falling back. `doctor` validates the manifest and every
154
158
  script's SHA-256 without regenerating it.
155
159
 
160
+ The local `.pantheon/code-mode/eval-*.py` helpers and any Promptfoo/evaluation
161
+ assets are development-only inputs and are excluded from the npm tarball and
162
+ from the runtime manifest. `src/mcp/eval_store.py` is different: it is a
163
+ shipped runtime dependency of the MCP resources server, not an evaluation
164
+ asset, so it remains packaged.
165
+
156
166
 
157
- ## What's new in 1.5.0-beta.2
167
+ ## What's new in 1.6.0-beta.1
158
168
 
159
- - OpenCode-only installer: platform guides consolidated into a single
160
- [OpenCode guide](docs/platforms/opencode.md).
161
- - New `uninstall` CLI with project and global scopes and ownership checks:
162
- `node scripts/uninstall.mjs --project|--global [--dry-run] [--force]`.
163
- - Hardened MCP resources: fixed `pantheon://agents` listing and added
164
- symlink/traversal protection for resource paths.
165
- - OpenCode V2 compatibility: `plugins` / `mcp.servers.enabled` config merge
166
- and PWD-correct stdio MCP launch.
167
- - Expanded `doctor` and install health checks.
168
- - Sandbox validator for global installs (`scripts/test-opencode-v1-v2-sandbox.sh`)
169
- covering OpenCode V1/V2 side by side — see
170
- [Sandbox validation](#sandbox-validation-v1v2).
171
- - Beta2 agent-economy policy: direct native delegation, bounded compaction
172
- carry-forward, compact context encoding, and quality floors.
173
- - A `--prompts` installer flag is planned for a future release.
169
+ - First beta compatible with the OpenCode 2 plugin contract.
170
+ - Removed the legacy vector-memory pipeline while preserving SQLite FTS5/BM25
171
+ keyword search and the `code_*` codemap tools.
172
+ - CI and release validation are fail-closed; `doctor` checks and the V2-only
173
+ sandbox validator cover the OpenCode 2 installation path.
174
174
 
175
- ## OpenCode V1/V2 — Dual Version (1.5.0-beta.2)
175
+ ## OpenCode V1/V2 — Dual Version (1.6.0-beta.1)
176
176
 
177
- Pantheon has two **exclusive** OpenCode plugin contracts. Ordinary OpenCode
177
+ This is the first beta compatible with OpenCode 2. Pantheon has two **exclusive** OpenCode
178
+ plugin contracts. Ordinary OpenCode
178
179
  configuration may be shared, but the Pantheon plugin registration is selected
179
180
  per installation; V1 and V2 Pantheon plugins must never be registered together.
180
181
 
@@ -189,8 +190,9 @@ The V2 plugin provides 6 orchestration tools (`hashline_edit`,
189
190
  `pantheon_goal_create`, `pantheon_goal_get`, `pantheon_goal_update`,
190
191
  `pantheon_cost`, `pantheon_model`), 4 event subscriptions (`session.created`,
191
192
  `session.idle`, `session.error`, `session.compacted`), session hooks (`prompt`,
192
- `context`), and tool hooks (`execute.before`, `execute.after`). The only
193
- unsupported V2 feature is `legacy-hooks` (the V1-specific hook surface).
193
+ `context`), and tool hooks (`execute.before`, `execute.after`). Unsupported V2
194
+ features are `legacy-hooks` (the V1-specific hook surface), `catalog-transform`,
195
+ `integration-transform`, and `skill-transform`.
194
196
 
195
197
  The package exposes both contracts as importable exports: `pantheon-opencode/plugin`
196
198
  (V1), `pantheon-opencode/plugin-v2` (V2) and `pantheon-opencode/v2-bridge`
@@ -321,38 +323,66 @@ Release validation keeps each manifest with its lockfile: the root
321
323
  SHA-256 of that same artifact, and binds the tarball and GitHub release to the
322
324
  full `TARGET_SHA`; a second pack is not interchangeable.
323
325
 
324
- ## Sandbox validation (V1/V2)
326
+ ## Sandbox validation (V2)
325
327
 
326
- `scripts/test-opencode-v1-v2-sandbox.sh` validates the globally installed
328
+ `scripts/test-opencode-v2-sandbox.sh` validates the globally installed
327
329
  package as a real user inside an isolated sandbox (own `HOME`, npm prefix and
328
- venv) — never the dev environment. It checks OpenCode V1 (`opencode`) and V2
329
- (`opencode2`) side by side: binaries, MCP connectivity, `doctor`, and — with
330
- `--prompts` — a prompt battery covering the `pantheon://agents` resource,
331
- memory store/recall, filesystem writes and agent delegation. The gate is
332
- fail-closed: every required check must return an explicit PASS; timeouts,
333
- auth/network/provider failures and missing prerequisites block the run.
330
+ venv) — never the dev environment. It checks the OpenCode V2 leg: the binary,
331
+ MCP connectivity, `doctor`, and — with `--prompts` — a prompt battery covering
332
+ the `pantheon://agents` resource, memory store/recall, filesystem writes and
333
+ agent delegation. The gate is fail-closed: every required check must return an
334
+ explicit PASS; timeouts, auth/network/provider failures and missing
335
+ prerequisites block the run.
336
+
337
+ "V2" here refers only to the hook canary observed against an OpenCode v2.0.18
338
+ host, where at least one tested hook callback fired; it does not establish
339
+ compatibility with the stable `@opencode/plugin@2.0.18` SDK or full 2.x
340
+ contract. This branch still pins transitional `@opencode-ai/plugin@1.18.30`.
341
+ On hosts where both `opencode` and `opencode2` exist, the latter is typically
342
+ a shim that execs the same binary, so an older side-by-side comparison proved
343
+ nothing about the binary itself. The project is V2-exclusive, so there is a
344
+ single leg.
334
345
 
335
346
  ```bash
336
- scripts/test-opencode-v1-v2-sandbox.sh --prepare # tarball + install + init in the sandbox
337
- scripts/test-opencode-v1-v2-sandbox.sh --run v1 --prompts # base validation + prompt battery (V1)
338
- scripts/test-opencode-v1-v2-sandbox.sh --run v2 # base validation only (V2)
339
- scripts/test-opencode-v1-v2-sandbox.sh --prompts # prompt battery for both versions
340
- scripts/test-opencode-v1-v2-sandbox.sh --reset # wipe the sandbox root
347
+ scripts/test-opencode-v2-sandbox.sh --prepare # tarball + install + init in the sandbox
348
+ scripts/test-opencode-v2-sandbox.sh --run v2 # base validation only
349
+ scripts/test-opencode-v2-sandbox.sh --prompts # base validation + prompt battery
350
+ scripts/test-opencode-v2-sandbox.sh --rehydrate # offline context rehydration/session-summary probe
351
+ scripts/test-opencode-v2-sandbox.sh --hooks # V2 hook callback canary
352
+ scripts/test-opencode-v2-sandbox.sh --rehydrate --hooks # run both canaries
353
+ scripts/test-opencode-v2-sandbox.sh --reset # wipe the sandbox root
341
354
  ```
342
355
 
343
- Modes are combinable (e.g. `--prepare --run v1 --prompts`). Binaries are
344
- resolved strictly inside the sandbox npm prefix — a non-prepared sandbox fails
345
- fast instead of silently testing the host installation.
356
+ Modes are combinable (e.g. `--prepare --run v2 --prompts`). `--rehydrate` runs
357
+ offline `context_rehydrate` and `context_session_summary` probes. `--hooks` runs
358
+ a V2 hook canary against the sandbox binary to check that hook callbacks fire;
359
+ it does not test transform callback effects or prove Pantheon's
360
+ `execute.before` security enforcement. With the probe-only `--rehydrate --hooks`
361
+ pair (without `--run`, `--prompts`, or `--cost`), the hooks canary still runs if
362
+ rehydration fails, and the command returns a failing status afterward. These
363
+ are test/sandbox canaries, not proof of Pantheon security enforcement. Binaries
364
+ are resolved strictly inside the sandbox npm prefix — a non-prepared sandbox
365
+ fails fast instead of silently testing the host installation. The sandbox is
366
+ always built from the checkout this script lives in; it never infers a
367
+ repository from a sibling directory.
346
368
 
347
369
  This validates the prepared isolated sandbox only. A PASS is not proof of
348
370
  support for every real host or for host configurations that were not exercised.
349
371
 
372
+ ## Plugin V2 TypeScript coverage
373
+
374
+ `npm run coverage:plugin-v2` runs the `tests/pantheon/*.test.ts` suite with
375
+ Node's source-mapped native coverage and enforces an 80% line-coverage minimum
376
+ for `src/plugin-v2.ts` only. It requires Node `v24.15.0`; branch and function
377
+ coverage are reported but are not gates. This is not a repository-wide coverage
378
+ claim.
379
+
350
380
  Env overrides:
351
381
 
352
382
  | Variable | Default | Purpose |
353
383
  |----------|---------|---------|
354
384
  | `PANTHEON_SANDBOX_ROOT` | `~/pantheon-sandbox` | Sandbox root (refused if unsafe for `--reset`) |
355
- | `OPENCODE_V1_SPEC` | `opencode-ai@1.18.18` | npm spec providing the `opencode` binary |
385
+ | `OPENCODE_V1_SPEC` | `opencode-ai@1.18.18` | Configures the V1 plugin only; the V2-only sandbox runner does not consume or support it |
356
386
  | `OPENCODE_V2_SPEC` | `@opencode-ai/cli@beta` | npm spec providing the `opencode2` binary |
357
387
  | `PANTHEON_SANDBOX_MODEL` | `opencode-go/mimo-v2.5` | Model used by init and prompts |
358
388
  | `PANTHEON_PROMPT_TIMEOUT` | `300` | Per-prompt timeout in seconds |
@@ -382,18 +412,22 @@ and returns nothing. Prefer `background=true` dispatches with an explicit
382
412
 
383
413
  ## Configuration (environment variables)
384
414
 
385
- | Variable | Default | Description |
386
- |---|---|---|
387
- | `PANTHEON_MEMORY_EMBED` | `on` | `off` (also `0`, `false`, `no`) disables the `pantheon-memory` embedding/vector pipeline — search runs in FTS5-only mode with no model download and no `sqlite-vec` writes. Also forced `off` automatically when `fastembed` fails to import, so a broken embedding install never takes the server down (issue #159). |
388
-
389
- The memory MCP degrades gracefully: when `fastembed` or `sqlite-vec` are
390
- unavailable (network failure, incompatible wheel), the server still starts,
391
- answers the MCP `initialize` handshake, and serves keyword search — only the
392
- semantic vector ranking is unavailable.
415
+ The `pantheon-memory` MCP server needs no configuration: search is SQLite FTS5
416
+ (BM25) only, all stdlib, with no embedding model, no vector index, and no
417
+ `sqlite-vec`/`fastembed` dependency. Other environment variables are documented
418
+ in the sections above.
393
419
 
394
420
 
395
421
  ## Documentation
396
422
 
423
+ ### Local evaluations
424
+
425
+ Promptfoo/evaluation experiments are local-only: place them under
426
+ `evals/promptfoo/`, which is gitignored and excluded from npm packaging,
427
+ package evidence, CI tests, coverage, and release gates. Publish reviewed
428
+ findings as documentation, not the local harness, datasets, outputs, or
429
+ credentials.
430
+
397
431
  - [Installation](docs/INSTALLATION.md) · [Quick start](docs/QUICKSTART.md)
398
432
  - [Architecture](docs/ARCHITECTURE.md) · [MCP tools](docs/mcp-tools.md)
399
433
  - [Platforms](docs/PLATFORMS.md) · [Upgrading](docs/UPGRADING.md)
@@ -409,10 +443,10 @@ or pull request.
409
443
 
410
444
  ## Citation and DOI
411
445
 
412
- Pantheon is released under the [MIT License](LICENSE). For the historical
413
- published v1.4.3 record only, use the [Zenodo DOI](https://doi.org/10.5281/zenodo.22306637);
414
- it is not the current operational version. Citation metadata is also available
415
- in [CITATION.cff](CITATION.cff).
446
+ Pantheon is released under the [MIT License](LICENSE). Cite the
447
+ [Zenodo concept DOI](https://doi.org/10.5281/zenodo.22650136), which always
448
+ resolves to the latest archived release; each release also has its own version
449
+ DOI. Citation metadata is also available in [CITATION.cff](CITATION.cff).
416
450
 
417
451
  Canonical repository: <https://github.com/ils15/pantheon-opencode>
418
452
 
package/README.pt-BR.md CHANGED
@@ -10,7 +10,7 @@ e equipes que querem mais estrutura sem perder o controle do próprio código.
10
10
 
11
11
  [![Versão](https://img.shields.io/github/v/release/ils15/pantheon-opencode?label=versão)](https://github.com/ils15/pantheon-opencode/releases/latest)
12
12
  [![CI](https://img.shields.io/github/actions/workflow/status/ils15/pantheon-opencode/ci.yml?branch=main&label=CI)](https://github.com/ils15/pantheon-opencode/actions)
13
- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22306637.svg)](https://doi.org/10.5281/zenodo.22306637)
13
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22650136.svg)](https://doi.org/10.5281/zenodo.22650136)
14
14
 
15
15
  ## O que é?
16
16
 
@@ -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 22+.
34
+ Requisitos: [OpenCode 1.18.4+](https://opencode.ai/docs/) e Node.js `^22.22.2 || ^24.15.0 || >=26.0.0`.
35
35
 
36
36
  No projeto em que você quer usar o Pantheon:
37
37
 
@@ -71,8 +71,8 @@ verificações repetíveis e passagens claras entre etapas do trabalho.
71
71
 
72
72
  ## Status
73
73
 
74
- Versão operacional neste checkout: **v1.5.0-beta.2** (candidata; esta página
75
- não afirma publicação). O Pantheon foi feito para OpenCode e depende da
74
+ Versão operacional neste checkout: **v1.6.0-beta.1** (primeira beta compatível
75
+ com OpenCode 2; esta página não afirma publicação). O Pantheon foi feito para OpenCode e depende da
76
76
  disponibilidade e da configuração do OpenCode e dos serviços opcionais que você
77
77
  escolher. Veja as [releases](https://github.com/ils15/pantheon-opencode/releases)
78
78
  e o [changelog](CHANGELOG.md) para acompanhar as mudanças publicadas.
@@ -103,25 +103,17 @@ falha fechado, sem fallback silencioso. O `doctor` valida o manifest e o
103
103
  SHA-256 de cada script sem regenerá-lo.
104
104
 
105
105
 
106
- ## Novidades da 1.5.0-beta.2
106
+ ## Novidades da 1.6.0-beta.1
107
107
 
108
- - Instalador exclusivo para OpenCode: guias de plataformas consolidados em um
109
- único [guia OpenCode](docs/platforms/opencode.md).
110
- - Novo CLI `uninstall` com escopos project/global e checagem de ownership:
111
- `node scripts/uninstall.mjs --project|--global [--dry-run] [--force]`.
112
- - Recursos MCP endurecidos: correção do `pantheon://agents` e proteção contra
113
- symlink/traversal nos caminhos de recursos.
114
- - Compatibilidade com OpenCode V2: merge de configuração `plugins` /
115
- `mcp.servers.enabled` e launch stdio MCP com PWD correto.
116
- - `doctor` e health checks de instalação expandidos.
117
- - Validador de sandbox para instalações globais
118
- (`scripts/test-opencode-v1-v2-sandbox.sh`) cobrindo OpenCode V1/V2 lado a
119
- lado — veja [Validação em sandbox](#validação-em-sandbox-v1v2).
120
- - A flag `--prompts` do instalador está planejada para uma release futura.
108
+ - Primeira beta compatível com o contrato de plugin do OpenCode 2.
109
+ - Remoção do pipeline legado de vector-memory, preservando a busca por palavras-
110
+ chave SQLite FTS5/BM25 e as ferramentas de codemap `code_*`.
111
+ - Validações de CI e release fail-closed; `doctor` e o sandbox exclusivo V2
112
+ cobrem o caminho de instalação do OpenCode 2.
121
113
 
122
- ## OpenCode V1/V2 — Versão dupla (1.5.0-beta.2)
114
+ ## OpenCode V1/V2 — Versão dupla (1.6.0-beta.1)
123
115
 
124
- O Pantheon tem dois contratos de plugin OpenCode **exclusivos**. A configuração
116
+ Esta é a primeira beta compatível com o OpenCode 2. O Pantheon tem dois contratos de plugin OpenCode **exclusivos**. A configuração
125
117
  comum do OpenCode pode ser compartilhada, mas o registro do plugin Pantheon é
126
118
  selecionado por instalação; os plugins Pantheon V1 e V2 nunca devem ser
127
119
  registrados juntos.
@@ -137,8 +129,9 @@ O plugin V2 fornece 6 ferramentas de orquestração (`hashline_edit`,
137
129
  `pantheon_goal_create`, `pantheon_goal_get`, `pantheon_goal_update`,
138
130
  `pantheon_cost`, `pantheon_model`), 4 assinaturas de eventos (`session.created`,
139
131
  `session.idle`, `session.error`, `session.compacted`), session hooks (`prompt`,
140
- `context`) e tool hooks (`execute.before`, `execute.after`). O único recurso V2
141
- sem suporte é `legacy-hooks` (a superfície de hooks específica do V1).
132
+ `context`) e tool hooks (`execute.before`, `execute.after`). Os recursos V2 sem
133
+ suporte são `legacy-hooks` (a superfície de hooks específica do V1),
134
+ `catalog-transform`, `integration-transform` e `skill-transform`.
142
135
 
143
136
  O pacote expõe os dois contratos como exports importáveis:
144
137
  `pantheon-opencode/plugin` (V1), `pantheon-opencode/plugin-v2` (V2) e
@@ -228,39 +221,66 @@ fallback para `npm install`. Uma release carrega um único tarball `.tgz`, calcu
228
221
  o SHA-256 desse mesmo artefato e vincula o tarball e o GitHub Release ao
229
222
  `TARGET_SHA` completo; um segundo pack não é intercambiável.
230
223
 
231
- ## Validação em sandbox (V1/V2)
224
+ ## Validação em sandbox (V2)
232
225
 
233
- O `scripts/test-opencode-v1-v2-sandbox.sh` valida o pacote instalado
226
+ O `scripts/test-opencode-v2-sandbox.sh` valida o pacote instalado
234
227
  globalmente como um usuário real dentro de um sandbox isolado (com `HOME`,
235
228
  prefix npm e venv próprios) — nunca o ambiente de desenvolvimento. Ele verifica
236
- OpenCode V1 (`opencode`) e V2 (`opencode2`) lado a lado: binários, conectividade
237
- MCP, `doctor` e — com `--prompts` — uma bateria de prompts cobrindo o recurso
238
- `pantheon://agents`, memory store/recall, escrita no filesystem e delegação de
239
- agente. O gate é fail-closed: todo check obrigatório precisa terminar em PASS
240
- explícito; timeout, falha de auth/rede/provider e pré-requisitos ausentes
241
- bloqueiam a execução.
229
+ a perna OpenCode V2: o binário, conectividade MCP, `doctor` e — com
230
+ `--prompts` — uma bateria de prompts cobrindo o recurso `pantheon://agents`,
231
+ memory store/recall, escrita no filesystem e delegação de agente. O gate é
232
+ fail-closed: todo check obrigatório precisa terminar em PASS explícito;
233
+ timeout, falha de auth/rede/provider e pré-requisitos ausentes bloqueiam a
234
+ execução.
235
+
236
+ "V2" aqui se refere somente ao canário de hooks observado em um host OpenCode
237
+ v2.0.18, no qual ao menos um callback testado foi disparado; isso não
238
+ estabelece compatibilidade com o SDK estável `@opencode/plugin@2.0.18` nem com
239
+ o contrato 2.x completo. Esta branch ainda fixa a dependência transitória
240
+ `@opencode-ai/plugin@1.18.30`. Em hosts com `opencode` e `opencode2`, este
241
+ último costuma ser um shim que executa o mesmo binário; a comparação lado a
242
+ lado anterior, portanto, não provava nada sobre o binário em si. O projeto é
243
+ exclusivo V2, portanto há uma única perna.
242
244
 
243
245
  ```bash
244
- scripts/test-opencode-v1-v2-sandbox.sh --prepare # tarball + install + init no sandbox
245
- scripts/test-opencode-v1-v2-sandbox.sh --run v1 --prompts # validação base + bateria de prompts (V1)
246
- scripts/test-opencode-v1-v2-sandbox.sh --run v2 # apenas validação base (V2)
247
- scripts/test-opencode-v1-v2-sandbox.sh --prompts # bateria de prompts para as duas versões
248
- scripts/test-opencode-v1-v2-sandbox.sh --reset # limpa a raiz do sandbox
246
+ scripts/test-opencode-v2-sandbox.sh --prepare # tarball + install + init no sandbox
247
+ scripts/test-opencode-v2-sandbox.sh --run v2 # apenas validação base
248
+ scripts/test-opencode-v2-sandbox.sh --prompts # validação base + bateria de prompts
249
+ scripts/test-opencode-v2-sandbox.sh --rehydrate # sondas offline de rehydration/summary de sessão
250
+ scripts/test-opencode-v2-sandbox.sh --hooks # canário de callbacks de hooks V2
251
+ scripts/test-opencode-v2-sandbox.sh --rehydrate --hooks # executa os dois canários
252
+ scripts/test-opencode-v2-sandbox.sh --reset # limpa a raiz do sandbox
249
253
  ```
250
254
 
251
- Os modos são combináveis (ex.: `--prepare --run v1 --prompts`). Os binários são
252
- resolvidos estritamente dentro do prefix npm do sandbox — um sandbox não
253
- preparado falha rápido em vez de testar silenciosamente a instalação do host.
255
+ Os modos são combináveis (ex.: `--prepare --run v2 --prompts`). `--rehydrate`
256
+ executa sondas offline de `context_rehydrate` e `context_session_summary`.
257
+ `--hooks` executa um canário de hooks V2 com o binário do sandbox para verificar
258
+ se os callbacks de hooks são disparados; ele não testa os efeitos dos callbacks
259
+ de transform nem comprova o enforcement de segurança `execute.before` do
260
+ Pantheon. Com o par de sondas `--rehydrate --hooks` (sem `--run`, `--prompts` ou
261
+ `--cost`), o canário de hooks ainda é executado se a rehydration falhar, e o
262
+ comando retorna falha em seguida. Esses canários de teste/sandbox não são prova
263
+ de enforcement de segurança do Pantheon. Os binários são resolvidos estritamente
264
+ dentro do prefix npm do sandbox — um sandbox não preparado falha rápido em vez
265
+ de testar silenciosamente a instalação do host.
254
266
 
255
267
  Isso valida somente o sandbox isolado e preparado. Um PASS não prova suporte
256
268
  para todo host real nem para configurações de host que não foram exercitadas.
257
269
 
270
+ ## Cobertura TypeScript do Plugin V2
271
+
272
+ `npm run coverage:plugin-v2` executa a suíte `tests/pantheon/*.test.ts` com a
273
+ cobertura nativa do Node habilitada para source maps e exige pelo menos 80% de
274
+ cobertura de linhas somente para `src/plugin-v2.ts`. Requer Node `v24.15.0`;
275
+ coberturas de branches e funções são informativas, não gates. Isso não é uma
276
+ alegação de cobertura do repositório inteiro.
277
+
258
278
  Variáveis de ambiente:
259
279
 
260
280
  | Variável | Padrão | Finalidade |
261
281
  |----------|---------|---------|
262
282
  | `PANTHEON_SANDBOX_ROOT` | `~/pantheon-sandbox` | Raiz do sandbox (recusada se insegura para `--reset`) |
263
- | `OPENCODE_V1_SPEC` | `opencode-ai@1.18.18` | Spec npm que fornece o binário `opencode` |
283
+ | `OPENCODE_V1_SPEC` | `opencode-ai@1.18.18` | Configura somente o plugin V1; o runner de sandbox exclusivo V2 não consome nem oferece suporte a essa variável |
264
284
  | `OPENCODE_V2_SPEC` | `@opencode-ai/cli@beta` | Spec npm que fornece o binário `opencode2` |
265
285
  | `PANTHEON_SANDBOX_MODEL` | `opencode-go/mimo-v2.5` | Modelo usado pelo init e pelos prompts |
266
286
  | `PANTHEON_PROMPT_TIMEOUT` | `300` | Timeout por prompt em segundos |
@@ -295,10 +315,10 @@ uma issue ou pull request.
295
315
 
296
316
  ## Citação e DOI
297
317
 
298
- O Pantheon é distribuído sob a [Licença MIT](LICENSE). Para o registro histórico
299
- publicado da v1.4.3 apenas, use o [DOI do Zenodo](https://doi.org/10.5281/zenodo.22306637);
300
- essa não é a versão operacional atual. Os metadados de citação também estão em
301
- [CITATION.cff](CITATION.cff).
318
+ O Pantheon é distribuído sob a [Licença MIT](LICENSE). Cite o
319
+ [DOI conceitual do Zenodo](https://doi.org/10.5281/zenodo.22650136), que sempre
320
+ resolve para a última release arquivada; cada release também tem seu próprio
321
+ version DOI. Os metadados de citação também estão em [CITATION.cff](CITATION.cff).
302
322
 
303
323
  Repositório canônico: <https://github.com/ils15/pantheon-opencode>
304
324
 
@@ -4,7 +4,7 @@ agent: "zeus"
4
4
  ---
5
5
  # /pantheon-optimize — Pantheon Project Optimizer
6
6
 
7
- **What:** Multi-mode optimization: scans for documentation bloat, archives completed deepwork, migrates memory-bank flat files to MCP memory (ChromaDB), and reports token savings.
7
+ **What:** Multi-mode optimization: scans for documentation bloat, archives completed deepwork, migrates memory-bank flat files to the FTS5-backed MCP memory server, and reports token savings.
8
8
 
9
9
  ## Usage
10
10
 
@@ -33,7 +33,7 @@ Archives completed deepwork sessions from `.pantheon/deepwork/<slug>/` to `.pant
33
33
  ```
34
34
 
35
35
  ### `--cache` — Memory Bank Migration
36
- Scans `.pantheon/memory-bank/` for flat `.md` files and migrates them to the MCP memory server (ChromaDB).
36
+ Scans `.pantheon/memory-bank/` for flat `.md` files and migrates them to the FTS5-backed MCP memory server.
37
37
 
38
38
  **What it does:**
39
39
  1. Reads all `.md` files in `.pantheon/memory-bank/`
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "1.5.1",
3
+ "version": "1.6.0-beta.1",
4
4
  "description": "Multi-agent orchestration for OpenCode — 14 specialized agents, TDD, Themis review gates.",
5
5
  "type": "module",
6
+ "workspaces": [
7
+ "src/plugins/tui"
8
+ ],
6
9
  "publishConfig": {
7
10
  "access": "public",
8
11
  "registry": "https://registry.npmjs.org/"
@@ -39,7 +42,10 @@
39
42
  "hooks:update": "pre-commit autoupdate",
40
43
  "test:security": "npm run secret-scan",
41
44
  "test:node": "node --test tests/*.mjs tests/pantheon/*.mjs",
45
+ "coverage": "echo 'Node coverage (report-only, NO threshold is enforced).' && echo 'Covers: the .mjs/.js modules under scripts/, src/ and bin/ that test:node exercises.' && echo 'Does NOT cover: test:ts (hand-rolled tsx loop, no node --test runner) and test:ci (pytest).' && echo ' TypeScript under src/ (41 files) is therefore entirely unmeasured here.' && echo '' && node --test --experimental-test-coverage --test-coverage-include='scripts/**/*.mjs' --test-coverage-include='src/**/*.mjs' --test-coverage-include='src/**/*.js' --test-coverage-include='bin/**/*.mjs' tests/*.mjs tests/pantheon/*.mjs",
46
+ "coverage:plugin-v2": "node scripts/check-plugin-v2-coverage.mjs",
42
47
  "test:ts": "for f in tests/pantheon/*.test.ts; do if [ \"$f\" = tests/pantheon/plugin-v2-contract.test.ts ]; then NODE_OPTIONS=--conditions=import tsx \"$f\"; else tsx \"$f\"; fi || exit 1; done",
48
+ "test:hooks": "node --test tests/pantheon/plugin-v2-hook-canary.test.mjs",
43
49
  "test:all": "npm run test:ci && npm run test:node && npm run test:ts",
44
50
  "test": "npm run test:all",
45
51
  "test:ci": "python3 -m pytest -q --tb=short 2>&1"
@@ -78,6 +84,9 @@
78
84
  "src/routing.yml",
79
85
  "src/pantheon/**",
80
86
  ".pantheon/code-mode/**",
87
+ "!.pantheon/code-mode/session-end-save.py",
88
+ "!.pantheon/code-mode/session-end-save.sh",
89
+ "!.pantheon/code-mode/eval-*.py",
81
90
  "src/plugins/**",
82
91
  "scripts/hooks/**",
83
92
  "src/mcp/requirements*",
@@ -100,6 +109,9 @@
100
109
  "tsx": "4.23.13",
101
110
  "typescript": "6.0.3"
102
111
  },
112
+ "overrides": {
113
+ "rolldown": "1.2.0"
114
+ },
103
115
  "repository": {
104
116
  "type": "git",
105
117
  "url": "https://github.com/ils15/pantheon-opencode.git"
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon",
3
3
  "publisher": "ils15",
4
- "version": "1.5.1",
4
+ "version": "1.6.0-beta.1",
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
@@ -4,19 +4,17 @@ build-backend = "setuptools.backends._legacy:_Backend"
4
4
 
5
5
  [project]
6
6
  name = "pantheon"
7
- version = "1.5.1"
7
+ version = "1.6.0-beta.1"
8
8
  description = "Multi-agent orchestration framework"
9
9
  requires-python = ">=3.11"
10
10
  dependencies = []
11
11
 
12
12
  [tool.pytest.ini_options]
13
- # `tests/` holds the main suite; the two entries below are orphaned test
14
- # modules that live next to the code they cover and are collected here so
15
- # pytest (and therefore `npm test`) exercises them instead of letting them
16
- # rot as dead code.
13
+ # `tests/` holds the main suite; the entry below is an orphaned test module
14
+ # that lives next to the code it covers and is collected here so pytest (and
15
+ # therefore `npm test`) exercises it instead of letting it rot as dead code.
17
16
  testpaths = [
18
17
  "tests",
19
- "scripts/vector_memory/test_memory.py",
20
18
  "benchmarks/beta2/test_beta2.py",
21
19
  ]
22
20
  asyncio_mode = "auto"
@@ -28,7 +26,6 @@ target-version = "py311"
28
26
 
29
27
  [tool.ruff.lint]
30
28
  select = ["E", "F", "W", "I", "N", "UP", "B", "SIM", "PL", "RUF", "C901"]
31
- ignore = ["E501"]
32
29
 
33
30
  [tool.ruff.lint.per-file-ignores]
34
31
  "__init__.py" = ["F401"]
@@ -36,21 +33,17 @@ ignore = ["E501"]
36
33
  "scripts/ci-validate-yaml.py" = ["N999"]
37
34
  "scripts/scrub-secrets.py" = ["N999"]
38
35
  # These modules defer optional/heavy imports until the corresponding command is used.
39
- "scripts/vector_memory/*.py" = ["PLC0415"]
40
36
  "tests/test_code_mode_sandbox.py" = ["PLC0415", "N806"]
41
37
  "tests/test_code_mode_server.py" = ["PLC0415"]
42
38
  "tests/test_codemap_mcp.py" = ["PLC0415"]
43
39
  "tests/test_memory_mcp_server.py" = ["PLC0415", "PLR2004"]
44
40
  # Existing public APIs and test fixtures are intentionally broad/simple; refactoring
45
41
  # them would be behavior-affecting rather than a mechanical lint correction.
46
- "scripts/code_mode_server.py" = ["PLR0913"]
47
- "src/mcp/code_mode_server.py" = ["PLR0913"]
48
- "scripts/mcp_persistence_server.py" = ["PLR0913"]
49
- "src/mcp/mcp_persistence_server.py" = ["PLR0913"]
42
+ "scripts/code_mode_server.py" = ["PLR0913", "PLR0917"]
43
+ "src/mcp/code_mode_server.py" = ["PLR0913", "PLR0917"]
44
+ "scripts/mcp_persistence_server.py" = ["PLR0913", "PLR0917"]
45
+ "src/mcp/mcp_persistence_server.py" = ["PLR0913", "PLR0917"]
50
46
  "scripts/memory_mcp_server.py" = ["C901"]
51
- "scripts/vector_memory/index.py" = ["C901", "PLR0913", "PLR2004", "PLW0603", "PLW2901"]
52
- "scripts/vector_memory/cli.py" = ["PLR2004"]
53
- "scripts/vector_memory/query.py" = ["PLR0913"]
54
47
  "src/mcp/eval_store.py" = ["PLR2004"]
55
48
  "tests/test_code_mode_frontmatter.py" = ["PLR2004"]
56
49
  "tests/test_eval.py" = ["PLR2004"]
@@ -106,7 +106,7 @@ function parseInstruction(content) {
106
106
  if (!nameMatch) return null
107
107
  return {
108
108
  name: nameMatch[1].trim(),
109
- body: content.slice(match[0].length).trimEnd() + '\n',
109
+ body: `${content.slice(match[0].length).trimEnd()}\n`,
110
110
  }
111
111
  }
112
112
 
@@ -165,7 +165,7 @@ export function generateAgentsMd(instructions) {
165
165
  '',
166
166
  )
167
167
  }
168
- return sections.join('\n').trimEnd() + '\n'
168
+ return `${sections.join('\n').trimEnd()}\n`
169
169
  }
170
170
 
171
171
  // ---------------------------------------------------------------------------