Files
Language-Server/docs/agent-workflow/tasks/T-FIX-DIAGNOSTIC-COLUMNS-013.md
T
faumaray da8003f6d4 Implement the VLS roadmap on the native VBS build
Native VBS and CMake builds of the server and every registered suite:
protocol and document sync, VBS/compdb providers, stock GCC diagnostics
(including in-process default profile preparation), the stock occurrence
observer and hover/definition, the bounded Scheduler, C++ module graph,
scan and artifact cache with real CMI production, the context-aware
symbol index with schema-2 snapshot migration, navigation and guarded
rename, reflection provenance with splice-origin extraction, index-backed
completion and signature help, live GCC worker control with a registered
DAP suite, and the Neovim and VS Code clients.

VoidLibrary follows main. The private GCC 16.2.0 frontend is reproduced
from the versioned patches and verified stepping reflection/template code
with projected values 17/34 and 41/82.
2026-12-05 14:06:50 +03:00

5.7 KiB

Correct ambiguous GCC display columns at zero-width characters

Task ID: T-FIX-DIAGNOSTIC-COLUMNS-013 Role: sol_implementer Status: READY

1. Context and baseline

The shared repository /home/faumaray/Projects/VoidLanguageServer is on feat/implement-roadmap, ca04975 with local work. Existing stock GCC 16.2 diagnostics ship through stdio. The independent reviewer reproduced a seven-bit letter followed by U+0301 or U+200D giving the same display endpoint on both sides of the subsequent scalar. Reader::position currently stops at the first matching display column. An error on the full identifier highlights only its first letter. The 26 diagnostics and source-catalog tests presently pass.

2. Objective and deliverables

Fix the incorrect range at this boundary in the existing decoder, supply distinguishing regressions and verify the actual source witness. Continue to mark a diagnostic unlocated when its origin or range cannot be proved.

3. Scope and non-goals

The assignment covers source-column admission inside the SARIF decoder. Preserve the public API, existing units, limits, UTF-8/UTF-16 conversion, BOM and tab rules. The root owns DAP and build registration. Leave source capture, worker execution, module graph, driver configuration and unrelated findings to their owners.

4. Files to inspect

Read src/semantic/Diagnostics.cpp, include/vls/semantic/Diagnostics.hpp, tests/semantic/DiagnosticTests.cpp, tests/semantic/GccDiagnosticFixture.cpp, docs/agent-workflow/tasks/T-DIAGNOSTIC-SARIF-013.md and the reviewer's benign inputs under build/review-semantic-013. Verify which existing display policies actually support non-ASCII. Confirm limits from the function itself.

5. Write ownership and coordination

Write scope: src/semantic/Diagnostics.cpp, tests/semantic/DiagnosticTests.cpp Use build/fix-diagnostic-columns-013 for private outputs. Root owns every build file and the normal build directories and will run both integrated suites. The reviewer remains a separate read-only owner. Do not edit other files or change branches.

6. Implementation or investigation approach

Reproduce before editing. An actual source spelling is int f(){return é;} with e followed by U+0301. GCC reports 1-based exclusive [16,17) at line 1. The current adapter produces UTF-16 [15,16), hiding the trailing scalar. Require a unique end and start in the supported coordinate convention. When unable to characterize a following non-ASCII scalar safely under the display policy, withhold the location. Keep a proven byte boundary usable under utf8_bytes. Avoid adding a competing Unicode width table if a small conservative proof suffices. Preserve valid ASCII cases and whichever uniquely provable non-ASCII prefixes are covered by the original contract.

7. Interfaces and data contracts

The independent review also demonstrated that an artifact table entry declaring a conflicting self-index can authorize an empty clear. In the same two owned files, require any present artifact location index to be its actual table position using the exact integer variant. Exercise out-of-range, wrong-type and conflicting index cases against the valid position. decode_gcc_diagnostics maps DiagnosticJob + DiagnosticOutput into DiagnosticBatch. A gap uses LocationGap::ambiguous_column, retains the compiler message and prevents a false complete clear. Both endpoints and the original immutable source snapshot matter. Preserve policy distinction between ascii_consensus, gcc_display and utf8_bytes; keep bounds in the reader's work budget.

8. Dependencies and integration

Based on T-REVIEW-SEMANTIC-013's November 28 independent evidence. No compiler modification or upstream dependency required. Notify root when independent object checks and patches are ready. Root will perform integrated build and re-review.

9. Edge cases security and performance

Check a zero-width codepoint exactly after the candidate boundary, at the beginning of a line, multiple zero-width scalars, and a normal ASCII control. Preserve bounds on maliciously long lines and repeated diagnostics. Do not introduce file reads while decoding or attach guessed locations.

10. Acceptance criteria

  1. The combining and joiner witnesses never return the incorrect partial-token highlight. 2. A validated UTF-8 byte report and an ordinary ASCII token still map correctly in the negotiated encoding. 3. A partial result retains its message and distinguishes unavailable columns from a valid empty report. 4. All previous body registrations are preserved.

11. Verification commands and evidence

Use dev cpp-gcc -c with the compile definitions and include directories from build/bootstrap/compile_commands.json. Compile the two owned files into the private directory; link a dedicated test runner using the existing library and test main as appropriate, or ask root for the normal build at handoff. Run the focused Void::Testing suite with --no-color and the existing GccDiagnosticFixture on the reviewer's recorded SARIF if practical. Run dev cpp -c clang-format --dry-run --Werror on the two owned files. Report actual commands and outcomes, and the new test count.

12. Constraints and stop conditions

If source representation or parser differences invalidate the witness, report exact evidence. No Git mutation, sibling edits, shared builds, extra models, further workers or messages to the user. Stay within the two owned paths.

13. Authorization and decisions

D-022 authorizes all roadmap development, D-025 native integration, D-027 GPT-6.2 Sol at Max. This scoped correctness fix fits the existing preflight contract.

14. Return format

T-FIX-DIAGNOSTIC-COLUMNS-013 DONE/PARTIAL with owned files, direct test results, prior/fixed outputs, case count and release of ownership. Send an early implementation-ready notice to root.