@nodii/dev 0.6.5 → 0.6.7

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
@@ -144,8 +144,21 @@ nodii-dev figma submit CHANGE_SET --file SUBMISSION.json
144
144
  nodii-dev figma apply CHANGE_SET --figma-version VERSION
145
145
  nodii-dev figma published CHANGE_SET --figma-version VERSION
146
146
  nodii-dev figma abandon CHANGE_SET
147
+ nodii-dev figma withdraw CHANGE_SET # take back a submit before anything is decided
147
148
  nodii-dev figma release FILE_KEY
148
149
 
150
+ ```
151
+
152
+ `figma withdraw` moves a change set you hold from `in_review` back to
153
+ `editing`, as long as no item has been decided (Dev's
154
+ `withdrawDesignChangeSet`). Dev refuses when the change set doesn't exist
155
+ (`CHANGE_SET_NOT_FOUND`), isn't in review (`CHANGE_SET_NOT_IN_REVIEW`), you
156
+ aren't its holder or an operator (`WITHDRAW_NOT_ALLOWED`), or an item is
157
+ already decided (`CHANGE_SET_HAS_DECISIONS`: ask the reviewer to request
158
+ changes instead). The CLI prints each refusal in plain words and keeps the
159
+ code.
160
+
161
+ ```bash
149
162
  nodii-dev hook claude-figma-pre # reads Claude Code hook JSON on stdin
150
163
  nodii-dev hook claude-figma-post # reads Claude Code hook JSON on stdin
151
164
  nodii-dev hook print-settings # prints managed-settings JSON; writes nothing
@@ -164,6 +177,8 @@ nodii-dev lane list [--kind KIND] [--status STATUS] [--machine UUID]
164
177
  nodii-dev lane show KEY
165
178
  nodii-dev lane prioritize|deprioritize KEY --reason TEXT
166
179
  nodii-dev lane stop KEY --reason TEXT
180
+ nodii-dev lane non-issue KEY --reason TEXT --evidence TEXT --reroute KEY[,KEY]|none
181
+ --branch carried:ISSUE|dropped[:REASON] [--commits SHA[,SHA]]
167
182
  nodii-dev next KEY
168
183
 
169
184
  nodii-dev built list [--cursor CURSOR] [--include-acknowledged true]
@@ -343,6 +358,38 @@ checks. Setup also checks the OAuth login (a token refresh, then the registered
343
358
  agent) and prints `nodii-dev login` guidance without exposing credential
344
359
  details.
345
360
 
361
+ `lane non-issue` ends a lane at its second terminal status, `non_issue`, when
362
+ its investigation proves the issue is not a defect in its repository (DEC-0011,
363
+ MW1-28.1). The lane's own agent or the machine's coordinator runs it; no staff
364
+ person is needed. It needs:
365
+
366
+ - `--reason`: why this is not a defect here;
367
+ - `--evidence`: what was checked, with `file:line` or data;
368
+ - `--reroute`: the issue keys the real cause was re-routed to, comma-separated,
369
+ or `none` only when the evidence shows no defect anywhere;
370
+ - `--branch`: what happens to the lane's branch work. `carried:ISSUE` carries it
371
+ into that open follow-up issue with its commits; `dropped:REASON` drops it
372
+ with a reason. A bare `dropped` is accepted only when the branch has no
373
+ commits beyond `origin/main`, and records that as the reason. Dev records the
374
+ outcome with the lane's branch.
375
+ - `--commits`: the commits (at most 200). Carried work needs at least one.
376
+ Without the flag the CLI reads the lane's branch commits that are not on
377
+ `origin/main` (as last fetched) from the lane's recorded worktree; it refuses
378
+ with `GIT_REQUIRED` when it cannot read them, and with `USAGE` when carried
379
+ work has none (drop it instead).
380
+
381
+ The CLI refuses with `USAGE` (exit 2) before sending anything when one of these
382
+ is missing. Dev then makes the lane `non_issue`, which frees its slot like
383
+ `on_dev`, and moves each linked open issue to `wont_do` with the reason. An
384
+ issue that another active lane still works on stays open. Dev refuses a lane
385
+ that is already terminal (409 `LANE_TERMINAL`), a caller that is neither the
386
+ lane's agent nor its coordinator (403 `LANE_ACTOR_REQUIRED`), a live lease held
387
+ by someone else (409 `CLAIM_HELD_BY_OTHER`), and a re-route or carried key that
388
+ names no issue, the lane's own issue, or (for carried) a closed one (422).
389
+ The command reaches Dev through the edge, so it needs the edge's route for
390
+ `/devops/api/v1/lanes/:id/non-issue`; until that is on an environment, the
391
+ command gets the edge's 404 there.
392
+
346
393
  Heartbeat notes are optional and limited by Dev to 500 characters.
347
394
  Prioritize and deprioritize require a 1–500 character reason, which the CLI
348
395
  sends to Dev. `lane review` records the review gate.
package/dist/cli.js CHANGED
@@ -68,6 +68,7 @@ Usage: nodii-dev <command> [options] [--json]
68
68
  design guideline propose ENTRY --file FILE.md [--summary TEXT] [--dry-run]
69
69
  design changeset list [--entry KEY] [--state STATE] | show ID
70
70
  figma lock|check|log-write|submit|apply|published|abandon|release
71
+ figma withdraw CHANGE_SET # holder takes back a submit: in_review -> editing
71
72
  hook claude-figma-pre|claude-figma-post|print-settings
72
73
  setup [--yes|--check] # dry-run by default
73
74
  harness install|update [--include-drafts[=false]] [--adopt PATH,...] [--dry-run]
@@ -84,6 +85,9 @@ Usage: nodii-dev <command> [options] [--json]
84
85
  lane step <key> --side SIDE --start|--done|--block <step>
85
86
  lane evidence <key> --pr|--commit|--figma|--deploy|--dev-check REF
86
87
  lane heartbeat|review|land|verify|prioritize|deprioritize|stop <key>
88
+ lane non-issue <key> --reason TEXT --evidence TEXT --reroute KEY[,KEY]|none
89
+ --branch carried:KEY|dropped[:REASON] [--commits SHA[,SHA]]
90
+ # DEC-0011: terminal non_issue; issue -> wont_do; slot frees
87
91
  lane list [--kind KIND] [--status STATUS] [--mine] [--cursor CURSOR]
88
92
  lane show <key> | next <key>
89
93
  built list | built ack <key...>
@@ -265,6 +269,25 @@ export function transitionBody(f) {
265
269
  return { to, ...(note ? { note } : {}) };
266
270
  }
267
271
 
272
+ // Dev's refusals of withdrawDesignChangeSet, said in terms of what to do next.
273
+ const WITHDRAW_REFUSALS = {
274
+ CHANGE_SET_NOT_FOUND: (id) => `No change set ${id} in Dev.`,
275
+ CHANGE_SET_NOT_IN_REVIEW: (id) => `${id} is not in review; only a submitted (in_review) change set can be withdrawn.`,
276
+ WITHDRAW_NOT_ALLOWED: (id) => `You don't hold ${id}; only its holder (or an operator) can withdraw it.`,
277
+ CHANGE_SET_HAS_DECISIONS: (id) => `${id} already has a decided item, so it can't be withdrawn; ask the reviewer to request changes instead.`,
278
+ };
279
+
280
+ export async function figmaWithdraw(id, { request = devRequest } = {}) {
281
+ if (!id) throw new CliError("USAGE", "figma withdraw CHANGE_SET", 2);
282
+ try {
283
+ return await request("POST", `/api/v1/design/change-sets/${encode(id)}/withdraw`, {});
284
+ } catch (error) {
285
+ const say = WITHDRAW_REFUSALS[error?.code];
286
+ if (!say) throw error;
287
+ throw new CliError(error.code, say(id), error.exitCode ?? 1, error.details);
288
+ }
289
+ }
290
+
268
291
  export async function main(argv = process.argv.slice(2)) {
269
292
  if (argv.length === 1 && ["--version", "-v"].includes(argv[0]))
270
293
  return console.log(VERSION);
@@ -571,6 +594,8 @@ export async function main(argv = process.argv.slice(2)) {
571
594
  json,
572
595
  );
573
596
  }
597
+ if (action === "withdraw")
598
+ return emit(await figmaWithdraw(rest[0]), json, `Withdrew ${rest[0]}; it is back in editing.`);
574
599
  if (action === "release")
575
600
  return emit(
576
601
  await devRequest(
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.5";
7
+ export const VERSION = "0.6.7";
8
8
  export const configPath = () =>
9
9
  process.env.NODII_DEV_CONFIG_PATH ??
10
10
  join(homedir(), ".config/nodii-dev/config.json");