From 1df0a5cf70c6a73c99eb87f3ee10385d807b8128 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 14:06:14 +0100 Subject: [PATCH 1/2] Run the offline check on GitHub Actions Pull requests and pushes to main run evals/offline/check.py with Claude Code pinned to 2.1.310 (the tested version). Read-only token, no secrets, no model calls: the check talks to a local mock endpoint. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Sm3JtGSXFLR6CZYVJXGHtU --- .github/workflows/offline-check.yml | 34 +++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/offline-check.yml diff --git a/.github/workflows/offline-check.yml b/.github/workflows/offline-check.yml new file mode 100644 index 0000000..1291c25 --- /dev/null +++ b/.github/workflows/offline-check.yml @@ -0,0 +1,34 @@ +name: offline-check + +# Runs evals/offline/check.py: the real Claude Code binary against a local mock +# model. No secrets, no tokens, no network beyond the package registry. +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: offline-check-${{ github.ref }} + cancel-in-progress: true + +jobs: + check: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-node@v4 + with: + node-version: 22 + # Pinned to the version the check was written and tested against. + # Bump it deliberately, together with the "provato su" line in MANUALE.md. + - name: Install Claude Code 2.1.310 + run: npm install --global @anthropic-ai/claude-code@2.1.310 + - name: Offline check + run: python3 evals/offline/check.py diff --git a/README.md b/README.md index dfb3373..42cb64c 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ For planning use Claude Code's native plan mode (Shift+Tab): it is read-only by python3 evals/offline/check.py # CLAUDE= if claude is not on PATH ``` -Installs the plugin into a throwaway home, replaces the model with a local mock that records every request, and checks in about 20 seconds, at zero token cost: rules and state reach the session, oversized state becomes a notice, workflows expand and stay out of the skill listing, the reviewer reads the diff but cannot write, and commit and push need you even when your settings allow git. It does not judge model behavior; `evals/scenarios/` describes the real-model scenarios and `evals/results.md` records decisions and evidence. +Installs the plugin into a throwaway home, replaces the model with a local mock that records every request, and checks in about 20 seconds, at zero token cost: rules and state reach the session, oversized state becomes a notice, workflows expand and stay out of the skill listing, the reviewer reads the diff but cannot write, and commit and push need you even when your settings allow git. GitHub Actions runs it on every pull request and on `main` (`.github/workflows/offline-check.yml`, Claude Code pinned to 2.1.310, no secrets). It does not judge model behavior; `evals/scenarios/` describes the real-model scenarios and `evals/results.md` records decisions and evidence. ## Layout From dce967edae5107b5512fee97210359869d42ac7f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 14:07:29 +0100 Subject: [PATCH 2/2] Record the CI run in the state and results Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Sm3JtGSXFLR6CZYVJXGHtU --- .dev-brain/STATE.md | 8 ++++---- evals/results.md | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.dev-brain/STATE.md b/.dev-brain/STATE.md index 9775492..d545d30 100644 --- a/.dev-brain/STATE.md +++ b/.dev-brain/STATE.md @@ -1,15 +1,15 @@ # State — agents-platform -Updated: 2026-11-03 · Branch: improve/token-budget-and-review (uncommitted edits; main has the same tree) +Updated: 2026-11-03 · Branch: ci/offline-check (PR #5; main has plugin 2.2.0) ## Goal Claude Code plugin 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.2.0 prepared, not committed: minimal `start`, review passes the Goal line, reviewer checks weakened tests — evidence: `python3 evals/offline/check.py` ALL PASS; external studies in `evals/results.md` 2026-11-03 +- Offline check runs on GitHub Actions for every PR and push to main (Claude Code 2.1.310 pinned) — 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); external studies in `evals/results.md` 2026-11-03 - No commit without the user, enforced: `PreToolUse` git guard (plugin 2.1.0) — evidence: `python3 evals/offline/check.py` ALL PASS; mutation without the hook FAILs - Plugin-only layout: rules + state via `SessionStart` hook, workflows as zero-cost skills, `plan` and other adapters removed, docs compacted — evidence: `python3 evals/offline/check.py` ALL PASS twice (Claude Code 2.1.310, mock model) - hph adopted: `AGENTS.md` + 1.3 KB state, `harness/` retired — evidence: hph PR #10 open -- Review no longer pays the diff three times (7005 → 1101 chars on hph) — evidence: `evals/results.md` 2026-10-25 ## In progress / blockers - Benefit of the rules on real code — status: NOT RUN; user postponed the benchmark @@ -19,6 +19,6 @@ Claude Code plugin for readable, maintainable code at the lowest context cost - none ## Next (max 3) -1. When the user decides: commit 2.2.0 on a new branch from main, push, then `claude plugin marketplace update dev-brain`; also review hph PR #10 (its `AGENTS.md` predates the minimal `start`). +1. User: `claude plugin marketplace update dev-brain`, try `/dev-brain:start` on a real repo (keep a copy of its old `AGENTS.md`); review hph PR #10 (its `AGENTS.md` predates the minimal `start`). 2. Collect feedback from real use: the user's `AGENTS.md`/`STATE.md`, `/context`, `/usage`, `/skill-doctor`, `/doctor prompt-audit`, and a defect log; change only what repeats twice. 3. Ablation on real tasks: `core/AGENTS.md` full vs reduced, and the three model-loaded skills with vs without; keep only what moves steps, cost or review findings. diff --git a/evals/results.md b/evals/results.md index e86bd54..60b79be 100644 --- a/evals/results.md +++ b/evals/results.md @@ -6,6 +6,14 @@ A log of decisions and the evidence behind them, newest first. Full run details Not measured. Real-model evidence so far: one model per scenario, one run, small synthetic Python fixtures; the no-kit baseline already solved every task. The one measured gain is the review policy (below). Next: the same real tasks with and without the plugin, same model; compare tokens per task, fix iterations, review findings, time to resume after a break. Keep what moves the numbers. +## 2026-11-03 — Offline check on GitHub Actions + +`.github/workflows/offline-check.yml` runs `python3 evals/offline/check.py` on every pull request, on pushes to `main` and on demand: Ubuntu runner, Node 22, `npm install --global @anthropic-ai/claude-code@2.1.310`, read-only token, no secrets. + +Evidence: pull request #5, run `offline-check`: success, 11 checks ALL PASS on a clean runner (about 13 s). Before that, `main` at 0d01d2b (plugin 2.2.0) was cloned into an empty directory and gave ALL PASS locally. The script exits with 1 when a check fails, so the job fails with it; a failing run on CI was not provoked. + +Limits: the version is pinned, so a newer Claude Code release is not tested until the pin is bumped; actions are referenced by major tag (`@v4`), not commit SHA; a red check does not block a merge unless branch protection requires it (not set); the check still does not judge model answers. + ## 2026-11-03 — Minimal `start`, review against the goal, weakened-test check (plugin 2.2.0) Changes: (1) `start` writes `AGENTS.md` as a draft under 40 lines with only commands, tooling, deviations from defaults and gotchas; no purpose line, stack list or architecture overview. Overview lines already in an existing file are listed for deletion, never removed. For names like `.env` or `input/` it prints the permission deny rules for the user to add. (2) `review` passes the state's Goal line to the reviewer as unverified requirements. (3) The reviewer also checks that no test was deleted, skipped, loosened or special-cased to pass. (4) When the repository has a fast check, `start` prints a Stop-hook line (exit code 2 blocks the turn) for the user to add; the plugin enforces nothing there.