pantheon-opencode 1.5.0-beta.1 → 1.5.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.
- package/.pantheon/code-mode/manifest.json +21 -0
- package/CHANGELOG.md +1026 -0
- package/README.md +171 -16
- package/README.pt-BR.md +99 -13
- package/bin/pantheon-init.mjs +178 -21
- package/package.json +23 -14
- package/plugin.json +1 -1
- package/pyproject.toml +65 -0
- package/scripts/code_mode_server.py +431 -55
- package/scripts/cost.mjs +30 -14
- package/scripts/doctor.mjs +178 -9
- package/scripts/install/cli-ui.mjs +17 -11
- package/scripts/install/config-migration.mjs +4 -6
- package/scripts/install/opencode.mjs +137 -35
- package/scripts/install/plugin.mjs +3 -33
- package/scripts/install/shared.mjs +43 -2
- package/scripts/install/strings.mjs +129 -0
- package/scripts/install-mcp.mjs +1 -0
- package/scripts/manifest-inventory.mjs +410 -0
- package/scripts/mcp_persistence_server.py +537 -128
- package/scripts/package-evidence.mjs +242 -0
- package/scripts/probe-context-rehydrate.mjs +240 -0
- package/scripts/probe-pantheon-cost.mjs +313 -0
- package/scripts/release-beta-version.mjs +56 -60
- package/scripts/sync-artifacts.mjs +169 -0
- package/scripts/sync-tui.mjs +121 -53
- package/scripts/test-opencode-v1-v2-sandbox.sh +367 -96
- package/scripts/validation-policy.mjs +7 -7
- package/scripts/version-check.mjs +113 -108
- package/scripts/versioning.mjs +230 -86
- package/src/agents/mnemosyne.md +1 -1
- package/src/agents/zeus.md +2 -2
- package/src/mcp/code_mode_server.py +431 -55
- package/src/mcp/mcp_persistence_server.py +537 -128
- package/src/pantheon/auto-wake.ts +1 -5
- package/src/pantheon/background-job-board.ts +43 -1
- package/src/pantheon/compaction-handoff.ts +304 -0
- package/src/pantheon/cost-command.ts +345 -62
- package/src/pantheon/delegate-manager.ts +390 -8
- package/src/pantheon/delegation-finalize.ts +32 -0
- package/src/pantheon/delegation.ts +235 -18
- package/src/pantheon/file-persistence-salvage.ts +64 -0
- package/src/pantheon/file-persistence.ts +194 -45
- package/src/pantheon/native-probe.ts +234 -0
- package/src/pantheon/native-task-status.ts +139 -0
- package/src/pantheon/provider-capabilities.ts +221 -0
- package/src/pantheon/provider-stream-tracker.ts +182 -0
- package/src/pantheon/shared-board.ts +37 -0
- package/src/pantheon/task-result-guard.ts +107 -0
- package/src/pantheon/token-opt.ts +146 -12
- package/src/pantheon/tool-ceiling.ts +159 -0
- package/src/pantheon/v2-events.ts +18 -1
- package/src/plugin-v2.ts +2 -14
- package/src/plugin.ts +28 -17
- package/src/plugins/pantheon-hooks.ts +51 -0
- package/src/plugins/tui/dist/server.d.ts +1 -1
- package/src/plugins/tui/dist/server.d.ts.map +1 -1
- package/src/plugins/tui/dist/server.js +1 -1
- package/src/plugins/tui/dist/server.js.map +1 -1
- package/src/plugins/tui/dist/tui.d.ts +116 -27
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +414 -150
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/dist/tui.tsx +447 -84
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/index.tsx +447 -84
- package/.pantheon/code-mode/.gitkeep +0 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-1.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-10.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-11.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-2.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-3.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-4.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-5.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-6.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-7.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-8.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-9.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/heartbeat.json +0 -8
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/session.json +0 -11
- package/src/pantheon/delegate-task-adapter.ts +0 -444
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ want useful structure without giving up control of their code.
|
|
|
8
8
|
[Português (Brasil)](README.pt-BR.md) ·
|
|
9
9
|
[Repository](https://github.com/ils15/pantheon-opencode) · [MIT License](LICENSE)
|
|
10
10
|
|
|
11
|
-
[](https://github.com/ils15/pantheon-opencode/releases/
|
|
11
|
+
[](https://github.com/ils15/pantheon-opencode/releases/latest)
|
|
12
12
|
[](https://github.com/ils15/pantheon-opencode/actions)
|
|
13
13
|
[](https://doi.org/10.5281/zenodo.22306637)
|
|
14
14
|
|
|
@@ -30,7 +30,7 @@ way to plan work, make progress, check results, and keep useful project context.
|
|
|
30
30
|
|
|
31
31
|
## Start in 2 minutes
|
|
32
32
|
|
|
33
|
-
Requirements: [OpenCode 1.18.4+](https://opencode.ai/docs/) and Node.js
|
|
33
|
+
Requirements: [OpenCode 1.18.4+](https://opencode.ai/docs/) and Node.js 22+.
|
|
34
34
|
|
|
35
35
|
From the project where you want to use Pantheon:
|
|
36
36
|
|
|
@@ -70,13 +70,94 @@ clear handoff between stages of work.
|
|
|
70
70
|
|
|
71
71
|
## Status
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
Operational checkout version: **v1.5.0-beta.2** (candidate; publication is not
|
|
74
|
+
asserted here). Pantheon is designed for OpenCode and depends on the
|
|
75
|
+
availability and configuration of OpenCode and any optional services you choose
|
|
76
|
+
to use. Check the [releases](https://github.com/ils15/pantheon-opencode/releases)
|
|
77
|
+
and [changelog](CHANGELOG.md) for the latest published changes.
|
|
78
|
+
|
|
79
|
+
## Delegation engines (legacy default, native opt-in)
|
|
80
|
+
|
|
81
|
+
Pantheon exposes two delegation engines behind one tool surface:
|
|
82
|
+
|
|
83
|
+
- **Legacy (default)** — `pantheon_delegate`, the original engine registered by
|
|
84
|
+
the V1 plugin. No configuration is required.
|
|
85
|
+
- **Native (opt-in, experimental)** — OpenCode's native `task()` child-session
|
|
86
|
+
engine, selected with `PANTHEON_DELEGATE_MODE=native`. Native is strict: it
|
|
87
|
+
does not use foreground fallback, model failover, or retry; it performs a
|
|
88
|
+
lazy capability probe on the first dispatch and includes the resulting
|
|
89
|
+
status in the delegation receipt.
|
|
90
|
+
|
|
91
|
+
Legacy stays the default for v1.5.x; native is not promoted to default until
|
|
92
|
+
v1.6. See [ADR-0011](.pantheon/memory-bank/adr/0011-delegation-engine-contract.md)
|
|
93
|
+
(Proposed) for the engine contract, rationale, and migration prerequisites.
|
|
94
|
+
|
|
95
|
+
**Kill-switch:** set `PANTHEON_DELEGATION=off` (case-insensitive) to disable
|
|
96
|
+
delegation entirely. The switch covers **both** engines — the legacy
|
|
97
|
+
`pantheon_delegate`/read/list tools throw, and the native manager throws too.
|
|
98
|
+
|
|
99
|
+
## Cost tool backend
|
|
100
|
+
|
|
101
|
+
`pantheon_cost` prefers a read-only `node:sqlite` backend against the selected
|
|
102
|
+
`opencode.db`. When `node:sqlite` is unavailable in the host runtime (for
|
|
103
|
+
example under Bun), the tool falls back to spawning `node scripts/cost.mjs` as
|
|
104
|
+
a read-only subprocess. The fallback resolves a real Node.js binary —
|
|
105
|
+
`PANTHEON_NODE` first, then `node` on `PATH` — verifies it supports
|
|
106
|
+
`node:sqlite` (Node.js >= 22.5), and runs the script with an argument array,
|
|
107
|
+
never a shell. If neither source resolves, the tool returns `status:
|
|
108
|
+
UNSUPPORTED`. Database failures return a contract status such as `UNAVAILABLE`
|
|
109
|
+
or `CORRUPT_DATA` and include diagnostic detail, including captured stderr when
|
|
110
|
+
available.
|
|
77
111
|
|
|
112
|
+
| Variable | Default | Purpose |
|
|
113
|
+
|----------|---------|---------|
|
|
114
|
+
| `PANTHEON_NODE` | `node` from `PATH` | Path to a Node.js >= 22.5 binary used by the CLI fallback; an explicit path must exist and be executable, otherwise the tool fails fast instead of ignoring the override |
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Code-mode execution (explicit opt-in)
|
|
118
|
+
|
|
119
|
+
Scripts run through the `pantheon-code-mode` MCP server (`execute_code_script`)
|
|
120
|
+
only when they are explicitly approved. Approval is recorded in
|
|
121
|
+
`.pantheon/code-mode/manifest.json` with the SHA-256 of each script:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"version": 1,
|
|
126
|
+
"scripts": {
|
|
127
|
+
"example-sync.sh": "<sha256>"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- **No manifest → nothing executes.** A missing manifest returns
|
|
133
|
+
`INVALID_STATE`; scripts are never run implicitly.
|
|
134
|
+
- **Not listed → `CONFLICT`.** The script must be approved first.
|
|
135
|
+
- **Hash mismatch → `CORRUPT_DATA`.** The SHA-256 of the file on disk must
|
|
136
|
+
match the manifest entry, so edits after approval are detected.
|
|
137
|
+
|
|
138
|
+
Approve or re-approve a script with the `approve_code_script` MCP tool:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
approve_code_script("checkpoint-session.sh")
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The installer seeds the manifest with the SHA-256 of every bundled script, so
|
|
145
|
+
shipped scripts stay approved across installs. Re-run `approve_code_script`
|
|
146
|
+
after intentionally editing a script. Status codes follow the shared nine-code
|
|
147
|
+
contract (`OK`, `UNSUPPORTED`, `UNAVAILABLE`, `INVALID_INPUT`, `INVALID_STATE`,
|
|
148
|
+
`CONFLICT`, `CORRUPT_DATA`, `TIMEOUT`, `ESCALATE`); with `json_output=true`,
|
|
149
|
+
results carry a `status` field.
|
|
78
150
|
|
|
79
|
-
|
|
151
|
+
Code-mode resolves project-first: `.opencode/.pantheon/code-mode` is preferred,
|
|
152
|
+
then `.pantheon/code-mode`. `PANTHEON_PROJECT` overrides the working directory,
|
|
153
|
+
and the installed MCP uses `cwd: "."` so OpenCode supplies the workspace. A
|
|
154
|
+
global directory is used only when no usable project directory is available;
|
|
155
|
+
once a project directory is selected, a missing or corrupt manifest fails
|
|
156
|
+
closed instead of falling back. `doctor` validates the manifest and every
|
|
157
|
+
script's SHA-256 without regenerating it.
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## What's new in 1.5.0-beta.2
|
|
80
161
|
|
|
81
162
|
- OpenCode-only installer: platform guides consolidated into a single
|
|
82
163
|
[OpenCode guide](docs/platforms/opencode.md).
|
|
@@ -90,9 +171,12 @@ and [changelog](CHANGELOG.md) for the latest changes.
|
|
|
90
171
|
- Sandbox validator for global installs (`scripts/test-opencode-v1-v2-sandbox.sh`)
|
|
91
172
|
covering OpenCode V1/V2 side by side — see
|
|
92
173
|
[Sandbox validation](#sandbox-validation-v1v2).
|
|
174
|
+
- Beta2 agent-economy policy: direct native delegation, bounded compaction
|
|
175
|
+
carry-forward, compact context encoding, and quality floors — see
|
|
176
|
+
[Beta2 agent economy policy](docs/ws3-token-opt-measurements.md#beta2-agent-economy-policy).
|
|
93
177
|
- A `--prompts` installer flag is planned for a future release.
|
|
94
178
|
|
|
95
|
-
## OpenCode V1/V2 — Dual Version (1.5.0)
|
|
179
|
+
## OpenCode V1/V2 — Dual Version (1.5.0-beta.2)
|
|
96
180
|
|
|
97
181
|
Pantheon has two **exclusive** OpenCode plugin contracts. Ordinary OpenCode
|
|
98
182
|
configuration may be shared, but the Pantheon plugin registration is selected
|
|
@@ -150,9 +234,56 @@ The installer still writes the compatibility settings required by the selected
|
|
|
150
234
|
OpenCode host, such as `experimental.subagent_depth`; this does not convert a
|
|
151
235
|
V1 plugin into V2 or provide V2 with V1 hooks.
|
|
152
236
|
|
|
153
|
-
##
|
|
237
|
+
## Updating between releases (beta.5+)
|
|
238
|
+
|
|
239
|
+
One command keeps an existing installation current:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Without a global install, ALWAYS pin the dist-tag — plain `npx
|
|
243
|
+
# pantheon-opencode` resolves `latest`, which is the stable release (1.4.3):
|
|
244
|
+
npx pantheon-opencode@beta update # npm beta channel + config refresh
|
|
245
|
+
npx pantheon-opencode@beta update --stable # stable channel instead
|
|
246
|
+
|
|
247
|
+
# With a global install, use the global bin (defaults to the beta channel):
|
|
248
|
+
pantheon-opencode update
|
|
249
|
+
```
|
|
154
250
|
|
|
155
|
-
|
|
251
|
+
`update` compares your installed version with the npm dist-tag, runs
|
|
252
|
+
`npm install -g pantheon-opencode@<channel>`, then re-runs `init --yes
|
|
253
|
+
--headless` so config merges, the venv and MCP entries match the new package.
|
|
254
|
+
Two freshness guarantees back it up:
|
|
255
|
+
|
|
256
|
+
- **Postinstall artifact sync** — after any `npm install`, copy-only artifacts
|
|
257
|
+
(agents, skills, AGENTS.md, commands, MCP scripts, code-mode payload) are
|
|
258
|
+
refreshed into the existing config dir automatically; you never have to
|
|
259
|
+
re-run `init` just for file copies.
|
|
260
|
+
- **Drift detection** — the installer stamps the installed version in
|
|
261
|
+
`.pantheon/install-state.json` and `doctor` warns when the package is newer
|
|
262
|
+
than the last sync, pointing at `update`.
|
|
263
|
+
|
|
264
|
+
`init` also gained `--components agents,skills,...` (narrow install),
|
|
265
|
+
`--clean` (alias of `--force`), `--opencode-version auto`, atomic config
|
|
266
|
+
writes with an `opencode.json.bak` backup, preflight checks for python3/npm
|
|
267
|
+
before any file is written, and a non-fatal Python runtime: if the venv fails,
|
|
268
|
+
the install completes but MCP entries are omitted (with a warning) instead of
|
|
269
|
+
pointing at a broken interpreter. Installer messages auto-detect pt-BR via
|
|
270
|
+
`LANG`/`LC_ALL`.
|
|
271
|
+
|
|
272
|
+
## Releases
|
|
273
|
+
|
|
274
|
+
Publication is authorized **only** by an explicit `workflow_dispatch` of the
|
|
275
|
+
`Release` workflow (`release_channel` input selects beta or stable). PR labels,
|
|
276
|
+
pushes, merges, and tags never publish anything, and every validation gate is
|
|
277
|
+
fail-closed: only an explicit PASS authorizes release evidence. See
|
|
278
|
+
[docs/RELEASING.md](docs/RELEASING.md) for validation and recovery details.
|
|
279
|
+
|
|
280
|
+
Release validation keeps each manifest with its lockfile: the root
|
|
281
|
+
`package.json` + `package-lock.json` and the TUI
|
|
282
|
+
`src/plugins/tui/package.json` + `src/plugins/tui/package-lock.json`. Both use
|
|
283
|
+
`npm ci --ignore-scripts`; an `npm ci` failure blocks the run and there is no
|
|
284
|
+
`npm install` fallback. A release carries one `.tgz` tarball, computes the
|
|
285
|
+
SHA-256 of that same artifact, and binds the tarball and GitHub release to the
|
|
286
|
+
full `TARGET_SHA`; a second pack is not interchangeable.
|
|
156
287
|
|
|
157
288
|
## Sandbox validation (V1/V2)
|
|
158
289
|
|
|
@@ -161,9 +292,9 @@ package as a real user inside an isolated sandbox (own `HOME`, npm prefix and
|
|
|
161
292
|
venv) — never the dev environment. It checks OpenCode V1 (`opencode`) and V2
|
|
162
293
|
(`opencode2`) side by side: binaries, MCP connectivity, `doctor`, and — with
|
|
163
294
|
`--prompts` — a prompt battery covering the `pantheon://agents` resource,
|
|
164
|
-
memory store/recall, filesystem writes and agent delegation.
|
|
165
|
-
|
|
166
|
-
|
|
295
|
+
memory store/recall, filesystem writes and agent delegation. The gate is
|
|
296
|
+
fail-closed: every required check must return an explicit PASS; timeouts,
|
|
297
|
+
auth/network/provider failures and missing prerequisites block the run.
|
|
167
298
|
|
|
168
299
|
```bash
|
|
169
300
|
scripts/test-opencode-v1-v2-sandbox.sh --prepare # tarball + install + init in the sandbox
|
|
@@ -177,6 +308,9 @@ Modes are combinable (e.g. `--prepare --run v1 --prompts`). Binaries are
|
|
|
177
308
|
resolved strictly inside the sandbox npm prefix — a non-prepared sandbox fails
|
|
178
309
|
fast instead of silently testing the host installation.
|
|
179
310
|
|
|
311
|
+
This validates the prepared isolated sandbox only. A PASS is not proof of
|
|
312
|
+
support for every real host or for host configurations that were not exercised.
|
|
313
|
+
|
|
180
314
|
Env overrides:
|
|
181
315
|
|
|
182
316
|
| Variable | Default | Purpose |
|
|
@@ -190,6 +324,26 @@ Env overrides:
|
|
|
190
324
|
Exit codes: `0` no real failures · `1` real failure (see `prompts-report.md`
|
|
191
325
|
in the sandbox root) · `2` usage error · `3` sandbox not prepared.
|
|
192
326
|
|
|
327
|
+
### Intentional memory MCP divergence
|
|
328
|
+
|
|
329
|
+
`scripts/memory_mcp_server.py` and `src/mcp/memory_mcp_server.py` are
|
|
330
|
+
intentionally different. The standalone `scripts/` copy keeps the lightweight
|
|
331
|
+
`memory_*` contract; the installed `src/mcp/` copy additionally exposes the
|
|
332
|
+
optional codemap schema and `code_index`, `code_query`, and `code_neighbors`.
|
|
333
|
+
The other shared MCP copies remain identical. Do not overwrite one memory copy
|
|
334
|
+
with the other.
|
|
335
|
+
|
|
336
|
+
### Task-result guard
|
|
337
|
+
|
|
338
|
+
A `task-result-guard` intercepts calls to the native `task()` tool where the
|
|
339
|
+
child session returns an empty or missing result. Instead of surfacing a silent
|
|
340
|
+
`completed` with no payload (which confuses the orchestrator), the guard now
|
|
341
|
+
raises an explicit error. This catches the common free-tier failure mode where a
|
|
342
|
+
child session exceeds the uncached-prefill token budget (`BackendAdmissionRejected`)
|
|
343
|
+
and returns nothing. For large payloads, prefer `pantheon_delegate` over native
|
|
344
|
+
`task()` — the delegation layer has better timeout and error handling.
|
|
345
|
+
|
|
346
|
+
|
|
193
347
|
## Documentation
|
|
194
348
|
|
|
195
349
|
- [Installation](docs/INSTALLATION.md) · [Quick start](docs/QUICKSTART.md)
|
|
@@ -207,9 +361,10 @@ or pull request.
|
|
|
207
361
|
|
|
208
362
|
## Citation and DOI
|
|
209
363
|
|
|
210
|
-
Pantheon is released under the [MIT License](LICENSE). For the
|
|
211
|
-
record, use the [Zenodo DOI](https://doi.org/10.5281/zenodo.22306637);
|
|
212
|
-
metadata is also available
|
|
364
|
+
Pantheon is released under the [MIT License](LICENSE). For the historical
|
|
365
|
+
published v1.4.3 record only, use the [Zenodo DOI](https://doi.org/10.5281/zenodo.22306637);
|
|
366
|
+
it is not the current operational version. Citation metadata is also available
|
|
367
|
+
in [CITATION.cff](CITATION.cff).
|
|
213
368
|
|
|
214
369
|
Canonical repository: <https://github.com/ils15/pantheon-opencode>
|
|
215
370
|
|
package/README.pt-BR.md
CHANGED
|
@@ -8,7 +8,7 @@ e equipes que querem mais estrutura sem perder o controle do próprio código.
|
|
|
8
8
|
[English](README.md) ·
|
|
9
9
|
[Repositório](https://github.com/ils15/pantheon-opencode) · [Licença MIT](LICENSE)
|
|
10
10
|
|
|
11
|
-
[](https://github.com/ils15/pantheon-opencode/releases/
|
|
11
|
+
[](https://github.com/ils15/pantheon-opencode/releases/latest)
|
|
12
12
|
[](https://github.com/ils15/pantheon-opencode/actions)
|
|
13
13
|
[](https://doi.org/10.5281/zenodo.22306637)
|
|
14
14
|
|
|
@@ -71,13 +71,39 @@ verificações repetíveis e passagens claras entre etapas do trabalho.
|
|
|
71
71
|
|
|
72
72
|
## Status
|
|
73
73
|
|
|
74
|
-
Versão
|
|
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
|
|
75
76
|
disponibilidade e da configuração do OpenCode e dos serviços opcionais que você
|
|
76
77
|
escolher. Veja as [releases](https://github.com/ils15/pantheon-opencode/releases)
|
|
77
|
-
e o [changelog](CHANGELOG.md) para acompanhar as mudanças.
|
|
78
|
+
e o [changelog](CHANGELOG.md) para acompanhar as mudanças publicadas.
|
|
78
79
|
|
|
79
80
|
|
|
80
|
-
##
|
|
81
|
+
## Execução code-mode (opt-in explícito)
|
|
82
|
+
|
|
83
|
+
Scripts executados pelo MCP server `pantheon-code-mode` (`execute_code_script`)
|
|
84
|
+
só rodam quando aprovados explicitamente. A aprovação fica em
|
|
85
|
+
`.pantheon/code-mode/manifest.json` com o SHA-256 de cada script.
|
|
86
|
+
|
|
87
|
+
- **Sem manifest → nada executa** (`INVALID_STATE`); nunca há execução implícita.
|
|
88
|
+
- **Script fora do manifest → `CONFLICT`**; é preciso aprovar antes.
|
|
89
|
+
- **Hash divergente → `CORRUPT_DATA`**; edições após a aprovação são detectadas.
|
|
90
|
+
|
|
91
|
+
Aprove (ou reaprove) um script com a tool `approve_code_script`. O instalador
|
|
92
|
+
semeia o manifest com o hash de todos os scripts empacotados. Os resultados
|
|
93
|
+
seguem o contrato de nove códigos (`OK`, `UNSUPPORTED`, `UNAVAILABLE`,
|
|
94
|
+
`INVALID_INPUT`, `INVALID_STATE`, `CONFLICT`, `CORRUPT_DATA`, `TIMEOUT`,
|
|
95
|
+
`ESCALATE`) e, com `json_output=true`, incluem o campo `status`.
|
|
96
|
+
|
|
97
|
+
O code-mode resolve primeiro o projeto: `.opencode/.pantheon/code-mode` vem
|
|
98
|
+
antes de `.pantheon/code-mode`. `PANTHEON_PROJECT` sobrescreve o diretório de
|
|
99
|
+
trabalho, e o MCP instalado usa `cwd: "."` para receber o workspace do
|
|
100
|
+
OpenCode. O diretório global só é usado sem um diretório de projeto utilizável;
|
|
101
|
+
depois de selecionar um diretório de projeto, manifest ausente ou corrompido
|
|
102
|
+
falha fechado, sem fallback silencioso. O `doctor` valida o manifest e o
|
|
103
|
+
SHA-256 de cada script sem regenerá-lo.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Novidades da 1.5.0-beta.2
|
|
81
107
|
|
|
82
108
|
- Instalador exclusivo para OpenCode: guias de plataformas consolidados em um
|
|
83
109
|
único [guia OpenCode](docs/platforms/opencode.md).
|
|
@@ -93,7 +119,7 @@ e o [changelog](CHANGELOG.md) para acompanhar as mudanças.
|
|
|
93
119
|
lado — veja [Validação em sandbox](#validação-em-sandbox-v1v2).
|
|
94
120
|
- A flag `--prompts` do instalador está planejada para uma release futura.
|
|
95
121
|
|
|
96
|
-
## OpenCode V1/V2 — Versão dupla (1.5.0)
|
|
122
|
+
## OpenCode V1/V2 — Versão dupla (1.5.0-beta.2)
|
|
97
123
|
|
|
98
124
|
O Pantheon tem dois contratos de plugin OpenCode **exclusivos**. A configuração
|
|
99
125
|
comum do OpenCode pode ser compartilhada, mas o registro do plugin Pantheon é
|
|
@@ -141,7 +167,7 @@ instalador remove referências Pantheon das duas formas de config antes de
|
|
|
141
167
|
gravar apenas o registro Pantheon selecionado. Entradas de terceiros não são
|
|
142
168
|
convertidas nem reivindicadas por essa regra.
|
|
143
169
|
|
|
144
|
-
O relatório `pantheon_cost
|
|
170
|
+
O relatório `pantheon_cost`, disponível nos plugins V1 e V2, pode selecionar o banco com
|
|
145
171
|
`PANTHEON_OPENCODE_VERSION=v1` ou `v2` (`opencode.db` ou `opencode-v2.db`).
|
|
146
172
|
`PANTHEON_COST_DB=/caminho/absoluto/para/opencode.db` tem precedência sobre o
|
|
147
173
|
seletor de versão, e um `dbPath` explícito fornecido pelo chamador da
|
|
@@ -153,9 +179,55 @@ O instalador continua gravando as configurações de compatibilidade exigidas
|
|
|
153
179
|
pelo host OpenCode selecionado, como `experimental.subagent_depth`; isso não
|
|
154
180
|
converte um plugin V1 em V2 nem dá hooks V1 ao V2.
|
|
155
181
|
|
|
156
|
-
##
|
|
182
|
+
## Atualizando entre releases (beta.5+)
|
|
183
|
+
|
|
184
|
+
Um comando mantém uma instalação existente em dia:
|
|
157
185
|
|
|
158
|
-
|
|
186
|
+
```bash
|
|
187
|
+
# Sem instalação global, SEMPRE fixe o dist-tag — `npx pantheon-opencode`
|
|
188
|
+
# puro resolve a tag `latest`, que é o release estável (1.4.3):
|
|
189
|
+
npx pantheon-opencode@beta update # canal beta do npm + refresh do config
|
|
190
|
+
npx pantheon-opencode@beta update --stable # canal estável
|
|
191
|
+
|
|
192
|
+
# Com instalação global, use o bin global (o padrão é o canal beta):
|
|
193
|
+
pantheon-opencode update
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
O `update` compara a versão instalada com o dist-tag do npm, roda
|
|
197
|
+
`npm install -g pantheon-opencode@<canal>` e re-executa `init --yes
|
|
198
|
+
--headless` para alinhar merge de config, venv e entradas de MCP com o novo
|
|
199
|
+
pacote. Duas garantias de freshness sustentam isso:
|
|
200
|
+
|
|
201
|
+
- **Sync de artifacts no postinstall** — depois de qualquer `npm install`, os
|
|
202
|
+
artefatos de cópia (agents, skills, AGENTS.md, commands, scripts MCP,
|
|
203
|
+
payload code-mode) são atualizados automaticamente no config dir existente;
|
|
204
|
+
você nunca precisa re-rodar `init` só para atualizar arquivos.
|
|
205
|
+
- **Detecção de drift** — o instalador grava a versão instalada em
|
|
206
|
+
`.pantheon/install-state.json` e o `doctor` avisa quando o pacote é mais
|
|
207
|
+
novo que o último sync, apontando para o `update`.
|
|
208
|
+
|
|
209
|
+
O `init` também ganhou `--components agents,skills,...` (instalação enxuta),
|
|
210
|
+
`--clean` (alias de `--force`), `--opencode-version auto`, escrita atômica do
|
|
211
|
+
config com backup em `opencode.json.bak`, pré-checagens de python3/npm antes
|
|
212
|
+
de escrever qualquer arquivo e runtime Python não-fatal: se a venv falha, a
|
|
213
|
+
instalação completa mas as entradas MCP ficam de fora (com aviso) em vez de
|
|
214
|
+
apontar para um interpretador quebrado.
|
|
215
|
+
|
|
216
|
+
## Releases
|
|
217
|
+
|
|
218
|
+
A publicação é autorizada **somente** por um `workflow_dispatch` explícito do
|
|
219
|
+
workflow `Release` (o input `release_channel` escolhe beta ou stable). Labels
|
|
220
|
+
de PR, push, merge e tag nunca publicam nada, e todos os gates de validação são
|
|
221
|
+
fail-closed: somente um PASS explícito autoriza release evidence. Consulte
|
|
222
|
+
[docs/RELEASING.md](docs/RELEASING.md) para detalhes de validação e recuperação.
|
|
223
|
+
|
|
224
|
+
A validação mantém cada manifest junto do seu lockfile: o root
|
|
225
|
+
`package.json` + `package-lock.json` e o TUI
|
|
226
|
+
`src/plugins/tui/package.json` + `src/plugins/tui/package-lock.json`. Ambos usam
|
|
227
|
+
`npm ci --ignore-scripts`; uma falha em `npm ci` bloqueia a execução e não há
|
|
228
|
+
fallback para `npm install`. Uma release carrega um único tarball `.tgz`, calcula
|
|
229
|
+
o SHA-256 desse mesmo artefato e vincula o tarball e o GitHub Release ao
|
|
230
|
+
`TARGET_SHA` completo; um segundo pack não é intercambiável.
|
|
159
231
|
|
|
160
232
|
## Validação em sandbox (V1/V2)
|
|
161
233
|
|
|
@@ -165,8 +237,9 @@ prefix npm e venv próprios) — nunca o ambiente de desenvolvimento. Ele verifi
|
|
|
165
237
|
OpenCode V1 (`opencode`) e V2 (`opencode2`) lado a lado: binários, conectividade
|
|
166
238
|
MCP, `doctor` e — com `--prompts` — uma bateria de prompts cobrindo o recurso
|
|
167
239
|
`pantheon://agents`, memory store/recall, escrita no filesystem e delegação de
|
|
168
|
-
agente.
|
|
169
|
-
|
|
240
|
+
agente. O gate é fail-closed: todo check obrigatório precisa terminar em PASS
|
|
241
|
+
explícito; timeout, falha de auth/rede/provider e pré-requisitos ausentes
|
|
242
|
+
bloqueiam a execução.
|
|
170
243
|
|
|
171
244
|
```bash
|
|
172
245
|
scripts/test-opencode-v1-v2-sandbox.sh --prepare # tarball + install + init no sandbox
|
|
@@ -180,6 +253,9 @@ Os modos são combináveis (ex.: `--prepare --run v1 --prompts`). Os binários s
|
|
|
180
253
|
resolvidos estritamente dentro do prefix npm do sandbox — um sandbox não
|
|
181
254
|
preparado falha rápido em vez de testar silenciosamente a instalação do host.
|
|
182
255
|
|
|
256
|
+
Isso valida somente o sandbox isolado e preparado. Um PASS não prova suporte
|
|
257
|
+
para todo host real nem para configurações de host que não foram exercitadas.
|
|
258
|
+
|
|
183
259
|
Variáveis de ambiente:
|
|
184
260
|
|
|
185
261
|
| Variável | Padrão | Finalidade |
|
|
@@ -194,6 +270,15 @@ Códigos de saída: `0` sem falhas reais · `1` falha real (veja
|
|
|
194
270
|
`prompts-report.md` na raiz do sandbox) · `2` erro de uso · `3` sandbox não
|
|
195
271
|
preparado.
|
|
196
272
|
|
|
273
|
+
### Divergência intencional do memory MCP
|
|
274
|
+
|
|
275
|
+
`scripts/memory_mcp_server.py` e `src/mcp/memory_mcp_server.py` são
|
|
276
|
+
intencionalmente diferentes. A cópia independente em `scripts/` mantém o
|
|
277
|
+
contrato leve de `memory_*`; a cópia instalada em `src/mcp/` também expõe o
|
|
278
|
+
schema opcional de codemap e `code_index`, `code_query` e `code_neighbors`. As
|
|
279
|
+
outras cópias compartilhadas permanecem idênticas. Não sobrescreva uma cópia de
|
|
280
|
+
memória com a outra.
|
|
281
|
+
|
|
197
282
|
## Documentação
|
|
198
283
|
|
|
199
284
|
- [Instalação](docs/INSTALLATION.md) · [Início rápido](docs/QUICKSTART.md)
|
|
@@ -211,9 +296,10 @@ uma issue ou pull request.
|
|
|
211
296
|
|
|
212
297
|
## Citação e DOI
|
|
213
298
|
|
|
214
|
-
O Pantheon é distribuído sob a [Licença MIT](LICENSE). Para o registro
|
|
215
|
-
da v1.4.3, use o [DOI do Zenodo](https://doi.org/10.5281/zenodo.22306637);
|
|
216
|
-
metadados de citação também estão em
|
|
299
|
+
O Pantheon é distribuído sob a [Licença MIT](LICENSE). Para o registro histórico
|
|
300
|
+
publicado da v1.4.3 apenas, use o [DOI do Zenodo](https://doi.org/10.5281/zenodo.22306637);
|
|
301
|
+
essa não é a versão operacional atual. Os metadados de citação também estão em
|
|
302
|
+
[CITATION.cff](CITATION.cff).
|
|
217
303
|
|
|
218
304
|
Repositório canônico: <https://github.com/ils15/pantheon-opencode>
|
|
219
305
|
|