Files
Language-Server/docs/agent-workflow/tasks/T-TRUST-004.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

7.6 KiB

Implement passive workspace configuration and tool identity checks

Task ID: T-TRUST-004 Role: astra_implementer Status: READY

1. Context and baseline

Repository /home/faumaray/Projects/VoidLanguageServer on feat/implement-roadmap at ca04975. Existing untracked Workspace/Configuration and Trust.hpp are authorized continuation with no other writer. R-007, R-008 and R-021 require separating metadata from execution authority. GCC 16.2 and VoidLibrary main 7d7d23e are available locally.

2. Objective and deliverables

Complete a tested passive workspace foundation. Resolve layered settings, bind user-selected executable identities and validate normalized command data. Supply tests for revocation, replacing tool contents and untrusted settings. Future process launch, provider loading and semantic workers will consume the boundary.

3. Scope and non-goals

Workspace configuration, trust, static classification and focused tests only. This slice never executes a compiler/VBS/tool/plugin/wrapper. Process sandboxing, launching through a mutable pathname, OS process trees, actual build permissions, server schema/wire integration and response-file expansion belong to consumers. Keep unresolved driver behavior explicit.

4. Files to inspect

Inspect include/Void/LanguageServer/Workspace/{Configuration,Trust}.hpp and src/Workspace/Configuration.cpp, relevant Protocol/Json.hpp accessors, docs/roadmap/{04-workspace-configuration-trust,05-build-contexts,07-compilation-database,09-semantic-workers}.md and ARCHITECTURE.md. Void::Crypto::Hasher, sha256 and file primitives are in the actual upstream public headers under build/bootstrap/_deps/voidlibrary-src/include/Void. Review T-PLAN-002 and the fresh preflight supplied by root.

5. Write ownership and coordination

Write scope: include/Void/LanguageServer/Workspace; src/Workspace; tests/workspace New files include src/Workspace/Trust.cpp and tests/workspace/WorkspaceTests.cpp. Shared checkout. Root owns build wiring, actual stdio/session and docs. No edits to Protocol, Documents or siblings. No branch changes or Git writes.

6. Implementation or investigation approach

Inspect before editing. Reject or diagnose invalid types and limits. Resolve relative settings against their owning layer/base and preserve distinct roots. Accept security grants only from validated user/runtime or CLI sources; plugin execution stays unsupported. Validate root containment by path components, distinguish explicit invocation from persistent trust and fail closed on missing/ambiguous identity. Use a strong digest of the same opened regular executable and revalidate on identity changes. Keep the original approved spelling if a symlink retarget must revoke approval. Revocation and generation checks must avoid races and callback deadlock. Use the planner/preflight decisions for exact operation types and model identity. Classify canonicalized argument vectors passively after bounded expansion by a future provider. Apply a conservative grammar for supported compiler inputs; reject unresolved driver/plugin/wrapper/indirect options as unsupported. Wrapper recognition only strips a data prefix. Emit actionable typed reasons.

7. Interfaces and data contracts

Existing WorkspaceSettings, PartialWorkspaceSettings, MergedConfiguration, ToolIdentity, TrustPolicy and CommandSecurityReport are the starting interfaces. Freeze the exact API with root if planner changes a permission or signature. A returned identity report has no power to launch a process. A launch implementation must later bind the approved executable and a current trust generation at actual dispatch; communicate that invariant. Different roots and levels remain distinct. Use VoidLibrary for JSON/digest, std::expected for explicit failures.

8. Dependencies and integration

Root integrates the native/CMake targets, then uses the policy in the provider and work queue. Other workers own documents and the protocol wrapper. Your tests should use native VOID_TEST names. Report the exact modules and build defines required (Void::Crypto hashing works without OpenSSL).

9. Edge cases security and performance

Bound file reads and synchronous work. Handle missing/nonregular files, symlink retargeting, executable-bit changes, tool-content changes with identical length/mtime, untrusted roots and denied repetition. Use benign marker files for a proof of passive behavior. Do not create exploits, execute project-provided code, or inspect workspace secrets. Repository configuration cannot raise resource ceilings or mint execution tokens.

10. Acceptance criteria

  1. Layer precedence and authority failures are covered, including malformed fields and two roots with different policies.
  2. An approved executable's changed bytes/permission/symlink invalidate the decision. Missing SHA-256 or ambiguous paths fail closed.
  3. Revocation changes generation before callbacks and stale work loses eligibility. Classifier distinguishes trusted command data, inert recognized wrapper spellings and refused execution-bearing options.
  4. Nonzero C++ tests execute through Void::Testing and leave marker files untouched. State unimplemented launch-time guarantees honestly.

11. Verification commands and evidence

From repository root: dev cpp-gcc -c g++ -std=c++26 -freflection -Iinclude -Ibuild/bootstrap/_deps/voidlibrary-src/include -fsyntax-only . Link a focused executable under build/workspace-check or use root's integrated target when ready. Verified native seed at build/tools/vbs-6c225-bin/bin/vbs, test runner/archives under build/vbs-framework-probe. Crypto library from committed-seed CMake exists at build/tools/vbs-6c225-bin/_deps/voidlibrary-build/libVoid_Crypto.a for a focused comparison only. Record actual compiler flags, executions and counts. Format owned C++ with dev cpp -c clang-format.

12. Constraints and stop conditions

Stop before any launch API starts running code or if response-file expansion/model changes cross worker boundaries. Escalate technical disagreements to root. After two failed repairs of the same issue return errors, diff and diagnosis. Never bypass review or permissions.

13. Authorization and decisions

D-022, D-024 through D-027. The user authorizes the project feature on this branch and requires GPT-6.2 at Max. This difficult authority boundary is the Astra implementation assignment. No authorization to modify siblings, global settings or remote services.

14. Return format

Return T-TRUST-004 DONE/PARTIAL/BLOCKED, exact files and signatures, tests/commands and outcomes, proposed consumer invariants, outstanding questions, and limitations against R-007/021. No children or independent user messages.

T-PLAN-002 clarification: model distinct operation kinds for metadata refresh, compiler use and a single explicitly requested project build action. Track the approved executable path as spelled, the canonical referent, SHA-256 and a trust generation. Root will read a user configuration only when the launcher explicitly selects it. LSP initialization/configuration input has workspace provenance. Use explicit configuration base paths and a hard ceiling for workspace-provided resource limits. Missing per-operation authority must remain a typed denial.

Preflight correction: scope each tool pin by workspace AND operation. No global map of approved binaries can be combined with a different root's grants. An explicit build approval is one-use and tied to the complete invocation (root, selected tool, ordered arguments, working directory and relevant input or generation identities). Do not let a metadata grant authorize a compiler. Derive config origin at the reader boundary, retain it in the parsed settings and prevent relabeling the same untrusted data as launcher input in the merge.