diff --git a/.dev-brain/STATE.md b/.dev-brain/STATE.md index ec4ea2b..4b3c190 100644 --- a/.dev-brain/STATE.md +++ b/.dev-brain/STATE.md @@ -5,7 +5,7 @@ Updated: 2026-11-20 Plugin (Claude Code; Codex CLI and Copilot read it too) 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.3.0 in a PR, not merged: Codex 0.171.0 and Copilot CLI 1.0.114 support (six `agents/openai.yaml`, guard denies on Codex, Copilot context key) — evidence: `python3 evals/offline/check.py` ALL PASS (24 checks, local), six mutations each FAIL the intended check; PR #7 CI success, manual run of both jobs success (newest: Claude Code 2.1.329, Codex 0.171.0, Copilot CLI 1.0.114) +- Plugin 2.3.0 merged (PR #7): Codex 0.171.0 and Copilot CLI 1.0.114 support (six `agents/openai.yaml`, guard denies on Codex, Copilot context key) — evidence: `python3 evals/offline/check.py` ALL PASS (24 checks, local), six mutations each FAIL the intended check; PR #7 CI success, manual run of both jobs success (newest: Claude Code 2.1.329, Codex 0.171.0, Copilot CLI 1.0.114); install from GitHub run as written on Codex and Copilot - 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) @@ -21,6 +21,6 @@ Plugin (Claude Code; Codex CLI and Copilot read it too) for readable, maintainab - none ## Next (max 3) -1. User: try 2.3.0 in VS Code Copilot (do the rules arrive? do the workflows list?) and in Codex (`/hooks` trust), then decide the PR merge and run `claude plugin marketplace update dev-brain`; review hph PR #10. +1. User: try 2.3.0 in VS Code Copilot (do the rules arrive? do the workflows list?) and in Codex (`/hooks` trust), then `claude plugin marketplace update dev-brain`; review hph PR #10; delete remote branch `improve/state-and-ci-2-2-1` (the proxy blocks it here). 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/MANUALE.md b/MANUALE.md index f4e51fe..6b97fbf 100644 --- a/MANUALE.md +++ b/MANUALE.md @@ -43,6 +43,7 @@ claude plugin install dev-brain@dev-brain - **Aggiornamento:** `claude plugin marketplace update dev-brain`. - **Sviluppo locale:** `claude plugin marketplace add /percorso/agents-platform`. Il plugin viene letto sul posto: le modifiche valgono dalla sessione successiva. - **Disinstallazione:** `claude plugin uninstall dev-brain@dev-brain`. I file nelle repository restano. +- **Codex e Copilot:** installazione, aggiornamento e rimozione sono nella sezione 12. Il plugin non tocca `CLAUDE.md` né le tue impostazioni: regole e stato arrivano da un hook `SessionStart`. @@ -111,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. +Se rispondi sì, il commit avviene: la decisione resta tua, ed è il punto. Su Codex non c'è la domanda: il comando viene rifiutato e lo esegui tu (sezione 12). --- @@ -119,7 +120,7 @@ Se rispondi sì, il commit avviene: la decisione resta tua, ed è il punto. Subagente `dev-brain:reviewer`, in sola lettura **imposta**. Può usare Read, Grep, Glob e `git diff/log/show/status`; ogni comando che crea, modifica o cancella file chiede la tua approvazione. Rispondi no. -Riporta difetti di correttezza, sicurezza, integrità dei dati o requisiti, separati dai problemi concreti di manutenibilità. Per ogni finding: `file:line`, trigger o scenario, impatto, correzione minima, confidenza. Niente preferenze cosmetiche. Non esegue test o build: li riporta come `NOT RUN`. +Su Codex non viene caricato, su Copilot non ha git (sezione 12). Riporta difetti di correttezza, sicurezza, integrità dei dati o requisiti, separati dai problemi concreti di manutenibilità. Per ogni finding: `file:line`, trigger o scenario, impatto, correzione minima, confidenza. Niente preferenze cosmetiche. Non esegue test o build: li riporta come `NOT RUN`. --- @@ -192,7 +193,7 @@ Se trova `codex` o `copilot` nel PATH (o nelle variabili `CODEX` e `COPILOT`, ch Non valuta la qualità delle risposte. Su GitHub Actions gira a ogni pull request sulle versioni fissate (Claude Code 2.1.325, Codex 0.171.0, Copilot CLI 1.0.114); a ogni push su `main`, ogni lunedì e su richiesta gira anche sulle ultime versioni, per accorgersi presto di un cambiamento. -`core/AGENTS.md` e le skill restano in formati standard: supportare un altro agente in futuro richiede un adattatore, non una riscrittura. +`core/AGENTS.md` e le skill restano in formati standard. Codex e Copilot si supportano con tre adattamenti (sezione 12); un nuovo workflow richiede anche il suo `agents/openai.yaml` (due righe, `allow_implicit_invocation: false`), altrimenti Codex lo elenca e ne paga il contesto. Un altro agente richiede un adattatore, non una riscrittura. --- @@ -206,6 +207,10 @@ Non valuta la qualità delle risposte. Su GitHub Actions gira a ogni pull reques | Il reviewer chiede di eseguire un comando che scrive | Rispondi no | | Claude Code chiede conferma per un `git commit` | È il guard di dev-brain: conferma solo se hai deciso tu di committare | | Ho dati sensibili nello stato | Rimuovili subito; non committare | +| Codex: regole e stato non arrivano, il commit non viene fermato | Gli hook non sono approvati: apri `/hooks` e approva quelli di dev-brain; `codex exec` non avvisa | +| Codex rifiuta un `git commit` | È voluto: Codex non può chiedere conferma, lo esegui tu | +| Codex: `review` dice che non c'è un reviewer | Atteso: Codex non carica gli agenti del plugin | +| Copilot: il reviewer non trova le modifiche | Non ha git: legge solo i file elencati; per un diff completo incollalo tu | --- @@ -226,11 +231,15 @@ Lo stesso marketplace e lo stesso plugin si installano senza modifiche. Provato | | Codex CLI | Copilot CLI | | --- | --- | --- | | Installazione | `codex plugin marketplace add Stcant/agents-platform`, poi `codex plugin add dev-brain@dev-brain` | `copilot plugin marketplace add Stcant/agents-platform`, poi `copilot plugin install dev-brain@dev-brain` | +| Aggiornamento | `codex plugin marketplace upgrade dev-brain`; se aggiorni anche la copia installata NON è stato provato: se la versione non cambia, ripeti `codex plugin add dev-brain@dev-brain` | `copilot plugin marketplace update`, poi `copilot plugin update dev-brain` | +| Rimozione | `codex plugin remove dev-brain@dev-brain` | `copilot plugin uninstall dev-brain` | | Regole e stato | Sì, ma solo dopo che approvi gli hook del plugin con `/hooks`: finché non lo fai regole, stato e guardia git sono spenti senza alcun avviso | Sì | | Workflow | `$dev-brain:start`; non costano contesto (file `agents/openai.yaml` in ogni workflow) | Elencati da `copilot skill list`, non costano contesto; la chiamata in sessione interattiva non è stata provata | | Commit, push, cambio di branch | **Rifiutati**: gli hook di Codex non sanno chiedere conferma, quindi il comando lo esegui tu | Chiede conferma (la richiesta interattiva non è stata provata; in `-p`, che non può chiedere, rifiuta) | | Reviewer | Non viene caricato: `review` lo dice e si ferma | Caricato, in sola lettura ma senza shell: non può lanciare git e legge i file elencati | +Versioni provate: Codex 0.171.0 e Copilot CLI 1.0.114 (Claude Code 2.1.325, in CI anche 2.1.329). La versione minima che funziona non è nota; le più vecchie NON sono state provate. Ho eseguito i comandi di installazione così come scritti, da GitHub: entrambi installano la 2.3.0. I nomi dei workflow in questo manuale sono quelli di Claude Code (`/dev-brain:`): su Codex scrivi `$dev-brain:`. + **VS Code (Copilot in modalità agente): NON PROVATO**, non si può eseguire qui. La documentazione dice che i plugin agente leggono il formato Claude: aggiungi `Stcant/agents-platform` dall'editor delle personalizzazioni (Configure Marketplaces) o con l'impostazione `chat.plugins.marketplaces`, poi installa `dev-brain`. Come VS Code carichi hook e agenti di un plugin non è documentato: verifica che le regole arrivino; se non arrivano, incolla `core/AGENTS.md` nelle istruzioni di Copilot. Cosa è stato aggiunto per far funzionare tutto (solo ciò che i programmi reali hanno mostrato rotto): diff --git a/README.md b/README.md index 78a094b..f1e70d4 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,18 @@ The same marketplace and plugin install unchanged; nothing is copied or forked. | Rules and state | yes | yes, once you trust the plugin's hooks with `/hooks`; until then they are silently off, and so is the git guard | yes | | Workflow call | `/dev-brain:start` | `$dev-brain:start` | listed by `copilot skill list`; calling them in an interactive session is NOT RUN | | Workflows cost no context | yes | yes, through `agents/openai.yaml` in each workflow | yes | +| Update | `claude plugin marketplace update dev-brain` | `codex plugin marketplace upgrade dev-brain`; whether it also refreshes the installed copy is NOT RUN, so `codex plugin add dev-brain@dev-brain` again if the version does not change | `copilot plugin marketplace update`, then `copilot plugin update dev-brain` | +| Remove | `claude plugin uninstall dev-brain@dev-brain` | `codex plugin remove dev-brain@dev-brain` | `copilot plugin uninstall dev-brain` | | Commit, push, branch change | asks you | refused: Codex hooks cannot ask, so you run the command | asks you (the interactive prompt is NOT RUN; `-p` mode cannot ask and refuses) | | Reviewer | read-only, reads the diff with git | not loaded: `review` says so and stops | read-only, but without a shell: it cannot run git and reads the listed files | +Tested versions: Claude Code 2.1.325 (CI also ran 2.1.329), Codex CLI 0.171.0, Copilot CLI 1.0.114. The oldest version that works is unknown; older releases are NOT RUN. The install commands above were run as written from GitHub (`Stcant/agents-platform`): both Codex and Copilot CLI installed 2.3.0. The workflow names below are written for Claude Code (`/dev-brain:`); on Codex write `$dev-brain:`. + VS Code (Copilot agent mode) is NOT RUN: it cannot be executed here. Its documentation says agent plugins read the Claude format: add `Stcant/agents-platform` in the Customizations editor (Configure Marketplaces) or in the `chat.plugins.marketplaces` setting, then install `dev-brain`. How VS Code loads a plugin's hooks and agents is not documented, so check that the rules arrive; if they do not, paste `core/AGENTS.md` into your Copilot instructions. ## First step in every repository: `/dev-brain:start` -Run it once in each repository, from its root. Everything else builds on the two files it creates: `resume` and `handoff` read and rewrite the state, every session gets it automatically, and Claude Code reads the project facts natively. +Run it once in each repository, from its root. Everything else builds on the two files it creates: `resume` and `handoff` read and rewrite the state, every session gets it automatically, and Claude Code reads the project facts natively (Codex and Copilot document the same for `AGENTS.md`; not tested here). 1. Inspects the real repository: stack, commands, conventions, traps. It does not open data directories (`input/`, `output/`, `.env`). 2. Writes or merges the root `AGENTS.md` as a draft, under 40 lines and only what the code does not show: exact commands, project tooling, decisions that differ from defaults, gotchas. No purpose line, stack list or architecture tour: studies find that such overviews add cost without helping the agent. It also creates or reconciles `.dev-brain/STATE.md` (goal, done with evidence, blockers, next actions, under 3000 characters). @@ -49,7 +53,7 @@ Then read both files, delete the lines the code already shows, fix anything untr ## Daily use -Ask Claude Code to implement or fix what you need. The rules already apply; the workflows support the work. +Ask the agent to implement or fix what you need. The rules already apply; the workflows support the work. | Workflow | When | | --- | --- | @@ -69,7 +73,7 @@ For planning use Claude Code's native plan mode (Shift+Tab): it is read-only by ## What is enforced, what is instructed - **No commit without you: enforced.** A `PreToolUse` hook answers "ask" (on Codex, which cannot ask: "deny") for `git commit` (including `--amend`), `push`, `merge`, `rebase`, `cherry-pick`, `revert`, `checkout`/`switch`, history-moving `reset`, `clean -f`, `branch -d/-m/-f`, `stash drop/pop/clear` and tag deletion, even inside chained commands and even when your settings allow git. Read-only git runs normally. -- **Reviewer read-only: enforced.** Its tool list allows Read, Grep, Glob and `git diff/log/show/status`; any command that creates, changes or removes files needs your approval. +- **Reviewer read-only: enforced on Claude Code and Copilot CLI** (not loaded on Codex). Its tool list allows Read, Grep, Glob and `git diff/log/show/status`; any command that creates, changes or removes files needs your approval. - **State budget: enforced.** Over 3000 characters only a notice is injected, telling the model to read the file and suggest `handoff`. - **Everything else is instructed:** rules guide the model; they do not guarantee good code. diff --git a/evals/results.md b/evals/results.md index 8bf2bc4..d124599 100644 --- a/evals/results.md +++ b/evals/results.md @@ -24,7 +24,7 @@ Observed, not changed (documented as limits): - Copilot CLI loads the reviewer but its `Bash(git diff:*)` entries map to nothing: the sub-agent gets `view`, `grep` and `glob` only. Read-only holds; it cannot run git and reads the listed files. Giving it a shell would break read-only, so no change. - Copilot ignores hook matchers, and its `source` is `new`; the Claude-format hook file still ran. -Evidence: `python3 evals/offline/check.py` ALL PASS, 24 checks (11 Claude Code 2.1.325, 8 Codex 0.171.0, 5 Copilot CLI 1.0.114), about 13 s. Six mutations each failed the intended check: no `openai.yaml` for one workflow, guard always "ask" (Codex: 0/2 refused), no top-level key (Copilot rules missing), top-level key for everyone (Codex rules missing), reviewer with `Bash` (Copilot reviewer tools included `bash`), no hooks (guard and context checks on all three hosts). `claude plugin validate core`: passes with the same warnings as `main`. CI now installs the three CLIs at pinned versions on pull requests and at `@latest` on pushes to `main`, weekly and on demand; `CODEX` and `COPILOT` make their checks required there. On GitHub Actions: pull request #7, pinned job success; manual run of the branch, both jobs success, and `latest` resolved to Claude Code 2.1.329, Codex 0.171.0, Copilot CLI 1.0.114, so Claude Code 2.1.329 (newer than the 2.1.325 pin) also passes. The weekly schedule is still NOT RUN. +Evidence: `python3 evals/offline/check.py` ALL PASS, 24 checks (11 Claude Code 2.1.325, 8 Codex 0.171.0, 5 Copilot CLI 1.0.114), about 13 s. Six mutations each failed the intended check: no `openai.yaml` for one workflow, guard always "ask" (Codex: 0/2 refused), no top-level key (Copilot rules missing), top-level key for everyone (Codex rules missing), reviewer with `Bash` (Copilot reviewer tools included `bash`), no hooks (guard and context checks on all three hosts). `claude plugin validate core`: passes with the same warnings as `main`. CI now installs the three CLIs at pinned versions on pull requests and at `@latest` on pushes to `main`, weekly and on demand; `CODEX` and `COPILOT` make their checks required there. On GitHub Actions: pull request #7, pinned job success; manual run of the branch, both jobs success, and `latest` resolved to Claude Code 2.1.329, Codex 0.171.0, Copilot CLI 1.0.114, so Claude Code 2.1.329 (newer than the 2.1.325 pin) also passes. The weekly schedule is still NOT RUN. After the merge (main at 7ad309a) the README install commands were run as written from GitHub into empty homes: Codex installed plugin 2.3.0, Copilot CLI installed 2.3.0 with 9 skills. Update and removal commands are listed from the CLIs' `--help`; that `codex plugin marketplace upgrade` also refreshes an installed copy was not run. Limits: VS Code is NOT RUN (cannot be executed here); the docs say its Local hook harness reads `hookSpecificOutput`, which the unchanged output satisfies, and that harness is deprecated (removal announced for February 2027), but plugin hook and agent loading in VS Code is undocumented. Calling the workflows in an interactive Copilot session, Copilot's interactive "ask" prompt, and the Codex `/hooks` trust screen are NOT RUN (the binaries were driven non-interactively). No real model was used on any host, so whether the rules improve code there is as unmeasured as on Claude Code. The host markers are env variables read from the binaries' behavior today; if a host changes them the matching check fails.