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.
50 lines
7.9 KiB
Markdown
50 lines
7.9 KiB
Markdown
# Implement per-workspace provider selection and status
|
||
|
||
Task ID: T-SESSION-PASSIVE-007
|
||
Role: sol_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
|
||
Implement the workspace session controller and focused race tests from the amended, independently cleared T-PROVIDER-SESSION-007. The root handles CLI, stdio dispatch, standalone compdb adapter and real process transcripts.
|
||
|
||
## 3. Scope and non-goals
|
||
Controller plus tests only, no LSP lifecycle changes, compiler launches, scheduling workers, sibling reads/writes or build registration. The independent reviewer completed all four provider verdicts; this task splits out the already-reviewed controller.
|
||
|
||
## 4. Files to inspect
|
||
Read docs/agent-workflow/tasks/T-PROVIDER-SESSION-007.md, src/Server.cpp, include/vls/Server.hpp, actual include/Void/LanguageServer/Build/{Providers,Model}.hpp, Workspace/{Trust,Configuration}.hpp, Documents/Uri.hpp, src/Workspace/Configuration.cpp, existing tests/workspace/WorkspaceTests.cpp.
|
||
|
||
## 5. Write ownership and coordination
|
||
Write scope: include/vls/WorkspaceSession.hpp; src/WorkspaceSession.cpp; tests/workspace/ProviderSessionTests.cpp
|
||
Root releases these three paths exclusively to you. All other paths including src/main.cpp and both builds are root-/other-owned.
|
||
|
||
## 6. Implementation or investigation approach
|
||
Implement bounded initialize workspaceFolders, then legacy rootUri only if absent, explicit null or empty folders supports document-only. Accept file URIs and stable existing roots, normalize safely. Track LSP add/remove and settings changes per workspace, support initializationOptions.voidLanguageServer and didChangeConfiguration params.settings.voidLanguageServer as passive default settings. Permit explicit scoped per-folder payload under a documented key (e.g. workspaces keyed by folder URI), retain workspace vs launcher provenance. Each folder has unique session/incarnation, config and trust generation. Only explicitly selected launcher root can use external exact locators or approved build root/producer cwd. Bind anchors once at grant ingress, never broaden after a path is redirected. Install TrustPolicy from merged configuration. Auto prefer real VBS selector even broken; only proven missing allows explicit or conventional compile_commands.json. Avoid all VBS managed aliases as automatic fallback (including generation-targeting symlinks); observe both selector absence and ordinary DB current before publication. No fallback for explicit broken provider. Native read via observe_vbs; compatibility via observe_compdb; true no-root supports normal docs.
|
||
|
||
## 7. Interfaces and data contracts
|
||
NEW vls::WorkspaceLaunch carries optional<filesystem::path> root, build_root, producer_cwd and optional<Workspace::PartialWorkspaceSettings> user_settings, cli_settings. NEW vls::WorkspaceSession(WorkspaceLaunch = {}), std::expected<void,std::string> initialize(const Protocol::Json& params), update_folders(const Protocol::Json* params), configure(const Protocol::Json* params); std::expected<Protocol::Json,std::string> provider_status(const Protocol::Json* params). Root supplies launch slots only from CLI. Status params {workspaceUri?,textDocument?:{uri}}; explicit root or unique matching root, error for ambiguous query. Return workspaceUri/incarnation/provider/requestedProvider/state, generation and nativeGeneration if present, profile/ticket, contextCount, bounded issues,warnings, selected and alternatives for a document with deterministic Build::SelectionState (selectedProfile preference). Distinguish historical last-good identity, degraded/missing/stale/disabled, document-only when no workspace. Protocol names camelCase; coordinate exact keys early for process tests. No fabricated AST/semantic status.
|
||
|
||
## 8. Dependencies and integration
|
||
ProviderFile + row importer are concurrent tasks. Root is implementing observe_vbs and observe_compdb. Public APIs usable immediately; no placeholder implementations in shared source. Write focused tests exercising real providers once linked, or independent staged begin/observe/install paths for races. Root integrates three owned paths in the native and CMake targets.
|
||
|
||
## 9. Edge cases security and performance
|
||
The root implemented the scoped reader in src/Build/ProviderFile.cpp; seven targeted tests pass. For a launcher-selected root, bind the external exact paths/build root once at launcher ingress, retain the bound scope across client configuration updates and root re-adds, and use reuse_provider_scope(bound,new_session) to reuse the original pinned directories for a fresh workspace incarnation. Keep this anchor binding separate from the merged per-folder limits and untrusted settings. A detached/replaced directory remains ineligible. In tests the controller may have an explicit observation callback/testing seam to prove late publications; use distinguishable real selectors/databases. Root owns CLI, provider tests and integration. The previous session writer hit HTTP 429 before creating any of your three files.
|
||
Issue monotonic sequence before EACH observation and validate latest issuance, immutable owner/incarnation, configuration, trust and all positive/negative lookup evidence before publishing success OR failure. Preserve last-good separately, invalidate on reconfigure/revoke/removal. Do not hold session map mutex across I/O. A late completion cannot restore retired state. Distinguish missing status/db/unsafe selector from genuinely absent selector. Bound roots, alternatives/status response and errors. Driver evidence absent stays passive; no wildcard grants from user configuration across folders.
|
||
|
||
## 10. Acceptance criteria
|
||
Real ProviderSession tests for two independent roots, absent/empty/legacy roots, bad folders/config, change/removal/re-add, explicit broken native override, native-before-cdb, marker remains untouched and external grants bound to one launcher-selected root. Deterministically introduce selector after fallback probe, reorder successful+failed reads across config/trust/root reincarnation. Expose latest outcomes and stale historical IDs without promoting stale work. Preserve caller's known documents/cache state on malformed transactional updates.
|
||
|
||
## 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. Root registers tests under vls_workspace_tests and integrates real executable behavior. Contact root early with constructor/wire signatures and result field names.
|
||
|
||
## 12. Constraints and stop conditions
|
||
Stop before a new public product capability, additional security authority, incompatible shared API or repeated repair failure. Return actual tested versus pending integrations. Testing must never execute metadata.
|
||
|
||
## 13. Authorization and decisions
|
||
The original session contract received independent Astra READY after amendments. D-022/D-025–D-030 apply. User requested GPT-6.2 family at Max; this is the general implementation portion of the cleared session design.
|
||
|
||
## 14. Return format
|
||
T-SESSION-PASSIVE-007 DONE/PARTIAL/BLOCKED, exact paths, API/wire status fields, test evidence, residual gaps and root integration needs.
|