@nodii/dev 0.6.123 → 0.6.125

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/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.123";
7
+ export const VERSION = "0.6.125";
8
8
  export const configPath = () =>
9
9
  process.env.NODII_DEV_CONFIG_PATH ??
10
10
  join(homedir(), ".config/nodii-dev/config.json");
package/dist/review.js CHANGED
@@ -525,14 +525,16 @@ export async function boundaryFrames(figma, { catalog, lookupSet = designCatalog
525
525
  /**
526
526
  * MW2-38.3: the nodes of the change sets a lane's agent holds in each
527
527
  * boundary file Dev registers as the design system. Returns
528
- * { fileKey: { changeSets: [id], nodes: [nodeId] } } for files with at least
529
- * one node. Dev's holderAgentId filter is checked again here, because a Dev
528
+ * { fileKey: { changeSets: [id], nodes: [nodeId] } } for every such file.
529
+ * hub-364: a DS file the change touches no unit of is still listed, with no
530
+ * nodes, so it is never checked whole for CLEAN: all of it is file debt
531
+ * (MW2-38.3: a whole-file DS check is never required). Dev's holderAgentId filter is checked again here, because a Dev
530
532
  * without it ignores the parameter and lists every set on the file. Items the
531
533
  * lane withdrew are left out; rejected items stay in until withdrawn. A
532
534
  * removed item's node is gone from Figma, so there is nothing to check.
533
535
  */
534
536
  export async function laneChangeSetNodes(request, agentId, fileKeys, templates = []) {
535
- if (!fileKeys.length || (!agentId && !templates.length)) return {};
537
+ if (!fileKeys.length) return {};
536
538
  const files = (await request("GET", "/api/v1/design/files")).data ?? [];
537
539
  const ds = new Set(files.filter((file) => file.kind === "design-system").map((file) => file.fileKey));
538
540
  const scoped = {};
@@ -558,7 +560,7 @@ export async function laneChangeSetNodes(request, agentId, fileKeys, templates =
558
560
  if (!nodes.has(unit.nodeId)) items.push({ nodeId: unit.nodeId, template: unit.template });
559
561
  nodes.add(unit.nodeId);
560
562
  }
561
- if (nodes.size) scoped[fileKey] = { changeSets, nodes: [...nodes], items, templates: [...new Set(touched.map((unit) => unit.template))] };
563
+ scoped[fileKey] = { changeSets, nodes: [...nodes], items, templates: [...new Set(touched.map((unit) => unit.template))] };
562
564
  }
563
565
  return scoped;
564
566
  }
@@ -662,9 +664,9 @@ export async function swapFor(swaps, { fileKey, nodeId }, readSet) {
662
664
 
663
665
  /**
664
666
  * DEV-REV-9, design-check part: designCheck on every boundary frame; per-state
665
- * frame comparison is Q-162. A boundary file with held change-set nodes
666
- * (MW2-38.3, from laneChangeSetNodes) is checked on those nodes only, never
667
- * as the whole file. A change-set node Figma no longer has, which a Swap in
667
+ * frame comparison is Q-162. A DS boundary file (MW2-38.3, from
668
+ * laneChangeSetNodes) is checked on the units the change touches only, never
669
+ * as the whole file for CLEAN; with no unit touched, nothing in it counts. A change-set node Figma no longer has, which a Swap in
668
670
  * Dev removes (MW8-5), is not a frame: like an item recorded as removed
669
671
  * (laneChangeSetNodes), there is nothing in Figma to check. It is left out of
670
672
  * the frames and listed in inputs.removed with its Swap (NODII-DEV-CLI-67).
@@ -902,10 +904,17 @@ export async function runLaneCheck(ref, flags, { request, lane, freeze, current,
902
904
  // Figma (DEV-REV-9): only a lane with a frontend side.
903
905
  let figma;
904
906
  if (!["frontend", "both"].includes(lane.side)) figma = { check: "figma", outcome: "NOT_APPLICABLE", iterationCount: 0, reviewerErrors: [], inputs: { side: lane.side ?? null }, findings: [] };
905
- else if (!Array.isArray(freeze?.boundaries?.figma) || !freeze.boundaries.figma.length) {
906
- // Nothing to compare, so the leg is skipped, not crashed. Dev requires a
907
- // frontend lane's figma check to run (NOT_APPLICABLE is refused there), so
908
- // the skip records as unavailable and the run stays NOT CLEAN until it is set.
907
+ else if (Array.isArray(freeze?.boundaries?.figma) && !freeze.boundaries.figma.length) {
908
+ // hub-364: a Freeze that sets its Figma boundary to [] says the change
909
+ // touches no Figma unit, so nothing counts (as with zero touched units of
910
+ // a DS file). Dev refuses NOT_REQUIRED and NOT_APPLICABLE on a frontend
911
+ // lane's figma check, so this is a CLEAN round over zero frames.
912
+ figma = round("figma", [], { side: lane.side, frames: [], frameComparison: "not_built", boundary: [], notChecked: `${ref}'s Freeze sets its Figma boundary to none (boundaries.figma = []), so the change touches no Figma unit and nothing is counted (hub-364)` });
913
+ } else if (!Array.isArray(freeze?.boundaries?.figma)) {
914
+ // No boundary set at all: nothing to compare, so the leg is skipped, not
915
+ // crashed. Dev requires a frontend lane's figma check to run
916
+ // (NOT_APPLICABLE is refused there), so the skip records as unavailable
917
+ // and the run stays NOT CLEAN until it is set.
909
918
  figma = errorCheck("figma", new ReviewerError(UNAVAILABLE, `skipped: ${ref} is a ${lane.side} lane, but its Freeze names no Figma boundary (boundaries.figma), so there is no frame to check and no design check ran. Dev requires a ${lane.side} lane's figma check to run, so this run is NOT CLEAN until the boundary is set: nodii-dev lane freeze swap ${ref} --section boundaries.`), firstRound("figma"), { side: lane.side, frames: [], frameComparison: "not_built", boundary: null });
910
919
  } else {
911
920
  const boundary = freeze.boundaries.figma;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodii/dev",
3
- "version": "0.6.123",
3
+ "version": "0.6.125",
4
4
  "description": "Agent CLI for Nodii Dev, reached through the platform edge",
5
5
  "type": "module",
6
6
  "bin": {