diff --git a/.dev-brain/STATE.md b/.dev-brain/STATE.md index 8f9159b..f84e5d0 100644 --- a/.dev-brain/STATE.md +++ b/.dev-brain/STATE.md @@ -5,7 +5,7 @@ Updated: 2026-11-23 Plugin (Claude Code, plus an OpenCode adapter) for readable, maintainable code at the lowest context cost — acceptance: installs from GitHub with two commands, every claim backed by `evals/` evidence, measured benefit on real tasks. ## Done (latest first, max 5) -- Plugin 2.4.0 on branch `feat/opencode-adapter`, PR #9 open and not merged: Codex and Copilot support removed (user decision), OpenCode adapter `adapters/opencode/index.ts` added — evidence: `python3 evals/offline/check.py` ALL PASS (20 checks: 11 Claude Code 2.1.325, 9 OpenCode 2.3.2), six adapter mutations each FAIL the intended check; PR #9 CI success on both jobs (newest: Claude Code 2.1.330, OpenCode 2.4.0) +- Plugin 2.4.0 merged (PR #9, 2fc3c7e): Codex and Copilot support removed (user decision), OpenCode adapter `adapters/opencode/index.ts` added — evidence: `python3 evals/offline/check.py` ALL PASS (20 checks: 11 Claude Code 2.1.325, 9 OpenCode 2.3.2), six adapter mutations each FAIL the intended check; PR #9 CI success on both jobs (newest: Claude Code 2.1.330, OpenCode 2.4.0) - Plugin 2.2.1 merged (PR #6): `handoff` stops writing branch/HEAD/commit status, CI pin 2.1.325 plus a newest-release job — evidence: CI success on both jobs; weekly schedule NOT RUN until it first fires - Offline check on GitHub Actions for every PR — evidence: PR #5 run `offline-check` success, ALL PASS on a clean runner - Plugin 2.2.0 merged (PR #4): minimal `start`, review passes the Goal line, reviewer checks weakened tests — evidence: `python3 evals/offline/check.py` ALL PASS on a clean clone of main (0d01d2b) @@ -14,12 +14,12 @@ Plugin (Claude Code, plus an OpenCode adapter) for readable, maintainable code a - Benefit of the rules on real code — status: NOT RUN; `claude plugin eval` (with/without plugin) would measure it but needs the user's credentials and tokens - Minimal `start` with a real model — status: partly seen on Presidio (deny rules and Stop hook adopted, `AGENTS.md` kept, not trimmed); its deletion-candidate list not seen - Opus 5.5 system card read only through secondary reports (PDF unreachable here) -- OpenCode TUI (the interactive ask prompt, `@start`) and OpenCode 1.x — status: NOT RUN (the TUI cannot be driven here) +- OpenCode 1.x — status: NOT RUN; the TUI cannot be driven here (the user's own trial of `@start` and the commit prompt is the only evidence) ## Known pre-existing failures - none ## Next (max 3) -1. User: review the PR; after merging, add `adapters/opencode` to `plugins` in `opencode.json`, run `opencode debug agents` (must list `reviewer`), then try `@start` and a commit in the TUI. +1. Nothing pending for OpenCode: the user ran `@start` and the commit prompt in the TUI (reported working, version not recorded). 2. User decision: draft a `claude plugin eval` suite (authorization, weakened tests, `start` size) and run it with `--max-cost-usd`. 3. Collect Presidio feedback: `/context all` from a fresh session, the `start` candidate list; change only what repeats twice. diff --git a/AGENTS.md b/AGENTS.md index 13a9237..ae624db 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,7 @@ Its primary goal is readable, maintainable code across languages and frameworks. - `core/bin/dev-brain-guard` — `PreToolUse` hook that answers "ask" for git commands changing history, branches or the remote; keep its list in sync with the Authorization rules in `core/AGENTS.md`. - `adapters/opencode/index.ts` — OpenCode has no plugin marketplace, so this one file runs `dev-brain-context` and `dev-brain-guard`, registers `core/skills` and builds the reviewer from `core/agents/reviewer.md`. It holds no rule of its own: change the rule in `core/`, not here. Its one extra line of policy is the reviewer's denial of redirections, which OpenCode's shell matcher does not parse. - `core/.claude-plugin/plugin.json` — bump `version` on every change so installed copies refresh. `.claude-plugin/marketplace.json` at the root lists the plugin. -- `evals/` — scenarios, measured results, and `offline/check.py` with `offline/mock_model.py`, a zero-token check against the real Claude Code and OpenCode binaries. The OpenCode TUI cannot run here, so it is untested. +- `evals/` — scenarios, measured results, and `offline/check.py` with `offline/mock_model.py`, a zero-token check against the real Claude Code and OpenCode binaries. The OpenCode TUI cannot run here; only the maintainer's own trial covers it. ## Changing the harness diff --git a/MANUALE.md b/MANUALE.md index 9444e3c..2436eed 100644 --- a/MANUALE.md +++ b/MANUALE.md @@ -112,7 +112,7 @@ La regola globale vieta commit, push, cambi di branch e comandi git distruttivi Vale anche dentro comandi concatenati (`git add -A && git commit …`), con opzioni globali (`git -C dir commit`), e anche se nelle tue impostazioni hai permesso git: la richiesta arriva comunque. I comandi in sola lettura (`status`, `diff`, `log`, `show`, `stash`, `reset `) passano senza chiedere. -Se rispondi sì, il commit avviene: la decisione resta tua, ed è il punto. Su OpenCode la richiesta compare nel TUI (la richiesta interattiva non è stata provata) e `opencode run` rifiuta (sezione 12). +Se rispondi sì, il commit avviene: la decisione resta tua, ed è il punto. Su OpenCode la richiesta compare nel TUI (provato nel TUI dal manutentore, versione non registrata) e `opencode run` rifiuta (sezione 12). --- @@ -239,15 +239,15 @@ Poi in `~/.config/opencode/opencode.json` (o nell'`opencode.json` di un progetto ``` - **Verifica:** `opencode debug agents` deve elencare `reviewer`. -- **Aggiornamento:** `git -C /percorso/agents-platform pull`. +- **Aggiornamento:** `git -C /percorso/agents-platform pull`, poi riavvia OpenCode; se `opencode service status` mostra un server in background attivo, riavvia anche quello con `opencode service restart` (qui ogni nuovo `opencode run` rileggeva i file modificati, ma un server rimasto acceso a lungo NON è stato provato). - **Rimozione:** togli la voce da `plugins`. | | Claude Code | OpenCode | | --- | --- | --- | | Regole e stato | ogni sessione | solo sessione principale, non i subagenti | -| Workflow | `/dev-brain:start` | `@start` nel prompt, oppure chiedi di caricare la skill `start` (la skill si carica per id: provato; la forma `@` segue la documentazione di OpenCode e NON è provata, serve il TUI) | +| Workflow | `/dev-brain:start` | `@start` nel prompt, oppure chiedi di caricare la skill `start` (la skill si carica per id: provato qui; la forma `@` ha funzionato nel TUI sulla macchina del manutentore, versione non registrata) | | Costo di contesto dei workflow | nullo | nullo: non compaiono nell'elenco delle skill | -| Commit, push, cambio di branch | chiede conferma | chiede conferma (la richiesta interattiva NON è stata provata); `opencode run` non può chiedere e rifiuta; `opencode run --auto` approva | +| Commit, push, cambio di branch | chiede conferma | chiede conferma (provato nel TUI dal manutentore, versione non registrata); `opencode run` non può chiedere e rifiuta; `opencode run --auto` approva | | Reviewer | sola lettura, legge il diff con git | sola lettura, legge il diff con git; redirezioni e `--output` sono negati per nome perché il filtro dei comandi di OpenCode non le interpreta | **`--auto` annulla la guardia.** `opencode run --auto` approva ogni richiesta, comprese quelle di dev-brain: usalo solo dove accetti commit e push senza controllo. diff --git a/README.md b/README.md index 67afc7e..9382c3f 100644 --- a/README.md +++ b/README.md @@ -35,14 +35,14 @@ Then add the adapter to `plugins` in `~/.config/opencode/opencode.json` (or in a { "plugins": ["/path/to/agents-platform/adapters/opencode"] } ``` -Requires `python3` and `git`; without `python3` the adapter asks before every shell command. Update with `git -C /path/to/agents-platform pull`; remove by deleting the entry. Check the install with `opencode debug agents`: it must list `reviewer`. +Requires `python3` and `git`; without `python3` the adapter asks before every shell command. Update with `git -C /path/to/agents-platform pull`, then start OpenCode again; if `opencode service status` shows a running background server, `opencode service restart` it too (each new `opencode run` re-read the edited files here, but a long-running server was NOT RUN). Remove by deleting the entry. Check the install with `opencode debug agents`: it must list `reviewer`. | | Claude Code | OpenCode | | --- | --- | --- | | Rules and saved state | every session | main session only, not subagents | -| Workflow call | `/dev-brain:start` | `@start` in the prompt, or ask the agent to load the skill `start` (the skill tool loads it by id: tested; the `@` form follows the OpenCode docs and is NOT RUN, since it needs the TUI) | +| Workflow call | `/dev-brain:start` | `@start` in the prompt, or ask the agent to load the skill `start` (the skill tool loads it by id: tested here; the `@` form worked in the TUI on the maintainer's machine, OpenCode version not recorded) | | Workflows cost no context | yes | yes: not in the skill listing | -| Commit, push, branch change | asks you | asks you (the interactive prompt is NOT RUN); `opencode run` cannot ask and refuses; `opencode run --auto` approves it | +| Commit, push, branch change | asks you | asks you (seen in the TUI on the maintainer's machine, version not recorded); `opencode run` cannot ask and refuses; `opencode run --auto` approves it | | Reviewer | read-only, reads the diff with git | read-only, reads the diff with git; redirections and `--output` are denied by name because OpenCode's shell matcher does not parse them | Tested versions: OpenCode 2.3.2 here and in CI, and 2.4.0 in CI (the newest release when written), through the V2 plugin API; OpenCode 1.x is NOT RUN. The workflow names below are written for Claude Code (`/dev-brain:`); in OpenCode use the bare name (`@start`). diff --git a/evals/results.md b/evals/results.md index 0f47e87..f564d88 100644 --- a/evals/results.md +++ b/evals/results.md @@ -22,7 +22,7 @@ Needed an adapter (`adapters/opencode/index.ts`, no rule of its own): Evidence: `python3 evals/offline/check.py` ALL PASS, 20 checks (11 Claude Code 2.1.325, 9 OpenCode 2.3.2), about 26 s: rules and state reach the main session and not the subagent, workflows are out of the skill listing and load by id, the reviewer reads the diff and 5 write attempts (`>`, `--output`, `rm`, `$(...)`, backticks) are rejected, `git status` runs while commit and push are refused with a git identity present, and an oversized state becomes a notice. Six mutations each failed the intended check: no context hook, context for subagents, no guard, no redirection denies (3/5 rejected), workflows offered, no reviewer. The adapter type-checks against the 2.3.2 plugin types. On GitHub Actions (pull request #9): pinned job success; manual run of the branch, both jobs success, and `latest` resolved to Claude Code 2.1.330 and OpenCode 2.4.0, so 2.4.0 also passes all 20 checks. -Limits: the TUI is NOT RUN, so the interactive "ask" prompt and the `@start` mention are untested (in `opencode run` an ask is rejected and `@start` is not expanded). `opencode run --auto` approves the guard's ask (observed: the commit ran); it is the equivalent of Claude Code's bypass mode. OpenCode 1.x is NOT RUN. The hook shapes come from 2.3.2 behavior and type declarations, not a stability promise: CI pins 2.3.2 on pull requests and runs `@latest` weekly to see a change. No real model was used. Install is by path (`plugins` in `opencode.json`), because the adapter lives in a repository that is not an npm package; `opencode plugin add` takes npm or git packages and was not used. +Limits: the TUI cannot run here (in `opencode run` an ask is rejected and `@start` is not expanded). Later the same day the user ran both in the TUI on their machine and answered yes to "did `@start` load the workflow" and "did the commit raise the guard's prompt"; I did not see the output, and the OpenCode version was not recorded. `opencode run --auto` approves the guard's ask (observed: the commit ran); it is the equivalent of Claude Code's bypass mode. OpenCode 1.x is NOT RUN. The hook shapes come from 2.3.2 behavior and type declarations, not a stability promise: CI pins 2.3.2 on pull requests and runs `@latest` weekly to see a change. No real model was used. On the user's own machine (user-run, same day) the adapter was installed by path from `main` and `opencode debug agents` listed `reviewer` with the prompt from `core/agents/reviewer.md`. Update: every new `opencode run` re-read edited `core/` files and `index.ts` (rules, state, reviewer and skill descriptions), but `opencode service status` showed the background server stopped between runs, so a long-running server was not exercised. Install is by path (`plugins` in `opencode.json`), because the adapter lives in a repository that is not an npm package; `opencode plugin add` takes npm or git packages and was not used. ## 2026-11-20 — Codex CLI and Copilot (CLI) support, plugin 2.3.0 (removed on 2026-11-23, see above)