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.
7.7 KiB
Control and replay the isolated GCC evaluator in C++
Task ID: T-GCC-SUPERVISOR-018 Role: astra_implementer Status: READY
1. Context and baseline
Shared repo feat/implement-roadmap at ca04975, existing implementation authorized. Exact GCC patch 0001 builds and real verify-gcc-events.py exits 0: 17/34 on old snapshot, 41/82 on edit, cancel 125, control failure 126. The patched cc1plus is 135307304 bytes (build/gcc-gate/compiler-build/gcc/cc1plus). Planner T-PLAN-GCC-008 and fresh reviewer T-PREFLIGHT-GCC-008 cleared the bounded control/replay design. Another worker owns Leaf.cpp/.hpp; root owns shared builds and LSP.
2. Objective and deliverables
Implement the standalone local C++ prototype parent and replay entry point using Void::Process, VoidLibrary StrictJson facade and copied compiler records. Demonstrate live step, cancel and replay from the same recorded stop on the private compiler.
3. Scope and non-goals
One active frontend per local prototype process, fixed leaf/input and integral evaluator only. No general compiler flags, editor integration, DAP, filesystem workspace discovery, public installation/distribution or production feature advertisement.
4. Files to inspect
Inspect T-GCC-LEAF-009, T-GCC-EVALUATOR-017, compiler-patches/gcc-16.2.0/0001-evaluator-events.patch (source of truth), tests/corpus/frontend/verify-gcc-events.py, tests/corpus/frontend/gcc-live.cpp, docs/roadmap/{18-live-debugging,19-trace-replay}.md, include/Void/LanguageServer/Protocol/Json.hpp, Void::Process header/implementation in build/voidlibrary/current, System/TempDir, Crypto/Sha256 or actual Crypto.hpp APIs. Confirm actual FD/try_wait/terminate shape before implementation.
5. Write ownership and coordination
Write scope: experiments/frontend/gcc-worker/Main.cpp; experiments/frontend/gcc-worker/Supervisor.cpp; experiments/frontend/gcc-worker/Supervisor.hpp; experiments/frontend/gcc-worker/Trace.cpp; experiments/frontend/gcc-worker/Trace.hpp; tests/native/GccSupervisor.py Private build/gcc-supervisor-tests only for checks/harness. Leaf.hpp/cpp, GCC patches, both shared builds, server and docs owned by others. No Git/branch changes, public sends or children.
6. Implementation or investigation approach
Implement private executable: --leaf validates argument form and dispatches vls::gcc::run_leaf(absolute selected compiler,sha256,nonce,stepping). Parent uses /proc/self/exe + Void::Process::spawn, search_path=false, explicit minimal env, new process group, PR_SET_CHILD_SUBREAPER before spawn. Copy explicitly chosen bounded fixture bytes into private TempDir/input.cpp, bind hash/compiler digest and fresh OS-random nonce. Run fixed leaf protocol with poll-driven bounded full-duplex I/O, separate events/stdout, controls/stdin and stderr. Maintain strict concrete state for observed hello/enter/body/value/cached/leave/stopped/resumed/terminal/frontendEnd, partial lines, running/stopped time, quota and PID. Treat copied value as provisional until leave, do not infer frames for cache. Persist captured source, immutable identity, terminal state and verified records to an explicitly named exclusive/new trace or owned directory. Provide offline replay at chosen event/stop/sequence, report matching frame/value stack from validated prefix with integrity checks. Input cutoff/cancel/truncation retains only verified prefix.
7. Interfaces and data contracts
NEW standalone local prototype (root can register as vls_gcc_probe). Provide explicit self-describing CLI for run, step, cancel and offline replay, document actual spelling early. Live control messages from parent caller bind current nonce+stop and one use. Accept exactly one action from current stopped state; no queued preauthorization/predicted ordinal. In interactive mode consume + serialize commands, require actual resumed echo before post-stop movement; running cancel terminates group. Trace frames version 1, nonce, contiguous seq from 0; pin expected ELF identity, GCC handshake backend and PID, declared kinds, required frame+parent stack, value bit widths/format and null metadata. frontendEnd only indicates frontend finish; conclude success after balanced frames, EOFs, valid child wait + diagnostics. Replay must work with compiler absent; distinguish conclusive success, failed, partial, cancelled, terminal or quota, do not promote truncated open frames. Wire optional value projection JSON/stdout of prototype can be used by bounded integration test. Coordinate interfaces early.
8. Dependencies and integration
Leaf owner separately implements and verifies prototype leaf, stable C++ signature in T-GCC-LEAF-009. Root may integrate your files as soon as present and will relay build errors. Use a temporary leaf-only testing source in your own ignored directory only for targeted failure-process fixtures; real compiler session/replay required once the leaf is ready. Keep supervisor/replay APIs usable by future authorized debugger work.
9. Edge cases security and performance
Bound input before reading, messages/partial LF, bytes, trace entries, source, stderr, live wall and paused idle separately. Preserve compile return status and bounded stderr. Suppress SIGPIPE safely on closed controls. Block user speculative/duplicate/stale control; continued visits and handle generations must be explicit. Cancel/timeout handles stopped, running, leader-first and backpressured descendants; always drain both streams then terminate/reap group and adopted processes on deadlines. No leakage across process groups, no external sends or folder reads from manifest locators. Fail closed on malformed manifests, open evidence incomplete or wrong backend. No implicit overwrite of traces.
10. Acceptance criteria
Exercise real fixed fixture original, edited, true pause+step then continue, cancel at inner with no outer, stale/double/resume-ack check, terminal on invalid/dead child, actual bounded stderr flood/partial frame and leader-first exit through private benign witness. Replay original 17/34 after source mutation to 41/82 and without usable compiler; cancelled prefix reconstructs copied provisional inner result (no invented successful return). Validate sections/corruption/truncation, source identity, nonce/seq, max limits, CPU/wall vs paused, deadline and absence of live descendants. Catch implementation defects; no fake compiler evidence.
11. Verification commands and evidence
Use dev cpp-gcc -c g++ -std=c++26 -freflection -Iinclude -Ibuild/voidlibrary/current/include and focused links to actual vls_protocol, Void_System/Crypto and pthread plus Leaf.cpp, or root built vls_gcc_probe. Run dev cpp-gcc -c python3 tests/native/GccSupervisor.py --help followed by documented real command with the absolute probe/compiler. Use dir build/gcc-supervisor-tests; root owns build/bootstrap and native build. Record real exit, ports use local pipes only, frame values and work not run.
12. Constraints and stop conditions
Stop for changes outside the assigned prototype or a required change to the shared leaf API. Two failed repair attempts require changed hypothesis. On 429 or blocked leaf, deliver validated independent parser/replay, private controlled process tests and exact integration requirements. Never claim complete full roadmap18/19/20.
13. Authorization and decisions
User D-030 approved local GCC instrumentation/worker prototype, D-025 primary VBS, D-027/029 GPT-6.2 family Max. This is the accepted prototype slice. Subsequent adopted frontend/IDE and DAP capability remain separate gates.
14. Return format
T-GCC-SUPERVISOR-018 DONE/PARTIAL/BLOCKED, precise paths/CLI/API, real cc1plus launch and control, saved/replayed values, bounds/cleanup, validation commands and residual integration risk. Return early CLI and source readiness then final evidence.