@nodii/dev 0.6.9 → 0.6.10

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
@@ -228,7 +228,7 @@ nodii-dev lane prioritize|deprioritize KEY --reason TEXT
228
228
  nodii-dev lane stop KEY --reason TEXT
229
229
  nodii-dev lane non-issue KEY --reason TEXT --evidence TEXT --reroute KEY[,KEY]|none
230
230
  --branch carried:ISSUE|dropped[:REASON] [--commits SHA[,SHA]]
231
- nodii-dev next KEY
231
+ nodii-dev next KEY [--paths A,B] [--components K,L] [--role ROLE]
232
232
 
233
233
  nodii-dev built list [--cursor CURSOR] [--include-acknowledged true]
234
234
  nodii-dev built ack KEY [KEY ...] [--note TEXT]
@@ -324,8 +324,60 @@ same checks, plus the ones that need its data, in one transaction.
324
324
  - `docs validate` also prints Dev's warnings for each document (they never
325
325
  block) and any problems with the decision's amends.
326
326
 
327
+ - **Clauses are bullets** (Dev issue 80). A clause is defined only as
328
+ `- **ID** text`. The same id written as a bold paragraph (`**APPR-3.** …`),
329
+ a heading, a bold table row or a numbered item, and defined nowhere as a
330
+ bullet, is refused with `CLAUSE_NOT_A_BULLET` (line and id); text inside the
331
+ bold (`- **ID [INTENDED]** …`) is `CLAUSE_MALFORMED` (write
332
+ `- **ID** [INTENDED] …`). `CLAUSE_COUNT_MISMATCH` then states how many
333
+ clauses Dev would store against how many the source defines, naming the
334
+ missing ids. `docs check` runs these locally; `rulebook list` prints
335
+ `N clauses` for each document.
336
+
337
+ ### Rule delivery (DEC-0020)
338
+
339
+ Every MUST clause declares how it reaches an agent, on one tag line indented
340
+ under the clause:
341
+
342
+ ```
343
+ - **MW2-14** The local gates MUST run in this order, …
344
+ ⟶ enforced · check: review-gates
345
+ - **U03-9** A list MUST page with the shared pager …
346
+ ⟶ served · build: dev_fix · step: adopt_test · side: frontend · comp: data-table
347
+ - **MW1-3** An agent MUST edit only its own config …
348
+ ⟶ core
349
+ ```
350
+
351
+ The delivery is `enforced` (with `check:`, which the document's Enforcement
352
+ table must name), `served` (with optional `build`, `step`, `side`, `svc`,
353
+ `path`, `comp` and `role` tags) or `core`; `gap: ISSUE` marks one that does not
354
+ work yet. `->` and `;` are ASCII aliases for `⟶` and `·`. A tag line as the
355
+ first line under a `###` heading is the default for that sub-section. Dev
356
+ checks every key and value, and refuses a ruling that adds or changes a MUST
357
+ clause with no delivery, and a ratification while any MUST clause has none
358
+ (`RULE_DELIVERY_MISSING`). The full syntax is in Dev's AD-era contract §1.8.
359
+
360
+ ```
361
+ nodii-dev next KEY # the next step, plus the clauses Dev serves for it
362
+ nodii-dev rules core # the generated core (every `core` clause); refused over the cap
363
+ nodii-dev rules report [--section rulebook|services|all] [--lane KEY]
364
+ nodii-dev rules cap TOKENS # operator: the core's token cap (default 3000)
365
+ ```
366
+
367
+ `next` sends the lane's changed files (its branch and working tree against
368
+ `origin/main`, read from the lane's worktree) so Dev serves path-tagged
369
+ clauses only where they apply; `--paths`, `--components` and `--role`
370
+ override. Each served clause prints its id, its first sentence and where to
371
+ read the rest; `--json` carries the full text and token counts. If Dev cannot
372
+ serve rules, `next` still prints the step. `rules report` shows, for each
373
+ document and in total, how many clauses use each delivery, how many MUST
374
+ clauses are untagged and how many carry a tool gap, plus the clauses and
375
+ tokens served to each lane at each step. Tokens are estimated as characters
376
+ divided by four.
377
+
327
378
  Like every other command, these reach Dev only through the platform edge
328
- (`/devops/api/v1/documents`, `/domains`, `/harness`, …) with the OAuth login.
379
+ (`/devops/api/v1/documents`, `/domains`, `/harness`, `/rules`, …) with the
380
+ OAuth login.
329
381
 
330
382
  ## Agent harness
331
383
 
@@ -394,7 +446,8 @@ operation's permission (requested in Dev).
394
446
  name, as Dev compares it), branch and worktree from git unless overridden, and resolves `--issue` keys to the UUIDs
395
447
  required by Dev. Lane keys are passed directly to every lane and Built
396
448
  acknowledgement route. `next` reads the lane's generated
397
- API steps and prints the exact next `lane step` command. Server refusals,
449
+ API steps and prints the exact next `lane step` command, then the rules Dev
450
+ serves for that step (see Rule delivery). Server refusals,
398
451
  including operator-only actions, workflow blocks, lane limits and Built items
399
452
  that are not on dev, retain Dev's error code/message and exit non-zero.
400
453
 
package/dist/api.js CHANGED
@@ -103,6 +103,8 @@ export const GROUPS = {
103
103
  swaps: "Swaps", ideas: "Ideas", terminology: "Terminology", credentials: "Credentials",
104
104
  rulebook: "ad-documents", "ad-decisions": "ad-decisions", domains: "ad-domains", standardizations: "standardizations",
105
105
  archive: "archive", harness: "harness",
106
+ // DEC-0020 rule delivery; `rules core|report|cap` are first-class (upload.js).
107
+ rules: "rulebook",
106
108
  };
107
109
 
108
110
  export const ALIASES = {
package/dist/cli.js CHANGED
@@ -27,7 +27,7 @@ import { setupCommand } from "./setup.js";
27
27
  import { harnessCommand } from "./harness.js";
28
28
  import { doctorCommand } from "./doctor.js";
29
29
  import { figmaChangeSetShow, figmaChangeSetText, figmaFileKey, figmaResubmit, notRegisteredHint } from "./figma.js";
30
- import { docsCommand, rulebookCommand } from "./upload.js";
30
+ import { docsCommand, rulebookCommand, rulesCommand } from "./upload.js";
31
31
  import { changeSetCommand, guidelineCommand } from "./guidelines.js";
32
32
  import {
33
33
  ALIASES,
@@ -87,6 +87,9 @@ Usage: nodii-dev <command> [options] [--json]
87
87
  docs ratify --domain KEY [--domain KEY ...] --decision FILE [--wait]
88
88
  docs parked [CODE] [--status pending|acknowledged]
89
89
  rulebook list|show CODE [--version V]|diff CODE
90
+ rules core # the generated core (M05-33); refused over the cap
91
+ rules report [--section S] [--lane KEY] # delivery totals per document; rules served per lane
92
+ rules cap TOKENS # operator: set the core token cap (default 3000)
90
93
 
91
94
  lane start <key> --title TEXT --kind KIND --side SIDE [--repo REPO] [--issue ISSUE]
92
95
  lane step <key> --side SIDE --start|--done|--block <step>
@@ -96,7 +99,8 @@ Usage: nodii-dev <command> [options] [--json]
96
99
  --branch carried:KEY|dropped[:REASON] [--commits SHA[,SHA]]
97
100
  # DEC-0011: terminal non_issue; issue -> wont_do; slot frees
98
101
  lane list [--kind KIND] [--status STATUS] [--mine] [--cursor CURSOR]
99
- lane show <key> | next <key>
102
+ lane show <key> | next <key> [--paths A,B] [--components K,L] [--role R]
103
+ # next step, plus the rules Dev serves for it (DEC-0020)
100
104
  built list | built ack <key...>
101
105
  machine list|show|set-coordinator|assign|report
102
106
  agent lane-limit|grant|revoke
@@ -390,6 +394,7 @@ export async function main(argv = process.argv.slice(2)) {
390
394
  }
391
395
  if (command === "docs") return emitCommand(await docsCommand(action, rest, f));
392
396
  if (command === "rulebook" && ["list", "show", "diff"].includes(action)) return emitCommand(await rulebookCommand(action, rest, f));
397
+ if (command === "rules") return emitCommand(await rulesCommand(action, rest, f));
393
398
  // Guideline change sets: approving or rejecting one is a person's action in Dev.
394
399
  if (command === "design" && action === "guideline") return emitCommand(await guidelineCommand(rest[0], rest.slice(1), f));
395
400
  if (command === "design" && action === "changeset") return emitCommand(await changeSetCommand(rest[0], rest.slice(1), f));
package/dist/core.js CHANGED
@@ -4,7 +4,7 @@ import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
4
4
  import { homedir, platform } from "node:os";
5
5
  import { dirname, join } from "node:path";
6
6
 
7
- export const VERSION = "0.6.9";
7
+ export const VERSION = "0.6.10";
8
8
  export const configPath = () =>
9
9
  process.env.NODII_DEV_CONFIG_PATH ??
10
10
  join(homedir(), ".config/nodii-dev/config.json");