fix(renderer): classify and format authoring failures at their source - #396
Draft
tt-a1i wants to merge 1 commit into
Draft
fix(renderer): classify and format authoring failures at their source#396tt-a1i wants to merge 1 commit into
tt-a1i wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and value
On main
6db72a9,node archify/bin/archify.mjs render architecture /no/such.json /tmp/diagram.htmlexits 1 with a raw Node stack. A valid-schema diagram with an overwide node label does the same, even though its renderer already attaches a layout diagnostic. A failed output write can also be reported asinput/readby the JSON boundary because it guesses the operation fromEISDIR/EACCES.Classify read, JSON parse, and output filesystem failures where those operations occur. Human renderer failures now format attached diagnostics with their existing rule codes and supported repairs; an unexpected implementation exception retains its stack and exit 1. This is a narrow defect with a concrete reproduction, so it needs no separate planning issue.
Stability impact
renderand direct renderer scripts are covered.validate --json/deliver --jsonreceipt structure, and standalonedoctorstartup. The public CLI source is unchanged. No new flag, schema, geometry, or Viewer change.input/readoroutput/writeat the actual operation, including parent-directory creation. JSON parse errors are classified only aroundJSON.parse. Existing classified output-path errors keep their own code. Unexpected implementation failures are not guessed to be malformed JSON or unreadable input.renderwrites.deliverremains the interface that preserves the prior artifact until verification and commit succeed.Tests run
Base
6db72a9aea3d0f67a6a034e41f8a5491476a11c1; candidatebfb7603ec3625a06b4587ecb4072711651594d98. Local macOS, official Node 22.23.2 unless noted.node --test archify/test/render-failure-diagnostics.test.mjs archify/test/repair-receipt.test.mjs archify/test/cli-output-types.test.mjs: 31 passed, 0 failed, 0 skipped on final source. The new 12-test regression suite gave 5 passed / 7 failed against the base. It covers all five renderers, missing/malformed inputs, directory output and blocked output parents, direct JSON output classification, successful output contracts, actual layout rejection, and unexpected implementation exceptions.doctorregression in an intermediate formatter refactor. The CLI source was restored, preserving its ability to diagnose an incomplete installation. Re-review passed the three doctor tests and both delivery/comparison alias-race tests, with no remaining finding.git diff --check: passed.doctorcorrection; it is not final-head evidence. Hosted CI subsequently passed on final headbfb7603across Node 18/20/22/24, browser/WebM checks, ZIP freshness, published-manifest checks, and Ubuntu/macOS/Windows package smoke: CI run. The mid-edit local run is still not labelled final-head evidence.Visual evidence
Not applicable. Only failure presentation/classification changes. The five-mode successful HTML comparison is byte-identical; no rendered appearance, interaction, or geometry is changed.
Generated artifacts
archify.ziprebuilt with official Node 22.23.2. All 79 archive entries are retained; changed entries are onlyreferences/delivery-contract.md,renderers/shared/cli.mjs, andrenderers/shared/diagnostics.mjs. No gallery, examples, or other generated content changed because their rendered bytes remain identical.