Repository navigation
fix(renderer): classify and format authoring failures at their source - #396
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 SummaryRenderer failures now classify filesystem and JSON errors at read/write boundaries. Human output includes diagnostic codes and repair guidance, while unexpected exceptions preserve debugging information. Prior layout diagnostics no longer mask later internal failures, and output classification requires confirmed filesystem errors. The shared behavior covers the CLI and five direct renderers. Success output, schemas, geometry, receipts, and writes remain unchanged. Reviewed base/head, author-reported validation, reused evidence revisions, and checked CI revision are not supplied, so revision-specific status cannot be verified. The supplied report states 93 focused tests passed, but does not establish browser or perceptual acceptance. WalkthroughThe renderer now classifies input read, JSON parse, output filesystem, schema, and layout failures. Human mode formats classified diagnostics without Node stacks. Unclassified implementation errors retain native debugging details. Machine receipts continue through Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The renderer diagnostic changes preserve classified authoring failures and native unexpected-error debugging behavior without a supported merge-blocking risk. 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
Full details: Contribution ScopeExplanation The PR is focused and explains the user problem, intended behavior, compatibility impact, and failure/rollback behavior. The implementation matches that scope: it changes shared renderer diagnostics, adds focused regression tests, updates the delivery contract, changelog, and generated archive. However, the PR adds a new command-level failure contract in Thanks 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 |
|
审核中发现两个错误分类边界还需要处理: 1. 真正的程序错误可能被前面的诊断掩盖如果渲染过程中先记录了一个布局问题,随后代码本身又发生意外异常,当前 JSON receipt 只会显示前面的布局问题,看不到真正导致程序失败的内部错误。 这样用户可能会一直修改图表,但实际上需要修复的是程序代码。 建议调整为:只有最终抛出的异常本身带有明确诊断时,才使用已记录的诊断;否则应报告 2. 部分程序错误会被误报成“输出路径不可写”现在只要异常带有字符串形式的 例如 建议只把确定来自文件系统操作的异常归类为 非阻塞建议
这项不阻塞当前修复。如果不方便抽成共享模块,建议至少增加一致性测试,同时继续保证 本地聚焦回归 31/31 通过,GitHub 最终头提交的 Node 18/20/22/24、三平台包冒烟和 ZIP 新鲜度检查也均通过;上面两个问题属于当前测试没有覆盖到的异常组合。 |
|
Hi @tt-a1i — following up on the workflow library proposal in #222 to coordinate the diagnostic entrypoint. At Would you prefer moving installation into I have a private experiment on |
|
Hi @tt-a1i — #418 is now synchronized with main I propose landing #418 first, then updating #396 on top. The import-side-effect fix is independently useful and does not change this PR's error classifications. When updating #396, please preserve boundary installation at the start of The earlier local rehearsal against your unchanged head Does this order work for you, or would you prefer #396 first? If #396 should land first, I can adapt #418 afterward, including the explicit probe initialization. #418 remains Draft pending that coordination. |
…gration # Conflicts: # CHANGELOG.md # archify.zip # archify/renderers/shared/diagnostics.mjs
…ation # Conflicts: # archify.zip
…ation # Conflicts: # archify.zip
Problem and behavior
A missing input, invalid JSON, or failed output write can produce a raw Node stack or be classified under the wrong operation. Classify expected filesystem failures at the read/write boundary and syntax errors around JSON.parse. Human-mode errors show their diagnostic code and supported repair. Unexpected implementation exceptions keep their stack and exit 1; an earlier layout diagnostic cannot disguise a later unrelated exception.
Scope and integration
The shared path serves all five renderers, including public CLI and direct renderer scripts. This revision integrates current dev, retains #418's import-safe boundary installation inside loadDiagram, and preserves #374's complete synchronous JSON stderr transport. No schema, geometry, Viewer, success stdout, or receipt-shape change. Rendering still writes directly; transactional preservation remains the deliver command's responsibility.
Validation
Candidate
935a768, based on deve1c27ee; local macOS with official Node 22.23.2:da85751as the dev-equivalent baseline.Visual review is not required for this failure-reporting change; the successful five-mode output comparison is byte-identical. Existing regressions cover filesystem operation classification, empty or unrelated diagnostic metadata, unexpected implementation errors, human/JSON modes, and the standalone doctor boundary.