@nodii/dev 0.6.190 → 0.6.191

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -715,7 +715,11 @@ nodii-dev lane heartbeat KEY [--note TEXT]
715
715
  # when the note names an open issue no live lane holds, Dev
716
716
  # answers with the lane leeway command to run and the
717
717
  # heartbeat prints it; the lane is then not blocked
718
- nodii-dev lane leeway KEY --blocker ISSUE [--repo NAME] --reason TEXT
718
+ nodii-dev lane leeway KEY --blocker ISSUE [--repo NAME] [--parent LEEWAY_ID] --reason TEXT
719
+ # hub-600 (MW1-12.8): a leeway is a chain link only when
720
+ # --parent names the granted leeway whose own work this
721
+ # blocker stops; otherwise Dev gives it depth 1, and only the
722
+ # 2-open cap bounds it (LEEWAY_PARENT_INVALID for a bad parent).
719
723
  # ask the machine coordinator for leeway to fix the blocker
720
724
  # instead of ending BLOCKED (MW1-12.6, DEC-0486); the ask
721
725
  # claims the blocker issue for the lane (MW1-21.1)
@@ -2018,7 +2022,7 @@ and does not file a note and stop (MW1-12.6). It asks its machine coordinator
2018
2022
  for leeway to fix that one issue:
2019
2023
 
2020
2024
  ```
2021
- nodii-dev lane leeway KEY --blocker ISSUE [--repo NAME] --reason TEXT
2025
+ nodii-dev lane leeway KEY --blocker ISSUE [--repo NAME] [--parent LEEWAY_ID] --reason TEXT
2022
2026
  ```
2023
2027
 
2024
2028
  Dev claims the issue for the lane (MW1-21.1) and the command prints `Leeway asked (ID):
package/dist/cli.js CHANGED
@@ -538,7 +538,9 @@ Usage: nodii-dev <command> [options] [--json]
538
538
  # note names an open issue no live lane holds, Dev answers with the
539
539
  # lane leeway command to run and the heartbeat prints it: the lane is then
540
540
  # not blocked, and the Stop gate and the supervisor continue its session
541
- lane leeway <key> --blocker ISSUE [--repo NAME] --reason TEXT
541
+ lane leeway <key> --blocker ISSUE [--repo NAME] [--parent LEEWAY_ID] --reason TEXT
542
+ # hub-600 (MW1-12.8): --parent names the granted leeway whose own work
543
+ # this blocker stops; only then is it a chain link. Without it, depth 1
542
544
  # MW1-12.6 (DEC-0486): a lane blocked on an open issue no live lane holds asks
543
545
  # its machine coordinator for leeway to fix it, instead of ending BLOCKED. Dev
544
546
  # claims the issue for the lane (MW1-21.1); LEEWAY_BLOCKER_HELD names the lane
package/dist/core.js CHANGED
@@ -4,7 +4,7 @@ import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
4
4
  import { homedir, platform } from "node:os";
5
5
  import { dirname, join } from "node:path";
6
6
 
7
- export const VERSION = "0.6.190";
7
+ export const VERSION = "0.6.191";
8
8
  export const configPath = () =>
9
9
  process.env.NODII_DEV_CONFIG_PATH ??
10
10
  join(homedir(), ".config/nodii-dev/config.json");
package/dist/flags.js CHANGED
@@ -59,7 +59,7 @@ export const COMMAND_FLAGS = {
59
59
  "lane closeout": ["reason"],
60
60
  "lane repo": ["repo", "branch", "worktree", "read-only", "reason"],
61
61
  // MW1-12.6: ask (--blocker, --repo, --reason), grant (--note, --source, --worktree), refuse (--note), list (--machine, --state, --lane, --cursor, --limit).
62
- "lane leeway": ["blocker", "repo", "reason", "note", "source", "worktree", "machine", "state", "lane", "cursor", "limit"],
62
+ "lane leeway": ["blocker", "repo", "parent", "reason", "note", "source", "worktree", "machine", "state", "lane", "cursor", "limit"],
63
63
  // hub-232: the honest close-out and the governor.
64
64
  "lane close": ["delivered-by", "reason", "sweeper", "no-closeout"],
65
65
  "governor show": ["machine-id"],
package/dist/leeway.js CHANGED
@@ -13,7 +13,7 @@ import { createWorktrees, writeLaneMarkers } from "./starting.js";
13
13
  * grants or refuses, and a grant reaches the lane as an amendment it
14
14
  * acknowledges with a Delta gather before it starts the fix.
15
15
  *
16
- * lane leeway <key> --blocker ISSUE [--repo NAME] --reason TEXT
16
+ * lane leeway <key> --blocker ISSUE [--repo NAME] [--parent LEEWAY_ID] --reason TEXT
17
17
  * lane leeway grant <id> [--note TEXT] [--source PATH] [--worktree PATH]
18
18
  * lane leeway refuse <id> [--note TEXT]
19
19
  * lane leeway withdraw <id>
@@ -23,10 +23,10 @@ import { createWorktrees, writeLaneMarkers } from "./starting.js";
23
23
 
24
24
  const execFile = promisify(execFileCallback);
25
25
  const via = { via: "nodii-dev" };
26
- const USAGE = "lane leeway <key> --blocker ISSUE [--repo NAME] --reason TEXT | lane leeway grant <id> [--note TEXT] [--source PATH] [--worktree PATH] | lane leeway refuse <id> [--note TEXT] | lane leeway withdraw <id> | lane leeway list [--machine M] [--state S] [--lane KEY] [--cursor C] [--limit N] | lane leeway show <id>";
26
+ const USAGE = "lane leeway <key> --blocker ISSUE [--repo NAME] [--parent LEEWAY_ID] --reason TEXT | lane leeway grant <id> [--note TEXT] [--source PATH] [--worktree PATH] | lane leeway refuse <id> [--note TEXT] | lane leeway withdraw <id> | lane leeway list [--machine M] [--state S] [--lane KEY] [--cursor C] [--limit N] | lane leeway show <id>";
27
27
  const SUBCOMMANDS = ["grant", "refuse", "withdraw", "list", "show"];
28
28
  const FLAGS = {
29
- ask: ["blocker", "repo", "reason"],
29
+ ask: ["blocker", "repo", "reason", "parent"],
30
30
  grant: ["note", "source", "worktree"],
31
31
  refuse: ["note"],
32
32
  withdraw: [],
@@ -77,9 +77,13 @@ async function ask(key, flags, { request }) {
77
77
  const blocker = String(requireFlag(flags, "blocker"));
78
78
  const reason = String(requireFlag(flags, "reason"));
79
79
  const repo = flags.repo === undefined ? undefined : String(requireFlag(flags, "repo"));
80
+ // hub-600 (MW1-12.8): only a leeway that names its parent is a chain link.
81
+ const parent = flags.parent === undefined ? undefined : String(flags.parent).trim();
82
+ if (parent !== undefined && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(parent))
83
+ throw new CliError("USAGE", "--parent takes the id of the granted leeway whose own work this blocker stops (lane leeway list --lane KEY).", 2);
80
84
  let payload;
81
85
  try {
82
- payload = await request("POST", `/api/v1/lanes/${encode(key)}/leeway`, { blocker, ...(repo ? { repo } : {}), reason, ...via });
86
+ payload = await request("POST", `/api/v1/lanes/${encode(key)}/leeway`, { blocker, ...(repo ? { repo } : {}), reason, ...(parent ? { parent } : {}), ...via });
83
87
  } catch (error) {
84
88
  // Every other refusal is Dev's own text. This one also says who holds the issue and what the lane does next.
85
89
  if (error?.code !== "LEEWAY_BLOCKER_HELD") throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodii/dev",
3
- "version": "0.6.190",
3
+ "version": "0.6.191",
4
4
  "description": "Agent CLI for Nodii Dev, reached through the platform edge",
5
5
  "type": "module",
6
6
  "bin": {