@nodii/dev 0.6.208 → 0.6.209
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 +105 -38
- package/dist/cli.js +64 -39
- package/dist/coordinator-items.js +31 -36
- package/dist/coordinator-watch.js +3 -1
- package/dist/core.js +72 -9
- package/dist/figma-scope.js +31 -6
- package/dist/flags.js +6 -4
- package/dist/harness.js +105 -2
- package/dist/impact.js +304 -12
- package/dist/lane-asks.js +22 -87
- package/dist/lane-messages.js +63 -1
- package/dist/lane-switches.js +1 -1
- package/dist/lanes.js +26 -5
- package/dist/managed-version.js +90 -11
- package/dist/nodii-dev.js +2 -0
- package/dist/process-tree.js +18 -0
- package/dist/rulings.js +77 -0
- package/dist/safety.js +3 -1
- package/dist/session-kind.js +164 -15
- package/dist/setup.js +1 -1
- package/dist/starting.js +2 -2
- package/dist/surface.js +10 -3
- package/dist/watchdog.js +108 -5
- package/package.json +1 -1
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 #
|
|
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.
|
|
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
|
|
772
|
-
|
|
773
|
-
|
|
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"
|
|
@@ -918,6 +949,7 @@ nodii-dev repo policy [--json] # print this repository's nodii.r
|
|
|
918
949
|
nodii-dev repo lint [--json] # 0 clean, 1 findings
|
|
919
950
|
nodii-dev repo docs-check [--base REF] [--json] # 0 clean or not checked, 1 TOOLING_DOCS_STALE (docs move with tooling)
|
|
920
951
|
nodii-dev harness update --check # the same check
|
|
952
|
+
nodii-dev harness week [--json] # the weekly page, read from Dev (O3 item 4, MW5-8.1)
|
|
921
953
|
nodii-dev watchdog install [--interval SECONDS] # macOS: com.nodii.watchdog in ~/Library/LaunchAgents
|
|
922
954
|
# Linux: nodii-watchdog.service and .timer in ~/.config/systemd/user
|
|
923
955
|
nodii-dev watchdog sweep # the job's entrypoint; normally not run by hand
|
|
@@ -1742,6 +1774,35 @@ Inside a lane, a failed check is noted in the step, and the harness files
|
|
|
1742
1774
|
are left alone; the repository's orchestrator runs `harness update` in a
|
|
1743
1775
|
`chore` lane (MW5-8).
|
|
1744
1776
|
|
|
1777
|
+
`harness update` keeps whether this machine's managed install needs root in
|
|
1778
|
+
`~/.config/nodii-dev/needs-root.json`: `true` when npm refuses with a
|
|
1779
|
+
permission error at `~/.local` (the fallback itself, or no fallback to
|
|
1780
|
+
take), `false` after any install that lands or finds the copy current. The
|
|
1781
|
+
watchdog sweep reports it as `needsRoot` in the machine's host facts.
|
|
1782
|
+
|
|
1783
|
+
### The weekly page: `harness week`
|
|
1784
|
+
|
|
1785
|
+
`nodii-dev harness week` (O3 item 4, MW5-8.1, DEC-0569) reads `GET
|
|
1786
|
+
/harness/week` and prints, for someone who does not build, in this order:
|
|
1787
|
+
run-hours that pushed nothing per ending class, with tokens beside; unknown
|
|
1788
|
+
waits (a PR or release Dev traced to no lane) apart from claimed ones; the
|
|
1789
|
+
top refusals by code, route, caller and machine; hours main was red per
|
|
1790
|
+
repository; count and oldest age per lane state; test baselines at main's
|
|
1791
|
+
merge base; Dev calls per machine (`hook`, `gather`, `command`: calls, ms,
|
|
1792
|
+
mean, since); CLI versions (target, floor, each machine's version or `no
|
|
1793
|
+
version`, the machines needing root); runs per machine with scratch apart;
|
|
1794
|
+
rulings filed; and every run in the window with its lane, step, start
|
|
1795
|
+
reason, tokens, duration, ending class and machine. `--json` prints Dev's
|
|
1796
|
+
payload as it came. Dev computes every number; the window is the last seven
|
|
1797
|
+
days.
|
|
1798
|
+
|
|
1799
|
+
Every Dev request adds `{n, ms}` to `call-cost.json` in the nodii-dev
|
|
1800
|
+
config directory (the one lane configs under `agents/` share), bucketed
|
|
1801
|
+
`hook` (inside `nodii-dev hook ...`), `gather` (`lane gather`, `gather ...`)
|
|
1802
|
+
or `command`, with the `since` the file started. The write is best effort
|
|
1803
|
+
and never fails a request. The watchdog sweep sends it as `callCost` in the
|
|
1804
|
+
machine's host facts, with no Dev call of its own.
|
|
1805
|
+
|
|
1745
1806
|
## Preflight: `doctor`
|
|
1746
1807
|
|
|
1747
1808
|
Run `nodii-dev doctor` from the lane's worktree, with the lane agent's config,
|
|
@@ -2086,6 +2147,17 @@ pre-write hook refuse a file, page, section or set outside the scope with
|
|
|
2086
2147
|
scope is not bounded; a Freeze with `figma: []` means "no Figma" and refuses
|
|
2087
2148
|
every Figma lock and write.
|
|
2088
2149
|
|
|
2150
|
+
A Freeze's Figma boundary can also grant sections and pages by node id
|
|
2151
|
+
(hub-643): `figma: [{fileKey, componentSetKeys, sectionIds: ["154:9552"],
|
|
2152
|
+
pageIds: ["6:22"]}]`, written with `lane freeze swap <key> --section boundaries`.
|
|
2153
|
+
`figma lock` and `figma scope add|set` then take `--scope section:ID` or
|
|
2154
|
+
`--scope page:ID` for exactly those ids, beside the lane's component sets and
|
|
2155
|
+
granted creates; any other section or page, and a whole-file lock, is still
|
|
2156
|
+
`FIGMA_OUTSIDE_LANE_SCOPE`. A granted id that is not a plain node id is
|
|
2157
|
+
`FIGMA_SCOPE_INVALID`. Gather keeps the granted creates, sections and pages
|
|
2158
|
+
in the boundary it stores. Dev checks the same grant on its side (needs the
|
|
2159
|
+
hub change of the same issue).
|
|
2160
|
+
|
|
2089
2161
|
Objective, scope and rule changes are durable `lane amend` records, never chat
|
|
2090
2162
|
messages. A coordinator's or steward's `lane amend` waits for the operator's
|
|
2091
2163
|
approval (`lane amendments approve`, with their TOTP code). One code covers
|
|
@@ -2210,27 +2282,23 @@ instruction, and an exit is reported for `lane resume` instead of ending the
|
|
|
2210
2282
|
run `blocked`. While an amendment waits for its Delta gather, `lane leeway`
|
|
2211
2283
|
still runs.
|
|
2212
2284
|
|
|
2213
|
-
### Lane questions and the coordinator's items (MW1-
|
|
2214
|
-
|
|
2215
|
-
**Lane questions are
|
|
2216
|
-
`lane ask`, `lane ask withdraw`, `lane answer` and `lane asks
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
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.
|
|
2285
|
+
### Lane questions are retired, and the coordinator's items (MW1-37.2)
|
|
2286
|
+
|
|
2287
|
+
**Lane questions are retired** (DEV-PROCESS-5, row 29b: one in, one out).
|
|
2288
|
+
`lane ask`, `lane ask withdraw`, `lane answer` and `lane asks`, and their
|
|
2289
|
+
switch `NODII_DEV_LANE_ASKS`, were retired in 0.6.209; they had shipped off by
|
|
2290
|
+
default since 18 Nov (MW1-37.2). Typing one is refused `USAGE` (exit 2) and
|
|
2291
|
+
calls nothing: "lane ask, lane asks and lane answer were retired in 0.6.209
|
|
2292
|
+
(DEV-PROCESS-5, row 29b). A lane waiting on a person records `nodii-dev lane
|
|
2293
|
+
heartbeat <key> --waiting-on person:ROLE`; the role reads them with `nodii-dev
|
|
2294
|
+
lane waits --person ROLE`." That role wait is what replaced them: it is
|
|
2295
|
+
delivered to the role's steward at its next turn. The coordinator's count line,
|
|
2296
|
+
`coordinator items` and the coordinator gate never list, count or gate a
|
|
2297
|
+
question Dev still serves.
|
|
2298
|
+
|
|
2299
|
+
`lane defer LEEWAY_ID --reason TEXT [--minutes N]` puts a leeway off (default
|
|
2300
|
+
60 minutes, at most 240); it counts again after that. It takes a leeway id
|
|
2301
|
+
only; `--leeway` is still accepted and changes nothing.
|
|
2234
2302
|
|
|
2235
2303
|
### Lane feature switches (NODII-DEV-CLI-191)
|
|
2236
2304
|
|
|
@@ -2325,13 +2393,13 @@ Each message is delivered once. `lane inbox [KEY]` prints the unread messages
|
|
|
2325
2393
|
and marks them read (`--all` prints every one); it also reads Dev's record and
|
|
2326
2394
|
adds the messages sent from another machine that the local file lacks.
|
|
2327
2395
|
|
|
2328
|
-
Dev counts what lanes wait on a machine's coordinator for (
|
|
2329
|
-
|
|
2396
|
+
Dev counts what lanes wait on a machine's coordinator for (leeway asks, waits
|
|
2397
|
+
and escalations; a retired question is left out) and names the count in the `x-dev-lane-items`
|
|
2330
2398
|
response header. Every command the coordinator runs prints one line for it
|
|
2331
2399
|
first, on stderr, so `--json` output on stdout stays parseable:
|
|
2332
2400
|
|
|
2333
2401
|
```
|
|
2334
|
-
3 from lanes waiting on you: 1 leeway (hr-page-time), 2
|
|
2402
|
+
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
2403
|
```
|
|
2336
2404
|
|
|
2337
2405
|
The lane names come from `GET /coordinator/items`, cached and read again when
|
|
@@ -2346,11 +2414,11 @@ session ends); the managed dispatcher installed by `harness update --system`
|
|
|
2346
2414
|
(refreshed by a plain `harness update`) checks for that file, so only a
|
|
2347
2415
|
coordinator session pays for the gate, and only on a `Bash` call that names
|
|
2348
2416
|
`nodii-dev` or on `AskUserQuestion`. The gate reads `/coordinator/items`
|
|
2349
|
-
through a 10-second cache. While
|
|
2417
|
+
through a 10-second cache. While a leeway has waited over 10 minutes
|
|
2350
2418
|
and is not deferred, it denies a `nodii-dev` write, naming each item and its
|
|
2351
2419
|
command. A question to the operator is never denied (MW1-116): it passes with
|
|
2352
2420
|
the same items named. Reads, local commands (`heavy`,
|
|
2353
|
-
`run`, `doctor`), `inbox`, `coordinator ...`, `lane
|
|
2421
|
+
`run`, `doctor`), `inbox`, `coordinator ...`, `lane defer`, `lane leeway
|
|
2354
2422
|
grant|refuse|show|list`, `lane resume` and `lane close|stop` always pass, and so
|
|
2355
2423
|
does everything that is not `nodii-dev`. Waits and escalations are counted and
|
|
2356
2424
|
shown and never gate. When Dev cannot be read the call passes with the note
|
|
@@ -2417,17 +2485,16 @@ missing base ref, an invalid policy file or a git error lets the call through.
|
|
|
2417
2485
|
| `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
2486
|
| `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
2487
|
| `LANE_WORKTREE_TAKEN` | Another lane already records the worktree path the grant names | Pass another --worktree PATH |
|
|
2420
|
-
| `LANE_NOTES_FULL` | The grant's
|
|
2421
|
-
| `MACHINE_REQUIRED` | The caller coordinates no machine, so Dev cannot tell whose items or
|
|
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 |
|
|
2488
|
+
| `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) |
|
|
2489
|
+
| `MACHINE_REQUIRED` | The caller coordinates no machine, so Dev cannot tell whose items or leeways to list | Pass --machine NAME/ID |
|
|
2425
2490
|
| `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
2491
|
| `LANE_ALREADY_FINISHED` | The lane is already marked finished | Nothing; its coordinator closes it with lane close |
|
|
2427
2492
|
| `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
2493
|
| `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
2494
|
| `HARNESS_SETTINGS_INVALID` | .claude/settings.json or .codex/hooks.json is not valid JSON | Repair the file, then run harness update |
|
|
2430
2495
|
| `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 |
|
|
2496
|
+
| `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 |
|
|
2497
|
+
| `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
2498
|
|
|
2432
2499
|
The machine coordinator sets a lane's subagent capacity with `lane
|
|
2433
2500
|
subagent-quota KEY N` (`0` to `100`). Registering a subagent run consumes one
|
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 {
|
|
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 {
|
|
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
|
|
@@ -328,6 +345,12 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
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
|
|
330
347
|
harness update --check # the same check
|
|
348
|
+
harness week # the weekly page (O3 item 4, MW5-8.1): run-hours that pushed nothing by
|
|
349
|
+
# ending class with tokens, unknown and claimed waits, top refusals, hours
|
|
350
|
+
# main was red, lane states, test baselines, Dev calls per machine (hook,
|
|
351
|
+
# gather, command: n, ms, mean, since), CLI versions and machines needing
|
|
352
|
+
# root, runs per machine with scratch apart, and every run (lane, step,
|
|
353
|
+
# start reason, tokens, duration, ending, machine); --json prints Dev's payload
|
|
331
354
|
repo policy # print this repository's nodii.repo.yaml facts (STD-11)
|
|
332
355
|
repo lint # 0 clean, 1 findings: policy file missing or invalid, stray root
|
|
333
356
|
# files, docs layout, scratch not gitignored, test scripts
|
|
@@ -398,15 +421,15 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
398
421
|
# components of finished sets (awaiting_publish), unticks the rest, reports
|
|
399
422
|
# what it can't map, publishes and records it (figma published)
|
|
400
423
|
coordinator items [--machine NAME|ID]
|
|
401
|
-
# MW1-37.2: what lanes wait on this coordinator for (
|
|
402
|
-
#
|
|
424
|
+
# MW1-37.2: what lanes wait on this coordinator for (leeway asks, waits,
|
|
425
|
+
# escalations), each with the command that clears it. Every command
|
|
403
426
|
# a coordinator runs prints the count first, on stderr:
|
|
404
|
-
# 3 from lanes waiting on you: 1 leeway (k), 2
|
|
405
|
-
# While
|
|
406
|
-
# refuse the coordinator's next nodii-dev write until it is
|
|
427
|
+
# 3 from lanes waiting on you: 1 leeway (k), 2 waits (k, ...)
|
|
428
|
+
# While a leeway has waited over 10 minutes, the managed hooks
|
|
429
|
+
# refuse the coordinator's next nodii-dev write until it is granted,
|
|
407
430
|
# refused or deferred; a question to the operator is never held (MW1-116) and
|
|
408
431
|
# passes with the waiting items named. Reads, inbox,
|
|
409
|
-
# lane
|
|
432
|
+
# lane defer, lane leeway grant|refuse, lane resume|close|stop pass.
|
|
410
433
|
# The gate runs only where coordinator start wrote coordinator.json beside
|
|
411
434
|
# the config, and passes when Dev cannot be read
|
|
412
435
|
coordinator gather [--objective TEXT] [--picker agent] [--delta] [--show]
|
|
@@ -498,7 +521,10 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
498
521
|
# untracked included) back to the test files that import them, run with
|
|
499
522
|
# each package's own runner. A manifest, lockfile, test or build config, or
|
|
500
523
|
# 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
|
|
524
|
+
# light slot (where the machine has a light pool) when at most --max-light (20) files are affected, else heavy.
|
|
525
|
+
# A failure main already has is a baseline (MW2-21): failed files rerun alone, and
|
|
526
|
+
# those the branch did not change rerun at the merge base (cached per base); it
|
|
527
|
+
# passes, naming "red on main at SHA", when every failure is main's
|
|
502
528
|
heavy run [--size light|heavy] -- <command...>
|
|
503
529
|
# run heavy work (tests, typecheck, build, gate, git push, image build,
|
|
504
530
|
# detached stack start) under one machine-wide slot (MW2-51): waits in FIFO
|
|
@@ -565,14 +591,6 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
565
591
|
# lane's in-flight branch, or credentials; chains stop at depth 2 and a lane
|
|
566
592
|
# holds at most 2 open leeways (MW1-12.8). Refusal codes: see "Refusals" below
|
|
567
593
|
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
594
|
lane message <to> --body TEXT|--body-file FILE [--issue ISSUE]
|
|
577
595
|
# On unless NODII_DEV_LANE_MESSAGES=0 (MW1-12.11; =0: lane message and lane
|
|
578
596
|
# inbox refuse LANE_MESSAGES_OFF and call nothing, and no hook delivers from
|
|
@@ -589,14 +607,16 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
589
607
|
# machine, or on none, is refused COORDINATOR_OTHER_MACHINE, nothing recorded
|
|
590
608
|
lane inbox [<key>] [--all] # the unread messages (--all: every one), marked read; also pulls in Dev's
|
|
591
609
|
# record of messages sent from another machine
|
|
592
|
-
lane
|
|
593
|
-
|
|
594
|
-
#
|
|
595
|
-
# (
|
|
596
|
-
#
|
|
597
|
-
|
|
610
|
+
lane defer <leeway id> --reason TEXT [--minutes N]
|
|
611
|
+
# the coordinator puts a leeway off, with a reason, for N minutes
|
|
612
|
+
# (default 60, at most 240); it counts again after that. It takes a leeway
|
|
613
|
+
# id only (lane asks are retired); --leeway is still accepted and changes nothing
|
|
614
|
+
# lane ask, lane asks and lane answer were retired in 0.6.209 (DEV-PROCESS-5,
|
|
615
|
+
# row 29b): typing one is refused USAGE (exit 2) and calls nothing. A lane
|
|
616
|
+
# waiting on a person records lane heartbeat <key> --waiting-on person:ROLE;
|
|
617
|
+
# the role reads them with lane waits --person ROLE
|
|
598
618
|
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 [...]
|
|
619
|
+
lane heartbeat <key> --waiting-on LANE|owner/repo#n|Q-nnn|DEC-nnnn|release:PKG|person:ROLE|launch-day [...]
|
|
600
620
|
# repeatable; replaces the lane's waits (a WAITING note's lane keys and
|
|
601
621
|
# repo#n count too; a note that is no wait clears them). A wait on another
|
|
602
622
|
# lane raises its priority by one and notifies the machine coordinator
|
|
@@ -725,8 +745,10 @@ Usage: nodii-dev <command> [options] [--json]
|
|
|
725
745
|
# DEC-0011: terminal non_issue; issue -> wont_do; slot frees
|
|
726
746
|
lane list [--kind KIND] [--status STATUS] [--mine] [--sort created|priority] [--cursor CURSOR]
|
|
727
747
|
# --sort priority: live lanes by effective priority (own + lanes waiting)
|
|
728
|
-
lane waits [--machine ID]
|
|
729
|
-
#
|
|
748
|
+
lane waits [--machine ID] [--person ROLE]
|
|
749
|
+
# the wait graph: lanes others wait on, chains through stuck or orphaned
|
|
750
|
+
# lanes, and lanes held per operator question, decision, launch day and
|
|
751
|
+
# role (person:ROLE); --person ROLE lists only that role's waits
|
|
730
752
|
lane show <key> | next <key> [--paths A,B] [--components K,L] [--role R]
|
|
731
753
|
# next step, plus the rules Dev serves for it (DEC-0020)
|
|
732
754
|
lane gather [key] [--delta] [--paths A,B] [--components K,L]
|
|
@@ -761,7 +783,7 @@ notification-registry, skills, open-questions, decisions, drift, requests,
|
|
|
761
783
|
rulebook, ad-decisions, domains, standardizations, archive, harness, utils,
|
|
762
784
|
runs, releases, and operate.
|
|
763
785
|
|
|
764
|
-
Refusals of leeway,
|
|
786
|
+
Refusals of leeway, the coordinator's items, lane finish, lane resume, the managed hooks, the docs check, the version floor and ruling file
|
|
765
787
|
(each line: the code, what it means, and what to do next):
|
|
766
788
|
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
789
|
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 +804,20 @@ Refusals of leeway, lane questions, the coordinator's items, lane finish, lane r
|
|
|
782
804
|
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
805
|
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
806
|
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
|
|
786
|
-
MACHINE_REQUIRED The caller coordinates no machine, so Dev cannot tell whose items or
|
|
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
|
|
807
|
+
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)
|
|
808
|
+
MACHINE_REQUIRED The caller coordinates no machine, so Dev cannot tell whose items or leeways to list. Next: pass --machine NAME|ID
|
|
788
809
|
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
810
|
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
811
|
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
812
|
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
813
|
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
814
|
LANE_ALREADY_FINISHED The lane is already marked finished. Next: nothing; its coordinator closes it with lane close
|
|
796
815
|
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
816
|
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
817
|
HARNESS_SETTINGS_INVALID .claude/settings.json or .codex/hooks.json is not valid JSON. Next: repair the file, then run harness update
|
|
799
818
|
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
|
|
819
|
+
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
|
|
820
|
+
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
821
|
|
|
801
822
|
Run a command with --help or see the package README for all flags.`;
|
|
802
823
|
|
|
@@ -1105,6 +1126,8 @@ const readsHelp = (argv) => argv[0] === "help" || argv.some((token) => ["--help"
|
|
|
1105
1126
|
export const runsBackstop = (argv) => argv[0] !== "hook" && argv[0] !== "__run-supervisor" && !readsHelp(argv);
|
|
1106
1127
|
|
|
1107
1128
|
export async function main(argv = process.argv.slice(2)) {
|
|
1129
|
+
// O3 item 4: what this process's Dev calls count as (hook, gather, command).
|
|
1130
|
+
setCallSource(callSourceFor(argv));
|
|
1108
1131
|
// Ahead of every check that reaches Dev: a session the lane spawned gets
|
|
1109
1132
|
// nothing from these hooks. The safety hooks still run.
|
|
1110
1133
|
if (argv[0] === "hook" && LANE_RUN_HOOKS.has(argv[1]) && (await inSpawnedSession())) return;
|
|
@@ -1114,6 +1137,8 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1114
1137
|
setLaneItemsObserver(argv[0] === "hook" || argv[0]?.startsWith("__") ? null : observeLaneItems);
|
|
1115
1138
|
// A lane's own exit reporter runs after its runtime ends (NODII-DEV-CLI-1).
|
|
1116
1139
|
if (argv[0] === "__lane-supervisor") return superviseLane();
|
|
1140
|
+
// DEV-PROCESS-5, row 29b: the retired lane-ask family is refused before anything reaches Dev.
|
|
1141
|
+
refuseRetiredLaneAsk(argv);
|
|
1117
1142
|
if (runsBackstop(argv)) {
|
|
1118
1143
|
await amendmentGuard(argv);
|
|
1119
1144
|
await showWaitingResults();
|
|
@@ -1265,6 +1290,8 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1265
1290
|
if (result.exitCode) process.exitCode = result.exitCode;
|
|
1266
1291
|
return;
|
|
1267
1292
|
}
|
|
1293
|
+
// O3 item 4 (MW5-8.1, DEC-0569): the weekly page, read from Dev and printed for a non-builder.
|
|
1294
|
+
if (command === "harness" && action === "week") return emitCommand(await harnessWeekCommand(rest, f));
|
|
1268
1295
|
if (command === "harness" && ["install", "update", "check"].includes(action)) {
|
|
1269
1296
|
// `--include-drafts` is a switch: `--include-drafts false` would leave `false` here and turn drafts on.
|
|
1270
1297
|
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 +1384,10 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1357
1384
|
}
|
|
1358
1385
|
if (command === "coordinator") return emitCommand(await coordinatorCommand(action, f, { installWatchdog }));
|
|
1359
1386
|
if (command === "steward") return emitCommand(await stewardCommand(action, rest, f));
|
|
1387
|
+
if (command === "ruling") return emitCommand(await rulingCommand(action, rest, f));
|
|
1360
1388
|
if (command === "lane" && action === "launch") return emitCommand(await launchLaneCommand(rest[0], f));
|
|
1361
1389
|
if (command === "lane" && action === "repo") return emitCommand(await laneRepoCommand(rest[0], rest.slice(1), f));
|
|
1362
1390
|
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
1391
|
if (command === "lane" && action === "defer") return emitCommand(await laneDeferCommand(rest, f));
|
|
1367
1392
|
if (command === "lane" && action === "message") return emitCommand(await laneMessageCommand(rest, f));
|
|
1368
1393
|
if (command === "lane" && action === "inbox") return emitCommand(await laneInboxCommand(rest, f));
|
|
@@ -1992,7 +2017,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
1992
2017
|
return;
|
|
1993
2018
|
}
|
|
1994
2019
|
if (action === "session-kind") {
|
|
1995
|
-
const context = await
|
|
2020
|
+
const context = await promptTurnText(payload).catch(() => null);
|
|
1996
2021
|
if (context) console.log(context);
|
|
1997
2022
|
return;
|
|
1998
2023
|
}
|