@nodii/dev 0.6.208 → 0.6.210

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
@@ -151,6 +151,7 @@ nodii-dev lane check KEY --gate 'pnpm typecheck' --gate 'pnpm lint' --gate 'nodi
151
151
  - The graph is read from source: static and dynamic imports, re-exports, `require`, `vi.mock`, `jest.mock` and `mock.module`, `new URL("./x", import.meta.url)`, the nearest tsconfig's `paths`, and workspace packages by name. A data file (SQL, JSON, a template) reaches the code that names it.
152
152
  - It fails closed. A manifest, lockfile, tsconfig, test or build config, a data file no source names, or a changed source file no test reaches selects the full suite (`full` lists why). Docs, `.github/` and the policy file select nothing.
153
153
  - Each package runs its tests with its own `test` script's runner and flags, and the selected files replace the script's paths. A script that is not one runner call (`bun run gate && bun test`) runs whole.
154
+ - With `--run`, main's reds are a baseline (MW2-21): a failed job's files run alone, and each that fails runs again at the merge base (a `nodii-baseline-` worktree, pruned before and removed on SIGINT or SIGTERM), once per repository and merge base. A file is main's only when the branch did not change it, it fails at the base twice the same way (once is "flaky at base", not main's and not kept), and every test the branch fails in it (by name, from node --test's TAP or spec output or bun test's `(fail)` lines) fails at the base too; output that names no test falls back to the file's exit code, and says so. The base shares the branch's `node_modules` only when no lockfile or `package.json` differs from the merge base and none of it links into the checkout; otherwise no baseline is taken and the job's failure stands. Each newly measured baseline is sent to Dev once (`POST /harness/baselines`: the repository as `owner/name` from a GitHub origin, else the checkout's folder name, never a path, the merge base, each file's code, and when), best effort: a failed post never changes the result, and a baseline read from the cache is not sent again.
154
155
  - `lane check` refuses a full-suite gate (`GATE_FULL_SUITE`) unless `--full-suite` is passed. A whole suite also means one workspace's or project's whole suite (`npm test -w X`, `pnpm --filter X test`, `jest --selectProjects web`), a runner given no path (`node --test`, `npx playwright test`, `pytest`, `go test ./...`), and any of these inside `sh -c`. From a lane's own config, `--full-suite` is refused too (`FULL_SUITE_LANE_REFUSED`, hub-485).
155
156
  - The review body carries the gates receipt (`gates`): each gate's command, exit code and commit for this head and base, so Dev can refuse a whole-suite gate itself (hub-485). A `gates` field in a hand-written review file is never sent.
156
157
  - Red, then green (hub-485). Before the change, `nodii-dev lane test KEY --red -- 'node --test test/a.test.js'` records the tests for it failing at a clean commit, as a signed red `test` receipt on the lane (`--check NAME` for work with no behaviour to test). Each green gate in the receipt names the repo-relative `files` it ran, so Dev can check that every red test is green at the head; a named check is green when a gate runs its exact command.
@@ -656,8 +657,13 @@ nodii-dev hook tooling-docs # MW1-46.3: refuses git push and gh pr cre
656
657
  # with no docs change (TOOLING_DOCS_STALE); every session, fails open
657
658
  nodii-dev hook session-start # every SessionStart: the session's kind and contract (MW1-92); after
658
659
  # compaction also the lane's or steward's Freeze
659
- nodii-dev hook session-kind # first prompt only: confirms or corrects the kind from the prompt
660
+ nodii-dev hook session-kind # every prompt: the first confirms or corrects the kind from the prompt;
661
+ # each keeps the turn locally for ruling file (never sent), asks the
662
+ # session to file the person's rules verbatim, and shows a steward
663
+ # session its unread lane messages (local inbox file, no Dev call)
664
+ nodii-dev ruling file --text TEXT # file the person's exact words, typed this turn, as a ruling (MW1-115)
660
665
  nodii-dev steward register --focus TEXT --repos R,... # a steward is a lane of kind steward (MW1-93)
666
+ nodii-dev steward register --focus TEXT --scratch # a throwaway steward: no repository, outside the weekly numbers
661
667
  nodii-dev hook nudge-stop # holds a lane session's stop until its done check is recorded;
662
668
  # guideline nudges when a lane session stops; asks once
663
669
  nodii-dev figma checked CS-n --unused-properties --stale-placeholders --dialog-body
@@ -675,7 +681,34 @@ in every session; every other managed hook stays lane-only. A steward is a lane
675
681
  of kind `steward` with no branch or worktree (`steward register`), so
676
682
  `lane gather <key> --picker agent`, the Freeze and the post-compaction
677
683
  re-grounding work for it unchanged; a fresh steward session prints its Clause
678
- map. Gather pins the always-on clauses for a lane's repository and side
684
+ map. Registering a steward sends its session's Claude or Codex process
685
+ (`process: {pid, startedAt}` on `/lanes/<key>/start`) and records the run
686
+ Dev returns in the watchdog registry, so a sweep reports the steward dead
687
+ within one sweep of the session ending (O3 item 6, MW1-36.5). A sweep also
688
+ reports the machine's `lastSweepAt`, `cliVersion` and `capState` in its host
689
+ facts, and `callCost` and `needsRoot` when this machine has recorded them
690
+ (O3 item 4): when those facts changed since the last report, else every 4
691
+ minutes, so `lastSweepAt` is never 5 minutes old. A machine record with no
692
+ `heavySlotTotal` sends no report and is a sweep error.
693
+
694
+ **Rulings (MW1-115, DEC-0569).** On every prompt outside a lane (no
695
+ `NODII_DEV_RUN_ID`, no lane config), `hook session-kind` keeps that turn
696
+ (`{sessionId, promptSha256, prompt, at}`) in the session-kinds state folder,
697
+ mode 0600, one file per session, overwritten each turn and never sent. When
698
+ the turn was kept, it adds one line asking the session to file any
699
+ instruction or rule the person gives about how work is done with
700
+ `nodii-dev ruling file --text - <<'EOF'` (the exact words on stdin, the
701
+ heredoc's closing newline dropped) or `--text '<their exact words>'` in
702
+ single quotes, in that turn. `ruling file` sends the words only when they are
703
+ an exact substring of this session's own turn (`CLAUDE_SESSION_ID` or
704
+ `CLAUDE_CODE_SESSION_ID`) recorded in the last 30 minutes, byte for byte or
705
+ with surrounding whitespace trimmed; otherwise, or with no session id, it
706
+ refuses `RULING_NOT_TYPED`, exits 2 and sends nothing. Words shorter than 3
707
+ words or 12 characters, or longer than 4000 characters, are `USAGE`. Dev
708
+ records the ruling with person, session and
709
+ time; it binds nothing until sorted and uploaded. No other prompt text leaves
710
+ the machine. When Dev refuses a write with `VERSION_BELOW_FLOOR`, the CLI
711
+ prints Dev's message and `Fix: nodii-dev harness update`, and exits 2. Gather pins the always-on clauses for a lane's repository and side
679
712
  (`GET /rules/gather-pins`), marked `always-on` in the Clause map.
680
713
 
681
714
  The hooks that run on every tool call or stop (`safety-pre`, `nudge-pre`,
@@ -768,11 +801,9 @@ nodii-dev lane leeway refuse ID [--note TEXT]
768
801
  nodii-dev lane leeway withdraw ID
769
802
  nodii-dev lane leeway list [--machine M] [--state S] [--lane KEY] [--cursor C] [--limit N]
770
803
  nodii-dev lane leeway show ID
771
- nodii-dev lane ask KEY --question TEXT [--options a,b]
772
- nodii-dev lane ask withdraw ID
773
- nodii-dev lane answer ID --text TEXT
774
- nodii-dev lane defer ID --reason TEXT [--minutes N] [--leeway]
775
- nodii-dev lane asks [--machine M] [--state S] [--lane KEY] [--cursor C] [--limit N]
804
+ nodii-dev lane defer LEEWAY_ID --reason TEXT [--minutes N]
805
+ # a leeway id only; lane ask, lane asks and lane answer were
806
+ # retired in 0.6.209 (see "Lane questions are retired")
776
807
  nodii-dev lane message TO --body TEXT|--body-file FILE [--issue ISSUE]
777
808
  nodii-dev lane inbox [KEY] [--all]
778
809
  # lane-to-lane messaging (NODII-DEV-CLI-191); see "Lane messages"
@@ -914,15 +945,72 @@ nodii-dev docs parked [CODE] [--status pending|acknowledged]
914
945
  nodii-dev harness install [--include-drafts] [--adopt PATH,...] [--dry-run] [--system]
915
946
  nodii-dev harness update [--include-drafts] [--adopt PATH,...] [--dry-run] [--system]
916
947
  nodii-dev harness check [--json] # 0 current, 1 differs from Dev, 2 no harness
948
+ nodii-dev harness drill lanes # DEV-PROCESS-1's done check, Part A: see "The lane drill"
917
949
  nodii-dev repo policy [--json] # print this repository's nodii.repo.yaml facts (STD-11)
918
950
  nodii-dev repo lint [--json] # 0 clean, 1 findings
919
951
  nodii-dev repo docs-check [--base REF] [--json] # 0 clean or not checked, 1 TOOLING_DOCS_STALE (docs move with tooling)
920
952
  nodii-dev harness update --check # the same check
953
+ nodii-dev harness week [--json] # the weekly page, read from Dev (O3 item 4, MW5-8.1)
921
954
  nodii-dev watchdog install [--interval SECONDS] # macOS: com.nodii.watchdog in ~/Library/LaunchAgents
922
955
  # Linux: nodii-watchdog.service and .timer in ~/.config/systemd/user
923
956
  nodii-dev watchdog sweep # the job's entrypoint; normally not run by hand
924
957
  ```
925
958
 
959
+ ### The lane drill: `harness drill lanes` (DEV-PROCESS-1)
960
+
961
+ `nodii-dev harness drill lanes` is the frozen done check of DEV-PROCESS-1,
962
+ Part A. The machine's coordinator runs it, under its own config, from the
963
+ installed release. It is never run by the lane that built it. It runs for
964
+ about an hour, with no model and no typed code, and exits 1 unless checks
965
+ 1 to 12 all hold. It prints every pid, run id and Dev record it reads.
966
+
967
+ - **Stub lanes.** The drill starts scratch lanes on the `stub` runtime
968
+ (`src/drill-stub.js`). Dev admits them under ruling A: no override, outside
969
+ the lane cap, and no repository, real account, Figma file or change set
970
+ (`STUB_LANE_BOUNDS`). A stub follows a JSON script given with
971
+ `--script PATH`:
972
+ - its jobs (a child, a nohup, a setsid and a heavy-slot job, each naming the
973
+ lane's key);
974
+ - its ticks and the tokens each tick reports;
975
+ - its `steps` (`[{afterTicks, sh}]`), each run once by `/bin/sh -c`;
976
+ - a silence (`silentAfterTicks`);
977
+ - a scripted or replayed ending, written verbatim. The stub classifies
978
+ nothing.
979
+ - **Finding processes.** The drill finds a lane's processes by scanning `ps`
980
+ for the lane's key, never from a list of its own.
981
+ - **Stub accounts** are drill folders registered as `stub` account runners.
982
+ The account reader reads a stub account's `usage.json`: a reading, a 429,
983
+ or an expired sign-in. No real account is read or written. Cleanup sets the
984
+ stub accounts offline.
985
+ - **Recorded routes.** Every process the drill starts preloads a route
986
+ recorder (`NODE_OPTIONS` for Node, `BUN_OPTIONS` for Bun) that logs method,
987
+ host and path only. Check 11 reads the whole run's routes after every check
988
+ and the cleanup.
989
+ - **Fixtures** are the planner's, frozen under
990
+ `~/Projects/_handoff/dev-process-2026-11-23/evidence/o1/`. A missing fixture
991
+ fails the check that needs it. Check 10 reads the red run's line
992
+ `check 10 codes: SHORT_CODE EXTRA_CODE` from `o1-red-run.txt`.
993
+ - **Scratch files** go under `~/.nodii/drill/<run>/` and are kept.
994
+ - **Up front and on every exit.** A config whose edge is not dev Dev's is
995
+ refused before anything starts. Cleanup runs on every exit (a pass, a
996
+ failure, a crash, a check's time running out, SIGINT or SIGTERM). It stops
997
+ the run's stub lanes in Dev, ends every process carrying the run's id,
998
+ removes the coordinator-config copies from `agents/` and sets the stub
999
+ accounts offline. A check whose time is up is stopped: it starts no further
1000
+ lane or command.
1001
+ - **No credentials.** The stub and its steps run with every credential-shaped
1002
+ variable removed (GitHub, AWS, Figma, npm, Claude, Codex, and any token,
1003
+ secret, password or key). A stub account must be a folder under
1004
+ `~/.nodii/drill/`.
1005
+ - **The Publish check** dry-runs only a scratch library: a fixture file that Dev
1006
+ tracks is refused, and it passes only on Dev's own `DESIGN_FILE_NOT_FOUND`
1007
+ answer (any other answer refuses). During its dry run it holds the
1008
+ coordinator's publish-watch job (`hold-publish-watch`), so no publish shares
1009
+ the shared Chrome seat at the same time; a hold already there refuses.
1010
+
1011
+ Changing an assertion, a control, a fixture or the drill's files needs a
1012
+ person's word (DEV-PROCESS-1, Done check).
1013
+
926
1014
  ### Structured dev checks
927
1015
 
928
1016
  `lane verify --checks FILE` sends what you read on dev. FILE is a JSON array, one entry per service and kind. Dev decides each result from the evidence and stores it, failed ones too. `lane show` lists them as `devChecks`.
@@ -1742,6 +1830,35 @@ Inside a lane, a failed check is noted in the step, and the harness files
1742
1830
  are left alone; the repository's orchestrator runs `harness update` in a
1743
1831
  `chore` lane (MW5-8).
1744
1832
 
1833
+ `harness update` keeps whether this machine's managed install needs root in
1834
+ `~/.config/nodii-dev/needs-root.json`: `true` when npm refuses with a
1835
+ permission error at `~/.local` (the fallback itself, or no fallback to
1836
+ take), `false` after any install that lands or finds the copy current. The
1837
+ watchdog sweep reports it as `needsRoot` in the machine's host facts.
1838
+
1839
+ ### The weekly page: `harness week`
1840
+
1841
+ `nodii-dev harness week` (O3 item 4, MW5-8.1, DEC-0569) reads `GET
1842
+ /harness/week` and prints, for someone who does not build, in this order:
1843
+ run-hours that pushed nothing per ending class, with tokens beside; unknown
1844
+ waits (a PR or release Dev traced to no lane) apart from claimed ones; the
1845
+ top refusals by code, route, caller and machine; hours main was red per
1846
+ repository; count and oldest age per lane state; test baselines at main's
1847
+ merge base; Dev calls per machine (`hook`, `gather`, `command`: calls, ms,
1848
+ mean, since); CLI versions (target, floor, each machine's version or `no
1849
+ version`, the machines needing root); runs per machine with scratch apart;
1850
+ rulings filed; and every run in the window with its lane, step, start
1851
+ reason, tokens, duration, ending class and machine. `--json` prints Dev's
1852
+ payload as it came. Dev computes every number; the window is the last seven
1853
+ days.
1854
+
1855
+ Every Dev request adds `{n, ms}` to `call-cost.json` in the nodii-dev
1856
+ config directory (the one lane configs under `agents/` share), bucketed
1857
+ `hook` (inside `nodii-dev hook ...`), `gather` (`lane gather`, `gather ...`)
1858
+ or `command`, with the `since` the file started. The write is best effort
1859
+ and never fails a request. The watchdog sweep sends it as `callCost` in the
1860
+ machine's host facts, with no Dev call of its own.
1861
+
1745
1862
  ## Preflight: `doctor`
1746
1863
 
1747
1864
  Run `nodii-dev doctor` from the lane's worktree, with the lane agent's config,
@@ -2086,6 +2203,17 @@ pre-write hook refuse a file, page, section or set outside the scope with
2086
2203
  scope is not bounded; a Freeze with `figma: []` means "no Figma" and refuses
2087
2204
  every Figma lock and write.
2088
2205
 
2206
+ A Freeze's Figma boundary can also grant sections and pages by node id
2207
+ (hub-643): `figma: [{fileKey, componentSetKeys, sectionIds: ["154:9552"],
2208
+ pageIds: ["6:22"]}]`, written with `lane freeze swap <key> --section boundaries`.
2209
+ `figma lock` and `figma scope add|set` then take `--scope section:ID` or
2210
+ `--scope page:ID` for exactly those ids, beside the lane's component sets and
2211
+ granted creates; any other section or page, and a whole-file lock, is still
2212
+ `FIGMA_OUTSIDE_LANE_SCOPE`. A granted id that is not a plain node id is
2213
+ `FIGMA_SCOPE_INVALID`. Gather keeps the granted creates, sections and pages
2214
+ in the boundary it stores. Dev checks the same grant on its side (needs the
2215
+ hub change of the same issue).
2216
+
2089
2217
  Objective, scope and rule changes are durable `lane amend` records, never chat
2090
2218
  messages. A coordinator's or steward's `lane amend` waits for the operator's
2091
2219
  approval (`lane amendments approve`, with their TOTP code). One code covers
@@ -2210,27 +2338,23 @@ instruction, and an exit is reported for `lane resume` instead of ending the
2210
2338
  run `blocked`. While an amendment waits for its Delta gather, `lane leeway`
2211
2339
  still runs.
2212
2340
 
2213
- ### Lane questions and the coordinator's items (MW1-12.9, MW1-37.2)
2214
-
2215
- **Lane questions are off by default** (`nodii-dev rules show MW1-37.2`):
2216
- `lane ask`, `lane ask withdraw`, `lane answer` and `lane asks`
2217
- refuse `LANE_ASKS_OFF` and call nothing unless `NODII_DEV_LANE_ASKS=1` is set.
2218
- While off, `lane defer` takes its id as a leeway, and the coordinator's count
2219
- line, `coordinator items` and the coordinator gate leave questions out (a
2220
- question cannot be cleared without the answer command); leeways still count and
2221
- gate. Dev's answer route is left as it is and is not reachable from the CLI
2222
- while off. A lane writes its question as an issue comment or a heartbeat note,
2223
- as before. The rest of this section describes the path switched on.
2224
-
2225
- A lane asks its machine coordinator a question with `lane ask KEY --question
2226
- TEXT [--options a,b]` (`lane ask withdraw ID` takes it back). The coordinator
2227
- answers with `lane answer ID --text TEXT`: Dev delivers the answer as an
2228
- amendment, which the lane acknowledges with `lane gather KEY --delta`. An issue
2229
- comment alone is not delivery. `lane defer ID --reason TEXT [--minutes N]` puts
2230
- an ask or a leeway off (default 60 minutes, at most 240); the id is tried as an
2231
- ask and, when Dev has no such ask, as a leeway, and `--leeway` goes straight to
2232
- the leeway. `lane asks [--machine M] [--state S] [--lane KEY] [--cursor C]
2233
- [--limit N]` lists asks.
2341
+ ### Lane questions are retired, and the coordinator's items (MW1-37.2)
2342
+
2343
+ **Lane questions are retired** (DEV-PROCESS-5, row 29b: one in, one out).
2344
+ `lane ask`, `lane ask withdraw`, `lane answer` and `lane asks`, and their
2345
+ switch `NODII_DEV_LANE_ASKS`, were retired in 0.6.209; they had shipped off by
2346
+ default since 18 Nov (MW1-37.2). Typing one is refused `USAGE` (exit 2) and
2347
+ calls nothing: "lane ask, lane asks and lane answer were retired in 0.6.209
2348
+ (DEV-PROCESS-5, row 29b). A lane waiting on a person records `nodii-dev lane
2349
+ heartbeat <key> --waiting-on person:ROLE`; the role reads them with `nodii-dev
2350
+ lane waits --person ROLE`." That role wait is what replaced them: it is
2351
+ delivered to the role's steward at its next turn. The coordinator's count line,
2352
+ `coordinator items` and the coordinator gate never list, count or gate a
2353
+ question Dev still serves.
2354
+
2355
+ `lane defer LEEWAY_ID --reason TEXT [--minutes N]` puts a leeway off (default
2356
+ 60 minutes, at most 240); it counts again after that. It takes a leeway id
2357
+ only; `--leeway` is still accepted and changes nothing.
2234
2358
 
2235
2359
  ### Lane feature switches (NODII-DEV-CLI-191)
2236
2360
 
@@ -2325,13 +2449,13 @@ Each message is delivered once. `lane inbox [KEY]` prints the unread messages
2325
2449
  and marks them read (`--all` prints every one); it also reads Dev's record and
2326
2450
  adds the messages sent from another machine that the local file lacks.
2327
2451
 
2328
- Dev counts what lanes wait on a machine's coordinator for (questions, leeway
2329
- asks, waits and escalations) and names the count in the `x-dev-lane-items`
2452
+ Dev counts what lanes wait on a machine's coordinator for (leeway asks, waits
2453
+ and escalations; a retired question is left out) and names the count in the `x-dev-lane-items`
2330
2454
  response header. Every command the coordinator runs prints one line for it
2331
2455
  first, on stderr, so `--json` output on stdout stays parseable:
2332
2456
 
2333
2457
  ```
2334
- 3 from lanes waiting on you: 1 leeway (hr-page-time), 2 questions (fe-adopt-hr-b 34 min, hr-clean-b 2 h) · nodii-dev coordinator items
2458
+ 3 from lanes waiting on you: 1 leeway (hr-page-time), 2 waits (fe-adopt-hr-b, hr-clean-b) · nodii-dev coordinator items
2335
2459
  ```
2336
2460
 
2337
2461
  The lane names come from `GET /coordinator/items`, cached and read again when
@@ -2346,11 +2470,11 @@ session ends); the managed dispatcher installed by `harness update --system`
2346
2470
  (refreshed by a plain `harness update`) checks for that file, so only a
2347
2471
  coordinator session pays for the gate, and only on a `Bash` call that names
2348
2472
  `nodii-dev` or on `AskUserQuestion`. The gate reads `/coordinator/items`
2349
- through a 10-second cache. While an ask or a leeway has waited over 10 minutes
2473
+ through a 10-second cache. While a leeway has waited over 10 minutes
2350
2474
  and is not deferred, it denies a `nodii-dev` write, naming each item and its
2351
2475
  command. A question to the operator is never denied (MW1-116): it passes with
2352
2476
  the same items named. Reads, local commands (`heavy`,
2353
- `run`, `doctor`), `inbox`, `coordinator ...`, `lane answer|defer`, `lane leeway
2477
+ `run`, `doctor`), `inbox`, `coordinator ...`, `lane defer`, `lane leeway
2354
2478
  grant|refuse|show|list`, `lane resume` and `lane close|stop` always pass, and so
2355
2479
  does everything that is not `nodii-dev`. Waits and escalations are counted and
2356
2480
  shown and never gate. When Dev cannot be read the call passes with the note
@@ -2417,17 +2541,16 @@ missing base ref, an invalid policy file or a git error lets the call through.
2417
2541
  | `LEEWAY_WORKTREE_FAILED` | The leeway is granted, but its worktree could not be created | Create it with the worktree command the refusal prints, then tell the lane |
2418
2542
  | `REPO_NOT_GRANTED` | The lane's agent has no grant for the repository the leeway adds | Grant the agent the repository, then grant the leeway again |
2419
2543
  | `LANE_WORKTREE_TAKEN` | Another lane already records the worktree path the grant names | Pass another --worktree PATH |
2420
- | `LANE_NOTES_FULL` | The grant's or answer's note would take the lane past its note cap | Fold superseded amendments into one note first (lane amendments fold) |
2421
- | `MACHINE_REQUIRED` | The caller coordinates no machine, so Dev cannot tell whose items or asks to list | Pass --machine NAME/ID |
2422
- | `LANE_ASKS_OFF` | lane ask, lane answer or lane asks while lane questions are off (the default) | Write the question as an issue comment or a heartbeat note; NODII_DEV_LANE_ASKS=1 turns the commands on |
2423
- | `ASK_NOT_FOUND` | Dev has no lane ask with this id | List them with lane asks |
2424
- | `ASK_DECIDED` | The ask is already answered or withdrawn | Read it with lane asks --lane KEY |
2544
+ | `LANE_NOTES_FULL` | The grant's note would take the lane past its note cap | Fold superseded amendments into one note first (lane amendments fold) |
2545
+ | `MACHINE_REQUIRED` | The caller coordinates no machine, so Dev cannot tell whose items or leeways to list | Pass --machine NAME/ID |
2425
2546
  | `LANE_NOT_FINISHED` | lane close before the lane's own agent marked the lane finished | The lane runs lane finish KEY --reason TEXT --evidence REF |
2426
2547
  | `LANE_ALREADY_FINISHED` | The lane is already marked finished | Nothing; its coordinator closes it with lane close |
2427
2548
  | `ACCOUNT_EXHAUSTED` | lane resume would relaunch onto a profile whose last run died on a usage limit, auth or the network, before its recorded reset, and no other account of its runtime has headroom | Resume after the reset it names, or move it with lane resume KEY --profile PATH --class CLASS |
2428
2549
  | `HARNESS_INVALID` | A managed hook entry is not one nodii-dev command, or Dev's harness cannot take the managed hooks | Run harness update, and file the entry as a harness issue |
2429
2550
  | `HARNESS_SETTINGS_INVALID` | .claude/settings.json or .codex/hooks.json is not valid JSON | Repair the file, then run harness update |
2430
2551
  | `TOOLING_DOCS_STALE` | The change touches a tooling file named in nodii.repo.yaml (toolingDocs.tooling) and no docs file (toolingDocs.docs), so hook tooling-docs refuses the push or the pull request (MW1-46.3) | Update the docs in the same change, or add the commit trailer Docs-unaffected: <reason>; check with repo docs-check |
2552
+ | `VERSION_BELOW_FLOOR` | Dev refuses an agent's write from a CLI below its version floor (HTTP 426); the message names the floor and this version, and the CLI exits 2 | Run nodii-dev harness update, then retry |
2553
+ | `RULING_NOT_TYPED` | ruling file --text was given words this session's prompt hook did not see typed in its current turn (within 30 minutes), or the command names no session; nothing was sent | File only the person's exact words, in the turn they typed them |
2431
2554
 
2432
2555
  The machine coordinator sets a lane's subagent capacity with `lane
2433
2556
  subagent-quota KEY N` (`0` to `100`). Registering a subagent run consumes one
package/dist/accounts.js CHANGED
@@ -304,7 +304,23 @@ export async function pickHeadroomAccount({ runtime, from, exclude = [], workCla
304
304
  return results.find((result) => !result.error && (ADMITS[workClass] ?? ADMITS.long).includes(result.band)) ?? null;
305
305
  }
306
306
 
307
- const READERS = { claude: readClaudeUsage, codex: readCodexUsage };
307
+ /**
308
+ * DEV-PROCESS-1 item 8: a stub account's reading, from its drill folder's
309
+ * usage.json, which the drill writes: {windows} is a reading, {status: 429}
310
+ * the usage endpoint refusing, {status: "expired"} a lapsed sign-in. No token
311
+ * and no network: a stub account is never a real one.
312
+ */
313
+ export async function readStubUsage(profile, { read = readFile, now = () => new Date() } = {}) {
314
+ let usage;
315
+ try { usage = JSON.parse(await read(join(profile, "usage.json"), "utf8")); }
316
+ catch { throw new CliError("ACCOUNT_USAGE_UNAVAILABLE", `The stub account ${profile} has no readable usage.json.`, 1); }
317
+ if (usage?.status === "expired") throw new CliError("ACCOUNT_TOKEN_EXPIRED", `The stub account ${profile}'s sign-in has expired.`, 1);
318
+ if (Number.isInteger(usage?.status)) throw new CliError("ACCOUNT_USAGE_UNAVAILABLE", `The stub account ${profile}'s usage endpoint answered ${usage.status}.`, 1, { httpStatus: usage.status });
319
+ const window = (value) => (value && typeof value.utilization === "number" ? { utilization: value.utilization, resetsAt: value.resetsAt ?? null } : null);
320
+ return { source: "stub-usage-file", measuredAt: now().toISOString(), windows: { fiveHour: window(usage?.windows?.fiveHour), sevenDay: window(usage?.windows?.sevenDay) } };
321
+ }
322
+
323
+ const READERS = { claude: readClaudeUsage, codex: readCodexUsage, stub: readStubUsage };
308
324
 
309
325
  /** The usage ceiling body Dev stores for one reading. */
310
326
  export function usageReport(reading) {
package/dist/cli.js CHANGED
@@ -13,6 +13,8 @@ import {
13
13
  readConfig,
14
14
  requestHash,
15
15
  requireFlag,
16
+ callSourceFor,
17
+ setCallSource,
16
18
  setLaneItemsObserver,
17
19
  writeConfig,
18
20
  } from "./core.js";
@@ -24,7 +26,7 @@ import {
24
26
  } from "./oauth.js";
25
27
  import { FIGMA_HOOK_DENIALS, heartbeatFromHook, postHook, postHookFailure, preHook, settingsSnippet, workflowSuggestion } from "./hooks.js";
26
28
  import { setupCommand } from "./setup.js";
27
- import { harnessCommand } from "./harness.js";
29
+ import { harnessCommand, harnessWeekCommand } from "./harness.js";
28
30
  import { readPolicy, repoCommand } from "./repo-policy.js";
29
31
  import { repoDocsCheckCommand } from "./tooling-docs.js";
30
32
  import { testCommand } from "./impact.js";
@@ -32,7 +34,8 @@ import { hookRuntime, recordHookFire, safetyContext } from "./safety.js";
32
34
  import { isLaneRunSession, isReviewSession } from "./review-session.js";
33
35
  import { HOOK_ANSWERS, errorText } from "./hook-handlers.js";
34
36
  import { SUBMIT_CHECK_FLAGS, changedPaths, nudgeStop, recordGathered, recordGuidelineRead, recordSubmitChecks, surfaceGenPre } from "./nudges.js";
35
- import { firstPromptText, isLaneConfig, sessionStartText, stewardCommand } from "./session-kind.js";
37
+ import { isLaneConfig, promptTurnText, sessionStartText, stewardCommand } from "./session-kind.js";
38
+ import { rulingCommand } from "./rulings.js";
36
39
  import { doctorCommand } from "./doctor.js";
37
40
  import { installManagedLatest, managedStatus } from "./managed-version.js";
38
41
  import { dispatchManagedClaudeHook, dispatchManagedHook } from "./managed-hooks.js";
@@ -145,7 +148,7 @@ import {
145
148
  } from "./runs.js";
146
149
  import { superviseLane } from "./lane-supervisor.js";
147
150
  import { laneLeewayCommand } from "./leeway.js";
148
- import { laneAnswerCommand, laneAskCommand, laneAsksCommand, laneDeferCommand } from "./lane-asks.js";
151
+ import { laneDeferCommand, refuseRetiredLaneAsk } from "./lane-asks.js";
149
152
  import { laneInboxCommand, laneMessageCommand } from "./lane-messages.js";
150
153
  import { coordinatorGate, coordinatorItemsCommand, observeLaneItems, resetLaneItemsNotice, takeLaneItemsLine } from "./coordinator-items.js";
151
154
  import { awsCli, superviseRemoteRun } from "./remote.js";
@@ -316,10 +319,24 @@ Usage: nodii-dev <command> [options] [--json]
316
319
  # staff or the hub's Steward: not canonical. Closes its sets still editing
317
320
  # or awaiting publish, and refuses new locks
318
321
  hook claude-figma-pre|claude-figma-post|safety-pre|safety-post|nudge-pre|nudge-stop|surface-gen-pre|coordinator-gate|tooling-docs|session-start|session-kind|managed-dispatch|claude-managed-dispatch|print-settings
319
- # session-start and session-kind (first prompt) print the session's kind:
320
- # lane, coordinator, steward or operator assistant, with its contract (MW1-92)
322
+ # session-start and session-kind (its first prompt) print the session's kind:
323
+ # lane, coordinator, steward or operator assistant, with its contract (MW1-92).
324
+ # session-kind runs every prompt: it keeps the turn on this machine only
325
+ # (0600, latest turn per session, never sent) as ruling file's proof, adds
326
+ # one line asking the session to file the person's rules verbatim, and shows
327
+ # a steward session its unread lane messages from its local inbox (MW1-115)
328
+ ruling file --text TEXT # file the person's exact words, typed this turn, as a ruling (MW1-115): Dev
329
+ # records them with person, session and time; words this session's prompt hook
330
+ # did not see typed, or no session id, are refused (RULING_NOT_TYPED) and nothing
331
+ # is sent; fewer than 3 words or 12 characters, or over 4000, is USAGE. --text -
332
+ # reads the exact words from stdin (a quoted heredoc). Binds nothing until sorted
333
+ # and uploaded
321
334
  steward register --focus TEXT --repos R,... [--side frontend|backend|both] [--key KEY]
335
+ steward register --focus TEXT --scratch
322
336
  # a steward is a lane of kind steward with no branch or worktree (MW1-93);
337
+ # --scratch: a throwaway steward with no repository, outside the weekly
338
+ # numbers. Registering sends the session's Claude or Codex process, and the
339
+ # watchdog sweep reports the steward dead when that process ends (MW1-36.5);
323
340
  # then lane gather <key> --picker agent (MW1-94); a new focus is a lane amend
324
341
  steward show # this agent's live steward registration
325
342
  setup [--yes|--check] # dry-run by default; installs/checks Ollama and pulls the Gather model
@@ -327,7 +344,17 @@ Usage: nodii-dev <command> [options] [--json]
327
344
  harness install|update [--include-drafts[=false]] [--adopt PATH,...] [--dry-run] [--system]
328
345
  # --system stages managed hooks and only prints operator-reviewed sudo commands
329
346
  harness check # 0 current, 1 differs from Dev, 2 not installed
347
+ harness drill lanes # DEV-PROCESS-1 done check, Part A: about an hour of scratch lanes on the
348
+ # stub runtime (no model, no account), run by the machine's coordinator;
349
+ # prints every pid, run id and Dev record it read; exit 1 unless checks
350
+ # 1 to 12 all hold. Its fixtures are the planner's (frozen)
330
351
  harness update --check # the same check
352
+ harness week # the weekly page (O3 item 4, MW5-8.1): run-hours that pushed nothing by
353
+ # ending class with tokens, unknown and claimed waits, top refusals, hours
354
+ # main was red, lane states, test baselines, Dev calls per machine (hook,
355
+ # gather, command: n, ms, mean, since), CLI versions and machines needing
356
+ # root, runs per machine with scratch apart, and every run (lane, step,
357
+ # start reason, tokens, duration, ending, machine); --json prints Dev's payload
331
358
  repo policy # print this repository's nodii.repo.yaml facts (STD-11)
332
359
  repo lint # 0 clean, 1 findings: policy file missing or invalid, stray root
333
360
  # files, docs layout, scratch not gitignored, test scripts
@@ -398,15 +425,15 @@ Usage: nodii-dev <command> [options] [--json]
398
425
  # components of finished sets (awaiting_publish), unticks the rest, reports
399
426
  # what it can't map, publishes and records it (figma published)
400
427
  coordinator items [--machine NAME|ID]
401
- # MW1-37.2: what lanes wait on this coordinator for (questions, leeway asks,
402
- # waits, escalations), each with the command that clears it. Every command
428
+ # MW1-37.2: what lanes wait on this coordinator for (leeway asks, waits,
429
+ # escalations), each with the command that clears it. Every command
403
430
  # a coordinator runs prints the count first, on stderr:
404
- # 3 from lanes waiting on you: 1 leeway (k), 2 questions (k 34 min, ...)
405
- # While an ask or a leeway has waited over 10 minutes, the managed hooks
406
- # refuse the coordinator's next nodii-dev write until it is answered, granted,
431
+ # 3 from lanes waiting on you: 1 leeway (k), 2 waits (k, ...)
432
+ # While a leeway has waited over 10 minutes, the managed hooks
433
+ # refuse the coordinator's next nodii-dev write until it is granted,
407
434
  # refused or deferred; a question to the operator is never held (MW1-116) and
408
435
  # passes with the waiting items named. Reads, inbox,
409
- # lane answer|defer, lane leeway grant|refuse, lane resume|close|stop pass.
436
+ # lane defer, lane leeway grant|refuse, lane resume|close|stop pass.
410
437
  # The gate runs only where coordinator start wrote coordinator.json beside
411
438
  # the config, and passes when Dev cannot be read
412
439
  coordinator gather [--objective TEXT] [--picker agent] [--delta] [--show]
@@ -498,7 +525,10 @@ Usage: nodii-dev <command> [options] [--json]
498
525
  # untracked included) back to the test files that import them, run with
499
526
  # each package's own runner. A manifest, lockfile, test or build config, or
500
527
  # a data file nothing names selects the full suite. --run runs them in a
501
- # light slot (where the machine has a light pool) when at most --max-light (20) files are affected, else heavy
528
+ # light slot (where the machine has a light pool) when at most --max-light (20) files are affected, else heavy.
529
+ # A failure main already has is a baseline (MW2-21): failed files rerun alone, and
530
+ # those the branch did not change rerun at the merge base (cached per base); it
531
+ # passes, naming "red on main at SHA", when every failure is main's
502
532
  heavy run [--size light|heavy] -- <command...>
503
533
  # run heavy work (tests, typecheck, build, gate, git push, image build,
504
534
  # detached stack start) under one machine-wide slot (MW2-51): waits in FIFO
@@ -565,14 +595,6 @@ Usage: nodii-dev <command> [options] [--json]
565
595
  # lane's in-flight branch, or credentials; chains stop at depth 2 and a lane
566
596
  # holds at most 2 open leeways (MW1-12.8). Refusal codes: see "Refusals" below
567
597
  lane leeway withdraw <id> # the lane takes its ask back
568
- lane ask <key> --question TEXT [--options a,b]
569
- # OFF unless NODII_DEV_LANE_ASKS=1 (MW1-37.2: lane asks ship off by default):
570
- # lane ask, lane answer and lane asks then refuse LANE_ASKS_OFF and call
571
- # nothing, lane defer takes its id as a leeway, and the coordinator's count,
572
- # coordinator items and the gate leave questions out. On:
573
- # MW1-12.9: a lane asks its machine coordinator a question. The answer
574
- # reaches it as an amendment it acknowledges with lane gather --delta;
575
- # lane ask withdraw <ask id> takes the question back
576
598
  lane message <to> --body TEXT|--body-file FILE [--issue ISSUE]
577
599
  # On unless NODII_DEV_LANE_MESSAGES=0 (MW1-12.11; =0: lane message and lane
578
600
  # inbox refuse LANE_MESSAGES_OFF and call nothing, and no hook delivers from
@@ -589,14 +611,16 @@ Usage: nodii-dev <command> [options] [--json]
589
611
  # machine, or on none, is refused COORDINATOR_OTHER_MACHINE, nothing recorded
590
612
  lane inbox [<key>] [--all] # the unread messages (--all: every one), marked read; also pulls in Dev's
591
613
  # record of messages sent from another machine
592
- lane answer <ask id> --text TEXT # the coordinator (or staff) answers; Dev delivers it as that amendment
593
- lane defer <ask or leeway id> --reason TEXT [--minutes N] [--leeway]
594
- # the coordinator puts an ask or a leeway off, with a reason, for N minutes
595
- # (default 60, at most 240); it counts again after that. The id is tried as
596
- # an ask, then as a leeway; --leeway goes straight to the leeway
597
- lane asks [--machine M] [--state S] [--lane KEY] [--cursor C] [--limit N]
614
+ lane defer <leeway id> --reason TEXT [--minutes N]
615
+ # the coordinator puts a leeway off, with a reason, for N minutes
616
+ # (default 60, at most 240); it counts again after that. It takes a leeway
617
+ # id only (lane asks are retired); --leeway is still accepted and changes nothing
618
+ # lane ask, lane asks and lane answer were retired in 0.6.209 (DEV-PROCESS-5,
619
+ # row 29b): typing one is refused USAGE (exit 2) and calls nothing. A lane
620
+ # waiting on a person records lane heartbeat <key> --waiting-on person:ROLE;
621
+ # the role reads them with lane waits --person ROLE
598
622
  lane leeway list [--machine M] [--state S] [--lane KEY] [--cursor C] [--limit N] | lane leeway show <id>
599
- lane heartbeat <key> --waiting-on LANE|owner/repo#n|Q-nnn|DEC-nnnn|release:PKG|launch-day [...]
623
+ lane heartbeat <key> --waiting-on LANE|owner/repo#n|Q-nnn|DEC-nnnn|release:PKG|person:ROLE|launch-day [...]
600
624
  # repeatable; replaces the lane's waits (a WAITING note's lane keys and
601
625
  # repo#n count too; a note that is no wait clears them). A wait on another
602
626
  # lane raises its priority by one and notifies the machine coordinator
@@ -725,8 +749,10 @@ Usage: nodii-dev <command> [options] [--json]
725
749
  # DEC-0011: terminal non_issue; issue -> wont_do; slot frees
726
750
  lane list [--kind KIND] [--status STATUS] [--mine] [--sort created|priority] [--cursor CURSOR]
727
751
  # --sort priority: live lanes by effective priority (own + lanes waiting)
728
- lane waits [--machine ID] # the wait graph: lanes others wait on, chains through stuck or orphaned
729
- # lanes, and lanes held per operator question, decision and launch day
752
+ lane waits [--machine ID] [--person ROLE]
753
+ # the wait graph: lanes others wait on, chains through stuck or orphaned
754
+ # lanes, and lanes held per operator question, decision, launch day and
755
+ # role (person:ROLE); --person ROLE lists only that role's waits
730
756
  lane show <key> | next <key> [--paths A,B] [--components K,L] [--role R]
731
757
  # next step, plus the rules Dev serves for it (DEC-0020)
732
758
  lane gather [key] [--delta] [--paths A,B] [--components K,L]
@@ -761,7 +787,7 @@ notification-registry, skills, open-questions, decisions, drift, requests,
761
787
  rulebook, ad-decisions, domains, standardizations, archive, harness, utils,
762
788
  runs, releases, and operate.
763
789
 
764
- Refusals of leeway, lane questions, the coordinator's items, lane finish, lane resume, the managed hooks and the docs check
790
+ Refusals of leeway, the coordinator's items, lane finish, lane resume, the managed hooks, the docs check, the version floor and ruling file
765
791
  (each line: the code, what it means, and what to do next):
766
792
  LEEWAY_BLOCKER_HELD Another live lane already holds leeway for this blocker; Dev names it and records your wait on it. Next: keep working what is not blocked and resume when the holder lands
767
793
  LEEWAY_BRANCH_HELD Another live lane is already working this issue as its own, so its in-flight branch is not yours to change (MW1-12.8). Next: wait on that lane with lane heartbeat KEY --waiting-on LANE
@@ -782,21 +808,20 @@ Refusals of leeway, lane questions, the coordinator's items, lane finish, lane r
782
808
  LEEWAY_WORKTREE_FAILED The leeway is granted, but its worktree could not be created. Next: create it with the worktree command the refusal prints, then tell the lane
783
809
  REPO_NOT_GRANTED The lane's agent has no grant for the repository the leeway adds. Next: grant the agent the repository, then grant the leeway again
784
810
  LANE_WORKTREE_TAKEN Another lane already records the worktree path the grant names. Next: pass another --worktree PATH
785
- LANE_NOTES_FULL The grant's or answer's note would take the lane past its note cap. Next: fold superseded amendments into one note first (lane amendments fold)
786
- MACHINE_REQUIRED The caller coordinates no machine, so Dev cannot tell whose items or asks to list. Next: pass --machine NAME|ID
787
- LANE_ASKS_OFF lane ask, lane answer or lane asks while lane questions are off (the default). Next: write the question as an issue comment or a heartbeat note; NODII_DEV_LANE_ASKS=1 turns the commands on
811
+ LANE_NOTES_FULL The grant's note would take the lane past its note cap. Next: fold superseded amendments into one note first (lane amendments fold)
812
+ MACHINE_REQUIRED The caller coordinates no machine, so Dev cannot tell whose items or leeways to list. Next: pass --machine NAME|ID
788
813
  RESUME_IF_CHANGED_OFF lane resume --if-changed while NODII_DEV_RESUME_IF_CHANGED=0 turns it off. Next: resume without it, as before; unset the variable to turn it back on
789
814
  LANE_MESSAGES_OFF lane message or lane inbox while NODII_DEV_LANE_MESSAGES=0 turns lane messages off. Next: write to the other lane as a comment on its issue, or unset NODII_DEV_LANE_MESSAGES
790
815
  COORDINATOR_OTHER_MACHINE lane message from a coordinator to a lane Dev places on another machine, or on none (MW1-37.3); nothing is recorded. Next: that machine's coordinator messages it
791
816
  ISSUES_GROUP_OFF issues group while NODII_DEV_ISSUES_GROUP=0 turns it off. Next: choose the lane's issue set by hand with issues list, or unset NODII_DEV_ISSUES_GROUP
792
- ASK_NOT_FOUND Dev has no lane ask with this id. Next: list them with lane asks
793
- ASK_DECIDED The ask is already answered or withdrawn. Next: read it with lane asks --lane KEY
794
817
  LANE_NOT_FINISHED lane close before the lane's own agent marked the lane finished. Next: the lane runs lane finish KEY --reason TEXT --evidence REF
795
818
  LANE_ALREADY_FINISHED The lane is already marked finished. Next: nothing; its coordinator closes it with lane close
796
819
  ACCOUNT_EXHAUSTED lane resume would relaunch onto a profile whose last run died on a usage limit, auth or the network, before its recorded reset, and no other account of its runtime has headroom. Next: resume after the reset it names, or move it with lane resume KEY --profile PATH --class CLASS
797
820
  HARNESS_INVALID A managed hook entry is not one nodii-dev command, or Dev's harness cannot take the managed hooks. Next: run harness update, and file the entry as a harness issue
798
821
  HARNESS_SETTINGS_INVALID .claude/settings.json or .codex/hooks.json is not valid JSON. Next: repair the file, then run harness update
799
822
  TOOLING_DOCS_STALE The change touches a tooling file named in nodii.repo.yaml (toolingDocs.tooling) and no docs file (toolingDocs.docs), so hook tooling-docs refuses the push or the pull request (MW1-46.3). Next: update the docs in the same change, or add the commit trailer Docs-unaffected: <reason>; check with repo docs-check
823
+ VERSION_BELOW_FLOOR Dev refuses an agent's write from a CLI below its version floor (HTTP 426); the message names the floor and this version. Next: run nodii-dev harness update, then retry
824
+ RULING_NOT_TYPED ruling file --text was given words this session's prompt hook did not see typed in its current turn (within 30 minutes), or the command names no session (CLAUDE_SESSION_ID or CLAUDE_CODE_SESSION_ID); nothing was sent. Next: file only the person's exact words, in the turn they typed them
800
825
 
801
826
  Run a command with --help or see the package README for all flags.`;
802
827
 
@@ -1105,6 +1130,8 @@ const readsHelp = (argv) => argv[0] === "help" || argv.some((token) => ["--help"
1105
1130
  export const runsBackstop = (argv) => argv[0] !== "hook" && argv[0] !== "__run-supervisor" && !readsHelp(argv);
1106
1131
 
1107
1132
  export async function main(argv = process.argv.slice(2)) {
1133
+ // O3 item 4: what this process's Dev calls count as (hook, gather, command).
1134
+ setCallSource(callSourceFor(argv));
1108
1135
  // Ahead of every check that reaches Dev: a session the lane spawned gets
1109
1136
  // nothing from these hooks. The safety hooks still run.
1110
1137
  if (argv[0] === "hook" && LANE_RUN_HOOKS.has(argv[1]) && (await inSpawnedSession())) return;
@@ -1114,6 +1141,8 @@ export async function main(argv = process.argv.slice(2)) {
1114
1141
  setLaneItemsObserver(argv[0] === "hook" || argv[0]?.startsWith("__") ? null : observeLaneItems);
1115
1142
  // A lane's own exit reporter runs after its runtime ends (NODII-DEV-CLI-1).
1116
1143
  if (argv[0] === "__lane-supervisor") return superviseLane();
1144
+ // DEV-PROCESS-5, row 29b: the retired lane-ask family is refused before anything reaches Dev.
1145
+ refuseRetiredLaneAsk(argv);
1117
1146
  if (runsBackstop(argv)) {
1118
1147
  await amendmentGuard(argv);
1119
1148
  await showWaitingResults();
@@ -1265,6 +1294,14 @@ export async function main(argv = process.argv.slice(2)) {
1265
1294
  if (result.exitCode) process.exitCode = result.exitCode;
1266
1295
  return;
1267
1296
  }
1297
+ // O3 item 4 (MW5-8.1, DEC-0569): the weekly page, read from Dev and printed for a non-builder.
1298
+ if (command === "harness" && action === "week") return emitCommand(await harnessWeekCommand(rest, f));
1299
+ if (command === "harness" && action === "drill") {
1300
+ // DEV-PROCESS-1: the frozen done check's Part A. `lanes` is its one drill.
1301
+ if (rest.length !== 1 || rest[0] !== "lanes") throw new CliError("USAGE", "harness drill lanes takes no other arguments.", 2);
1302
+ const { drillLanesCommand } = await import("./drill.js");
1303
+ return emitCommand(await drillLanesCommand());
1304
+ }
1268
1305
  if (command === "harness" && ["install", "update", "check"].includes(action)) {
1269
1306
  // `--include-drafts` is a switch: `--include-drafts false` would leave `false` here and turn drafts on.
1270
1307
  if (rest.length) throw new CliError("USAGE", `harness ${action} takes no arguments, got: ${rest.join(" ")}. Write a flag value as --include-drafts=false.`, 2);
@@ -1357,12 +1394,10 @@ export async function main(argv = process.argv.slice(2)) {
1357
1394
  }
1358
1395
  if (command === "coordinator") return emitCommand(await coordinatorCommand(action, f, { installWatchdog }));
1359
1396
  if (command === "steward") return emitCommand(await stewardCommand(action, rest, f));
1397
+ if (command === "ruling") return emitCommand(await rulingCommand(action, rest, f));
1360
1398
  if (command === "lane" && action === "launch") return emitCommand(await launchLaneCommand(rest[0], f));
1361
1399
  if (command === "lane" && action === "repo") return emitCommand(await laneRepoCommand(rest[0], rest.slice(1), f));
1362
1400
  if (command === "lane" && action === "leeway") return emitCommand(await laneLeewayCommand(rest, f));
1363
- if (command === "lane" && action === "ask") return emitCommand(await laneAskCommand(rest, f));
1364
- if (command === "lane" && action === "asks") return emitCommand(await laneAsksCommand(rest, f));
1365
- if (command === "lane" && action === "answer") return emitCommand(await laneAnswerCommand(rest, f));
1366
1401
  if (command === "lane" && action === "defer") return emitCommand(await laneDeferCommand(rest, f));
1367
1402
  if (command === "lane" && action === "message") return emitCommand(await laneMessageCommand(rest, f));
1368
1403
  if (command === "lane" && action === "inbox") return emitCommand(await laneInboxCommand(rest, f));
@@ -1992,7 +2027,7 @@ export async function main(argv = process.argv.slice(2)) {
1992
2027
  return;
1993
2028
  }
1994
2029
  if (action === "session-kind") {
1995
- const context = await firstPromptText(payload).catch(() => null);
2030
+ const context = await promptTurnText(payload).catch(() => null);
1996
2031
  if (context) console.log(context);
1997
2032
  return;
1998
2033
  }