vigiles 14.0.0 → 14.2.0

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/README.md CHANGED
@@ -65,10 +65,13 @@
65
65
  research/ links / NO enterprise/national-interest framing — name the user
66
66
  benefit; ~220-line body cap; push depth into docs/ and LINK it. Assets: the hero
67
67
  vigiles-audit.png is a REPRESENTATIVE report ("my-plugin", C 77) — the verdict-
68
- led header + ranked fixes + the "Your rules → enforced" section (the new rule-
69
- compile capability). Re-render via headless Chromium if the UI changes: build
70
- report/, screenshot report/dist/index.html (falls back to the sample fixture),
71
- inject the dark :root tokens before </body> for the dark render.
68
+ led header + category strip + ranked fixes + broken references. The "Your rules →
69
+ enforced" preview is DEMOTED low + badged EXPERIMENTAL (the rule map is alpha —
70
+ research/rule-enforcer-design.md §8). Re-render if the UI changes: `npm run build`
71
+ (rebuilds report/dist/index.html from the SAMPLE fixture), then headless Chromium
72
+ (puppeteer-core, executablePath /opt/pw-browsers/chromium) with
73
+ prefers-color-scheme:dark emulated + a fullPage screenshot at deviceScaleFactor 2
74
+ → vigiles-audit.png (2200px wide).
72
75
  -->
73
76
 
74
77
  <p align="center">
@@ -110,7 +113,7 @@ It's free and open-source, runs entirely on your machine, and never bills per to
110
113
  ## What it caught
111
114
 
112
115
  <p align="center">
113
- <img src="vigiles-audit.png" width="760" alt="vigiles audit report for my-plugin: a verdict header reading 'Two one-line fixes away from a B.' next to a C (77/100) grade, a five-category strip (Truthfulness, Triggering, Structure, Safety, Tested), ranked fix cards with '+N pts' impact badges, and a 'Your rules → enforced' section showing a prose rule the config silently turns off" />
116
+ <img src="vigiles-audit.png" width="760" alt="vigiles audit report for my-plugin: a verdict header reading 'Two one-line fixes away from a B.' next to a C (77/100) grade, a five-category strip (Truthfulness, Triggering, Structure, Safety, Tested), ranked fix cards with '+N pts' impact badges, broken-reference findings — and, lower down and badged experimental, a 'Your rules → enforced' preview mapping a prose rule the config silently turns off" />
114
117
  </p>
115
118
 
116
119
  **Like Google's Lighthouse, but for your agent harness.** One command grades it A–F across five categories, leads with a plain-English verdict — _"two one-line fixes away from a B"_ — and ranks every fix by the points it buys back:
@@ -186,11 +189,11 @@ That's the whole idea: it checks your harness against **reality, not style**. Ev
186
189
  | `test` | Does the harness behave? | No — a scripted stand-in | Every commit |
187
190
  | `eval` | Does a skill actually help? | Yes — your subscription | On demand |
188
191
 
189
- **One engine, two doors.** `audit` is the local report; **`lint` is the CI gate** that fails the build on the same deterministic checks — broken refs, bad tool contracts, dead hooks, skill collisions (Proofs 1–2). `test` and `eval` go further: past _does it exist_ to _does it work_. (`init` / `compile` / `eject` manage the spec layer underneath — you rarely run them by hand.)
192
+ **One engine, two doors.** `audit` is the local report; **`lint` is the CI gate** that fails the build on the same deterministic checks — broken refs, bad tool contracts, dead hooks, skill collisions (Proofs 1–2). `test` and `eval` go further: past _does it exist_ to _does it work_. (`init` / `compile` / `eject` manage the optional typed-spec layer for the structural rules no linter can express a graduation step you rarely run by hand.)
190
193
 
191
194
  ### 🔎 Lint — your instructions stop lying
192
195
 
193
- Every path, script, symbol, and rule verified against reality — plus tool contracts, skill collisions, and dead hooks (the catches above). You don't write the checks. `npx vigiles init` writes a `CLAUDE.md.spec.ts` beside your file: the same rules, each reference now wrapped so vigiles can confirm it exists. `compile` turns that back into the `CLAUDE.md` (or `AGENTS.md`) your agent already reads. Your agent edits the spec in plain English; `eject` deletes it and leaves your original untouched.
196
+ Every path, script, symbol, and rule verified against reality — plus tool contracts, skill collisions, and dead hooks (the catches above). You don't write the checks, and you don't port anything into a spec: `lint` reads the `CLAUDE.md` or `AGENTS.md` you already hand-edit and checks it as-is. Rules that map to a real linter rule run in your own config (ESLint, Ruff), not a shadow layer.
194
197
  **[How →](docs/verifying-instruction-files.md)**
195
198
 
196
199
  ### 🧪 Test — does the harness actually do its job?
@@ -223,15 +226,15 @@ npx vigiles audit
223
226
 
224
227
  ```text
225
228
  Set up vigiles in this repo: run `npx vigiles init` and accept the defaults. If I
226
- already have a CLAUDE.md or AGENTS.md, adopt it into a spec and show me which
227
- references are stale. Then compile and write + run one harness test for a hook or
228
- skill of mine. Don't run a real-model eval without asking me first.
229
+ already have a CLAUDE.md or AGENTS.md, audit it and show me which references are
230
+ stale and which of my rules aren't enforced. Then write + run one harness test for
231
+ a hook or skill of mine. Don't run a real-model eval without asking me first.
229
232
  ```
230
233
 
231
234
  Or run it yourself:
232
235
 
233
236
  ```bash
234
- npx vigiles init # adopts your files (non-destructive — eject reverses), adds CI,
237
+ npx vigiles init # sets up the typed spec for structural rules (non-destructive — eject reverses), adds CI,
235
238
  # installs vigiles's skills + hooks as a Claude Code plugin (in
236
239
  # ~/.claude/, not your repo). On Codex, skills install globally too.
237
240
  ```
@@ -250,7 +253,7 @@ The **hooks** keep it honest in-loop — nudging the agent to tag a linter-rule
250
253
  <summary>What <code>init</code> sets up</summary>
251
254
 
252
255
  - **Both lint and test** by default; scope with `--lint` / `--test`.
253
- - **Already have a CLAUDE.md / AGENTS.md, skills, or subagents? `init` adopts them all** into specs faithfully and **non-destructively** untouched until you `compile` (and `eject` undoes it).
256
+ - **Already have a CLAUDE.md / AGENTS.md, skills, or subagents? `audit` and `lint` read them as-is** nothing is moved or rewritten. For the structural rules that want a typed spec, `init` sets one up **non-destructively** (`eject` undoes it).
254
257
  - Adds `vigiles` to `devDependencies`; installs the Claude Code plugin (skills + hooks) via the marketplace — globally, never vendored.
255
258
  - Wires CI as a `zernie/vigiles@v1` workflow (needs only read + PR-comment permissions) that posts a sticky PR comment + a `valid` output.
256
259
 
@@ -262,7 +265,7 @@ Targets Claude Code and Codex out of the box, or [your own harness](docs/authori
262
265
 
263
266
  - **Is this a framework I have to build around?** No. It's a tool you run — like ESLint, Lighthouse, or `npm audit`. One command, a report, an optional CI gate. There's a library API for automation, but you never touch it to get value.
264
267
  - **Isn't this just a markdown linter?** No — it checks whether your instruction file is _true_ (every path/script/symbol/rule exists and is enabled), then tests and measures your harness. A style linter can't do any of that.
265
- - **Do I have to write TypeScript?** No — your agent writes the spec (`init` adopts your CLAUDE.md or AGENTS.md into one), or plain markdown lints with zero new files. Compiler-grade guarantees are opt-in, like TS's `strict` ([why?](docs/faq.md#why-are-the-strongest-guarantees-opt-in-not-the-default)).
268
+ - **Do I have to write TypeScript?** No — plain markdown works with zero new files, and rules run in your own linter config. The typed spec is opt-in, only for the structural checks a linter can't do like TS's `strict` ([why?](docs/faq.md#why-are-the-strongest-guarantees-opt-in-not-the-default)).
266
269
  - **Is it stable enough to adopt?** The CLI you run is small and rarely changes; the library API still moves between releases. The high version number is release automation (a new major per breaking change), not age — see [Stability](STABILITY.md).
267
270
  - **Non-JS repo?** `npx vigiles lint` verifies your CLAUDE.md or AGENTS.md with no install (Ruff/Clippy/Pylint/… too).
268
271
 
@@ -3,7 +3,7 @@
3
3
  * The concrete dialect is DEFINED here, in the adapter, symmetric with the other
4
4
  * four ports (`claudeCodeLayout`/`Runtime`/`HookProtocol`/`ModelMock`): the core
5
5
  * holds only the `HarnessDialect` interface and never a harness's vocabulary. The
6
- * compiler/validator receive this by injection (`compileAgent(spec, { dialect })`,
6
+ * rule-enforcer/validator receive this by injection (`compileAgent(spec, { dialect })`,
7
7
  * the CLI/composition root supplies it). A second harness defines its own dialect
8
8
  * in its adapter (e.g. `src/adapters/codex/dialect.ts` exporting `codexDialect`).
9
9
  */
@@ -84,7 +84,10 @@ function buildAuditReport(report, opts) {
84
84
  ...(opts.rulesInventory && opts.rulesInventory.length
85
85
  ? { rulesInventory: opts.rulesInventory }
86
86
  : {}),
87
- ...(opts.ruleRouting && opts.ruleRouting.segmented > 0
87
+ ...(opts.ruleRouting &&
88
+ (opts.ruleRouting.segmented > 0 ||
89
+ opts.ruleRouting.possible.length > 0 ||
90
+ opts.ruleRouting.skipped.length > 0)
88
91
  ? { ruleRouting: opts.ruleRouting }
89
92
  : {}),
90
93
  };