Skip to content

patch explainer: every embedded-payload error is reported as "payload cannot be inflated" (patch.mjs:26 checks error.diagnostics) #1084

Closed

Description

@MBrekhof

What happens

archify patch explainer reports "Embedded native diagram payload cannot be inflated." for every problem with the page's embedded payload. When the page has no prepared payload at all (for example, the wrong HTML file was passed), has two of them, or holds invalid JSON, the specific message that embedded() raises is lost.

Reproduced on v3.2.0 and on main (25cf370). Windows 11, Node 24.

Minimal repro

node archify/bin/archify.mjs deliver lifecycle archify/examples/agent-run.lifecycle.json native.html
printf '## Q {#q}\n\nText.\n' > repl.md
node archify/bin/archify.mjs patch explainer native.html q repl.md out.html

Output:

Embedded native diagram payload cannot be inflated.
[explainer/patch-payload] Embedded native diagram payload cannot be inflated. Fix: Rebuild the original artifact before patching..

Expected

[explainer/patch-payload] The artifact must contain one original draft and prepared resource payload. with its fix "Use an artifact produced by the formal explainer CLI.", which is what embedded() raises. For invalid JSON: "Embedded draft payload is invalid."

Cause

archify/explainer/patch.mjs:26: catch (error) { if (error.diagnostics) throw error; fail('payload','Embedded native diagram payload cannot be inflated.', …) }. The errors raised by fail() carry their diagnostics on archifyDiagnostics (that is what commandPatch reads), so error.diagnostics is always undefined and every embedded() failure is replaced. Checking error.archifyDiagnostics keeps the specific message.

🤖 Generated with Claude Code

Activity

  1. BlueboxC commented on Oct 24, 2026

    @BlueboxC

    Reproduced: missing or duplicate prepared payloads and invalid JSON lost their specific diagnostic and were reported as inflation failures. Fixed in 897cbbf0.

    The catch now preserves error.archifyDiagnostics, while retaining the legacy error.diagnostics route. The original message and repair advice survive. A genuinely corrupt gzip payload still produces the inflation diagnostic.

    Tests cover all four cases through preparePanelPatch, plus the public CLI when an ordinary native page is mistakenly passed to patch explainer. They verify that the original page and previous output remain unchanged. Existing successful patch cases also pass. Full regression: 3,473 passes/133 conditional skips; Chrome: 324 passes/no skips. The same package is installed and hash/mode checked across 213 managed files, with CLI checks on macOS Node 22.23.2 and 26.0.0.

    BlueboxC

  2. tt-a1i commented on Oct 25, 2026

    @tt-a1i
    Owner

    Completed on dev through #1089, integrated by #1102 at commit 10b4dd5. Original contribution history is retained.

    Missing/duplicate/invalid prepared payloads retain their specific diagnostics; actual decompression failures retain the fallback.

    The exact integrated candidate 98efbfc passed CI run 40177166414: 19 successful jobs, no failures, two deployment-only skips. Closing as completed in the development branch; this does not announce a release or a live installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions