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.
11 KiB
Produce compiler-owned call and definition facts with stock GCC 16.2
Task ID: T-STOCK-OCCURRENCES-014 Role: astra_implementer Status: READY
1. Context and baseline
Shared workspace /home/faumaray/Projects/VoidLanguageServer on feat/implement-roadmap, ca04975 plus uncommitted changes. D-028/030 approve local GCC evaluation. The planner T-PLAN-STOCK-NAVIGATION-014 built a separate observer against the unmodified installed GCC 16.2.0 and compiled the real DocumentSnapshot.cpp under a sealed Linux view. The saved TU selected Void::Hash::fnv1a64 at Hash.hpp:59; changing its argument to a byte span selects line 65, with canonical long unsigned int. Broken/recovery exits 1/0. Both calls have the same physical spelling; terminal information in CALL_EXPR is not a standalone token location.
2. Objective and deliverables
Implement a local development observer that a verified regular GCC 16.2 cc1plus can load to publish source-bound facts for resolved direct calls in the selected translation unit and actual function definitions in the captured file set. Build/installing the user's compiler is outside scope. Deliver an opt-in development build tool and actual closed-fixture tests. Root owns StockCompiler, profile, server, semantic result binding and LSP; work entirely in the owned three paths.
3. Scope and non-goals
C++ direct free/namespace function calls, ASCII identifiers in a conservative source grammar; overloads, declared-only cases, and an explicit incomplete-coverage result. Positive physically verified use and target identity only. Support the actual overload/type edit in Void. Later plugins/features may add class members, completion, templates and reflection. Never hardcode Void symbol names, fixture values or paths. Do not choose a project license or distribute a shared object.
4. Files to inspect
Read build/plan-stock-navigation-014/{probe.py,observe.cc,real.py} and private sealed evidence as available, root's tests/corpus/frontend/gcc-queries.cpp and gcc-live.cpp, src/Documents/DocumentSnapshot.cpp, prepared Void/Core/Hash.hpp, compiler-patches/gcc-16.2.0/{0002-ide-occurrences,0003-physical-utf8-origin}.patch, tools/prepare-gcc-profile, src/semantic/StockCompiler.cpp. Verify plugin header callbacks from stock GCC dev shell. The checked-in app does not yet consume this wire.
5. Write ownership and coordination
Write scope: experiments/frontend/gcc-observer/Observer.cpp, tools/prepare-gcc-observer, tests/corpus/frontend/verify-stock-observer.py Private artifacts in build/stock-observer-014 only. No compiler source edits, shared worker, profile, VBS/CMake, fixtures already owned, LSP dispatch, docs or Git. No subagents or user contact. Coordinate final wire names and proofs with root. Root owns host decoder and launcher assembly.
6. Implementation or investigation approach
Use the actual stock GCC plugin ABI with version checks. Observe function bodies before genericization, selected direct callee identity, canonical and spelled return type; join definitions only to an observed function body in the same invocation. Keep location, line-map and GCC UID inside this process until projecting copied facts. Restrict parsing to files named in the sealed job manifest, read exact immutable stage bytes and prove both physical endpoints. Use CALL_EXPR start/caret/finish, original source and restricted ordinary qualified-id grammar to isolate a unique terminal identifier before '('. Withhold on remap, hidden macro expansion, overlapping/ambiguous facts, missing definition, malformed encoding/columns or quota. A defined-only/overloaded-ambiguous token never supplies a unique definition. Filter or suppress correctly for template specializations/instantiations before committing the unique occurrence. Ignore #line, macro-generated locations and BOM-shifted coordinates unless independently proven. Runtime must not override handlers needed by GCC itself.
7. Interfaces and data contracts
NEW supervised observer mode uses three fixed, program-selected resources in the private worker. Bind verified ELF at /vls-observer/occurrences.so; arguments -fplugin=/vls-observer/occurrences.so with no compiler options forwarded from build metadata. A reads-only config file /vls-observer/inputs contains a schema line VLS-OCCURRENCES-1, nonce on second line (32 lowercase hex), absolute primary file path on third line, and remaining absolute source paths one per line. Require only admitted absolute paths, nonempty lines, max 1024 inputs, length <=4095, no NUL or line breaks. For independent harnesses allow test runner selected absolute input/output paths in explicitly named environment VLS_OBSERVER_INPUTS, VLS_OBSERVER_OUTPUT exclusively on the private plugin test leg; normal server supplies only constants inside its sandbox. Use one fresh private report at /vls-observer/report. Default report format UTF-8 strict JSON envelope {schema:1,nonce,complete:true,partial:boolean,occurrences:[{name,type,canonicalType,use:{path,line,startByte,endByte},definition:{path,line,startByte,endByte}}]}. All fields owned, one-based byte/line coordinates, half-open ranges in original captured UTF-8 bytes. Partial means supported individual facts only; complete means normal report finished, not project-wide semantic completeness. Conflicting target/type at any single physical use is unavailable independent of iteration order. Global invalidity (compiler error, remap, quota) yields zero facts and explicit reason/incomplete status. No parser for user C++ types in the host. Use strict escaping even for controls in render strings, or withhold unsupported output. Root must independently verify nonce/fields/path/spelling/ranges/encoding and revalidate revision and scope at delivery. Confirm wire and build command to root early.
8. Dependencies and integration
Refinement from the completed planner proof. A positively identified unique direct call can carry a compiler-proven type even when no physical defining token is available. Encode definition: null in this case. Conflicting invocation-local semantic identities at one use suppress the entire occurrence. Copy the bounded GCC signature into a signature string when available for hover, alongside type and canonicalType. The host will require a proven physical definition before serving a location.
Dispatch depends on independent preflight of the current contract.
The producer preflight cleared the observation logic and found a mutable repository RUNPATH in the private probe ELF. Build the checked artifact with a scrubbed compiler/linker environment and explicit, verified ABI headers and runtime search directories. Inspect its actual dynamic section before publishing. Reject relative, workspace, empty or unapproved loader search entries, unexpected DT_NEEDED or loader extensions, and any dependency outside the selected immutable GCC runtime closure. Verify required SONAME resolution against approved immutable libraries or already loaded frontend libraries with proven identities. Include the admission inputs in the build result for the server's independent check. Reproduce rejection of the planner's binary with its project RUNPATH, and demonstrate the prepared observer works in the actual sealed runtime. A digest of the observer alone does not establish its dependencies.
Stock dev driver, its installed GCC plugin headers (g++ -print-file-name=plugin), same immutable GMP dev include from the selected compiler build environment, export ABI marker required for local experiments. Use a fixed source and absolute selected compiler for building this development observer, no workspace-provided compiler argv/plugins. tools/prepare-gcc-observer --output ABSOLUTE_SO should invoke stock build, validate version, publish atomically, print SHA-256 and matched ABI. Root integrates only an explicit launcher-selected artifact digest into GCC profile. Compile project with its ordinary toolchain and keep diagnostics working with no plugin. The local roadmap expressly defers distribution or project license.
9. Edge cases security and performance
Bound recursive/tree walk, macros, strings, observations, matching candidates, bytes read, report size and file descriptors. Avoid excessive traversal for stdlib or unrelated bodies. Avoid repeated per-call full source and macro-map scans. No arbitrary output target in production; private test paths never enter project server options. Report resource exhaustion, unknown call expression, overloaded macros/self-name macro after undef, same-token dependent instantiations, qualifier with same terminal name, declaration merging and malformed units. Correct header definitions and typed overloads within the selected immutable file set. Avoid stdout/stderr pollution on a successful observed compile and persistent GCC tree pointers across invocations.
10. Acceptance criteria
- Fresh stock GCC and matching headers build/load the observer. 2. Normal two same-line overloads select distinct witnessed definitions and int/double after edit; include genuine Void data or the planner's original and byte-span checked fixture. 3. Header shifts and recovery are detected; macro/#line/same-name qualifier, declared-only and conflicting template instantiations never create an incorrect occurrence. 4. Verify raw spans against captured bytes, UTF-8 BOM, names containing spaces and both release/malformed/quota behavior. 5. Root can consume a report from an explicitly configured, unmodified compiler using the fixed runtime paths.
11. Verification commands and evidence
Use dev cpp-gcc -c g++ --version, dev cpp-gcc -c tools/prepare-gcc-observer --output "$PWD/build/stock-observer-014/occurrences.so", then dev cpp-gcc -c python3 -B tests/corpus/frontend/verify-stock-observer.py --observer "$PWD/build/stock-observer-014/occurrences.so". Provide the observed command if actual dev-shell dependency discovery needs adaptation. Verify syntax and clang-format only owned files. Never invoke a full GCC rebuild or switch a shared selector. Derive other probes from existing checked stock corpus.
12. Constraints and stop conditions
Stop on unresolvable ABI/provenance or product licensing/distribution decision, return evidence to root. Do not add a compiler dependency for the default build, a process launcher under LSP project authority or fake analysis to fill a gap. An unprovable individual case returns unsupported within scope. Do not modify compiler, user's shell/environment, sibling repositories or any existing relevant files not explicitly owned.
13. Authorization and decisions
D-022 full implementation, D-025 native primary, D-027/029 GPT-6.2 Astra at Max, D-028/030 opt-in compiler experiments on this branch. The local header/ABI use and packaging of the release are separate; do not assert a release license.
14. Return format
T-STOCK-OCCURRENCES-014 DONE/PARTIAL, paths, exact ABI and proof, wire/build details, tests and outcomes, limitations and release of ownership. Return earliest usable compiled producer and scope of evidence; no subagents.