# Select and expose passive providers through the running server Task ID: T-PROVIDER-SESSION-007 Role: astra_implementer Status: READY ## 1. Context and baseline Shared /home/faumaray/Projects/VoidLanguageServer, feat/implement-roadmap at ca04975, dirty files authorized. Primary native descriptor build.cpp, optional CMake verification, VoidLibrary main 7d7d23e. T-PLAN-006 verified VBS 6c225c2 selector/status/generations and actual compdb rows. Build/Model.hpp, Workspace/{Configuration,Trust}.hpp and Protocol/Json.hpp are implemented. Root owns build/test registration, CLI, session, docs and integration. No shared tree branch switches, Git mutations, sibling writes, child agents or independent user messages. ## 2. Objective and deliverables Connect root-bound configuration and sequenced native/compdb observations to the real stdio server. Provide an inspectable first user-facing build integration. ## 3. Scope and non-goals Only passive metadata and status. No invented completion/navigation or compiler launches. Keep existing lifecycle and editor sync behavior; future analysis work consumes guarded generations. ## 4. Files to inspect Inspect src/{main,Server,DocumentSync}.cpp, include/vls/Server.hpp, actual Protocol/Workspace/Build models, T-PLAN-006 and provider tasks. ## 5. Write ownership and coordination Write scope: include/Void/LanguageServer/Build/Providers.hpp; src/Build/CompdbProvider.cpp; include/vls/WorkspaceSession.hpp; src/WorkspaceSession.cpp; src/main.cpp; src/Server.cpp; include/vls/Server.hpp; tests/ProviderProcessTests.cpp; tests/build/CompdbProviderTests.cpp; build.cpp; CMakeLists.txt; tests/CMakeLists.txt; tests/NativeRegistration.cpp The root exclusively owns these paths. ## 6. Implementation or investigation approach Freeze common header following preflight. Implement compdb observation with real immutable inputs and status, retaining last-good historical identity only under the same provider/locator. Route LSP initialize workspaceFolders then rootUri fallback, add/remove and passive settings changes, expose custom voidLanguageServer/providerStatus for a selected workspace/document. Identify incarnation on root re-add, do not reuse old trust or state. Advertise only implemented workspace capabilities. Auto mode prefer existing VBS selector even if broken; deliberate manual provider never silently switches. Allow explicit scoped launcher settings and metadata locators, preserve help/version-only handling, reject bare -- and conflicting choices. Prove edits and file replacements update status through a fresh observation. Keep discovery bounded under admitted roots; do not search environment/user home. ## 7. Interfaces and data contracts NEW namespace Void::LanguageServer::Build. Root owns Providers.hpp. ProviderScope contains WorkspaceIdentity workspace, optional absolute exact_database, exact_selector, build_root, producer_cwd (root-bound launcher grants only) and Workspace::ResourceLimitsConfig limits. enum FilePurpose {selection,status,database,response}; read_provider_file(scope,path,purpose,byte_limit) returns expected; provider_file_current(scope,file) revalidates identity. ProviderFile has purpose, logical_path, canonical_path, bytes, content_id, stamp; stamp binds admission root, opened object and selected name. ProviderIssue has string code,message and filesystem::path path. DatabaseInput has const ProviderScope& scope, const ProviderFile& database, optional profile, optional driver; DriverInput holds a workspace/purpose/generation checked Workspace::ToolCheck and Workspace::CompilerDriver, plus known wrapper spellings. import_commands(const DatabaseInput&) returns expected; ImportedCommands has vector contexts, vector dependencies and string revision. ProviderObservation has string provider, optional selection_ticket, optional profile, Generation generation, vector issues and vector inputs; fresh is a generation without blocking issues (row limitations stay in context). observe_vbs(scope, selector_path, optional), observe_compdb(scope, database_path, optional) return ProviderObservation. Root owns latest sequenced publication and revalidation at install. All reads are passive. Concrete spelling in forthcoming header coordinated by root after preflight. ## 8. Dependencies and integration Freeze common header for three disjoint agents from shared planner/preflight evidence. Use published BuildGeneration immutable data and capture sequences for installs. Default scan remains passive. Final root performs installation, real consumer observations and regression matrix. ## 9. Edge cases security and performance T-PREFLIGHT-007 amendment. Bind each external locator/grant to one explicit launcher-selected root and capture its scoped directory anchors when configuration is installed. Distinguish absence of the selector from dangling/denied/invalid selectors or a missing selected DB/status. Only genuine selector absence permits auto compdb; repeat that negative lookup before installing any fallback, reject a VBS-managed alias as an automatic fallback and keep last-good separate. Assign a sequence before every observation, and compare latest sequence, config revision, trust generation and workspace incarnation for success AND failure before installation; revalidate retained inputs, including selector absence where applicable. Re-adding a root starts a fresh owner. A removed or revoked owner cannot publish late work. Add deterministic tests that introduce the selector between reads, and complete stale work after settings/revocation/removal+re-add. Use a bounded private session status response for errors. Restart, removal/re-add, broken versus absent native selection, two workspace folders with conflicting locator preferences and root-bound launcher grants; cap workspace/status result sizes, alternatives and issue text. URI aliases, malformed application settings and requests produce typed errors. Preserve deterministic ordering and stderr-only diagnostics. Consumers of provider caches revalidate latest observations before publishing current state. ## 10. Acceptance criteria Actual transcripts show two roots choosing distinct providers, direct manual native failure, valid native generation+compdb alternatives, edits/replacements, selection changes and no launch. Zero stdout outside framed protocol. Both build systems register nonzero cases; process, build, install, counts and honest residuals recorded. ## 11. Verification commands and evidence Use git status --short --branch, scoped graph coverage plus direct reads, dev cpp-gcc -c g++ -std=c++26 -freflection -Iinclude -Ibuild/voidlibrary/current/include -fsyntax-only on the owned sources and tests, then link/run the actual Void::Testing suite in a private build subdirectory. Use dev cpp -c clang-format --dry-run --Werror on owned C++ paths. List the cases via --list --no-color. Root owns the two shared build trees. Run integrated native vbs test/install, compare optional CTest, query both generated real DBs using vls --stdio; make missing/failed cases ordinary checks. ## 12. Constraints and stop conditions Do not turn an untrusted IDE initialization value into a launcher grant; reject external reads with ambiguous scope. Escalate new protocol/product decisions only if outside existing acceptance; do not delay known passive workflow. ## 13. Authorization and decisions D-022,D-025,D-026,D-027; no external side effects or Git mutations beyond prior branch creation. ## 14. Return format Root records code/commands, verified capabilities, remaining gates and fresh independent integrated review.