#583·archify

[Bug]: Workflow v2 rejects its own layout when same-lane nodes land exactly 8px apart (gap computed as 7.999999999999886)

Author: ThakayCreated Sep 26, 2026Updated Sep 29, 2026

Filed as a blank issue, so the fields below follow .github/ISSUE_TEMPLATE/bug-report.yml rather than being entered through it.

Archify version or commit: 2.16.0 (release archify.zip, SHA-256 4c59fa6557a2385beaaef8c7219cc414573acc9f0c30a932d5053b0b20689a46), and main at 9e35d2b0b39b155553ba9fcfe0b4f2a5198dd993

Installation method: Downloaded archify.zip (the v2.16.0 release asset); also reproduced from a Git clone of main

Diagram type: Workflow

Exact command

bash
node bin/archify.mjs validate workflow workflow-8px-boundary.json --quality showcase --json

Minimal redacted JSON reproduction

Shrunk automatically from a larger diagram by removing one element at a time while the error persisted. Removing either edge, the side pins on s0-a1, any node, or the node widths no longer reproduces it.

json
{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {"title": "Clearance rounding", "quality_profile": "showcase"},
  "lanes": [
    {"id": "upper", "label": "Upper: the first lane"},
    {"id": "lower", "label": "Lower lane: second lane"}
  ],
  "nodes": [
    {"id": "s0", "lane": "lower", "col": 0, "type": "backend", "label": "Start", "width": 160},
    {"id": "a1", "lane": "upper", "col": 1, "type": "backend", "label": "Step one", "width": 160},
    {"id": "a2", "lane": "upper", "col": 2, "type": "backend", "label": "Step two", "width": 160},
    {"id": "a3", "lane": "upper", "col": 3, "type": "backend", "label": "Step three", "width": 160},
    {"id": "a4", "lane": "upper", "col": 4, "type": "backend", "label": "Step four", "width": 160},
    {"id": "a5", "lane": "upper", "col": 5, "type": "backend", "label": "Step five", "width": 160}
  ],
  "edges": [
    {"id": "s0-a1", "from": "s0", "to": "a1", "fromSide": "top", "toSide": "left"},
    {"id": "a3-a4", "from": "a3", "to": "a4"}
  ]
}

Validation receipt or exact error

From main; v2.16.0 returns the same diagnostic and the same coordinates.

json
{
  "schemaVersion": 1,
  "ok": false,
  "command": "validate",
  "stage": "render",
  "type": "workflow",
  "input": "<dir>/workflow-8px-boundary.json",
  "error": "Workflow nodes \"a4\" and \"a5\" are less than 8px apart in lane \"upper\".",
  "diagnostics": [
    {
      "code": "workflow/node-overlap",
      "severity": "error",
      "message": "Workflow nodes \"a4\" and \"a5\" are less than 8px apart in lane \"upper\".",
      "subject": {
        "diagramType": "workflow",
        "node": "a5",
        "path": "/nodes/5"
      },
      "evidence": {
        "lane": "upper",
        "minimumClearancePx": 8,
        "nodes": [
          {
            "id": "a4",
            "rect": {
              "x": 793.6,
              "y": 93,
              "width": 160,
              "height": 52
            }
          },
          {
            "id": "a5",
            "rect": {
              "x": 961.5999999999999,
              "y": 93,
              "width": 160,
              "height": 52
            }
          }
        ]
      },
      "supportedFixes": []
    }
  ]
}

Expected behavior

The compiler never produces a layout that its own clearance check rejects. Two same-lane nodes that the solver separates by exactly the 8px minimum pass.

Actual behavior

The solver places a4 at x = 793.6 (right edge 953.6) and a5 at x = 961.5999999999999, which is the 8px minimum up to floating-point error. The same-lane check at archify/renderers/workflow/workflow-compiler.mjs:2670 calls rectsOverlap(left, right, 8), and archify/renderers/shared/geometry.mjs:30 tests a.x + a.width + gap <= b.x. In JavaScript 793.6 + 160 + 8 is 961.6, which is not <= 961.5999999999999, so the pair is reported as overlapping.

Two details make this hard to repair from the author's side:

  • supportedFixes is empty, so the diagnostic suggests no repair.
  • Narrowing a5 to 150 still fails with the same coordinates, because the solver keeps a5 on the same boundary.

The fractional coordinate seems to come from the measured width of the lower lane's title: shortening "Lower lane: second lane" to "Lower lane" removes the error, while shortening the upper lane's title does not.

Workaround: leave an empty column between the two nodes. In the reproduction, moving a1 to a4 one column left (columns 0 to 3) while a5 stays in column 5 passes.

Possible fix: compare with a small tolerance, for example a.x + a.width + gap <= b.x + 1e-6, or snap solved coordinates to a fixed precision before validation and serialization, so the solver and the check agree.

Supporting visual evidence

None needed; validate fails before any artifact is written.

Environment

  • Ubuntu 24.04 on WSL2 (Linux 6.18), Node.js v24.15.0
  • Found while authoring with Claude Code (Claude Opus 5.5); the reproduction does not depend on the client or a browser.

Final checks

  • I searched existing issues for the same problem ("less than 8px", "node-overlap", "rounding", "floating point") and found none.
  • I removed access tokens, credentials, private repository contents, and personal or customer data.