pantheon-opencode 1.5.2 → 1.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pantheon/code-mode/README.md +4 -2
- package/.pantheon/code-mode/checkpoint_session.py +138 -102
- package/.pantheon/code-mode/compress-inline.py +102 -57
- package/.pantheon/code-mode/manifest.json +2 -8
- package/CHANGELOG.md +59 -0
- package/README.md +115 -55
- package/README.pt-BR.md +86 -43
- package/commands/pantheon-optimize.md +2 -2
- package/package.json +13 -1
- package/plugin.json +1 -1
- package/pyproject.toml +8 -15
- package/scripts/build-agents-md.mjs +2 -2
- package/scripts/check-plugin-v2-coverage.mjs +213 -0
- package/scripts/ci-validate-yaml.py +7 -5
- package/scripts/code_mode_server.py +116 -24
- package/scripts/doctor.mjs +85 -28
- package/scripts/install/cli-ui.mjs +1 -1
- package/scripts/install/config-migration.mjs +124 -3
- package/scripts/install/health-check.mjs +6 -19
- package/scripts/install/interactive.mjs +6 -6
- package/scripts/install/migrate.mjs +1 -1
- package/scripts/install/opencode.mjs +43 -10
- package/scripts/mcp_persistence_server.py +390 -76
- package/scripts/memory_mcp_server.py +370 -196
- package/scripts/postinstall.mjs +0 -7
- package/scripts/probe-context-rehydrate.mjs +28 -11
- package/scripts/prune.mjs +2 -2
- package/scripts/test-opencode-v2-sandbox.sh +1759 -0
- package/scripts/validate-routing.mjs +40 -0
- package/skills-lock.json +9 -10
- package/src/agents/aphrodite.md +0 -1
- package/src/agents/apollo.md +0 -1
- package/src/agents/athena.md +0 -1
- package/src/agents/demeter.md +0 -1
- package/src/agents/gaia.md +0 -1
- package/src/agents/hephaestus.md +0 -1
- package/src/agents/hermes.md +0 -1
- package/src/agents/iris.md +0 -1
- package/src/agents/mnemosyne.md +15 -17
- package/src/agents/nyx.md +0 -1
- package/src/agents/prometheus.md +0 -1
- package/src/agents/talos.md +0 -1
- package/src/agents/themis.md +0 -1
- package/src/agents/zeus.md +1 -3
- package/src/mcp/code_mode_server.py +116 -24
- package/src/mcp/mcp_codemap_module.py +559 -129
- package/src/mcp/mcp_persistence_server.py +390 -76
- package/src/mcp/memory_mcp_server.py +371 -248
- package/src/mcp/pantheon_vision_server.py +136 -24
- package/src/mcp/requirements-mcp.txt +5 -3
- package/src/mcp/requirements-vision.txt +2 -0
- package/src/pantheon/model-command.ts +18 -7
- package/src/pantheon/presets.d.mts +0 -8
- package/src/pantheon/presets.mjs +0 -29
- package/src/pantheon/todo-enforcer.ts +1 -1
- package/src/pantheon/vision.ts +1 -1
- package/src/plugin-v2.ts +134 -104
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/package-lock.json +23 -23
- package/src/plugins/tui/package.json +12 -12
- package/src/routing.yml +0 -16
- package/src/skills/README.md +31 -36
- package/src/skills/auto-continue/SKILL.md +27 -77
- package/.pantheon/code-mode/eval-llm-judge.py +0 -255
- package/.pantheon/code-mode/eval-monte-carlo.py +0 -368
- package/.pantheon/code-mode/eval-run.py +0 -197
- package/.pantheon/code-mode/eval-static.py +0 -321
- package/.pantheon/code-mode/session-end-save.py +0 -186
- package/.pantheon/code-mode/session-end-save.sh +0 -18
- package/scripts/recover-zenodo-deposition.mjs +0 -146
- package/scripts/test-opencode-v1-v2-sandbox.sh +0 -862
- package/scripts/validate-zenodo-release.mjs +0 -154
- package/scripts/zenodo-artifact.mjs +0 -94
- package/scripts/zenodo-release-state.mjs +0 -53
- 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
|
[](https://github.com/ils15/pantheon-opencode/releases/latest)
|
|
12
12
|
[](https://github.com/ils15/pantheon-opencode/actions)
|
|
13
|
-
[](https://doi.org/10.5281/zenodo.22650136)
|
|
14
14
|
|
|
15
15
|
## What is it?
|
|
16
16
|
|
|
@@ -78,11 +78,14 @@ clear handoff between stages of work.
|
|
|
78
78
|
|
|
79
79
|
## Status
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
and
|
|
81
|
+
Candidate version: the manifests in this checkout express the version being
|
|
82
|
+
prepared, not a confirmed publication. A beta is published only after the
|
|
83
|
+
Release workflow completes successfully. To check which version is actually
|
|
84
|
+
published, consult the npm `beta` dist-tag. Pantheon is designed for OpenCode
|
|
85
|
+
and depends on the availability and configuration of OpenCode and any optional
|
|
86
|
+
services you choose to use. Check the
|
|
87
|
+
[releases](https://github.com/ils15/pantheon-opencode/releases) and
|
|
88
|
+
[changelog](CHANGELOG.md) for the latest published changes.
|
|
86
89
|
|
|
87
90
|
## Delegation (native `task()`)
|
|
88
91
|
|
|
@@ -132,6 +135,10 @@ only when they are explicitly approved. Approval is recorded in
|
|
|
132
135
|
- **Hash mismatch → `CORRUPT_DATA`.** The SHA-256 of the file on disk must
|
|
133
136
|
match the manifest entry, so edits after approval are detected.
|
|
134
137
|
|
|
138
|
+
Session persistence is provided by the persistence MCP server. The bundled
|
|
139
|
+
code-mode payload contains execution helpers only and does not export or back
|
|
140
|
+
up a database.
|
|
141
|
+
|
|
135
142
|
Approve or re-approve a script with the `approve_code_script` MCP tool:
|
|
136
143
|
|
|
137
144
|
```
|
|
@@ -153,28 +160,25 @@ once a project directory is selected, a missing or corrupt manifest fails
|
|
|
153
160
|
closed instead of falling back. `doctor` validates the manifest and every
|
|
154
161
|
script's SHA-256 without regenerating it.
|
|
155
162
|
|
|
163
|
+
The local `.pantheon/code-mode/eval-*.py` helpers and any Promptfoo/evaluation
|
|
164
|
+
assets are development-only inputs and are excluded from the npm tarball and
|
|
165
|
+
from the runtime manifest. `src/mcp/eval_store.py` is different: it is a
|
|
166
|
+
shipped runtime dependency of the MCP resources server, not an evaluation
|
|
167
|
+
asset, so it remains packaged.
|
|
168
|
+
|
|
156
169
|
|
|
157
|
-
## What's new in 1.
|
|
170
|
+
## What's new in 1.6.0-beta.1
|
|
158
171
|
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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.
|
|
172
|
+
- First beta compatible with the OpenCode 2 plugin contract.
|
|
173
|
+
- Removed the legacy vector-memory pipeline while preserving SQLite FTS5/BM25
|
|
174
|
+
keyword search and the `code_*` codemap tools.
|
|
175
|
+
- CI and release validation are fail-closed; `doctor` checks and the V2-only
|
|
176
|
+
sandbox validator cover the OpenCode 2 installation path.
|
|
174
177
|
|
|
175
|
-
## OpenCode V1/V2 — Dual Version (1.
|
|
178
|
+
## OpenCode V1/V2 — Dual Version (1.6.0-beta.1)
|
|
176
179
|
|
|
177
|
-
Pantheon has two **exclusive** OpenCode
|
|
180
|
+
This is the first beta compatible with OpenCode 2. Pantheon has two **exclusive** OpenCode
|
|
181
|
+
plugin contracts. Ordinary OpenCode
|
|
178
182
|
configuration may be shared, but the Pantheon plugin registration is selected
|
|
179
183
|
per installation; V1 and V2 Pantheon plugins must never be registered together.
|
|
180
184
|
|
|
@@ -189,8 +193,9 @@ The V2 plugin provides 6 orchestration tools (`hashline_edit`,
|
|
|
189
193
|
`pantheon_goal_create`, `pantheon_goal_get`, `pantheon_goal_update`,
|
|
190
194
|
`pantheon_cost`, `pantheon_model`), 4 event subscriptions (`session.created`,
|
|
191
195
|
`session.idle`, `session.error`, `session.compacted`), session hooks (`prompt`,
|
|
192
|
-
`context`), and tool hooks (`execute.before`, `execute.after`).
|
|
193
|
-
|
|
196
|
+
`context`), and tool hooks (`execute.before`, `execute.after`). Unsupported V2
|
|
197
|
+
features are `legacy-hooks` (the V1-specific hook surface), `catalog-transform`,
|
|
198
|
+
`integration-transform`, and `skill-transform`.
|
|
194
199
|
|
|
195
200
|
The package exposes both contracts as importable exports: `pantheon-opencode/plugin`
|
|
196
201
|
(V1), `pantheon-opencode/plugin-v2` (V2) and `pantheon-opencode/v2-bridge`
|
|
@@ -229,6 +234,29 @@ The installer still writes the compatibility settings required by the selected
|
|
|
229
234
|
OpenCode host, such as `experimental.subagent_depth`; this does not convert a
|
|
230
235
|
V1 plugin into V2 or provide V2 with V1 hooks.
|
|
231
236
|
|
|
237
|
+
Pantheon does not set a step ceiling on agents. On OpenCode 2 the `steps`
|
|
238
|
+
field is optional and has no default: absent means the host applies no native
|
|
239
|
+
limit. A config written before this change still carries the old value, and the
|
|
240
|
+
V2 install path strips it from every agent Pantheon manages — an agent you
|
|
241
|
+
define yourself is never touched, and the retiring V1 singular `agent` block
|
|
242
|
+
is left alone. Run the installer once to clear a stale value from an existing
|
|
243
|
+
config:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
npx pantheon-opencode init --opencode-version=v2
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Context control is not a Pantheon setting. Whatever budget an agent runs
|
|
250
|
+
against comes from the compaction settings of the OpenCode host you are
|
|
251
|
+
running, and Pantheon does not define them.
|
|
252
|
+
|
|
253
|
+
When a V1 `agent` block and a V2 `agents` block are both present — which is
|
|
254
|
+
what an installed `opencode.json` carries — the V1→V2 conversion merges them
|
|
255
|
+
instead of letting one replace the other. The V2 block is the base, the
|
|
256
|
+
framework-managed fields from the V1 block overwrite, and your own fields are
|
|
257
|
+
preserved, matching the precedence the installer already applies elsewhere.
|
|
258
|
+
Key order does not matter.
|
|
259
|
+
|
|
232
260
|
## Updating between releases (beta.5+)
|
|
233
261
|
|
|
234
262
|
One command keeps an existing installation current:
|
|
@@ -321,38 +349,66 @@ Release validation keeps each manifest with its lockfile: the root
|
|
|
321
349
|
SHA-256 of that same artifact, and binds the tarball and GitHub release to the
|
|
322
350
|
full `TARGET_SHA`; a second pack is not interchangeable.
|
|
323
351
|
|
|
324
|
-
## Sandbox validation (
|
|
352
|
+
## Sandbox validation (V2)
|
|
325
353
|
|
|
326
|
-
`scripts/test-opencode-
|
|
354
|
+
`scripts/test-opencode-v2-sandbox.sh` validates the globally installed
|
|
327
355
|
package as a real user inside an isolated sandbox (own `HOME`, npm prefix and
|
|
328
|
-
venv) — never the dev environment. It checks OpenCode
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
356
|
+
venv) — never the dev environment. It checks the OpenCode V2 leg: the binary,
|
|
357
|
+
MCP connectivity, `doctor`, and — with `--prompts` — a prompt battery covering
|
|
358
|
+
the `pantheon://agents` resource, memory store/recall, filesystem writes and
|
|
359
|
+
agent delegation. The gate is fail-closed: every required check must return an
|
|
360
|
+
explicit PASS; timeouts, auth/network/provider failures and missing
|
|
361
|
+
prerequisites block the run.
|
|
362
|
+
|
|
363
|
+
"V2" here refers only to the hook canary observed against an OpenCode v2.0.18
|
|
364
|
+
host, where at least one tested hook callback fired; it does not establish
|
|
365
|
+
compatibility with the stable `@opencode/plugin@2.0.18` SDK or full 2.x
|
|
366
|
+
contract. This branch still pins transitional `@opencode-ai/plugin@1.18.30`.
|
|
367
|
+
On hosts where both `opencode` and `opencode2` exist, the latter is typically
|
|
368
|
+
a shim that execs the same binary, so an older side-by-side comparison proved
|
|
369
|
+
nothing about the binary itself. The project is V2-exclusive, so there is a
|
|
370
|
+
single leg.
|
|
334
371
|
|
|
335
372
|
```bash
|
|
336
|
-
scripts/test-opencode-
|
|
337
|
-
scripts/test-opencode-
|
|
338
|
-
scripts/test-opencode-
|
|
339
|
-
scripts/test-opencode-
|
|
340
|
-
scripts/test-opencode-
|
|
373
|
+
scripts/test-opencode-v2-sandbox.sh --prepare # tarball + install + init in the sandbox
|
|
374
|
+
scripts/test-opencode-v2-sandbox.sh --run v2 # base validation only
|
|
375
|
+
scripts/test-opencode-v2-sandbox.sh --prompts # base validation + prompt battery
|
|
376
|
+
scripts/test-opencode-v2-sandbox.sh --rehydrate # offline context rehydration/session-summary probe
|
|
377
|
+
scripts/test-opencode-v2-sandbox.sh --hooks # V2 hook callback canary
|
|
378
|
+
scripts/test-opencode-v2-sandbox.sh --rehydrate --hooks # run both canaries
|
|
379
|
+
scripts/test-opencode-v2-sandbox.sh --reset # wipe the sandbox root
|
|
341
380
|
```
|
|
342
381
|
|
|
343
|
-
Modes are combinable (e.g. `--prepare --run
|
|
344
|
-
|
|
345
|
-
|
|
382
|
+
Modes are combinable (e.g. `--prepare --run v2 --prompts`). `--rehydrate` runs
|
|
383
|
+
offline `context_rehydrate` and `context_session_summary` probes. `--hooks` runs
|
|
384
|
+
a V2 hook canary against the sandbox binary to check that hook callbacks fire;
|
|
385
|
+
it does not test transform callback effects or prove Pantheon's
|
|
386
|
+
`execute.before` security enforcement. With the probe-only `--rehydrate --hooks`
|
|
387
|
+
pair (without `--run`, `--prompts`, or `--cost`), the hooks canary still runs if
|
|
388
|
+
rehydration fails, and the command returns a failing status afterward. These
|
|
389
|
+
are test/sandbox canaries, not proof of Pantheon security enforcement. Binaries
|
|
390
|
+
are resolved strictly inside the sandbox npm prefix — a non-prepared sandbox
|
|
391
|
+
fails fast instead of silently testing the host installation. The sandbox is
|
|
392
|
+
always built from the checkout this script lives in; it never infers a
|
|
393
|
+
repository from a sibling directory.
|
|
346
394
|
|
|
347
395
|
This validates the prepared isolated sandbox only. A PASS is not proof of
|
|
348
396
|
support for every real host or for host configurations that were not exercised.
|
|
349
397
|
|
|
398
|
+
## Plugin V2 TypeScript coverage
|
|
399
|
+
|
|
400
|
+
`npm run coverage:plugin-v2` runs the `tests/pantheon/*.test.ts` suite with
|
|
401
|
+
Node's source-mapped native coverage and enforces an 80% line-coverage minimum
|
|
402
|
+
for `src/plugin-v2.ts` only. It requires Node `v24.15.0`; branch and function
|
|
403
|
+
coverage are reported but are not gates. This is not a repository-wide coverage
|
|
404
|
+
claim.
|
|
405
|
+
|
|
350
406
|
Env overrides:
|
|
351
407
|
|
|
352
408
|
| Variable | Default | Purpose |
|
|
353
409
|
|----------|---------|---------|
|
|
354
410
|
| `PANTHEON_SANDBOX_ROOT` | `~/pantheon-sandbox` | Sandbox root (refused if unsafe for `--reset`) |
|
|
355
|
-
| `OPENCODE_V1_SPEC` | `opencode-ai@1.18.18` |
|
|
411
|
+
| `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
412
|
| `OPENCODE_V2_SPEC` | `@opencode-ai/cli@beta` | npm spec providing the `opencode2` binary |
|
|
357
413
|
| `PANTHEON_SANDBOX_MODEL` | `opencode-go/mimo-v2.5` | Model used by init and prompts |
|
|
358
414
|
| `PANTHEON_PROMPT_TIMEOUT` | `300` | Per-prompt timeout in seconds |
|
|
@@ -382,18 +438,22 @@ and returns nothing. Prefer `background=true` dispatches with an explicit
|
|
|
382
438
|
|
|
383
439
|
## Configuration (environment variables)
|
|
384
440
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
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.
|
|
441
|
+
The `pantheon-memory` MCP server needs no configuration: search is SQLite FTS5
|
|
442
|
+
(BM25) only, all stdlib, with no embedding model, no vector index, and no
|
|
443
|
+
`sqlite-vec`/`fastembed` dependency. Other environment variables are documented
|
|
444
|
+
in the sections above.
|
|
393
445
|
|
|
394
446
|
|
|
395
447
|
## Documentation
|
|
396
448
|
|
|
449
|
+
### Local evaluations
|
|
450
|
+
|
|
451
|
+
Promptfoo/evaluation experiments are local-only: place them under
|
|
452
|
+
`evals/promptfoo/`, which is gitignored and excluded from npm packaging,
|
|
453
|
+
package evidence, CI tests, coverage, and release gates. Publish reviewed
|
|
454
|
+
findings as documentation, not the local harness, datasets, outputs, or
|
|
455
|
+
credentials.
|
|
456
|
+
|
|
397
457
|
- [Installation](docs/INSTALLATION.md) · [Quick start](docs/QUICKSTART.md)
|
|
398
458
|
- [Architecture](docs/ARCHITECTURE.md) · [MCP tools](docs/mcp-tools.md)
|
|
399
459
|
- [Platforms](docs/PLATFORMS.md) · [Upgrading](docs/UPGRADING.md)
|
|
@@ -409,10 +469,10 @@ or pull request.
|
|
|
409
469
|
|
|
410
470
|
## Citation and DOI
|
|
411
471
|
|
|
412
|
-
Pantheon is released under the [MIT License](LICENSE).
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
in [CITATION.cff](CITATION.cff).
|
|
472
|
+
Pantheon is released under the [MIT License](LICENSE). Cite the
|
|
473
|
+
[Zenodo concept DOI](https://doi.org/10.5281/zenodo.22650136), which always
|
|
474
|
+
resolves to the latest archived release; each release also has its own version
|
|
475
|
+
DOI. Citation metadata is also available in [CITATION.cff](CITATION.cff).
|
|
416
476
|
|
|
417
477
|
Canonical repository: <https://github.com/ils15/pantheon-opencode>
|
|
418
478
|
|
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
|
[](https://github.com/ils15/pantheon-opencode/releases/latest)
|
|
12
12
|
[](https://github.com/ils15/pantheon-opencode/actions)
|
|
13
|
-
[](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.
|
|
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.
|
|
106
|
+
## Novidades da 1.6.0-beta.1
|
|
107
107
|
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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.
|
|
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`).
|
|
141
|
-
|
|
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
|
|
@@ -178,6 +171,29 @@ O instalador continua gravando as configurações de compatibilidade exigidas
|
|
|
178
171
|
pelo host OpenCode selecionado, como `experimental.subagent_depth`; isso não
|
|
179
172
|
converte um plugin V1 em V2 nem dá hooks V1 ao V2.
|
|
180
173
|
|
|
174
|
+
O Pantheon não define mais um teto de passos para os agentes. No OpenCode 2 o
|
|
175
|
+
campo `steps` é opcional e não tem default: ausente significa que o host não
|
|
176
|
+
aplica nenhum limite nativo. Uma config escrita antes dessa mudança ainda
|
|
177
|
+
carrega o valor antigo, e o caminho de instalação v2 o remove de todos os
|
|
178
|
+
agentes que o Pantheon gerencia — um agente definido por você nunca é tocado,
|
|
179
|
+
e o bloco V1 singular `agent`, em retirada, é deixado intacto. Rode o
|
|
180
|
+
instalador uma vez para limpar um valor antigo de uma config existente:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
npx pantheon-opencode init --opencode-version=v2
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
O controle de contexto não é uma configuração do Pantheon. Qualquer orçamento
|
|
187
|
+
que um agente terá vem das settings de compactação do próprio host OpenCode,
|
|
188
|
+
e o Pantheon não as define.
|
|
189
|
+
|
|
190
|
+
Quando um bloco V1 `agent` e um bloco V2 `agents` coexistem — o que acontece
|
|
191
|
+
em qualquer `opencode.json` já instalado — a conversão V1→V2 mescla os dois em
|
|
192
|
+
vez de deixar um substituir o outro. O bloco V2 é a base, os campos
|
|
193
|
+
gerenciados que vêm do V1 sobrescrevem, e os seus próprios campos são
|
|
194
|
+
preservados, com a mesma precedência que o instalador já aplica em outros
|
|
195
|
+
pontos. A ordem das chaves não muda o resultado.
|
|
196
|
+
|
|
181
197
|
## Atualizando entre releases (beta.5+)
|
|
182
198
|
|
|
183
199
|
Um comando mantém uma instalação existente em dia:
|
|
@@ -228,39 +244,66 @@ fallback para `npm install`. Uma release carrega um único tarball `.tgz`, calcu
|
|
|
228
244
|
o SHA-256 desse mesmo artefato e vincula o tarball e o GitHub Release ao
|
|
229
245
|
`TARGET_SHA` completo; um segundo pack não é intercambiável.
|
|
230
246
|
|
|
231
|
-
## Validação em sandbox (
|
|
247
|
+
## Validação em sandbox (V2)
|
|
232
248
|
|
|
233
|
-
O `scripts/test-opencode-
|
|
249
|
+
O `scripts/test-opencode-v2-sandbox.sh` valida o pacote instalado
|
|
234
250
|
globalmente como um usuário real dentro de um sandbox isolado (com `HOME`,
|
|
235
251
|
prefix npm e venv próprios) — nunca o ambiente de desenvolvimento. Ele verifica
|
|
236
|
-
OpenCode
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
252
|
+
a perna OpenCode V2: o binário, conectividade MCP, `doctor` e — com
|
|
253
|
+
`--prompts` — uma bateria de prompts cobrindo o recurso `pantheon://agents`,
|
|
254
|
+
memory store/recall, escrita no filesystem e delegação de agente. O gate é
|
|
255
|
+
fail-closed: todo check obrigatório precisa terminar em PASS explícito;
|
|
256
|
+
timeout, falha de auth/rede/provider e pré-requisitos ausentes bloqueiam a
|
|
257
|
+
execução.
|
|
258
|
+
|
|
259
|
+
"V2" aqui se refere somente ao canário de hooks observado em um host OpenCode
|
|
260
|
+
v2.0.18, no qual ao menos um callback testado foi disparado; isso não
|
|
261
|
+
estabelece compatibilidade com o SDK estável `@opencode/plugin@2.0.18` nem com
|
|
262
|
+
o contrato 2.x completo. Esta branch ainda fixa a dependência transitória
|
|
263
|
+
`@opencode-ai/plugin@1.18.30`. Em hosts com `opencode` e `opencode2`, este
|
|
264
|
+
último costuma ser um shim que executa o mesmo binário; a comparação lado a
|
|
265
|
+
lado anterior, portanto, não provava nada sobre o binário em si. O projeto é
|
|
266
|
+
exclusivo V2, portanto há uma única perna.
|
|
242
267
|
|
|
243
268
|
```bash
|
|
244
|
-
scripts/test-opencode-
|
|
245
|
-
scripts/test-opencode-
|
|
246
|
-
scripts/test-opencode-
|
|
247
|
-
scripts/test-opencode-
|
|
248
|
-
scripts/test-opencode-
|
|
269
|
+
scripts/test-opencode-v2-sandbox.sh --prepare # tarball + install + init no sandbox
|
|
270
|
+
scripts/test-opencode-v2-sandbox.sh --run v2 # apenas validação base
|
|
271
|
+
scripts/test-opencode-v2-sandbox.sh --prompts # validação base + bateria de prompts
|
|
272
|
+
scripts/test-opencode-v2-sandbox.sh --rehydrate # sondas offline de rehydration/summary de sessão
|
|
273
|
+
scripts/test-opencode-v2-sandbox.sh --hooks # canário de callbacks de hooks V2
|
|
274
|
+
scripts/test-opencode-v2-sandbox.sh --rehydrate --hooks # executa os dois canários
|
|
275
|
+
scripts/test-opencode-v2-sandbox.sh --reset # limpa a raiz do sandbox
|
|
249
276
|
```
|
|
250
277
|
|
|
251
|
-
Os modos são combináveis (ex.: `--prepare --run
|
|
252
|
-
|
|
253
|
-
|
|
278
|
+
Os modos são combináveis (ex.: `--prepare --run v2 --prompts`). `--rehydrate`
|
|
279
|
+
executa sondas offline de `context_rehydrate` e `context_session_summary`.
|
|
280
|
+
`--hooks` executa um canário de hooks V2 com o binário do sandbox para verificar
|
|
281
|
+
se os callbacks de hooks são disparados; ele não testa os efeitos dos callbacks
|
|
282
|
+
de transform nem comprova o enforcement de segurança `execute.before` do
|
|
283
|
+
Pantheon. Com o par de sondas `--rehydrate --hooks` (sem `--run`, `--prompts` ou
|
|
284
|
+
`--cost`), o canário de hooks ainda é executado se a rehydration falhar, e o
|
|
285
|
+
comando retorna falha em seguida. Esses canários de teste/sandbox não são prova
|
|
286
|
+
de enforcement de segurança do Pantheon. Os binários são resolvidos estritamente
|
|
287
|
+
dentro do prefix npm do sandbox — um sandbox não preparado falha rápido em vez
|
|
288
|
+
de testar silenciosamente a instalação do host.
|
|
254
289
|
|
|
255
290
|
Isso valida somente o sandbox isolado e preparado. Um PASS não prova suporte
|
|
256
291
|
para todo host real nem para configurações de host que não foram exercitadas.
|
|
257
292
|
|
|
293
|
+
## Cobertura TypeScript do Plugin V2
|
|
294
|
+
|
|
295
|
+
`npm run coverage:plugin-v2` executa a suíte `tests/pantheon/*.test.ts` com a
|
|
296
|
+
cobertura nativa do Node habilitada para source maps e exige pelo menos 80% de
|
|
297
|
+
cobertura de linhas somente para `src/plugin-v2.ts`. Requer Node `v24.15.0`;
|
|
298
|
+
coberturas de branches e funções são informativas, não gates. Isso não é uma
|
|
299
|
+
alegação de cobertura do repositório inteiro.
|
|
300
|
+
|
|
258
301
|
Variáveis de ambiente:
|
|
259
302
|
|
|
260
303
|
| Variável | Padrão | Finalidade |
|
|
261
304
|
|----------|---------|---------|
|
|
262
305
|
| `PANTHEON_SANDBOX_ROOT` | `~/pantheon-sandbox` | Raiz do sandbox (recusada se insegura para `--reset`) |
|
|
263
|
-
| `OPENCODE_V1_SPEC` | `opencode-ai@1.18.18` |
|
|
306
|
+
| `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
307
|
| `OPENCODE_V2_SPEC` | `@opencode-ai/cli@beta` | Spec npm que fornece o binário `opencode2` |
|
|
265
308
|
| `PANTHEON_SANDBOX_MODEL` | `opencode-go/mimo-v2.5` | Modelo usado pelo init e pelos prompts |
|
|
266
309
|
| `PANTHEON_PROMPT_TIMEOUT` | `300` | Timeout por prompt em segundos |
|
|
@@ -295,10 +338,10 @@ uma issue ou pull request.
|
|
|
295
338
|
|
|
296
339
|
## Citação e DOI
|
|
297
340
|
|
|
298
|
-
O Pantheon é distribuído sob a [Licença MIT](LICENSE).
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
[CITATION.cff](CITATION.cff).
|
|
341
|
+
O Pantheon é distribuído sob a [Licença MIT](LICENSE). Cite o
|
|
342
|
+
[DOI conceitual do Zenodo](https://doi.org/10.5281/zenodo.22650136), que sempre
|
|
343
|
+
resolve para a última release arquivada; cada release também tem seu próprio
|
|
344
|
+
version DOI. Os metadados de citação também estão em [CITATION.cff](CITATION.cff).
|
|
302
345
|
|
|
303
346
|
Repositório canônico: <https://github.com/ils15/pantheon-opencode>
|
|
304
347
|
|
|
@@ -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
|
|
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
|
|
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.
|
|
3
|
+
"version": "1.6.0-beta.2",
|
|
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.
|
|
4
|
+
"version": "1.6.0-beta.2",
|
|
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.
|
|
7
|
+
version = "1.6.0-beta.2"
|
|
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
|
|
14
|
-
#
|
|
15
|
-
#
|
|
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()
|
|
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()
|
|
168
|
+
return `${sections.join('\n').trimEnd()}\n`
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
// ---------------------------------------------------------------------------
|