@nodii/dev 0.6.174 → 0.6.176
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 +404 -20
- package/dist/accounts.js +62 -1
- package/dist/cli.js +255 -85
- package/dist/coordinator-items.js +235 -0
- package/dist/core.js +13 -2
- package/dist/flags.js +15 -2
- package/dist/freeze.js +35 -2
- package/dist/gather.js +14 -3
- package/dist/harness.js +2 -0
- package/dist/hook-handlers.js +127 -0
- package/dist/hooks.js +22 -6
- package/dist/issue-group.js +63 -0
- package/dist/lane-asks.js +115 -0
- package/dist/lane-messages.js +313 -0
- package/dist/lane-runtime.js +7 -1
- package/dist/lane-supervisor.js +366 -23
- package/dist/lane-switches.js +32 -0
- package/dist/lanes.js +105 -17
- package/dist/leeway.js +218 -0
- package/dist/managed-hooks.js +58 -6
- package/dist/nudges.js +55 -21
- package/dist/repo-policy.js +13 -1
- package/dist/resume-gate.js +150 -0
- package/dist/runtime-launcher.js +64 -4
- package/dist/safety.js +69 -6
- package/dist/session-kind.js +18 -5
- package/dist/setup.js +8 -5
- package/dist/starting.js +114 -21
- package/dist/tooling-docs.js +127 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -543,6 +543,9 @@ nodii-dev hook safety-post # silently records resources created by su
|
|
|
543
543
|
nodii-dev hook nudge-pre # guideline nudges before a tool call; never blocks. In a steward
|
|
544
544
|
# session: cite before you steer (MW1-95)
|
|
545
545
|
nodii-dev hook surface-gen-pre # MW8-17 Surface-generation nudge; every session, never blocks
|
|
546
|
+
nodii-dev hook coordinator-gate # MW1-37.2: holds a coordinator's nodii-dev write while a lane item waits
|
|
547
|
+
nodii-dev hook tooling-docs # MW1-46.3: refuses git push and gh pr create|ready when tooling changed
|
|
548
|
+
# with no docs change (TOOLING_DOCS_STALE); every session, fails open
|
|
546
549
|
nodii-dev hook session-start # every SessionStart: the session's kind and contract (MW1-92); after
|
|
547
550
|
# compaction also the lane's or steward's Freeze
|
|
548
551
|
nodii-dev hook session-kind # first prompt only: confirms or corrects the kind from the prompt
|
|
@@ -568,7 +571,7 @@ map. Gather pins the always-on clauses for a lane's repository and side
|
|
|
568
571
|
(`GET /rules/gather-pins`), marked `always-on` in the Clause map.
|
|
569
572
|
|
|
570
573
|
The hooks that run on every tool call or stop (`safety-pre`, `nudge-pre`,
|
|
571
|
-
`nudge-stop`, `lane-heartbeat
|
|
574
|
+
`nudge-stop`, `lane-heartbeat` on stop, and `claude-figma-pre` on a Figma write) read the lane from Dev on each call, never from
|
|
572
575
|
a kept copy, and ask for as little as decides the same thing
|
|
573
576
|
(hub-528). A lane is read as `GET /lanes/KEY?view=hook`: only the
|
|
574
577
|
fields the hooks use, without the lane's timeline. A Dev that does not know
|
|
@@ -604,6 +607,8 @@ nodii-dev lane start KEY --title TEXT --kind dev_fix|new_build|docs_change|uat_f
|
|
|
604
607
|
nodii-dev lane step KEY --side backend|frontend --start|--done|--block STEP [--reason TEXT]
|
|
605
608
|
# --reason is kept as a lane note; on a step already blocked,
|
|
606
609
|
# --block --reason records the new reason (Dev issue 125 moves it onto the step)
|
|
610
|
+
# blocked on an open issue that no live lane holds: ask for leeway
|
|
611
|
+
# (lane leeway) instead of ending BLOCKED (MW1-12.6, DEC-0486)
|
|
607
612
|
nodii-dev lane step KEY --side backend|frontend --done STEP --review REVIEW.json
|
|
608
613
|
# build_test, adopt_test and local_test record their review (as lane review)
|
|
609
614
|
# first; a refused review leaves the step open
|
|
@@ -616,11 +621,41 @@ nodii-dev lane done-check KEY --evidence TEXT|URL
|
|
|
616
621
|
# lane already on_dev (land → verify first) it is a no-op
|
|
617
622
|
# refused with FIGMA_AFTER_IMAGES_MISSING while an open change
|
|
618
623
|
# set the lane holds has a changed node with no after image
|
|
624
|
+
nodii-dev lane finish KEY --reason TEXT --evidence TEXT|URL
|
|
625
|
+
# the lane's own agent marks the lane finished (MW1-28.2):
|
|
626
|
+
# why, and what it delivered and where its branch and
|
|
627
|
+
# commits went. The lane keeps its status and its slot; its
|
|
628
|
+
# coordinator's `lane close` is refused LANE_NOT_FINISHED
|
|
629
|
+
# without this record. A launched run that exits 0 after
|
|
630
|
+
# its done check records it itself, with that evidence
|
|
619
631
|
nodii-dev lane subagent-quota KEY N
|
|
620
632
|
nodii-dev lane heartbeat KEY [--note TEXT]
|
|
621
633
|
# a note starting "BLOCKED" or "WAITING:" (capitals) marks
|
|
622
634
|
# the lane blocked: an exit then ends its run blocked and
|
|
623
635
|
# never counts toward the two-deaths stop (AGENT-HARNESS-46)
|
|
636
|
+
# when the note names an open issue no live lane holds, Dev
|
|
637
|
+
# answers with the lane leeway command to run and the
|
|
638
|
+
# heartbeat prints it; the lane is then not blocked
|
|
639
|
+
nodii-dev lane leeway KEY --blocker ISSUE [--repo NAME] --reason TEXT
|
|
640
|
+
# ask the machine coordinator for leeway to fix the blocker
|
|
641
|
+
# instead of ending BLOCKED (MW1-12.6, DEC-0486); the ask
|
|
642
|
+
# claims the blocker issue for the lane (MW1-21.1)
|
|
643
|
+
nodii-dev lane leeway grant ID [--note TEXT] [--source PATH] [--worktree PATH]
|
|
644
|
+
nodii-dev lane leeway refuse ID [--note TEXT]
|
|
645
|
+
# the lane's machine coordinator or staff. The coordinator's grant
|
|
646
|
+
# is enough: no operator approval, no TOTP code (MW1-12.7)
|
|
647
|
+
nodii-dev lane leeway withdraw ID
|
|
648
|
+
nodii-dev lane leeway list [--machine M] [--state S] [--lane KEY] [--cursor C] [--limit N]
|
|
649
|
+
nodii-dev lane leeway show ID
|
|
650
|
+
nodii-dev lane ask KEY --question TEXT [--options a,b]
|
|
651
|
+
nodii-dev lane ask withdraw ID
|
|
652
|
+
nodii-dev lane answer ID --text TEXT
|
|
653
|
+
nodii-dev lane defer ID --reason TEXT [--minutes N] [--leeway]
|
|
654
|
+
nodii-dev lane asks [--machine M] [--state S] [--lane KEY] [--cursor C] [--limit N]
|
|
655
|
+
nodii-dev lane message TO --body TEXT|--body-file FILE [--issue ISSUE]
|
|
656
|
+
nodii-dev lane inbox [KEY] [--all]
|
|
657
|
+
# lane-to-lane messaging (NODII-DEV-CLI-191); see "Lane messages"
|
|
658
|
+
nodii-dev coordinator items [--machine NAME|ID]
|
|
624
659
|
nodii-dev lane resume --host-lost [--min-free-gb N] [--stagger-seconds N]
|
|
625
660
|
# after a reboot (coordinator): resume every host_lost lane
|
|
626
661
|
# on this machine in priority order, each under its own
|
|
@@ -641,6 +676,12 @@ nodii-dev lane resume KEY --profile PATH --class long|short|no-build
|
|
|
641
676
|
# offline or unread account, and LANE_ALREADY_ON_ACCOUNT. A
|
|
642
677
|
# lane stopped by two deaths moves off an exhausted account
|
|
643
678
|
# with no amendment or override, and its death count restarts
|
|
679
|
+
# NODII-DEV-CLI-191: any lane resume first reads the
|
|
680
|
+
# profiles recorded exhausted (see "Account failures" below).
|
|
681
|
+
# A lane on one is moved to another account of its runtime
|
|
682
|
+
# whose fresh band admits its class, and the output says so;
|
|
683
|
+
# with none it is refused ACCOUNT_EXHAUSTED naming the reset.
|
|
684
|
+
# --profile naming another account goes as before
|
|
644
685
|
nodii-dev lane resume KEY [--override --reason TEXT]
|
|
645
686
|
# --override (coordinator): resume a lane the two-identical-
|
|
646
687
|
# deaths rule stopped; Dev refuses it with
|
|
@@ -651,6 +692,30 @@ nodii-dev lane resume KEY [--override --reason TEXT]
|
|
|
651
692
|
# running run or a lane-agent heartbeat since the death
|
|
652
693
|
# that is not yet old enough to be dead: one process per
|
|
653
694
|
# lane (the coordinator's own heartbeats do not count)
|
|
695
|
+
nodii-dev lane resume KEY --if-changed
|
|
696
|
+
# OFF unless NODII_DEV_RESUME_IF_CHANGED=1 (see "Switched-off
|
|
697
|
+
# lane features"); off, it refuses RESUME_IF_CHANGED_OFF.
|
|
698
|
+
# NODII-DEV-CLI-191: resume only when what blocks the lane
|
|
699
|
+
# changed since its last resume: each PR wait's state, head
|
|
700
|
+
# and merge commit (gh), each issue wait's status and each
|
|
701
|
+
# blocking lane's status (Dev), its leeways and its latest
|
|
702
|
+
# amendment. Heartbeat notes never count. Unchanged prints
|
|
703
|
+
# BLOCKERS_UNCHANGED and exits 0; the fingerprint is kept in
|
|
704
|
+
# runs/resume-fingerprints.json. A superseded lane (every
|
|
705
|
+
# issue it holds closed) is refused as LANE_DEAD with the
|
|
706
|
+
# evidence; nothing stops it here (the coordinator ends it by
|
|
707
|
+
# the MW1-28 exit that fits). A
|
|
708
|
+
# lane whose work is landed (MW1-30.1: its changed paths
|
|
709
|
+
# match origin/main) before deploy is refused as
|
|
710
|
+
# LANDED_NOT_DONE and never stopped: landed is not done
|
|
711
|
+
# (MW1-28), so it goes on to deploy and the dev check. With
|
|
712
|
+
# NODII_DEV_SAME_SESSION_RESUME=1, every resume
|
|
713
|
+
# continues the dead run's own session when this machine has
|
|
714
|
+
# its log and the lane stayed on its account (`claude
|
|
715
|
+
# --resume`, `codex exec resume`), with a prompt of its last
|
|
716
|
+
# conclusion, what changed and the claim-and-fix directive,
|
|
717
|
+
# never the full Freeze; otherwise it starts fresh with the
|
|
718
|
+
# Freeze as before
|
|
654
719
|
nodii-dev lane check KEY [--gate CMD ...] [--critical] [--max-iterations N] [--picker agent]
|
|
655
720
|
# from the lane's worktree: the rules, Figma and code checks (DEV-REV) over
|
|
656
721
|
# the diff against origin/main, tracked and untracked; --gate runs the gates
|
|
@@ -711,6 +776,7 @@ nodii-dev harness update [--include-drafts] [--adopt PATH,...] [--dry-run] [--sy
|
|
|
711
776
|
nodii-dev harness check [--json] # 0 current, 1 differs from Dev, 2 no harness
|
|
712
777
|
nodii-dev repo policy [--json] # print this repository's nodii.repo.yaml facts (STD-11)
|
|
713
778
|
nodii-dev repo lint [--json] # 0 clean, 1 findings
|
|
779
|
+
nodii-dev repo docs-check [--base REF] [--json] # 0 clean or not checked, 1 TOOLING_DOCS_STALE (docs move with tooling)
|
|
714
780
|
nodii-dev harness update --check # the same check
|
|
715
781
|
nodii-dev watchdog install [--interval SECONDS] # macOS: com.nodii.watchdog in ~/Library/LaunchAgents
|
|
716
782
|
# Linux: nodii-watchdog.service and .timer in ~/.config/systemd/user
|
|
@@ -869,7 +935,7 @@ in any session that is not a Dev lane. Each cites the clause it protects.
|
|
|
869
935
|
| Figma read | A code lane reads by node id (`get_design_context`, `get_metadata`, `get_screenshot`, ...) instead of the published key (MW8-20) | a Figma lane, or no node id |
|
|
870
936
|
| `figma submit CS-n` | The unused-property, stale `Blocked on DS` placeholder and Dialog-without-body hand checks (F-34, CS-2453) | all three are recorded with `figma checked CS-n --unused-properties --stale-placeholders --dialog-body` |
|
|
871
937
|
| AskUserQuestion | The question is also an item in `docs/figma-ux-drive/qa-with-abhi/open.md` (R7) | open.md already holds the question |
|
|
872
|
-
| Stop | The lane is not `on_dev` but "done" was claimed (MW3); an "I couldn't" with no filed issue; Unconfirmed Freeze items still open; uncommitted work | none of those; a Stop that was already nudged once may stop |
|
|
938
|
+
| Stop | The lane is not `on_dev` but "done" was claimed (MW3); an "I couldn't" with no filed issue (the nudge also names `lane leeway` for a blocker no live lane holds, MW1-12.6); Unconfirmed Freeze items still open; uncommitted work | none of those; a Stop that was already nudged once may stop |
|
|
873
939
|
|
|
874
940
|
**One nudge reaches every session, lane or not: Surface generation (MW8-17).**
|
|
875
941
|
Product pages in the design-system repository are generated from their
|
|
@@ -904,15 +970,40 @@ and is retried after ten minutes, not on every write.
|
|
|
904
970
|
The Stop nudge asks the session to continue once (`decision: block`, skipped
|
|
905
971
|
when `stop_hook_active`); Codex passes it through its managed dispatcher.
|
|
906
972
|
Before that, in a lane session (a `lane-*.json` identity), the same hook holds
|
|
907
|
-
the stop while the lane's done check is not recorded
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
973
|
+
the stop while the lane's done check is not recorded (NODII-DEV-CLI-8), even
|
|
974
|
+
after an earlier block: it reads the lane from Dev and answers `Lane KEY: done
|
|
975
|
+
check not recorded. Continue the Task: STEP.` By default a blocked step, an
|
|
976
|
+
open wait or a heartbeat note that starts "blocked" or "WAITING:" lets the stop
|
|
977
|
+
through, except where leeway covers the blocker (MW1-12.6). With
|
|
978
|
+
`NODII_DEV_BLOCKED_NOT_EXIT=1` (NODII-DEV-CLI-191; off until its clause is in
|
|
979
|
+
force, as lane questions were, DEC-0503), BLOCKED is not an exit:
|
|
980
|
+
only a typed human gate lets the stop through. The gates
|
|
981
|
+
are a wait on an operator question (`Q-n`), a decision (`DEC-n`), a release or
|
|
982
|
+
launch day; a wait on a `steward-*` lane; or a latest heartbeat typed
|
|
983
|
+
`WAITING: human-gate totp|steward|spend: WHAT THE PERSON MUST DO`. Any other
|
|
984
|
+
blocker, such as a blocked step, a PR, an issue, another lane, or an untyped
|
|
985
|
+
BLOCKED or WAITING note, holds the stop. The answer then names the blocker and
|
|
986
|
+
says to claim it with `lane leeway` (MW1-12.6), fix it with the lane's
|
|
987
|
+
subagents, and keep working what is not blocked. Recording the done check
|
|
988
|
+
(`lane done-check`) lets the stop through, and so does a lane Dev can't serve.
|
|
989
|
+
While a leeway is asked or granted (MW1-12.6, DEC-0486), the hook keeps the
|
|
990
|
+
session on what is not blocked, or on the fix. A no-progress guard lets the
|
|
991
|
+
stop through after `NODII_DEV_STOP_STALL_LIMIT` holds in a row (default 2) with
|
|
992
|
+
no new tool call in the session's transcript. One session is held at most
|
|
993
|
+
`NODII_DEV_STOP_BLOCK_LIMIT` times in a row (default 40), as a cost backstop.
|
|
994
|
+
The Stop nudge answers "I couldn't …" with "fix it, or claim it and fix it with
|
|
995
|
+
your subagents", and citing an issue key no longer silences it. No
|
|
996
|
+
hook (the managed dispatcher included) runs the amendment guard or the
|
|
997
|
+
waiting-results banner: a hook cannot enforce them, since it exits 0 on
|
|
998
|
+
anything but a policy denial, either would corrupt its JSON, and it cannot run
|
|
999
|
+
a Delta gather (NODII-DEV-CLI-191). Every command the agent runs still reads
|
|
1000
|
+
both fresh from Dev; `hook nudge-pre` tells the lane of a pending amendment.
|
|
1001
|
+
|
|
1002
|
+
The managed dispatcher runs `safety-pre`, `nudge-pre`, `tooling-docs` and
|
|
1003
|
+
`safety-post` inside its own process, with the same code and the same answers
|
|
1004
|
+
as `nodii-dev hook ACTION`; every other handler still gets its own process. A
|
|
1005
|
+
`Bash` call in a lane was two dispatcher processes plus five handler processes;
|
|
1006
|
+
it is now the two dispatchers.
|
|
916
1007
|
|
|
917
1008
|
### DS conformance: `design roles` and `design check` (DEC-0034)
|
|
918
1009
|
|
|
@@ -1609,10 +1700,15 @@ coordinator run for the machine when it belongs to the caller (CLI-16).
|
|
|
1609
1700
|
|
|
1610
1701
|
`lane launch KEY` replaces the manual worktree/start/process sequence. It
|
|
1611
1702
|
requires the issue (whose title supplies both lane title and objective), done
|
|
1612
|
-
check, build kind and side, runtime profile and model,
|
|
1703
|
+
check, build kind and side, runtime profile and model, the
|
|
1613
1704
|
lane's class (`--class long|short|no-build`, MW1-38.3), and
|
|
1614
1705
|
repeated `--repo NAME=/SOURCE` plus
|
|
1615
|
-
`--branch NAME=BRANCH` pairs.
|
|
1706
|
+
`--branch NAME=BRANCH` pairs. `--subagents N` (`0` to `100`) is optional and
|
|
1707
|
+
defaults to 4; an explicit `0` gives the lane no subagent slots. The default
|
|
1708
|
+
shape is fewer lanes, with subagents fanned out inside each (MW1-38.15). In
|
|
1709
|
+
the `two_builds` and `one_build` usage bands Dev clamps a new lane's quota to
|
|
1710
|
+
2 and 1, and the launch prints `Subagent quota: asked N, granted M (account
|
|
1711
|
+
usage band BAND).` The Hub preflight checks the coordinator waiter,
|
|
1616
1712
|
target agent and machine, the account's fresh usage band against the lane's
|
|
1617
1713
|
class (refusing with `ACCOUNT_LIMIT_UNAVAILABLE` or `ACCOUNT_BAND_REFUSED` and
|
|
1618
1714
|
the command that fixes it), repository grants,
|
|
@@ -1636,7 +1732,14 @@ lane's status. A lane whose done check is recorded (`nodii-dev lane done-check
|
|
|
1636
1732
|
KEY --evidence TEXT|URL`, its `dev_check` step done, or the lane `on_dev`,
|
|
1637
1733
|
`non_issue` or `stopped`) has finished. On it, exit 0 with a clean worktree ends the run
|
|
1638
1734
|
`done`, exit 0 with uncommitted or untracked files ends it `handed_off` and names
|
|
1639
|
-
them, and any other exit ends it `failed`. None of these counts as a death.
|
|
1735
|
+
them, and any other exit ends it `failed`. None of these counts as a death.
|
|
1736
|
+
Ending the run does not finish the lane, so on exit 0 after a recorded `lane
|
|
1737
|
+
done-check` the supervisor also records the lane finished (as `lane finish`
|
|
1738
|
+
does) with the done check's evidence, and its coordinator can close it. It does
|
|
1739
|
+
not on a failed, blocked or unfinished exit, on a lane that still has an open
|
|
1740
|
+
wait or a blocked step (a READY lane waiting on its steward), on a lane that has ended, or when
|
|
1741
|
+
only a `dev_check` step counts as the done check; if Dev refuses the call the
|
|
1742
|
+
exit is reported as before and the supervisor log names `lane finish`. A
|
|
1640
1743
|
process that stops before the done check is recorded is unfinished, whatever
|
|
1641
1744
|
its exit code (a lane that exits 0 after Gather included). It is reported as a
|
|
1642
1745
|
`process-exit` with its code, fingerprint (`lane-unfinished-exit-0`,
|
|
@@ -1645,13 +1748,38 @@ so `lane resume` relaunches it with `recoveryOf`. A lane status Dev can't serve
|
|
|
1645
1748
|
counts as unfinished. A lane that recorded BLOCKED (a blocked step, or a
|
|
1646
1749
|
latest heartbeat note that starts with "blocked") and then exits ends its run
|
|
1647
1750
|
`blocked` with that reason: never an orphan, never a death that counts toward
|
|
1648
|
-
the same-death stop (hub-58). A
|
|
1751
|
+
the same-death stop (hub-58). A lane that leeway covers is not BLOCKED
|
|
1752
|
+
(MW1-12.6, DEC-0486; see Leeway below): its exit is unfinished, and its session
|
|
1753
|
+
is continued. A Dev without that status gets the process exit,
|
|
1649
1754
|
which it also ends blocked from the lane's record. Every report carries `exit_code`, `worktree` and
|
|
1650
1755
|
`lane_status` evidence. `process.pid` still holds the runtime's own PID, and the
|
|
1651
1756
|
supervisor appends its report line to `process.log`.
|
|
1652
1757
|
|
|
1758
|
+
**Account failures (NODII-DEV-CLI-191).** When the newest line the runtime
|
|
1759
|
+
itself wrote (not a tool's output) names a usage limit (`Claude AI usage limit
|
|
1760
|
+
reached|EPOCH`, `You've hit your limit`, `5-hour limit reached ∙ resets 3pm`,
|
|
1761
|
+
a weekly limit, Codex's `You've hit your usage limit ... try again at|in ...`),
|
|
1762
|
+
an auth failure (`OAuth token has expired`, `401`, `authentication_error`,
|
|
1763
|
+
`Invalid API key`, `Please run /login`) or a network one (Cloudflare,
|
|
1764
|
+
`cf-ray`, `ECONNRESET`, `ETIMEDOUT`, `fetch failed`, `529 Overloaded`), the
|
|
1765
|
+
unfinished exit is reported with the fingerprint `lane-account-usage_limit`,
|
|
1766
|
+
`lane-account-auth` or `lane-account-network`, and the reason names the kind,
|
|
1767
|
+
the reset time and the line. The run's profile (`CLAUDE_CONFIG_DIR` or
|
|
1768
|
+
`CODEX_HOME`, else `~/.claude` or `~/.codex`) is recorded exhausted until the
|
|
1769
|
+
reset the line gives, else for 5 hours (a limit) or 1 hour (auth, network), in
|
|
1770
|
+
`exhausted-accounts.json` in the nodii-dev config directory (beside
|
|
1771
|
+
`config.json`). A later, shorter failure never shortens a recorded wait. The
|
|
1772
|
+
supervisor does not continue the same session on such a failure. `lane resume`
|
|
1773
|
+
reads the file before it asks Dev for a run: a lane whose recorded profile is
|
|
1774
|
+
still exhausted moves to another registered account of its runtime on this
|
|
1775
|
+
machine whose fresh band admits the lane's class (`ok` for long work), or is
|
|
1776
|
+
refused `ACCOUNT_EXHAUSTED` naming the reset; `--profile` naming the exhausted
|
|
1777
|
+
profile is refused too.
|
|
1778
|
+
|
|
1653
1779
|
Before it reports an unfinished exit, the supervisor continues the same session
|
|
1654
|
-
(NODII-DEV-CLI-9)
|
|
1780
|
+
(NODII-DEV-CLI-9) unless the lane waits on a typed human gate
|
|
1781
|
+
(NODII-DEV-CLI-191; a fixable blocker is continued with the claim-and-fix
|
|
1782
|
+
directive) and the run log names the
|
|
1655
1783
|
session (Claude's `session_id`, Codex's `thread_id`). It runs `claude ...
|
|
1656
1784
|
--resume SESSION`, or `codex exec resume ... SESSION -`, with the same model
|
|
1657
1785
|
and permission mode, and sends `Lane KEY: done check not recorded. Continue the
|
|
@@ -1662,9 +1790,20 @@ Task: STEP.` on stdin. It does this up to `NODII_DEV_LANE_CONTINUATIONS` times
|
|
|
1662
1790
|
continuations included, the supervisor heartbeats its run every
|
|
1663
1791
|
`NODII_DEV_RUN_HEARTBEAT_SECONDS` (60) as the lane identity that owns it. A
|
|
1664
1792
|
runtime that is alive but writes nothing gets no heartbeat from the supervisor,
|
|
1665
|
-
so it goes Quiet at 15 minutes and Orphan at 45 (MW1-36).
|
|
1666
|
-
|
|
1667
|
-
|
|
1793
|
+
so it goes Quiet at 15 minutes and Orphan at 45 (MW1-36). A write to the
|
|
1794
|
+
session's Claude transcript (`<profile>/projects/<worktree>/<session>.jsonl`,
|
|
1795
|
+
and its subagents' transcripts) counts as one too. The same tick is the lane's
|
|
1796
|
+
harness heartbeat (`POST /lanes/KEY/heartbeat` with `source: "hook"`), which
|
|
1797
|
+
keeps Dev's `stuck` meaningful, and the run heartbeat's note ends `last
|
|
1798
|
+
activity <time>` (NODII-DEV-CLI-191). This lighter tracking is off unless
|
|
1799
|
+
`NODII_DEV_STOP_ONLY_HEARTBEAT=1` (see "Switched-off lane features"); off, the
|
|
1800
|
+
harness registers `hook lane-heartbeat` on every tool call and on `Stop` as
|
|
1801
|
+
before, and neither the supervisor nor `hook nudge-pre` beats the lane. On, no
|
|
1802
|
+
hook process runs on every tool call for it: the harness's `hook lane-heartbeat`
|
|
1803
|
+
is registered on `Stop` only. A session with no lane supervisor (no `NODII_DEV_RUN_ID`) is beaten from
|
|
1804
|
+
`hook nudge-pre`, which already runs on each tool call, at most once every 5
|
|
1805
|
+
minutes. `lane heartbeat` also heartbeats the run. The Stop hook beats at most
|
|
1806
|
+
once a minute per worktree. It reads its lane
|
|
1668
1807
|
from Dev once and keeps the lane's id and key in the worktree's git private dir
|
|
1669
1808
|
(`nodii-lane-heartbeat-lane.json`, beside `nodii-lane.json`), so a beat is one
|
|
1670
1809
|
small POST. It reads the lane again when the branch or the lane key changes,
|
|
@@ -1693,7 +1832,14 @@ scope is not bounded; a Freeze with `figma: []` means "no Figma" and refuses
|
|
|
1693
1832
|
every Figma lock and write.
|
|
1694
1833
|
|
|
1695
1834
|
Objective, scope and rule changes are durable `lane amend` records, never chat
|
|
1696
|
-
messages.
|
|
1835
|
+
messages. A coordinator's or steward's `lane amend` waits for the operator's
|
|
1836
|
+
approval (`lane amendments approve`, with their TOTP code). One code covers
|
|
1837
|
+
several requests when one command names them (`lane amendments approve ID ID
|
|
1838
|
+
...`) or takes every pending one (`--all-pending`): Dev's step-up lasts 10
|
|
1839
|
+
minutes and the CLI holds it for one process, so a shell loop over ids asks
|
|
1840
|
+
for a code each time. A leeway grant is
|
|
1841
|
+
also delivered as an amendment, and it never waits: the coordinator's grant is
|
|
1842
|
+
enough (MW1-12.7, DEC-0486). Every CLI call from a launched worktree checks the current watched
|
|
1697
1843
|
run's acknowledgement version. A pending change is printed and blocks the
|
|
1698
1844
|
call until `lane gather --delta` serves the current rules and acknowledges the
|
|
1699
1845
|
newest displayed version. `NODII_DEV_RUN_ID` makes this check per subagent run,
|
|
@@ -1757,6 +1903,244 @@ serves for that step (see Rule delivery). Server refusals,
|
|
|
1757
1903
|
including operator-only actions, workflow blocks, lane limits and Built items
|
|
1758
1904
|
that are not on dev, retain Dev's error code/message and exit non-zero.
|
|
1759
1905
|
|
|
1906
|
+
### Leeway (MW1-12.6 to MW1-12.8, MW1-21.1; DEC-0486)
|
|
1907
|
+
|
|
1908
|
+
A lane blocked on an open issue that no live lane holds does not end BLOCKED,
|
|
1909
|
+
and does not file a note and stop (MW1-12.6). It asks its machine coordinator
|
|
1910
|
+
for leeway to fix that one issue:
|
|
1911
|
+
|
|
1912
|
+
```
|
|
1913
|
+
nodii-dev lane leeway KEY --blocker ISSUE [--repo NAME] --reason TEXT
|
|
1914
|
+
```
|
|
1915
|
+
|
|
1916
|
+
Dev claims the issue for the lane (MW1-21.1) and the command prints `Leeway asked (ID):
|
|
1917
|
+
ISSUE claimed for KEY. Waiting for coordinator NAME. Keep working what is not
|
|
1918
|
+
blocked.` When another lane already holds the issue, Dev refuses with
|
|
1919
|
+
`LEEWAY_BLOCKER_HELD`; the CLI names the holder, says that Dev recorded a wait
|
|
1920
|
+
on it, and exits non-zero. Dev's other refusals (`LEEWAY_PROD`,
|
|
1921
|
+
`LEEWAY_LOCKED_COMPONENT`, `LEEWAY_FIGMA_PUBLISH`, `LEEWAY_BRANCH_HELD`,
|
|
1922
|
+
`LEEWAY_CREDENTIALS`, `LEEWAY_DEPTH`, `LEEWAY_CYCLE`, `LEEWAY_LIMIT`,
|
|
1923
|
+
`LEEWAY_ISSUE_CLOSED`, `REPO_NOT_GRANTED`) are printed as Dev wrote them.
|
|
1924
|
+
|
|
1925
|
+
The coordinator answers with `lane leeway grant ID [--note TEXT]` or `lane
|
|
1926
|
+
leeway refuse ID [--note TEXT]`; the lane takes an ask back with `lane leeway
|
|
1927
|
+
withdraw ID`. `lane leeway list [--machine M] [--state S] [--lane KEY]` and
|
|
1928
|
+
`lane leeway show ID` read them. The coordinator's grant is enough (MW1-12.7):
|
|
1929
|
+
it needs no operator approval and no TOTP code, and it widens the lane's
|
|
1930
|
+
contract to exactly the named issue and repository. A grant is an amendment:
|
|
1931
|
+
the lane acknowledges it with `lane gather KEY --delta` and does not start the
|
|
1932
|
+
fix before that (MW1-12.6). The fix is its own PR linked to the issue, merged
|
|
1933
|
+
by the repository's steward where it has one, and the lane rebases its own PR
|
|
1934
|
+
after the fix merges.
|
|
1935
|
+
|
|
1936
|
+
Leeway never reaches Prod, a locked component or lock change, a Figma publish,
|
|
1937
|
+
a steward's merge, another lane's in-flight branch, or credentials. Chains stop
|
|
1938
|
+
at depth 2 and a lane holds at most 2 open leeways (MW1-12.8). Dev refuses each
|
|
1939
|
+
of these with its own code; see [Refusal codes](#refusal-codes-for-leeway-asks-and-the-coordinators-items).
|
|
1940
|
+
|
|
1941
|
+
When the leeway names a repository the lane does not work in, `grant` works
|
|
1942
|
+
out the worktree path (`<source>/.claude/worktrees/KEY`, where the source is
|
|
1943
|
+
`--source PATH` or the checkout of that name beside the lane's first
|
|
1944
|
+
repository; `--worktree PATH` overrides it), sends it to Dev with the grant,
|
|
1945
|
+
and only after Dev accepts creates the worktree on Dev's branch
|
|
1946
|
+
(`fix/<lane key>`, S01-57) from `origin/main`, with the lane's marker, as `lane
|
|
1947
|
+
launch` does. When the lane already has the repository, no worktree is made:
|
|
1948
|
+
the fix goes in the lane's existing worktree as its own commit range and PR.
|
|
1949
|
+
|
|
1950
|
+
The step model follows. A lane with a `requested` or `granted` leeway, or with
|
|
1951
|
+
a blocker Dev says it can ask leeway for (`leewayNext` on the lane detail, printed by
|
|
1952
|
+
`lane heartbeat --note "BLOCKED: ..."` as the command to run), is not blocked:
|
|
1953
|
+
the Stop gate and the launch supervisor continue its session with that
|
|
1954
|
+
instruction, and an exit is reported for `lane resume` instead of ending the
|
|
1955
|
+
run `blocked`. While an amendment waits for its Delta gather, `lane leeway`
|
|
1956
|
+
still runs.
|
|
1957
|
+
|
|
1958
|
+
### Lane questions and the coordinator's items (MW1-12.9, MW1-37.2)
|
|
1959
|
+
|
|
1960
|
+
**Lane questions are off by default** (`nodii-dev rules show MW1-37.2`):
|
|
1961
|
+
`lane ask`, `lane ask withdraw`, `lane answer` and `lane asks`
|
|
1962
|
+
refuse `LANE_ASKS_OFF` and call nothing unless `NODII_DEV_LANE_ASKS=1` is set.
|
|
1963
|
+
While off, `lane defer` takes its id as a leeway, and the coordinator's count
|
|
1964
|
+
line, `coordinator items` and the coordinator gate leave questions out (a
|
|
1965
|
+
question cannot be cleared without the answer command); leeways still count and
|
|
1966
|
+
gate. Dev's answer route is left as it is and is not reachable from the CLI
|
|
1967
|
+
while off. A lane writes its question as an issue comment or a heartbeat note,
|
|
1968
|
+
as before. The rest of this section describes the path switched on.
|
|
1969
|
+
|
|
1970
|
+
A lane asks its machine coordinator a question with `lane ask KEY --question
|
|
1971
|
+
TEXT [--options a,b]` (`lane ask withdraw ID` takes it back). The coordinator
|
|
1972
|
+
answers with `lane answer ID --text TEXT`: Dev delivers the answer as an
|
|
1973
|
+
amendment, which the lane acknowledges with `lane gather KEY --delta`. An issue
|
|
1974
|
+
comment alone is not delivery. `lane defer ID --reason TEXT [--minutes N]` puts
|
|
1975
|
+
an ask or a leeway off (default 60 minutes, at most 240); the id is tried as an
|
|
1976
|
+
ask and, when Dev has no such ask, as a leeway, and `--leeway` goes straight to
|
|
1977
|
+
the leeway. `lane asks [--machine M] [--state S] [--lane KEY] [--cursor C]
|
|
1978
|
+
[--limit N]` lists asks.
|
|
1979
|
+
|
|
1980
|
+
### Switched-off lane features (NODII-DEV-CLI-191)
|
|
1981
|
+
|
|
1982
|
+
These features ship off by default until their clauses are in Dev's rulebook,
|
|
1983
|
+
as lane questions (`NODII_DEV_LANE_ASKS`) and BLOCKED is not an exit
|
|
1984
|
+
(`NODII_DEV_BLOCKED_NOT_EXIT`) did. The clauses are drafted on NODII-DEV-CLI-191
|
|
1985
|
+
for a Docs change; when a clause is in force, its default flips. Each
|
|
1986
|
+
is on only when its variable is exactly `1`, in the environment of the process
|
|
1987
|
+
that does the work: the coordinator's for `lane resume`, the lane session's for
|
|
1988
|
+
hooks, and the harness's for `harness update`.
|
|
1989
|
+
|
|
1990
|
+
| Variable | Feature | Off (the default) |
|
|
1991
|
+
|---|---|---|
|
|
1992
|
+
| `NODII_DEV_RESUME_IF_CHANGED` | `lane resume --if-changed` | Refused `RESUME_IF_CHANGED_OFF`; resume without it |
|
|
1993
|
+
| `NODII_DEV_SAME_SESSION_RESUME` | A resume continues the dead run's own session with a short prompt | A resume starts a fresh session with the Freeze |
|
|
1994
|
+
| `NODII_DEV_SUBAGENT_BUDGET` | The subagent budget line in the launch brief, gather's next step and the resume prompt | No line |
|
|
1995
|
+
| `NODII_DEV_ISSUES_GROUP` | `issues group` | Refused `ISSUES_GROUP_OFF` |
|
|
1996
|
+
| `NODII_DEV_LANE_MESSAGES` | `lane message`, `lane inbox` and their delivery by the Stop hook, `hook nudge-pre` and the supervisor | Refused `LANE_MESSAGES_OFF`; no hook delivers from an inbox file |
|
|
1997
|
+
| `NODII_DEV_STOP_ONLY_HEARTBEAT` | The harness beats a lane on `Stop` only; the supervisor and `hook nudge-pre` beat it while it acts | The harness's `hook lane-heartbeat` runs on every tool call and on `Stop`, as before |
|
|
1998
|
+
|
|
1999
|
+
### Lane messages (NODII-DEV-CLI-191)
|
|
2000
|
+
|
|
2001
|
+
Off unless `NODII_DEV_LANE_MESSAGES=1` (see "Switched-off lane features").
|
|
2002
|
+
|
|
2003
|
+
Lanes, stewards and the coordinator message each other by name: a lane by its
|
|
2004
|
+
lane key, a steward by its steward lane key, the machine's coordinator as
|
|
2005
|
+
`coordinator`. `lane message TO --body TEXT` (or `--body-file FILE`) sends one.
|
|
2006
|
+
The sender is the session's own identity: the current lane (`NODII_DEV_LANE_KEY`),
|
|
2007
|
+
else this agent's Dev name. No flag names it (P-8). A delivered message is
|
|
2008
|
+
marked as information from another session, not an instruction: the lane's
|
|
2009
|
+
Freeze and the rulebook still govern.
|
|
2010
|
+
|
|
2011
|
+
Dev keeps the durable record: the message is a comment on the recipient lane's
|
|
2012
|
+
issue (a message to the coordinator goes on the sending lane's issue; `--issue
|
|
2013
|
+
ISSUE` names another), headed
|
|
2014
|
+
|
|
2015
|
+
```
|
|
2016
|
+
[lane message] from <sender> to <recipient> · <ISO time> · id <short id>
|
|
2017
|
+
```
|
|
2018
|
+
|
|
2019
|
+
A local inbox file is the doorbell. When the recipient runs on this machine (a
|
|
2020
|
+
lane provisioned here, a lane Dev places on this agent's machine, or the
|
|
2021
|
+
coordinator), the message is also appended as one JSON line,
|
|
2022
|
+
`{id, from, to, at, body, issueKey, commentRef}`, to
|
|
2023
|
+
`<config dir>/inbox/<key>.jsonl` (file 0600, folder 0700). A read marker beside
|
|
2024
|
+
it (`<key>.read.json`) records how far it has been delivered.
|
|
2025
|
+
|
|
2026
|
+
A lane gets an unread message without polling, Claude and Codex alike:
|
|
2027
|
+
|
|
2028
|
+
- at its next tool call, `hook nudge-pre` adds it to the call's context, from
|
|
2029
|
+
the inbox file alone (no Dev call);
|
|
2030
|
+
- at its next stop, the Stop hook holds the session with the messages (sender,
|
|
2031
|
+
time and body, oldest first, about 1,500 characters at most; the rest wait
|
|
2032
|
+
for the next delivery);
|
|
2033
|
+
- at its next continuation, the lane supervisor puts them ahead of the
|
|
2034
|
+
continuation prompt, so a headless lane takes them as its next turn.
|
|
2035
|
+
|
|
2036
|
+
Each message is delivered once. `lane inbox [KEY]` prints the unread messages
|
|
2037
|
+
and marks them read (`--all` prints every one); it also reads Dev's record and
|
|
2038
|
+
adds the messages sent from another machine that the local file lacks.
|
|
2039
|
+
|
|
2040
|
+
Dev counts what lanes wait on a machine's coordinator for (questions, leeway
|
|
2041
|
+
asks, waits and escalations) and names the count in the `x-dev-lane-items`
|
|
2042
|
+
response header. Every command the coordinator runs prints one line for it
|
|
2043
|
+
first, on stderr, so `--json` output on stdout stays parseable:
|
|
2044
|
+
|
|
2045
|
+
```
|
|
2046
|
+
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
|
|
2047
|
+
```
|
|
2048
|
+
|
|
2049
|
+
The lane names come from `GET /coordinator/items`, cached and read again when
|
|
2050
|
+
the header's total changes; when that read fails the line keeps the counts
|
|
2051
|
+
alone. No line is printed when the total is zero or the header is absent, and
|
|
2052
|
+
hooks never print it. `coordinator items [--machine NAME|ID]` lists every item
|
|
2053
|
+
with the command that clears it.
|
|
2054
|
+
|
|
2055
|
+
The coordinator gate holds the coordinator to it. `coordinator start` writes
|
|
2056
|
+
`coordinator.json` beside the config (and the heartbeater removes it when the
|
|
2057
|
+
session ends); the managed dispatcher installed by `harness update --system`
|
|
2058
|
+
(refreshed by a plain `harness update`) checks for that file, so only a
|
|
2059
|
+
coordinator session pays for the gate, and only on a `Bash` call that names
|
|
2060
|
+
`nodii-dev` or on `AskUserQuestion`. The gate reads `/coordinator/items`
|
|
2061
|
+
through a 10-second cache. While an ask or a leeway has waited over 10 minutes
|
|
2062
|
+
and is not deferred, it denies a `nodii-dev` write, naming each item and its
|
|
2063
|
+
command. A question to the operator is never denied (MW1-116): it passes with
|
|
2064
|
+
the same items named. Reads, local commands (`heavy`,
|
|
2065
|
+
`run`, `doctor`), `inbox`, `coordinator ...`, `lane answer|defer`, `lane leeway
|
|
2066
|
+
grant|refuse|show|list`, `lane resume` and `lane close|stop` always pass, and so
|
|
2067
|
+
does everything that is not `nodii-dev`. Waits and escalations are counted and
|
|
2068
|
+
shown and never gate. When Dev cannot be read the call passes with the note
|
|
2069
|
+
`lane items unread: Dev unreachable`. `nodii-dev hook coordinator-gate` is the
|
|
2070
|
+
same check as a direct hook. The governor's launch gate is separate and still
|
|
2071
|
+
fails closed.
|
|
2072
|
+
|
|
2073
|
+
On the lane side, `hook nudge-pre` (and `hook lane-heartbeat`, where an older
|
|
2074
|
+
harness still runs it after a tool call) tell a
|
|
2075
|
+
long-running session about an amendment it has not acknowledged (an answer, a
|
|
2076
|
+
leeway grant, a rebrief) as `additionalContext`, through the 15-second read
|
|
2077
|
+
cache and at most once a minute per newest version, so it learns of it without
|
|
2078
|
+
running a `nodii-dev` command itself.
|
|
2079
|
+
|
|
2080
|
+
### Docs move with tooling: `repo docs-check` and `hook tooling-docs` (MW1-46.3; DEC-0486)
|
|
2081
|
+
|
|
2082
|
+
A change to a command, route, refusal code or hook lands with the words that
|
|
2083
|
+
describe it (operator, 17 Nov 2026). Each repository names its files in
|
|
2084
|
+
`nodii.repo.yaml`:
|
|
2085
|
+
|
|
2086
|
+
```yaml
|
|
2087
|
+
toolingDocs:
|
|
2088
|
+
tooling: ["packages/dev/src/**"] # commands, routes, refusal codes, hooks
|
|
2089
|
+
docs: ["packages/dev/README.md", "docs/**"] # the files that describe them
|
|
2090
|
+
```
|
|
2091
|
+
|
|
2092
|
+
Both lists are path globs from the repository root (`*` and `?` stay in one
|
|
2093
|
+
folder, `**` crosses folders; quote a glob that starts with `*`). `repo
|
|
2094
|
+
policy` prints the block and `repo lint` refuses a malformed one. A repository
|
|
2095
|
+
without the block is not checked.
|
|
2096
|
+
|
|
2097
|
+
`nodii-dev repo docs-check [--base REF]` reads the range `REF...HEAD` (default
|
|
2098
|
+
`origin/main`) from git alone. It exits 1 with `TOOLING_DOCS_STALE` when the
|
|
2099
|
+
range changes a file matching `tooling` and no file matching `docs`, unless a
|
|
2100
|
+
commit in the range carries the trailer `Docs-unaffected: <reason>` (the
|
|
2101
|
+
reason is required). `nodii-dev hook tooling-docs` is the same check as a
|
|
2102
|
+
PreToolUse hook on Bash: it denies `git push` (also `git -C DIR push`) and
|
|
2103
|
+
`gh pr create|ready` on that finding, naming the tooling files changed, the
|
|
2104
|
+
docs globs and the trailer. `harness install|update` adds it to
|
|
2105
|
+
`.claude/settings.json` and `.codex/hooks.json`, and the managed dispatcher
|
|
2106
|
+
runs it in every session, lane or not. It never calls Dev and fails open: a
|
|
2107
|
+
missing base ref, an invalid policy file or a git error lets the call through.
|
|
2108
|
+
|
|
2109
|
+
### Refusal codes for leeway, asks and the coordinator's items
|
|
2110
|
+
|
|
2111
|
+
| Code | What it means | What to do next |
|
|
2112
|
+
|---|---|---|
|
|
2113
|
+
| `LEEWAY_BLOCKER_HELD` | Another live lane already holds leeway for this blocker; Dev names it and records your wait on it | Keep working what is not blocked and resume when the holder lands |
|
|
2114
|
+
| `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) | Wait on that lane with lane heartbeat KEY --waiting-on LANE |
|
|
2115
|
+
| `LEEWAY_CYCLE` | The lane that holds this blocker is itself waiting on you | Land your own work first, or ask the coordinator in an issue comment or a heartbeat note |
|
|
2116
|
+
| `LEEWAY_PROD` | Leeway never reaches Prod (MW1-12.8) | Raise the operator item |
|
|
2117
|
+
| `LEEWAY_LOCKED_COMPONENT` | The blocker touches a locked component or a lock change (U07-34) | Raise the operator item |
|
|
2118
|
+
| `LEEWAY_FIGMA_PUBLISH` | A Figma publish stays with the operator | Raise the operator item |
|
|
2119
|
+
| `LEEWAY_CREDENTIALS` | An issue of kind credential or operator prerequisite is not fixed by leeway (MW1-38.8) | Raise the operator item |
|
|
2120
|
+
| `LEEWAY_DEPTH` | Leeway chains stop at depth 2 | Ask the coordinator to launch a lane for the blocker |
|
|
2121
|
+
| `LEEWAY_LIMIT` | A lane holds at most 2 open leeways | Finish or withdraw one (lane leeway withdraw ID) first |
|
|
2122
|
+
| `LEEWAY_ISSUE_CLOSED` | The blocker issue is already done or closed, so there is nothing left to fix | Re-check what blocks the lane |
|
|
2123
|
+
| `LEEWAY_OWN_ISSUE` | The blocker is already this lane's own issue and needs no leeway | Fix it in the lane |
|
|
2124
|
+
| `LEEWAY_ALREADY_ASKED` | This lane already asked for leeway on this blocker; Dev names the ask | Read it with lane leeway show ID and wait for the coordinator |
|
|
2125
|
+
| `LEEWAY_DECIDED` | The leeway is already granted, refused or withdrawn | Read it with lane leeway show ID |
|
|
2126
|
+
| `LEEWAY_NOT_FOUND` | Dev has no leeway with this id | List them with lane leeway list |
|
|
2127
|
+
| `LEEWAY_WORKTREE_REQUIRED` | The grant names a repository the lane does not work in and carries no worktree for it | Run lane leeway grant from a current CLI, which creates the worktree, or pass --worktree PATH |
|
|
2128
|
+
| `LEEWAY_SOURCE_REQUIRED` | The grant needs a local clone of the leeway's repository to create the worktree from, and found none; nothing was granted | Pass --source PATH, the repository's clone |
|
|
2129
|
+
| `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 |
|
|
2130
|
+
| `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 |
|
|
2131
|
+
| `LANE_WORKTREE_TAKEN` | Another lane already records the worktree path the grant names | Pass another --worktree PATH |
|
|
2132
|
+
| `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) |
|
|
2133
|
+
| `MACHINE_REQUIRED` | The caller coordinates no machine, so Dev cannot tell whose items or asks to list | Pass --machine NAME/ID |
|
|
2134
|
+
| `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 |
|
|
2135
|
+
| `ASK_NOT_FOUND` | Dev has no lane ask with this id | List them with lane asks |
|
|
2136
|
+
| `ASK_DECIDED` | The ask is already answered or withdrawn | Read it with lane asks --lane KEY |
|
|
2137
|
+
| `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 |
|
|
2138
|
+
| `LANE_ALREADY_FINISHED` | The lane is already marked finished | Nothing; its coordinator closes it with lane close |
|
|
2139
|
+
| `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 |
|
|
2140
|
+
| `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 |
|
|
2141
|
+
| `HARNESS_SETTINGS_INVALID` | .claude/settings.json or .codex/hooks.json is not valid JSON | Repair the file, then run harness update |
|
|
2142
|
+
| `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 |
|
|
2143
|
+
|
|
1760
2144
|
The machine coordinator sets a lane's subagent capacity with `lane
|
|
1761
2145
|
subagent-quota KEY N` (`0` to `100`). Registering a subagent run consumes one
|
|
1762
2146
|
slot; Dev refuses another registration with `SUBAGENT_QUOTA_REACHED` when the
|
package/dist/accounts.js
CHANGED
|
@@ -7,7 +7,7 @@ import { execFile as execFileCallback } from "node:child_process";
|
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { mkdir, readFile, readdir, rename, writeFile } from "node:fs/promises";
|
|
9
9
|
import { homedir, tmpdir } from "node:os";
|
|
10
|
-
import { dirname, isAbsolute, join, normalize } from "node:path";
|
|
10
|
+
import { basename, dirname, isAbsolute, join, normalize } from "node:path";
|
|
11
11
|
import { promisify } from "node:util";
|
|
12
12
|
import { CliError, configPath, devRequest, encode, readConfig } from "./core.js";
|
|
13
13
|
|
|
@@ -224,6 +224,67 @@ async function resolveCodexBin(run = execFile) {
|
|
|
224
224
|
catch { return null; }
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
// NODII-DEV-CLI-191: a profile whose lane run died on a usage limit, auth
|
|
228
|
+
// or the network, until its reset. The lane supervisor writes it (as the
|
|
229
|
+
// lane's identity, whose config sits under agents/) and lane resume reads it
|
|
230
|
+
// (as the coordinator's), so it lives in the nodii-dev dir both share.
|
|
231
|
+
export function exhaustedAccountsPath(path = configPath()) {
|
|
232
|
+
const dir = dirname(path);
|
|
233
|
+
return join(basename(dir) === "agents" ? dirname(dir) : dir, "exhausted-accounts.json");
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
async function readExhausted(path, read = readFile) {
|
|
237
|
+
try {
|
|
238
|
+
const entries = JSON.parse(await read(path, "utf8"));
|
|
239
|
+
return entries && typeof entries === "object" && !Array.isArray(entries) ? entries : {};
|
|
240
|
+
} catch { return {}; }
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const liveOnly = (entries, now) => Object.fromEntries(Object.entries(entries)
|
|
244
|
+
.filter(([, entry]) => Date.parse(entry?.until) > now.getTime()));
|
|
245
|
+
|
|
246
|
+
/** The profiles recorded exhausted whose reset has not come yet, by profile. */
|
|
247
|
+
export async function liveExhaustedAccounts({ path = exhaustedAccountsPath(), now = () => new Date(), read = readFile } = {}) {
|
|
248
|
+
return liveOnly(await readExhausted(path, read), now());
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Record a profile exhausted until `entry.until`. A later failure with an
|
|
253
|
+
* earlier time never shortens a recorded wait; entries past their time are
|
|
254
|
+
* dropped.
|
|
255
|
+
*/
|
|
256
|
+
export async function recordExhaustedAccount(profile, entry, { path = exhaustedAccountsPath(), now = () => new Date() } = {}) {
|
|
257
|
+
const key = profilePath(profile);
|
|
258
|
+
const entries = liveOnly(await readExhausted(path), now());
|
|
259
|
+
const recorded = entries[key];
|
|
260
|
+
if (!recorded || Date.parse(entry.until) >= Date.parse(recorded.until)) entries[key] = entry;
|
|
261
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
262
|
+
const temporary = `${path}.tmp-${process.pid}`;
|
|
263
|
+
await writeFile(temporary, `${JSON.stringify(entries, null, 2)}\n`, { mode: 0o600 });
|
|
264
|
+
await rename(temporary, path);
|
|
265
|
+
return entries[key];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// MW1-38.2: a long resume needs an ok band; a short or no-build one fits up to short_only.
|
|
269
|
+
const ADMITS = { long: ["ok"], short: ["ok", "warning", "short_only"], no_build: ["ok", "warning", "short_only"] };
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Another registered account of the runtime on this machine whose freshly
|
|
273
|
+
* read band admits the work class, skipping `from` and the `exclude`d
|
|
274
|
+
* (recorded exhausted) profiles; null when none has headroom or the
|
|
275
|
+
* accounts cannot be listed.
|
|
276
|
+
*/
|
|
277
|
+
export async function pickHeadroomAccount({ runtime, from, exclude = [], workClass = "long" }, { request = devRequest, config = readConfig, readers = READERS } = {}) {
|
|
278
|
+
let accounts;
|
|
279
|
+
try { accounts = await listAccounts(await coordinatorMachineId({ request, config }), { request }); }
|
|
280
|
+
catch { return null; }
|
|
281
|
+
const skip = new Set([from, ...exclude].map(profilePath));
|
|
282
|
+
const candidates = accounts.filter((account) => account.runtime === runtime && !skip.has(profilePath(account.profile)));
|
|
283
|
+
if (!candidates.length) return null;
|
|
284
|
+
const results = await reportUsage(candidates, { request, readers });
|
|
285
|
+
return results.find((result) => !result.error && (ADMITS[workClass] ?? ADMITS.long).includes(result.band)) ?? null;
|
|
286
|
+
}
|
|
287
|
+
|
|
227
288
|
const READERS = { claude: readClaudeUsage, codex: readCodexUsage };
|
|
228
289
|
|
|
229
290
|
/** The usage ceiling body Dev stores for one reading. */
|