Skip to content

mac: Problems panel reads structured diagnostics — code grouping, notes/help rows, Fix… from help.replacement (#277 part 4) - #345

Merged
GoKubar merged 2 commits into
mainfrom
agent/daniel-parent/problems-panel-structured
Sep 14, 2026
Merged

GoKubar merged 2 commits into
mainfrom
agent/daniel-parent/problems-panel-structured

Conversation

@d-q222

@d-q222 d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

#277 part (4), claim GH-277-mac, announced on #2 before work. Implemented by a Cursor worker (Grok 4.6 high) and reviewed by daniel-parent.

What

  • Decoding: RuntimeV1.Diagnostic and the FastJSON hot path decode the optional code, suggestion, labels[], notes[] and help{message, replacement?} from protocol/proposals/runtime-v1-structured-diagnostics.md (the diagnostics: rustc-style reports in the CLI and the app — source excerpt, carets, labels, suggested fix #277 compiler lane). Absent fields decode exactly as before, and unknown keys are still ignored. help.replacement accepts bare bytes or a path/source object, because the compiler-side shape is still under review on diagnostics: rustc-style reports in the CLI and the app — source excerpt, carets, labels, suggested fix #277.
  • Grouping and categorising: EditorDiagnostics uses code when present. unsupported_feature is a gap; unknown_command, syntax_error, recovered_input, fidelity_note and export_limitation are not. A missing or unknown code falls back to today's message-phrase heuristic, which is kept.
    • Behaviour change: a typo such as \alpah (unknown_command) now counts as an error, not a FlashTeX gap. It's an authoring mistake.
  • Panel: rows show = note: and = help: lines, secondary label text appears on hover, and "Copy diagnostics as text" includes the note and help lines.
  • Fix…: applies help.replacement through the existing QuickFix.prepare / pendingEdit path as one undo step. It's shown only when the range is a valid UTF-8 range in the current buffer, targets the active file, and the compile revision equals the editor revision (the same test as previewIsStale). Help without a replacement shows no button.

No edits outside apps/mac.

Tests

  • Worker: filtered swift test → Executed 76 tests, with 7 tests skipped and 0 failures.
  • daniel-parent re-run (--filter 'StructuredDiagnostic|EditorDiagnostics|DiagnosticsPanelTests|FastJSONTests|ProtocolTests') → Executed 81 tests, with 7 tests skipped and 0 failures.
  • Full swift test (worker) → 1064 executed, 134 skipped, 1 failure: CompletionTests.testBundledInventoryMatchesTheCompiler. That's the bundled supported-latex.json being out of date. It fails the same way on base 8f83ab5c, and apps/mac: sync bundled supported-latex.json to main (#250 landed without it) #327 (mac-claude-a) fixes it.

Dependency

The compiler doesn't emit labels, notes or help until the #277 (1)+(3) lane lands, render-pipeline forwards the fields, and vendor/compiler is re-pinned. Until then only code affects behaviour, and this PR is safe to merge on its own.

🤖 Generated with Claude Code

https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

Decode optional code/suggestion/labels/notes/help on RuntimeV1.Diagnostic
(FastJSON + Codable), group/categorise by code with the message-phrase
fallback kept, show notes/help on the row, copy rustc-like = note/= help
lines, and apply help.replacement through the existing QuickFix path when
the range is in bounds and the compile revision still matches.

Filtered swift test from apps/mac (StructuredDiagnosticTests,
EditorDiagnostics*, DiagnosticsPanelTests, FastJSONTests, ProtocolTests):
Executed 76 tests, with 7 tests skipped and 0 failures.

Next: full `swift test` from apps/mac, then push this lane branch.

Open questions: none in-scope; help.replacement with an explicit other-file
path hides Fix… (QuickFix.otherDocument), matching today's explanation edits.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

daniel-parent Mac pre-merge verification (for the integration lane, which has no Swift toolchain). Xcode 26.6, macOS 26.6, merged onto origin/main 98ca402a in a throwaway worktree, PR head 1792eaab. Worker: Cursor; results checked by daniel-parent.

PR merge filtered tests full suite verdict
#345 CLEAN 51 / 1 skipped / 0 fail 1064 / 135 skipped / 3 fail (pre-existing WordCount) READY

About the 3 full-suite failures: WordCountModelTests.testOnlyTheLastScheduledUpdateWins and testScheduleUpdateEventuallyPublishesTotals fail in every full run, including the control on main, while the machine is loaded. Run alone on main 095e8406 they pass twice (2/0), so they're timing-flaky under full-suite load, not caused by this PR or broken on main.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants