# Observe resolved GCC source occurrences and witnessed definitions Task ID: T-GCC-IDE-008 Role: astra_implementer Status: READY ## 1. Context and baseline Shared VoidLanguageServer feat/implement-roadmap ca04975. Root has applied immutable first evaluator patch 4b4ff5b6 (build/gcc-gate/applied-0001.patch) on owned verified GCC 16.2.0 source in build/gcc-gate/gcc-16.2.0. T-PLAN-GCC-008 established real source anchors. Independent T-PREFLIGHT-GCC-008 approved this narrow slice subject to physical provenance, all-level tentative parsing, positive definition evidence and separate fixed IDE mode. Baseline eight tooling probes exercise actual compiler output. ## 2. Objective and deliverables Implement a second versioned unified patch and bounded real acceptance harness for narrow typed call/member occurrences and their observed source definition or declaration. Give root an apply-ready patch early. ## 3. Scope and non-goals Compiler-owned facts for direct parsed resolved ordinary calls and explicit fields in the fixed read-only GCC IDE experiment. No LSP methods, background build execution, inferred general reflection support, distribution or changes to launcher fixed evaluator flags. ## 4. Files to inspect Inspect patches/actual compiler members from T-GCC-EVALUATOR-017, tests/corpus/frontend/{gcc-queries.cpp,probe-gcc-tooling.py,verify-gcc-events.py}, actual gcc/cp/{parser.cc,decl.cc,lex.cc,vls-eval.{h,cc}}, c-family/c.opt, libcpp/directives.cc, gcc/diagnostics/sarif-sink.cc, linemap support and actual generated header flags in build/gcc-gate/compiler-build/gcc. ## 5. Write ownership and coordination Write scope: compiler-patches/gcc-16.2.0/0002-ide-occurrences.patch; tests/corpus/frontend/verify-gcc-ide.py Author against private minimal member copies under build/gcc-gate/ide-author. Never write active GCC extract/build, 0001 or other owners' files. Root owns applying/rebuilding both. No staging, commits, branch changes, child agents, external sends. ## 6. Implementation or investigation approach Capture terminal unqualified-id token before opening paren in cp/parser.cc around 7150–64/8941, resolve after finish_call_expr 9129 using ordinary CALL_EXPR + cp_get_callee_fndecl_nofold and TREE_TYPE. Capture explicit p.x name at 9639, resolved COMPONENT_REF FIELD_DECL after final rejection check 9745–50. Suppress unresolved/tentative AST facts unless all enclosing levels committed (checking top alone wrong); use bounded deferred candidate buffer and all-level suppression or precise rollback. Witness actual definitions (e.g. real function body finalized cp/decl.cc ~20583), ordinary field origin via grokfield ~31583; synthesized/redeclared/implicit/macro/unknown cannot masquerade as a definition. No positive conclusions from matching spelling/lines alone. Verify stable physical token range for both use+target, primary fixed snapshot, no overlays beyond current invocation. Guard same-file #line/linemarker collisions using final seen_line_directive or genuine physical proof. Remember std headers may have numeric markers; be honest about degraded coverage. Collect compact owned metadata/indices with strict caps; never GC tree pointers after compiler hooks. ## 7. Interfaces and data contracts NEW private probe option -fvls-ide, distinguish hello capability and observed facts from evaluator-only mode, incompatible flag combos rejected or clear. Reuse v1 two-pipe strict writer/sequence/nonce/bounds in 0001 without changing existing evaluator behavior. Specify event names and fields, concrete byte ranges (one-based GCC raw bytes mapped to half-open span), invocation-local IDs, typed result and source authority, location-kind/explicit gaps, immutable snapshot identity supplied by harness. Emit IDE records only after confirming origin at finalization before frontendEnd. Narrow arbitrary operand within fixed query.cpp. Send root exact fixed mode requirements and wire early; separate owned IDE harness can use -fdiagnostics-format=sarif-stderr and -fvls-observe -fvls-ide. SARIF columns are display units; require byte/snapshot proof or mark diagnostic range unavailable. ## 8. Dependencies and integration Root is currently compiling 0001, will own incremental application to compiler-build. Observer 0001 owner may revise 0001. Coordinate with root before patches sharing writer/HELLO/lex/c.opt are re-based. Never run make in shared compiler-build. Use copied/narrow fsyntax-only checks while root builds. ## 9. Edge cases security and performance Bound all fields/events and candidate memory independent of translation-unit size; if obscured or incomplete, explicitly withhold affected facts. No arbitrary file reads from #line origin, no saved GC pointers, no unrestricted flags from projects. No exposed production compilers, no advertising unsupported IDE features. Test coordinates across tabs, combining and supplementary Unicode; conversion must detect ambiguity. ## 10. Acceptance criteria Real private compiler: saved point operand -> actually witnessed line 6 int, edit same call -> line 7 double, invalid edit -> genuine SARIF failure with no old overload, recovery -> line 6. Field use 6:46 -> actually witnessed field at 3:9. Add duplicate same-spelling occurrences with distinct physical use positions, forward-only declaration, same-file '#line 11' collisions, tentative or speculative/no admitted evidence, macro origin, tab/emoji differing display/byte/UTF16. Validate real hook output matches only observed identities; disabled evaluator baseline unchanged. ## 11. Verification commands and evidence git status --short --branch; patch --dry-run --fuzz=0 -p1 using private patch-0001 base; Python syntax checks with no checkout bytecode; root will run dev cpp-gcc -c make -C build/gcc-gate/compiler-build/gcc -j3 cc1plus. Run dev cpp-gcc -c python3 tests/corpus/frontend/verify-gcc-ide.py --cc1plus /absolute/path when root releases built binary, using temp private fixtures and timeouts. Give exact failing output/proof for skipped coverage. ## 12. Constraints and stop conditions Stop if unsupported physical coordinates or tentative behavior cannot be proven: report explicit withheld evidence, don't fabricate. Escalate if shared first patch API must be changed instead of additive second patch. On two failed repairs report new hypothesis. Limit private patch to approved GCC source version. ## 13. Authorization and decisions D-025 native primary, D-027/D-029 configured GPT-6.2 family Max, D-030 approved local patched compiler only. Review assignments stay GPT-6.2 Astra Max. Keep license and distribution deferred. This is the difficult direct IDE slice cleared under amended preflight. ## 14. Return format T-GCC-IDE-008 DONE/PARTIAL/BLOCKED with owned paths, exact baseline/patch digest, wire fields, commands and actual statuses, per-fixture positive and unavailable evidence, limitations and integration requirements. Return early patch-ready handoff and bounded real results.