Files
Language-Server/docs/agent-workflow/tasks/T-PROVIDER-IO-007.md
T
faumaray da8003f6d4 Implement the VLS roadmap on the native VBS build
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.
2026-12-05 14:06:50 +03:00

50 lines
7.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Bounded workspace-scoped metadata reads
Task ID: T-PROVIDER-IO-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
Implement passive input acquisition and revalidation for both build providers with scoped authority before any payload bytes are read.
## 3. Scope and non-goals
Linux-first metadata acquisition. Preserve the behavior of existing unscoped selected-user-file, document and executable callers. No JSON, command parsing, compiler execution, discovery or file writes in providers.
## 4. Files to inspect
Read include/Void/LanguageServer/Support/RegularFile.hpp and its current callers in Documents/DocumentStore.cpp and Workspace/{Configuration,Trust}.cpp, Providers.hpp proposal below and T-PLAN-006. Use existing Void::System::OwnedFd and Void::Crypto SHA-256.
## 5. Write ownership and coordination
Write scope: include/Void/LanguageServer/Support/RegularFile.hpp; src/Build/ProviderFile.cpp; tests/build/ProviderFileTests.cpp
Existing shared helper is exclusively yours after the torn-read review correction, follow its established overload or factor the already-open descriptor logic. Others only consume public header.
## 6. Implementation or investigation approach
Use pinned dirfd rooted admission and a stable regular-file FD (Linux openat2 beneath a verified scope or equally provable traversal); avoid prechecks followed by an independent pathname open. Reject an unprovable route. Admission checks logical pathname, target and purpose before streaming. Distinguish missing, outside scope, not regular, exceeded limit and change. Recheck root, logical and opened referent after streaming and on current(). Hash byte content while reading with VoidLibrary, preserve the logical locator base even when following a permitted symlink. Avoid opening FIFO/device content. Reject invalid path/NUL/over-limit.
## 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<ProviderFile,ProviderIssue>; 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<string> profile, optional<DriverInput> driver; DriverInput holds a workspace/purpose/generation checked Workspace::ToolCheck and Workspace::CompilerDriver, plus known wrapper spellings. import_commands(const DatabaseInput&) returns expected<ImportedCommands,ProviderIssue>; ImportedCommands has vector<BuildContext> contexts, vector<ProviderFile> dependencies and string revision. ProviderObservation has string provider, optional<uint64_t> selection_ticket, optional<string> profile, Generation generation, vector<ProviderIssue> issues and vector<ProviderFile> inputs; fresh is a generation without blocking issues (row limitations stay in context). observe_vbs(scope, selector_path, optional<DriverInput>), observe_compdb(scope, database_path, optional<DriverInput>) 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
Root freezes header and wires targets. Each workspace has separate user/CLI-selected exact file(s), optional explicit build tree and known producer base. An exact external database admits only that named file; relative response inputs remain workspace scoped. Explicit build tree can admit VBS profile metadata and selected immutable DB only, never responses. Classify native generation DB separately if the normal database purpose would elevate an unrelated input; tell root any API amendment.
## 9. Edge cases security and performance
T-PREFLIGHT-007 amendments now on the actual Providers.hpp: implement bind_provider_scope(ProviderScope) -> expected<ProviderScope,ProviderIssue> that pins workspace/build root and exact external parents once per settings grant/incarnation. Readers reject unbound scopes and any change in root/grant fields, symlinked/unprovable roots or redirected names, including replacement between binding and the FIRST read. A legitimate atomic leaf replacement is eligible on a fresh capture; stale retained files fail current(). Implement same_provider_object(a,b) noexcept using stable opened dev/inode for hard-link @ cycles. Preserve every logical name on retained files. Reserve issue code "missing" for proven absence of a path component through an admitted anchored directory, never a dangling link, nonregular file, unsafe traversal or denied access. Only genuine selector absence permits automatic compatibility fallback. Test hard links, an external parent replaced after binding, legitimate leaf replacement, dangling/symlinked presence and bounded observers. The opaque ProviderAnchors and ProviderStamp are yours to implement in ProviderFile.cpp. Treat FilePurpose::native_database as distinct. A build root grant restricts both shape and profile/generation path as specified.
Read quota bounds regular file streaming. For external exact file use a captured approved identity or freeze its intended authority under hostile alias replacement; untrusted writable link changes must not redirect an exact authorized file to arbitrary external targets. Same-object stable state + namespace binding and change detection for concurrent reads. Do not return retained bytes via equality/revalidation alone. No process invocation.
## 10. Acceptance criteria
Nonzero ProviderFiles suite covers workspace success, permitted interior link or stated unsupported links, escape/changed-link refusal, exact-file isolation, restricted build purpose, response outside workspace, nonregular/bounded files, changed contents, root/name replacement and validity after unrelated changes. Real executable test/fixture may be used only as inert data.
## 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.
## 12. Constraints and stop conditions
Stop for incompatible existing helper callers, unresolvable authorization before reading or repeated repair failure. Explain any limitations and leave denied reads passive.
## 13. Authorization and decisions
D-022, D-025–027. This is a bounded implementation of the independently planned read boundary; changes outside this repository require separate authorization.
## 14. Return format
T-PROVIDER-IO-007 DONE/PARTIAL/BLOCKED, paths, scope matrix, stamp design, actual tests and residual issues. Send early frozen implementation detail needed by providers.