@rness/cli 0.9.2 → 0.10.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
@@ -63,7 +63,9 @@ the files a given agent needs, for the agents the team declares in
63
63
  repository reads the context repository without a prompt. Claude Code
64
64
  applies it once the repository has been trusted interactively. Verified
65
65
  with Claude Code 2.1.284 on 2026-09-29. Each clone also gets `.mcp.json`,
66
- which registers the MCP server; see "MCP server".
66
+ which registers the MCP server; see "MCP server". The same settings file
67
+ carries two hooks, and so does `.claude/settings.json` at the workspace
68
+ root, which `sync` writes on every machine; see "Hooks".
67
69
  - rness owns values, not files: what is missing is added, nothing else is
68
70
  touched, and a file it cannot parse is reported, never rewritten.
69
71
  `sync --check` and `validate` report a missing value. Removing an agent
@@ -71,6 +73,39 @@ the files a given agent needs, for the agents the team declares in
71
73
  - Other agents (Codex, Cursor, GitHub Copilot) read the `AGENTS.md` block;
72
74
  `sync` refuses an agent it has no target for.
73
75
 
76
+ ### Hooks
77
+
78
+ With `claude` in `agents`, each clone's `.claude/settings.json` and the
79
+ workspace root's carry two Claude Code hooks, both run by the pinned copy:
80
+
81
+ - **At session start** (`SessionStart`, every source): a line for the
82
+ developer — `rness 0.10.0 · acme · scope web — 3 standards, 2 decisions`
83
+ — and, for the model, the scope's documents as `rness_context` lists
84
+ them. When the context may be wrong, both say why: no `.rness` next to the
85
+ repository or nothing installed there, a `rness.json` rness refuses, a pin
86
+ the installed copy does not match, the problems `rness validate` reports.
87
+ After a compaction, the context only.
88
+ - **After an edit** (`PostToolUse` on `Edit|Write`): when the file is under
89
+ `.rness/`, its front-matter problems — or those of `rness.json` — go back
90
+ to the model, which fixes them in the same turn. Any other edit costs one
91
+ path check. Stale blocks are left to `sync`.
92
+
93
+ Each hook is one fixed `sh` line: it runs
94
+ `<.rness>/node_modules/@rness/cli/dist/bin/rness.js hook <event>` when that
95
+ file exists, and otherwise says so at session start and nothing after an
96
+ edit. The line never changes between versions — what the hook does lives in
97
+ the CLI — because rness compares its entry as a whole: an entry edited by
98
+ hand counts as missing, and the next `sync` adds a second one. The team's
99
+ own hooks stay where they are.
100
+
101
+ Claude Code runs hooks from a committed settings file without asking each
102
+ developer, including in `claude -p`. These two read `.rness/` and nothing
103
+ else: they write no file, run no install and reach no network. Review a
104
+ change to them like code. Verified with Claude Code 2.1.284 on 2026-09-29:
105
+ in a clone and at the root, the model received the context; after an edit
106
+ that broke a status, it received the problem. The `sh` line is not verified
107
+ on Windows.
108
+
74
109
  ### MCP server
75
110
 
76
111
  rness mcp # started by the agent over stdio, not by hand
@@ -243,6 +278,18 @@ per repository, the files to commit there.
243
278
  Exit codes: 0 success, 1 failure, 2 usage — or a refusal without a TTY.
244
279
  `RNESS_DEBUG=1` adds stack traces; `RNESS_NO_DELEGATE=1` skips the delegation.
245
280
 
281
+ ## 0.10.0 — hooks: the context at session start, validation after an edit
282
+
283
+ - With `claude` in `agents`, `sync` adds two hooks to each clone's
284
+ `.claude/settings.json`, and writes `.claude/settings.json` at the
285
+ workspace root with the same two. See "Hooks". `rness upgrade` syncs, so
286
+ it adds them; then commit `.claude/settings.json` in each repository, as
287
+ its next steps list. Until then `sync --check` and `validate` report the
288
+ hooks missing.
289
+ - A settings file keeps the team's own hooks: rness appends its entries
290
+ after them.
291
+ - Blocks are unchanged.
292
+
246
293
  ## 0.9.2 — the sync summary reads as a sentence
247
294
 
248
295
  - `rness sync` counts agent files apart from blocks: "4 blocks: 4
package/dist/bin/rness.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findDelegate,
7
7
  reportError,
8
8
  run
9
- } from "../chunk-JKDF7ROY.js";
9
+ } from "../chunk-R4BRAAC2.js";
10
10
 
11
11
  // src/bin/rness.ts
12
12
  import { pathToFileURL } from "url";