@rness/cli 0.8.1 → 0.9.1

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
@@ -29,6 +29,7 @@ Inside a workspace, every `rness` delegates to the copy pinned in
29
29
  rness logout
30
30
  rness context [--scope <name>] [--json]
31
31
  rness validate
32
+ rness mcp
32
33
 
33
34
  `create` never runs inside a workspace. `add`, `sync` and `create` ask for
34
35
  confirmation in a terminal; pass `-y`/`--yes` in scripts. `sync --check`
@@ -61,7 +62,8 @@ the files a given agent needs, for the agents the team declares in
61
62
  `../../.rness` in `permissions.additionalDirectories`, so a session in the
62
63
  repository reads the context repository without a prompt. Claude Code
63
64
  applies it once the repository has been trusted interactively. Verified
64
- with Claude Code 2.1.284 on 2026-09-29.
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".
65
67
  - rness owns values, not files: what is missing is added, nothing else is
66
68
  touched, and a file it cannot parse is reported, never rewritten.
67
69
  `sync --check` and `validate` report a missing value. Removing an agent
@@ -69,6 +71,39 @@ the files a given agent needs, for the agents the team declares in
69
71
  - Other agents (Codex, Cursor, GitHub Copilot) read the `AGENTS.md` block;
70
72
  `sync` refuses an agent it has no target for.
71
73
 
74
+ ### MCP server
75
+
76
+ rness mcp # started by the agent over stdio, not by hand
77
+
78
+ A local, read-only MCP server over the workspace's `.rness/`, for an agent to
79
+ find what applies to the repository it works in and where a subject was
80
+ decided:
81
+
82
+ | Tool | Returns |
83
+ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
84
+ | `rness_context({ scope? })` | the scope of the working directory (or the one named) and what applies to it: standards, decisions, specifications, plans — id, status, title, path |
85
+ | `rness_list({ collection, status? })` | every document of a collection, across scopes, optionally of one status |
86
+ | `rness_read({ path })` | one file of `.rness/`, 256 KiB at most; nothing outside it |
87
+ | `rness_search({ query, collection? })` | the documents that match, most matching first, with the matching lines |
88
+
89
+ - MCP over stdio, one message per line: the `2026-07-28` revision and the
90
+ earlier ones that open with `initialize` (`2025-11-25` back to
91
+ `2024-11-05`). No MCP SDK, no added dependency.
92
+ - `.rness/` is read again on each call, so an edit shows at once. Nothing is
93
+ written.
94
+ - With `claude` in `agents`, `sync` registers it in each clone:
95
+ `.mcp.json` gets `mcpServers.rness`, which runs the pinned copy
96
+ (`node ../../.rness/node_modules/@rness/cli/dist/bin/rness.js mcp`). A
97
+ team's own `rness` entry is left as it is.
98
+ - Each developer approves the server once, in Claude Code's own dialog.
99
+ rness does not pre-approve it: `enabledMcpjsonServers` in a committed
100
+ settings file would let any change to the `rness` entry of `.mcp.json` run
101
+ unasked. Review such a change like code.
102
+ - Verified with Claude Code 2.1.284 on 2026-09-29: the server starts from the
103
+ repository and its tools answer.
104
+ - Another agent can run the same command from a clone; rness writes no
105
+ configuration for it.
106
+
72
107
  ### Log in
73
108
 
74
109
  rness login # shows a code and https://github.com/login/device
@@ -143,8 +178,9 @@ dependency does this: `util.styleText`, and a banner kept as a constant.
143
178
 
144
179
  The version is written in one place, `.rness/package.json`. `upgrade` pins it
145
180
  there (exact, the rest of the file untouched), installs with the workspace's
146
- package manager, then syncs through the new copy; a failed install restores
147
- the file. Commit `.rness`. Teammates pull, and the next `rness` command in that
181
+ package manager, syncs through the new copy, then commits `.rness`
182
+ (`chore: rness <version>`); a failed install restores the file. Push
183
+ `.rness`. Teammates pull, and the next `rness` command in that
148
184
  workspace installs the new pin itself — frozen, so the working tree stays
149
185
  clean — and carries on: nothing to remember, nothing to run.
150
186
  `RNESS_NO_INSTALL=1` turns that off and restores the warning, for CI, a
@@ -182,8 +218,10 @@ now names; `rness validate` warns while it is behind.
182
218
  scaffold did not change; overlapping lines conflict, and `upgrade` stops
183
219
  before installing — resolve with git (`git checkout --ours <file>` keeps
184
220
  yours, `--theirs` takes the scaffold's), commit, run `upgrade` again.
185
- - `.rness` must be a clean git repository. The merge is staged, not
186
- committed: the next steps end in one commit.
221
+ - `.rness` must be a clean git repository with no merge in progress.
222
+ `upgrade` commits the merge itself, through the repository's hooks. When a
223
+ hook refuses, everything stays staged, what it said is shown, and
224
+ `upgrade` exits 1 with the commit to make.
187
225
  - A workspace with no scaffold commit (made by hand, or older than
188
226
  `create`) is adopted: identical files merge silently, a differing one
189
227
  conflicts once.
@@ -197,13 +235,44 @@ pin merges the scaffold of the copy installed in `.rness`. A global below
197
235
  `npx` form, or the pinned copy from inside `.rness`. A workspace pinned below 0.5.0, whose copy has no such
198
236
  command, starts with the `npx` form.
199
237
 
200
- An upgrade touches `.rness` only: a generated block is current when its hash
201
- is, whatever wrote it, so no `AGENTS.md` of the organization changes unless
202
- its content does.
238
+ An upgrade commits `.rness` only. Its sync rewrites a block only when the
239
+ block's content changed — a block is current when its hash is, whatever
240
+ wrote it — and writes the agent files a release adds. The next steps list,
241
+ per repository, the files to commit there.
203
242
 
204
243
  Exit codes: 0 success, 1 failure, 2 usage — or a refusal without a TTY.
205
244
  `RNESS_DEBUG=1` adds stack traces; `RNESS_NO_DELEGATE=1` skips the delegation.
206
245
 
246
+ ## 0.9.1 — upgrade ends in its commit; the MCP server approved per developer
247
+
248
+ - `rness upgrade` commits `.rness` itself (`chore: rness <version>`), with
249
+ the repository's hooks; a refusal leaves everything staged and exits 1.
250
+ The next steps say what is left: push, and per repository the files the
251
+ sync changed.
252
+ - `upgrade` syncs every time, the Dependabot case included (pin and install
253
+ already at the target). In 0.9.0 it skipped the sync there, so the values
254
+ 0.9.0 added to the agent files were missing and the scaffold's
255
+ pre-commit hook refused the commit.
256
+ - `upgrade` refuses a `.rness` with a merge in progress.
257
+ - `validate` counts a merge in progress: the commit recording a scaffold
258
+ merge no longer warns that the scaffold is not merged.
259
+ - The Claude target no longer writes `enabledMcpjsonServers`: each developer
260
+ approves the MCP server once. After syncing with 0.9.0, remove `rness`
261
+ from `enabledMcpjsonServers` in each `.claude/settings.json` by hand —
262
+ rness never removes a value.
263
+
264
+ ## 0.9.0 — the context on demand: `rness mcp`
265
+
266
+ - `rness mcp`: a local, read-only MCP server with four tools —
267
+ `rness_context`, `rness_list`, `rness_read`, `rness_search`. See "MCP
268
+ server".
269
+ - The Claude target registers it: each clone gets `.mcp.json`
270
+ (`mcpServers.rness`) and `rness` in `enabledMcpjsonServers` of
271
+ `.claude/settings.json`. After upgrading, run `rness sync` once and commit
272
+ both files in each repository; until then `sync --check` and `validate`
273
+ report them missing.
274
+ - Blocks are unchanged.
275
+
207
276
  ## 0.8.1 — adoption without placeholders
208
277
 
209
278
  - Adopting the scaffold no longer adds a `.gitkeep` to a directory that
package/dist/bin/rness.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findDelegate,
7
7
  reportError,
8
8
  run
9
- } from "../chunk-ONLF4VFA.js";
9
+ } from "../chunk-N3F6N6GA.js";
10
10
 
11
11
  // src/bin/rness.ts
12
12
  import { pathToFileURL } from "url";