commit
ca04975d54
62 files changed
+3381
No files matched your search
@@ -0,0 +1,4 @@
|
||||
BasedOnStyle: LLVM
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 100
|
||||
SortIncludes: CaseSensitive
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
# Build and local runtime state
|
||||
/build/
|
||||
/build-*/
|
||||
/.vls/
|
||||
/.serena/
|
||||
/.cache/
|
||||
/compile_commands.json
|
||||
CMakeUserPresets.json
|
||||
# Credentials and local environment
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
/keys/
|
||||
/keys
|
||||
/WG.conf
|
||||
*.key
|
||||
*.pem
|
||||
# Editor/OS scratch
|
||||
*.swp
|
||||
*~
|
||||
.DS_Store
|
||||
@@ -0,0 +1,44 @@
|
||||
# VoidLanguageServer development
|
||||
|
||||
Read docs/agent-workflow/STATE.md and TASKS.md, then the relevant roadmap.
|
||||
The approved current scope is repository initialization, detailed plans and a
|
||||
compiling LSP lifecycle shell. Compiler semantics, native VBS integration, indexing,
|
||||
debugging and editor plugins remain future milestones until implemented and verified.
|
||||
|
||||
## Build and dependency rules
|
||||
Use `dev cpp-gcc -c COMMAND...` (observed GCC 16.2.0). The bootstrap uses
|
||||
C++26, -freflection, CMake 4+ and Ninja. Per user decision D-021, VoidLibrary
|
||||
follows main; do not restore a commit pin without a new user instruction.
|
||||
Record the exact tested commit in docs/agent-workflow/VERIFICATION.md.
|
||||
The explicit VLS_VOID_SOURCE_DIR override
|
||||
is development-only; never modify the external checkout or copy its secrets.
|
||||
VoidLibrary's decimal support is an upstream prerequisite. Do not implement a
|
||||
competing decimal parser or claim JSON conformance before the capability suite passes.
|
||||
|
||||
Planned bootstrap checks, once CMakeLists.txt exists:
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B build/bootstrap -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
dev cpp-gcc -c cmake --build build/bootstrap
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap --output-on-failure
|
||||
```
|
||||
Use the actual registered tests; zero tests is not success. Format only owned C++ paths.
|
||||
|
||||
## Contracts
|
||||
- stdout is protocol-only in stdio mode; diagnostics use stderr.
|
||||
- Never advertise an unimplemented LSP/DAP capability or return fabricated semantics.
|
||||
- Keep document, build-context, backend and dependency identities in analysis results.
|
||||
- VBS declaration JSON is not its future resolved tooling export.
|
||||
- Metadata does not authorize compiler/plugin/wrapper execution.
|
||||
- Keep compiler AST state inside workers; own compiler-specific module caches.
|
||||
- Rename requires known provenance, complete affected-context coverage and guarded edits.
|
||||
- Debugger live control and custom views share one versioned session.
|
||||
- Licensing is deliberately deferred until the backend decision.
|
||||
|
||||
## Workflow and ownership
|
||||
Use the supplied Astra/Sol workflow and precise linted task specs. Workers share this
|
||||
checkout unless isolation is established. Root owns docs, decisions, Git initialization
|
||||
and integration. Read TASKS.md for active source ownership before editing.
|
||||
No staging, commits, remote setup, pushing, deployment or sibling-repository changes
|
||||
are authorized by the bootstrap task. Never reset, stash, clean or overwrite unrelated work.
|
||||
Do not inspect/index .env files, keys, WG.conf, credentials or ignored caches.
|
||||
No global Nix configuration changes, generated CODEX_HOME edits or tool installers.
|
||||
@@ -0,0 +1,41 @@
|
||||
cmake_minimum_required(VERSION 4.0)
|
||||
project(VoidLanguageServer VERSION 0.1.0 LANGUAGES CXX)
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
|
||||
message(FATAL_ERROR "VoidLanguageServer requires GCC 16+ with C++26 reflection; use dev cpp-gcc")
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD 26)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
|
||||
include(CheckCXXSourceCompiles)
|
||||
set(CMAKE_REQUIRED_FLAGS "-freflection")
|
||||
check_cxx_source_compiles("#include <meta>\nstatic_assert(std::meta::is_type(^^int));\nint main() {}"
|
||||
VLS_HAS_REFLECTION)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
if(NOT VLS_HAS_REFLECTION)
|
||||
message(FATAL_ERROR "GCC must support <meta> and -freflection")
|
||||
endif()
|
||||
|
||||
include(CTest)
|
||||
set(VLS_VOID_SOURCE_DIR "" CACHE PATH "Explicit development-only VoidLibrary source override")
|
||||
# User-selected development policy: follow main; record the tested commit in verification evidence.
|
||||
set(VLS_VOID_REF "main")
|
||||
include(cmake/VoidDependency.cmake)
|
||||
vls_add_void_dependency()
|
||||
|
||||
add_library(vls_protocol STATIC src/Framing.cpp src/Json.cpp src/Server.cpp)
|
||||
target_include_directories(vls_protocol PUBLIC "${PROJECT_SOURCE_DIR}/include")
|
||||
target_link_libraries(vls_protocol PUBLIC Void::Data PRIVATE Void::Unicode)
|
||||
target_compile_options(vls_protocol PUBLIC -freflection PRIVATE -Wall -Wextra -Wpedantic)
|
||||
|
||||
add_executable(vls src/main.cpp)
|
||||
target_link_libraries(vls PRIVATE vls_protocol Void::Configuration)
|
||||
target_compile_options(vls PRIVATE -Wall -Wextra -Wpedantic)
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS vls RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
|
||||
if(BUILD_TESTING)
|
||||
include("${VLS_VOID_TESTING_SCRIPT}")
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
@@ -0,0 +1,86 @@
|
||||
# VoidLanguageServer
|
||||
|
||||
A C++26 language server project for Void, using VoidLibrary. The target product
|
||||
combines native Void Build System integration, compilation-database compatibility,
|
||||
core IDE features, modules/reflection, and a live/replay metaprogram debugger for
|
||||
Neovim and VS Code.
|
||||
|
||||
**Current state:** milestone0 shell implementation. The CLI and stdio LSP lifecycle
|
||||
are implemented and the ordinary unit/process suites pass. Full JSON conformance
|
||||
and final shell acceptance are **blocked on VoidLibrary's decimal-support update**.
|
||||
The capability suite intentionally reports the missing behavior as failures.
|
||||
This is not yet a usable clangd replacement.
|
||||
|
||||
Compiler semantics, document synchronization, build providers, indexing, debugging
|
||||
and editor plugins are planned, not implemented. The shell advertises no semantic
|
||||
capabilities. See the [27-part roadmap](docs/roadmap/README.md),
|
||||
[requirements](docs/roadmap/REQUIREMENTS.md) and [architecture](docs/roadmap/ARCHITECTURE.md).
|
||||
|
||||
## Build and test
|
||||
|
||||
Requires GCC16+ with C++26 reflection, CMake4+, Ninja and Git. The observed local
|
||||
environment provides GCC16.2 via `dev cpp-gcc`. On another system, run the underlying
|
||||
CMake commands in an equivalent toolchain environment; `dev` is a local wrapper.
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B build/bootstrap -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
dev cpp-gcc -c cmake --build build/bootstrap
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap --output-on-failure
|
||||
```
|
||||
|
||||
Default configuration follows VoidLibrary's main branch, as requested. Re-run
|
||||
configuration to check for upstream updates. The currently observed main revision
|
||||
still lacks decimal/exponent support; passing configure
|
||||
and compilation does not mean the full test suite passes.
|
||||
See [dependency provenance](docs/DEPENDENCIES.md) and
|
||||
[observed verification](docs/agent-workflow/VERIFICATION.md).
|
||||
|
||||
For explicit development against a local checkout, use a separate output tree:
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B build/local -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVLS_VOID_SOURCE_DIR=/home/faumaray/Projects/VoidLibrary
|
||||
dev cpp-gcc -c cmake --build build/local
|
||||
dev cpp-gcc -c ctest --test-dir build/local --output-on-failure
|
||||
```
|
||||
|
||||
The override bypasses upstream main and is reported during configuration. The dependency
|
||||
checkout is never an output directory and must remain unchanged.
|
||||
|
||||
## Run
|
||||
|
||||
```sh
|
||||
./build/bootstrap/vls --help
|
||||
./build/bootstrap/vls --version
|
||||
./build/bootstrap/vls --stdio
|
||||
```
|
||||
|
||||
No arguments also starts stdio mode. Send Content-Length-framed UTF-8 JSON through
|
||||
stdin; stdout contains only protocol messages. Logs/errors go to stderr.
|
||||
The shell handles initialize/initialized/shutdown/exit, protocol errors and unknown
|
||||
methods. It returns empty capabilities and no fabricated semantic results.
|
||||
Header/body/depth limits are8KiB/16MiB/64. Help and version are standalone CLI modes.
|
||||
|
||||
Install the executable into an explicit local prefix after building:
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c cmake --install build/bootstrap --prefix /tmp/vls-install
|
||||
/tmp/vls-install/bin/vls --version
|
||||
```
|
||||
|
||||
The development dependency is linked statically; standard compiler/runtime libraries
|
||||
remain system requirements. Packaging/distribution and licensing are later gates.
|
||||
|
||||
## Development
|
||||
|
||||
[Current state](docs/agent-workflow/STATE.md) and
|
||||
[task ownership](docs/agent-workflow/TASKS.md) distinguish implemented, verified and
|
||||
blocked work. User decisions and preflight corrections are recorded alongside them.
|
||||
Run meaningful tests and obtain independent review of integrated changes.
|
||||
|
||||
The first usable release includes both live and recorded replay debugging of
|
||||
templates, constraints, constexpr/consteval and reflection, through DAP and custom
|
||||
views in both editors. Frontend/debugger feasibility and native VBS producer work
|
||||
are explicit gates. CMake bootstraps the repository; native VBS self-build follows.
|
||||
|
||||
Project licensing is intentionally deferred until the backend decision. Local
|
||||
initialization does not authorize commits, pushes, publication or sibling edits.
|
||||
@@ -0,0 +1,31 @@
|
||||
include(FetchContent)
|
||||
|
||||
function(vls_add_void_dependency)
|
||||
# Function scope prevents embedding policy from leaking into the parent cache.
|
||||
set(VOID_ENABLE_TESTING OFF)
|
||||
set(VOID_ENABLE_BENCHMARKS OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(VOID_ENABLED_MODULES Configuration Data Unicode)
|
||||
if(BUILD_TESTING)
|
||||
list(APPEND VOID_ENABLED_MODULES Testing System)
|
||||
endif()
|
||||
if(VLS_VOID_SOURCE_DIR)
|
||||
get_filename_component(_vls_void_source "${VLS_VOID_SOURCE_DIR}" ABSOLUTE
|
||||
BASE_DIR "${PROJECT_SOURCE_DIR}")
|
||||
if(NOT EXISTS "${_vls_void_source}/CMakeLists.txt")
|
||||
message(FATAL_ERROR "VLS_VOID_SOURCE_DIR must contain a VoidLibrary CMakeLists.txt")
|
||||
endif()
|
||||
message(STATUS "VLS development source override: ${_vls_void_source}; upstream ref "
|
||||
"${VLS_VOID_REF} is bypassed; local source is not verified by this build")
|
||||
FetchContent_Declare(voidlibrary SOURCE_DIR "${_vls_void_source}" EXCLUDE_FROM_ALL SYSTEM)
|
||||
else()
|
||||
message(STATUS "VLS VoidLibrary ref: ${VLS_VOID_REF} (tracks upstream; remote fetch)")
|
||||
FetchContent_Declare(voidlibrary
|
||||
GIT_REPOSITORY https://git.faumaray.com/Void/VoidLibrary.git
|
||||
GIT_TAG "${VLS_VOID_REF}"
|
||||
GIT_SHALLOW FALSE
|
||||
EXCLUDE_FROM_ALL SYSTEM)
|
||||
endif()
|
||||
FetchContent_MakeAvailable(voidlibrary)
|
||||
set(VLS_VOID_TESTING_SCRIPT "${voidlibrary_SOURCE_DIR}/cmake/VoidTesting.cmake" PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -0,0 +1,51 @@
|
||||
# Dependency provenance and integration gates
|
||||
|
||||
## VoidLibrary
|
||||
Source: https://git.faumaray.com/Void/VoidLibrary.git
|
||||
Inspected baseline: 9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5 (2026-11-25).
|
||||
This is the tested baseline, not proof of JSON conformance. User decision D-021
|
||||
supersedes the original pin policy: CMake follows main. Record the actual fetched
|
||||
commit for every verification run and rerun configuration to check upstream updates.
|
||||
The decimal-capable main revision must pass the ingress capability suite before
|
||||
final shell acceptance; following main does not automatically establish readiness.
|
||||
|
||||
Use Configuration/Argparse, Data, Unicode, System and Testing through their verified
|
||||
public APIs. Later modules may reuse Async, Time, Functional, Memory, IPC or Sqlite
|
||||
only after inspecting their actual guarantees; roadmap modules are not implemented APIs.
|
||||
In particular, Void IPC's own framing is not LSP or DAP framing.
|
||||
|
||||
VLS_VOID_SOURCE_DIR is a development-only source override that bypasses upstream main.
|
||||
All outputs must stay in the VLS binary tree. Do not modify or index secrets in the
|
||||
external checkout. The approved initial work does not include VoidLibrary patches.
|
||||
|
||||
## Void Build System
|
||||
Local source: /home/faumaray/Projects/VoidBuildSystem.
|
||||
Planning initially observed an unborn bootstrap. Execution observed
|
||||
3cac890ce9b8a0681130a58601e0516231471ad8 on main with active changes to build descriptions.
|
||||
This moving checkout is reference evidence, not a pinned runtime dependency.
|
||||
Its native resolved tooling export remains a NEW cross-project contract; no
|
||||
VBS source files are owned by this task.
|
||||
|
||||
## Candidate semantic frontend
|
||||
https://github.com/bloomberg/clang-p2996
|
||||
Candidate revision: 562409c7942690d59ea470762515f88f24b16e23.
|
||||
No toolchain is downloaded or linked by milestone0. Its P2996 documentation
|
||||
explicitly lacks constexpr-range expansion, used in VoidLibrary Enum.hpp.
|
||||
The candidate must pass GCC16/libstdc++ compatibility and separate debugging gates.
|
||||
A source-level debugger API must not be inferred from Clang's compiler debug helpers.
|
||||
See roadmap08 and17. Compiler fixes/replacement require a new explicit decision.
|
||||
|
||||
## Licenses
|
||||
Project licensing is deliberately deferred. Preserve provenance and applicable
|
||||
third-party notices; audit actual dependency licenses before distribution.
|
||||
No MIT/GPL/Apache license for original VLS code is selected by this document.
|
||||
|
||||
## Primary technical references
|
||||
- [LSP3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)
|
||||
- [Compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
|
||||
- [Clang modules](https://clang.llvm.org/docs/StandardCPlusPlusModules.html)
|
||||
- [Pinned reflection fork](https://github.com/bloomberg/clang-p2996/blob/562409c7942690d59ea470762515f88f24b16e23/P2996.md)
|
||||
- [Constant interpreter](https://clang.llvm.org/docs/ConstantInterpreter.html)
|
||||
- [DAP](https://microsoft.github.io/debug-adapter-protocol/specification)
|
||||
References were retrieved during planning on2026-11-25; rolling documentation
|
||||
is not proof of functionality in the pinned fork.
|
||||
@@ -0,0 +1,38 @@
|
||||
# Approved scope
|
||||
|
||||
Approved by the user: "Implement the plan." on 2026-11-25.
|
||||
Initial baseline: /home/faumaray/Projects/VoidLanguageServer, no Git repository,
|
||||
only Serena runtime metadata. Root initialized main locally; HEAD remains unborn.
|
||||
|
||||
## Immediate milestone
|
||||
Initialize repository; persist requirements, architecture, decisions, 27 detailed
|
||||
subsystem plans and workflow evidence; implement a C++26 VoidLibrary-backed
|
||||
CLI and stdio LSP lifecycle shell with meaningful unit and subprocess tests.
|
||||
CMake/Ninja bootstrap is approved. Native VBS self-build is a later milestone.
|
||||
No staging, commit, remote, push or publishing is included.
|
||||
|
||||
## Full product requirements
|
||||
Independent compiler-library-based C++ server; GCC16 Void fidelity; Linux first;
|
||||
Neovim and VS Code; Library/VBS first adoption; native VBS plus compdb providers;
|
||||
core IDE operations, modules/reflection; templates/constraints/constant-evaluation
|
||||
and reflection debugging with live control AND recorded replay, DAP AND custom UIs.
|
||||
Responsive editing targets: warm completion p95 approximately100ms, navigation50ms.
|
||||
Milestones, no fixed deadline. License intentionally deferred until backend gate.
|
||||
|
||||
## Gated work
|
||||
The current Clang/P2996 candidate needs a later bounded feasibility experiment.
|
||||
Its documented missing constexpr-range expansion is a likely incompatibility.
|
||||
Compiler fixes, backend replacement or standard-library substitution need a new
|
||||
explicit decision. Full semantics/debugger implementation is not bootstrap scope.
|
||||
VBS tooling producer is a separate upstream dependency, not authorized sibling edits.
|
||||
|
||||
The user reports another worker is adding VoidLibrary JSON decimal support.
|
||||
Inspect and pin the committed update after the capability suite passes; do not
|
||||
write a competing decimal parser. Until then, proceed with independent work and
|
||||
mark final JSON integration/shell acceptance blocked rather than verified.
|
||||
|
||||
## Execution amendment D-021
|
||||
The user subsequently instructed: "not yet implemented, watch main no need to pin".
|
||||
VoidLibrary now follows main by default; historical pin instructions above and
|
||||
in T-001 are superseded. Record the exact tested commit and validate upstream
|
||||
JSON changes. The final JSON acceptance gate remains mandatory.
|
||||
@@ -0,0 +1,46 @@
|
||||
# Confirmed decisions
|
||||
|
||||
Date: 2026-11-25. These are user choices unless explicitly marked proposed.
|
||||
|
||||
| ID | Decision | Status / implication |
|
||||
| --- | --- | --- |
|
||||
| D-001 | Independent server reusing compiler libraries | CONFIRMED; no clangd fork or from-scratch C++ frontend |
|
||||
| D-002 | GCC16 Void projects define fidelity | CONFIRMED; actual flags/headers/extensions matter |
|
||||
| D-003 | Initial delivery is plans plus working shell | CONFIRMED; semantic/debug implementation remains gated |
|
||||
| D-004 | Linux first | CONFIRMED; Windows/macOS later |
|
||||
| D-005 | Neovim and VS Code | CONFIRMED; both are acceptance clients |
|
||||
| D-006 | Core IDE plus modules/reflection | CONFIRMED; diagnostics/completion/hover/navigation/references/safe rename |
|
||||
| D-007 | Metadata refresh and private IDE caches | CONFIRMED; trusted metadata scope, explicit project generator/dependency builds |
|
||||
| D-008 | CMake now, VBS later | CONFIRMED; native VBS self-build has its own gate |
|
||||
| D-009 | VoidLibrary and VBS adoption first | CONFIRMED; remaining Void projects follow evidence |
|
||||
| D-010 | Probe Clang reflection fork first | CONFIRMED; reject unsupported GCC-context fidelity; no implicit compiler repairs |
|
||||
| D-011 | Defer license until backend decision | CONFIRMED; do not add an invented LICENSE |
|
||||
| D-012 | Responsive daily editing | CONFIRMED; proposed targets accepted: warm completion100ms/navigation50ms p95 |
|
||||
| D-013 | Follow VBS profile with override | CONFIRMED; keep per-file target alternatives |
|
||||
| D-014 | Milestones without a fixed date | CONFIRMED |
|
||||
| D-015 | Metaprogram debugging required in first usable release | CONFIRMED; separate instrumentation track |
|
||||
| D-016 | Templates/constraints plus constant evaluation/reflection | CONFIRMED; not reflection-only debugging |
|
||||
| D-017 | Live AND recorded replay | CONFIRMED; neither substitutes for the other |
|
||||
| D-018 | DAP AND custom UI | CONFIRMED by free-text correction; one service, two client surfaces |
|
||||
| D-019 | Upstream worker will add Void JSON decimals | CONFIRMED user report, implementation NOT yet verified; dependency gate |
|
||||
| D-020 | Implement the plan | CONFIRMED; authorizes milestone0 local writes, no commit/push/deploy |
|
||||
| D-021 | Follow VoidLibrary main; no commit pin | CONFIRMED execution follow-up: "not yet implemented, watch main no need to pin"; supersedes previous VoidLibrary pin requirements, retains exact tested-commit evidence and JSON acceptance gate |
|
||||
|
||||
## Root technical defaults accepted into the reviewed plan
|
||||
- LSP3.17 compatibility, stdio, empty semantic capability set in bootstrap.
|
||||
- New immutable VBS tooling export, separate from declaration JSON and exact execution records.
|
||||
- Server/compiler workers/DAP in C++; thin clients TypeScript/Lua.
|
||||
- Compiler/plugin execution identity separate from metadata authority.
|
||||
- Guarded rename across declared affected contexts, no atomic filesystem-save claim.
|
||||
- One live debug session;2GiB worker/3GiB aggregate;256MiB/1M-event trace;
|
||||
running60s CPU/120s wall; paused30min idle; disconnect5s grace, configurable.
|
||||
- License and candidate compatibility remain gates; no silent libc++ substitution.
|
||||
- No competing VLS decimal parser; follow upstream main and verify its actual revision, adding only remaining local validation.
|
||||
- No telemetry or remote service is part of the initial product.
|
||||
|
||||
## Routing record
|
||||
The initial astra_planner candidate was used for VBS discovery; astra_researcher
|
||||
provided independent official-source frontend evidence. The later upstream-status
|
||||
follow-up created no new implementation package while in Plan Mode, so its Sol
|
||||
candidate was not dispatched. The execution-turn Sol candidate owns T-001.
|
||||
Roles are configured XHigh; model execution was not independently verified.
|
||||
@@ -0,0 +1,21 @@
|
||||
# Preflight record
|
||||
|
||||
Date: 2026-11-25. Scope: initial shell/documents and gated future roadmap.
|
||||
Configured independent astra_reviewer (gpt-6-astra/XHigh); runtime model routing
|
||||
was not independently exposed by spawn metadata.
|
||||
|
||||
Initial verdict: CHANGES_REQUIRED. Final contract re-review: READY, with explicit
|
||||
upstream JSON and later compiler/debugger feasibility prerequisites.
|
||||
No implementation diff, build, client run or release was approved by that review.
|
||||
|
||||
| Finding | Binding correction |
|
||||
| --- | --- |
|
||||
| Compiler options can load native code | Metadata cannot authorize tools; identity-bound approved tools, response-file inspection, no arbitrary plugins/unapproved wrappers. |
|
||||
| Rename coverage/application undefined | All affected provider-exported workspace contexts; materialize and synchronize files, version/content preconditions, transactional buffer application or refusal. No filesystem-atomic claim. |
|
||||
| Trace quotas do not isolate debugger resources | One live session, memory/admission limits, CPU and running wall watchdogs, paused lifetime and disconnect reaping. |
|
||||
| Void JSON parsers have incompatible ingress properties | Verified upstream decimal revision, full JSON capability suite, VLS-owned validation only for remaining UTF-8/surrogate/depth gaps. No integer-only fallback. |
|
||||
|
||||
Additional invariants: post-shutdown requests return InvalidRequest; debug handles
|
||||
include stop/replay-position generation; Gate2 includes failed constraints,
|
||||
nested evaluator/Sema transitions, cancellation and truncated replay.
|
||||
Fresh review of the actual integrated implementation is still required.
|
||||
@@ -0,0 +1,50 @@
|
||||
# Integrated review record
|
||||
|
||||
Date: 2026-11-25. Scope: approved initial milestone, main with unborn HEAD.
|
||||
Reviewer role: astra_reviewer, configured XHigh; runtime model not independently
|
||||
verified. The reviewer did not implement the changes and had read-only ownership.
|
||||
Review contracts: [initial review](tasks/T-REVIEW-001.md) and
|
||||
[focused re-review](tasks/T-REVIEW-002.md). Root inspected actual code and tests.
|
||||
|
||||
## Final verdict
|
||||
Independent implemented shell behavior and documentation: READY.
|
||||
Full JSON acceptance: CHANGES_REQUIRED, blocked upstream.
|
||||
No additional actionable defects were found in the focused re-review.
|
||||
These verdicts do not claim a usable clangd replacement or authorize publication.
|
||||
|
||||
## Finding dispositions
|
||||
| Finding | Severity | Disposition and evidence |
|
||||
| --- | --- | --- |
|
||||
| Valid incoming response envelopes produced error replies | P2 | Fixed: Server::handle classifies success/error responses before request-ID validation, ignores unmatched responses including null IDs and preserves lifecycle state; request/response hybrids remain invalid. Unit and executable regressions pass. |
|
||||
| Capability tests rejected integral IDs spelled1.0/1e0 | P2 | Fixed expectations and boundary visitor: accept finite integral signed32-bit values, preserve strings, reject bool/fractions/out-of-range values before narrowing. Numeric tests cover exponent forms, negative zero and boundaries. Runtime decimal behavior still waits on upstream. |
|
||||
| StrictJson rejects valid decimal/exponent syntax | P1 | OPEN: tested main9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5 rejects affected initialization requests. All six capability bodies fail normally. No skip, xfail, substitute parser or dependency patch. |
|
||||
|
||||
## Independent evidence
|
||||
The reviewer inspected all18 source/build/test files and all27 plans during the
|
||||
initial review, then the actual corrected files, assertions and current records.
|
||||
Graph coverage for new files is absent; conclusions rely on direct source reads.
|
||||
Review snapshots are ignored scratch artifacts; current source is authoritative.
|
||||
|
||||
Re-review execution used binaries under build/bootstrap/tests, with cwd /tmp:
|
||||
|
||||
- vls_unit_tests --no-color: exit0,22/22 pass.
|
||||
- vls_process_tests --no-color: exit0,9/9 pass.
|
||||
- vls_json_capabilities --no-color: exit1,6/6 fail.
|
||||
- Registration.cmake with the three binaries: exit0,37 registered bodies and
|
||||
successful execution of a named regression.
|
||||
- Separate Python probe of vls --stdio with a3-second deadline:36 valid responses
|
||||
ignored across all three lifecycle states;6 invalid hybrids/error payloads
|
||||
rejected;11 expected response IDs/lifecycle transitions correct; exit0, empty stderr.
|
||||
|
||||
Root independently built and tested fetched-main and local-override configurations,
|
||||
formatted the source, checked documentation links/whitespace, installed the corrected
|
||||
binary and ran its version command outside the checkout. See
|
||||
[verification evidence](VERIFICATION.md) for commands and observed outcomes.
|
||||
|
||||
## Required follow-up
|
||||
Follow VoidLibrary main per D-021 and record the actual tested revision. Inspect
|
||||
the arriving numeric representation, including precision/range behavior; the current
|
||||
generic floating branch is uninstantiated and unverified against that future API.
|
||||
Require every corrected capability body to pass, then obtain focused integration
|
||||
review before closing full shell acceptance. No compiler frontend, VBS provider,
|
||||
debugger, editor-client, sanitizer or fuzz acceptance is claimed by this milestone.
|
||||
@@ -0,0 +1,33 @@
|
||||
# Development state
|
||||
|
||||
Updated: 2026-11-25
|
||||
Repository: /home/faumaray/Projects/VoidLanguageServer
|
||||
Branch: main; HEAD: unborn
|
||||
Stage: AWAITING_UPSTREAM — independent scope reviewed; final JSON acceptance blocked
|
||||
Baseline: only .serena runtime metadata; preserved and ignored.
|
||||
Git initialized locally; no stage/commit/remote/push.
|
||||
|
||||
## Delivered work
|
||||
Root: 27 plans, requirements, architecture and decisions written; T-001 handed
|
||||
source ownership back. Upstream and local-override builds pass. Unit/process tests
|
||||
pass (31 cases); six JSON capability cases fail on the actual upstream limitation.
|
||||
Initial review found unmatched-response handling and incorrect numeric-ID test
|
||||
expectations; both are corrected and cleared by T-REVIEW-002. Independent scope
|
||||
verdict READY; final JSON acceptance CHANGES_REQUIRED. See REVIEW.md and
|
||||
VERIFICATION.md for evidence. Implementer and reviewer are closed; no active workers.
|
||||
|
||||
## Prerequisites
|
||||
VoidLibrary inspected HEAD: 9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5.
|
||||
Upstream decimal support is not implemented yet, confirmed by the user. D-021
|
||||
selects following main WITHOUT a commit pin; the fetched/tested commit remains
|
||||
the baseline above. Reconfigure to check main, inspect its API and run the full
|
||||
suite before closing final JSON integration and shell acceptance.
|
||||
Semantic/backend, debugger and native VBS capabilities remain planned.
|
||||
|
||||
## Next concrete action
|
||||
When upstream main changes, rerun the default configure command, record its actual
|
||||
fetched commit, inspect StrictJson's numeric API and adapt only the thin VLS boundary
|
||||
if necessary. Build and run all four CTest entries, inspect all six JSON capability
|
||||
bodies and re-review representation/range behavior. Do not accept the full shell
|
||||
while any required case fails, restore a pin, or patch a sibling repository.
|
||||
The final main check still returned9931c5f. No persistent watcher was created.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Task graph and ownership
|
||||
|
||||
Baseline: main, unborn HEAD. Shared checkout; no isolated worktrees.
|
||||
|
||||
| Task | Status | Owner | Exclusive writes/dependencies |
|
||||
| --- | --- | --- | --- |
|
||||
| T-ROOT-INIT | COMPLETE | Root Astra | Git initialization, AGENTS.md, .gitignore |
|
||||
| T-DOC | COMPLETE_REVIEWED | Root Astra | README.md, docs/; 27 plans, contracts and local links reviewed |
|
||||
| T-001 | PARTIAL_UPSTREAM_GATE | Root after Sol handoff | Source/build/tests implemented; 31 cases pass, 6 upstream JSON capability cases fail |
|
||||
| T-JSON-MAIN | BLOCKED_UPSTREAM | Root | Follow main per D-021; record tested commit; complete JSON suite must pass |
|
||||
| T-INTEGRATE | PARTIAL_UPSTREAM_GATE | Root Astra | Both build modes, install and independent scope verified; final JSON gate remains |
|
||||
| T-REVIEW | COMPLETE | Independent astra_reviewer, closed | T-REVIEW-002: independent READY, full acceptance CHANGES_REQUIRED; see REVIEW.md |
|
||||
|
||||
Jev's sol_implementer candidate matches T-001. Root handles docs concurrently.
|
||||
T-001 completed handoff; root now owns source/build paths. All workers are closed.
|
||||
All future roadmap ownership is proposed, not an active worker assignment.
|
||||
@@ -0,0 +1,87 @@
|
||||
# Verification evidence
|
||||
|
||||
Updated: 2026-11-25. Builds and independent shell suites pass; final JSON acceptance is blocked upstream.
|
||||
|
||||
## Planning evidence
|
||||
- `dev cpp-gcc -c g++ --version`: exit0, GCC16.2.0.
|
||||
- `dev cpp -c clang++ --version`: exit0, Clang23.1.3.
|
||||
- Syntax-only enum helper probe including Void/Detail/Enum.hpp:
|
||||
GCC16.2, C++26, -freflection exit0; Clang23.1.3 same probe exit1 on reflection.
|
||||
No application artifacts were produced. This is not a full VoidLibrary build.
|
||||
- VoidLibrary inspected/remote HEAD: 9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5.
|
||||
- Candidate Clang/P2996 p2996 ref: 562409c7942690d59ea470762515f88f24b16e23.
|
||||
Candidate has not been built or tested.
|
||||
- VBS initial investigation found declaration bootstrap, not native tooling export.
|
||||
Its checkout subsequently advanced; verify current contracts before upstream integration.
|
||||
- Graph coverage: VoidLibrary had stale/partial metadata; flagged sources were read
|
||||
directly. VBS graph lacked current source coverage. No reindex of secret-bearing
|
||||
sibling checkouts occurred.
|
||||
|
||||
## Implementation evidence
|
||||
All commands below ran in /home/faumaray/Projects/VoidLanguageServer unless stated.
|
||||
Root observed:
|
||||
|
||||
| Command | Result |
|
||||
| --- | --- |
|
||||
| `dev cpp-gcc -c cmake -S . -B build/bootstrap -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON` | Exit0; original exact baseline fetched; repeated after D-021 follows main, resolves same9931c5f |
|
||||
| `dev cpp-gcc -c cmake --build build/bootstrap --parallel 2` | Exit0; full initial build, later no-work confirmation after ref change |
|
||||
| `dev cpp-gcc -c ctest --test-dir build/bootstrap --output-on-failure` | Exit8;3/4 CTest entries pass, only JSON capability suite fails |
|
||||
| `dev cpp-gcc -c cmake -S . -B build/local -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVLS_VOID_SOURCE_DIR=/home/faumaray/Projects/VoidLibrary` | Exit0; explicit override provenance |
|
||||
| `dev cpp-gcc -c cmake --build build/local --parallel 2` | Exit0; configuration also updated to D-021 policy |
|
||||
| `dev cpp-gcc -c ctest --test-dir build/local --output-on-failure` | Exit8; same3/4 suite result |
|
||||
| `dev cpp-gcc -c cmake --install build/bootstrap --prefix /home/faumaray/Projects/VoidLanguageServer/build/install` | Exit0 |
|
||||
| `/home/faumaray/Projects/VoidLanguageServer/build/install/bin/vls --version` (cwd /tmp) | Exit0; VoidLanguageServer0.1.0 |
|
||||
| `git -C build/bootstrap/_deps/voidlibrary-src rev-parse HEAD` | 9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5 |
|
||||
|
||||
Initial runs before review corrections:21 unit cases and8 actual-subprocess cases
|
||||
pass;4 JSON capability cases fail normally (not skipped/xfail). Registration verifies33 bodies and executes
|
||||
a named regression. Root inspected actual source/assertions; counts are not inferred
|
||||
from an empty CTest invocation.
|
||||
|
||||
Known failing cases: decimal/exponent values; decimal initialization options;
|
||||
numeric-ID validation after number parsing; executable initialization with decimals.
|
||||
Current StrictJson rejects decimal syntax, so these are real acceptance failures.
|
||||
The user confirmed the upstream change is not implemented yet; follow main per D-021.
|
||||
|
||||
Documentation validation:27 numbered plans, required contracts/implementation/failure/
|
||||
acceptance/ownership sections present,0 broken local Markdown links.
|
||||
Source graph remains untracked/stale for new files; important claims use direct reads.
|
||||
|
||||
After review corrections, root rebuilt both build/bootstrap and build/local with
|
||||
the same commands above: exit0 in each. Full CTest reruns: exit8 in each;22 unit
|
||||
cases and9 subprocess cases pass; all6 JSON capability bodies fail. Registration
|
||||
checks37 bodies and executes a named regression. The two added passing regressions
|
||||
exercise unmatched response envelopes at every lifecycle state and through the
|
||||
actual executable. Numeric acceptance now covers integer-valued decimal/exponent
|
||||
IDs, signed32-bit limits, fractional/out-of-range rejection and executable ID
|
||||
correlation. These six capability failures remain required; they are not waived.
|
||||
The adapter's floating numeric branch is not instantiated by the present upstream
|
||||
variant and must be verified against its eventual numeric API.
|
||||
|
||||
`git ls-remote https://git.faumaray.com/Void/VoidLibrary.git refs/heads/main`
|
||||
was repeated after the fixes: exit0, still9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5.
|
||||
Root formatted exactly the five changed C++ files with dev cpp -c clang-format -i:
|
||||
exit0. Final clang-format --dry-run --Werror on all13 owned C++ source/header paths:
|
||||
exit0. The untracked-file whitespace check initially found extra blank EOF lines in
|
||||
42 root-created documentation/ignore files; these were removed. Repeated per-file
|
||||
git diff --no-index --check against /dev/null produced no warnings for all61 files
|
||||
(exit1 denotes a new-file diff, not a whitespace failure). A script verified27 plans,
|
||||
all6 required sections and37 valid local Markdown links: exit0.
|
||||
Reinstall of the corrected build into build/install: exit0; its bin/vls --version
|
||||
from /tmp: exit0, VoidLanguageServer0.1.0.
|
||||
|
||||
## Independent review and final state
|
||||
T-REVIEW-001 found two P2 defects; root corrected both and T-REVIEW-002 cleared them.
|
||||
The reviewer independently ran22 unit and9 process cases (all pass),6 JSON capability
|
||||
bodies (all fail), registration (37 bodies plus named execution) and an additional
|
||||
bounded executable probe covering36 incoming responses and6 invalid hybrids/error
|
||||
payloads. Independent scope READY; full JSON acceptance CHANGES_REQUIRED.
|
||||
See [review record](REVIEW.md). The numeric adapter's future representation still
|
||||
requires review when upstream changes; the passing independent scope does not waive it.
|
||||
|
||||
Final repeated remote-main check: exit0, still9931c5f. All three task contracts pass
|
||||
the workflow structure linter; root also reviewed their technical scope. Git remains
|
||||
main/unborn, with only the expected new task files, no index entries or remotes.
|
||||
The local VoidLibrary tracked diff remained empty. Implementer/reviewer are closed.
|
||||
No full compiler/frontend, VBS provider, debugger, editor-client or sanitizer suite
|
||||
was run; those components remain planned. No staging/commit/remote/push occurred.
|
||||
@@ -0,0 +1,76 @@
|
||||
# Bootstrap and stdio LSP lifecycle shell
|
||||
Task ID: T-001
|
||||
Role: sol_implementer
|
||||
Status: APPROVED
|
||||
|
||||
Execution amendment D-021: after worker handoff, the user selected following
|
||||
VoidLibrary main without a commit pin. Root changed the default dependency ref.
|
||||
Historical pin instructions below are superseded; exact tested-commit evidence
|
||||
and the upstream JSON acceptance gate remain required.
|
||||
|
||||
## 1. Context and baseline
|
||||
Cwd/repository /home/faumaray/Projects/VoidLanguageServer. Root initialized main with unborn HEAD. Existing .serena runtime metadata is preserved/ignored. Root has added AGENTS.md, .gitignore and docs/agent-workflow records; no source, CMake, tests or formatting files existed. User approved the complete plan with "Implement the plan." Current execution scope is the initial compiling shell plus detailed plans, NOT the full language server/debugger. Relevant requirements R-001 C++26/VoidLibrary, R-002 lifecycle shell, R-003 reliable JSON, R-004 honest capability reporting, R-005 reproducible dependency/testing. Independent planner mapped VBS; fresh preflight reviewer accepted revised contracts. See docs/agent-workflow/APPROVED_PLAN.md and PREFLIGHT.md.
|
||||
|
||||
## 2. Objective and deliverables
|
||||
Implement a maintainable C++26 vls executable and reusable protocol library, using actual VoidLibrary APIs. Deliver CLI, bounded LSP framing, safe JSON adapter, lifecycle state machine, and meaningful unit plus real-subprocess tests. Establish CMake/Ninja build with exact VoidLibrary pin/default remote fetch and explicit VLS_VOID_SOURCE_DIR development override. Keep final JSON conformance visibly pending if the user's upstream decimal revision has not landed; complete all independent code/testing. Do not substitute an integer-only protocol success claim.
|
||||
|
||||
## 3. Scope and non-goals
|
||||
In: local bootstrap, help/version/stdio, JSON-RPC envelope validation and LSP3.17 lifecycle, error handling, input bounds, tests, install of executable if straightforward. Out: semantic parsing/diagnostics/completion, document synchronization, VBS or compdb providers, compiler-fork downloads, DAP/debugging/editor extensions, unrelated dependency fixes, Git mutations and docs writes. The shell advertises no unimplemented capabilities and never returns fake semantic results.
|
||||
|
||||
## 4. Files to inspect
|
||||
Read project AGENTS.md and workflow records first. Dependency read-only at /home/faumaray/Projects/VoidLibrary: CMakeLists.txt, include/Void/Configuration/Argparse.hpp, include/Void/Data/StrictJson.hpp, include/Void/Data/Json.hpp, include/Void/Unicode/Utf.hpp, include/Void/System/Process.hpp, cmake/VoidTesting.cmake, tests/standalone/Data/StrictJson.cpp and relevant Testing examples. VBS read-only reference: /home/faumaray/Projects/VoidBuildSystem/cmake/VoidDependency.cmake, tests/CMakeLists.txt, tests/SdkRegistration.cmake, src/main.cpp. Do not assume VBS provides a native executor. Inspect actual APIs before code; do not change sibling repositories.
|
||||
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: CMakeLists.txt; cmake; include; src; tests; .clang-format
|
||||
All these are NEW VLS paths. Root exclusively owns .gitignore, AGENTS.md, README.md and docs/; do not edit them. You share the checkout, not an isolated worktree. Do not revert others' changes. No branch changes, staging, commits, clean/reset/stash, remote setup or push. Use build/worker for your builds; root will use build/bootstrap and build/local. Do not edit generated .serena config, global tools or Nix sources. Report changed paths; parent integrates after explicit handoff.
|
||||
|
||||
## 6. Implementation or investigation approach
|
||||
Mandatory sequence:
|
||||
1. Inspect actual Void APIs and establish narrowly selected dependency modules (Configuration, Data, Unicode; Testing and System as needed for tests). Configure C++26/-freflection with GCC16+ checks and CMake>=4; scope Void options, disable dependency tests/benchmarks and use static linkage for this bootstrap.
|
||||
2. Implement stream-independent framing and lifecycle components plus thin main. Prefer simple synchronous shell with clean interfaces over premature worker/index abstractions.
|
||||
3. Use Void::Argparse for CLI. No-argument and --stdio launch LSP; --help/-h and --version/-V are standalone, mixed/incompatible modes or unknown options exit2. Help/version can use stdout outside stdio. In stdio stdout only framed protocol; stderr logs.
|
||||
4. JSON UPSTREAM GATE: inspected VoidLibrary baseline 9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5 has StrictJson integer-only parsing. The user says another worker is adding decimal support. DO NOT create a competing decimal parser or edit VoidLibrary. Design a thin adapter to use improved upstream StrictJson with raw UTF-8 validation and any needed bounded escape/depth validation. Use variant visitors tolerant of the future numeric alternative rather than assuming an unobserved exact new API. Until a verified committed revision exists, pin the observed baseline provisionally, complete independent components, and keep decimal capability tests as real FAILURES (no skip/xfail/false success). Parent owns final pin decision after verification. Notify parent when ready to adopt any observed upstream change.
|
||||
5. Add unit and executable protocol tests using Void::Testing and a bounded subprocess harness. Preserve real test failure exit codes; registration must be nonzero.
|
||||
6. Format exact owned C++ paths, inspect your diff, build and test what is available. Return code complete vs blocked accurately.
|
||||
|
||||
## 7. Interfaces and data contracts
|
||||
NEW C++ public interfaces should separate framing, JSON-envelope processing and lifecycle so tests exercise the real main path; choose clear minimal names under namespace vls and include/vls. No public ABI commitment yet.
|
||||
Framing: Content-Length ASCII decimal, CRLF headers, body length in BYTES, optional UTF-8 Content-Type, multiple messages/partial reads. Header max8192 bytes; body max16777216 bytes; JSON depth64. Reject missing/duplicate/invalid/overflow length, unsupported charset, oversized/truncated framing without trying to resynchronize: stderr and nonzero exit. Validate before unbounded allocation. Exact-limit cases testable through smaller injectable limits in units.
|
||||
JSON: valid objects with jsonrpc="2.0"; preserve integer/string request IDs (LSP signed32-bit integer range), reject invalid ID types/ranges. Arrays/batches and malformed envelopes return InvalidRequest with appropriate id/null. Full decimal/exponent grammar in initializationOptions/ignored fields is REQUIRED, pending upstream. Reject raw controls, invalid UTF-8 and escaped lone surrogates. Void's general parser alone lacks these guards; raw UTF-8 validation alone does not reject escaped surrogates. No unchecked recursive parse before a depth bound. Known-size malformed JSON -> ParseError (-32700), id:null and continue.
|
||||
Lifecycle: before initialize, requests except initialize receive ServerNotInitialized (-32002); ignore notifications except exit as prescribed by LSP. Initialize returns serverInfo{name:"VoidLanguageServer",version:"0.1.0"} and capabilities:{}; initialized notification accepted. Repeated initialize -> InvalidRequest (-32600). Unknown requests after initialize -> MethodNotFound (-32601); unknown notifications no response. Shutdown request -> result:null and enter shutdown state. Post-shutdown requests -> InvalidRequest before generic method handling. Exit notification returns process0 after shutdown,1 otherwise. Unexpected/truncated EOF before proper shutdown/exit must not report a successful lifecycle. Initialization params are an object; test complete client payloads and tolerant handling of unknown fields. No responses to notifications, including invalid/unknown methods when no response id exists; malformed JSON itself uses id:null.
|
||||
No compiler, build description, shell, plugin, package manager, network listener, or metadata command executes during normal server operation.
|
||||
|
||||
## 8. Dependencies and integration
|
||||
Default dependency URL https://git.faumaray.com/Void/VoidLibrary.git with exact revision, no floating branches. Current observed HEAD baseline above. VLS_VOID_SOURCE_DIR bypass must be explicit and print clear provenance; build output goes into VLS build dir, never dependency source. Root will validate new upstream pin and repeat default+override paths after handoff.
|
||||
The source API may change while the other worker works. Inspect and report rather than silently adopting dirty source or pretending pin validation. Root documentation proceeds independently. No Nix module change is needed; use existing dev cpp-gcc. Flake/store source copying, --impure and installer work are prohibited.
|
||||
|
||||
## 9. Edge cases security and performance
|
||||
Bound read buffers, depth and frame sizes. Check stream errors and avoid stderr/stdout mixing. Ignore unknown extension fields without rejecting valid decimal values once gate passes. Test surrogate pairs and malformed escapes; preserve quoted/non-ASCII string IDs. Enforce argument mode errors deterministically. Subprocess tests need timeouts and cleanup; do not let a blocked child hang CTest. Do not read/index .env, keys, WG.conf, .aws, credentials or ignored caches from dependencies. Graph identities known: home-faumaray-Projects-VoidLibrary and home-faumaray-Projects-VoidBuildSystem; old indexes are stale. Use exact-path coverage and source verification; no reindex. Keep Serena active project VoidLanguageServer; do not switch shared activation.
|
||||
|
||||
## 10. Acceptance criteria
|
||||
1. Default pinned and explicit local builds have truthful provenance and leave dependency source unchanged (R-001/R-005).
|
||||
2. CLI --help/--version and invalid combinations have correct output/exit codes; stdio default writes only protocol (R-002).
|
||||
3. Unit tests cover frame boundaries, length overflow, encoding/JSON/ID checks and lifecycle precedence (R-002/R-003).
|
||||
4. End-to-end tests run the built vls executable through initialize/initialized/shutdown/exit; fragment headers/bodies, send multiple messages, unknown methods/notifications, malformed JSON, premature exit, post-shutdown requests (R-002).
|
||||
5. Decimal/exponent initialization options and Unicode/depth tests pass on the VERIFIED upstream pin before final shell acceptance (R-003). If not available, return PARTIAL with exact failing prerequisite.
|
||||
6. Capability response is empty; no semantic/debugger/VBS behavior claimed (R-004).
|
||||
7. Tests are nonzero, fail visibly, time-bounded; no ignored failures/xfails fabricated to pass (R-005).
|
||||
|
||||
## 11. Verification commands and evidence
|
||||
Cwd /home/faumaray/Projects/VoidLanguageServer. Existing environment commands observed: dev cpp-gcc -c g++ --version =>16.2.0; dev cpp -c clang++ --version =>23.1.3. GCC passes reflection syntax probe, installed Clang fails, so GCC required.
|
||||
NEW project acceptance commands once you create build files:
|
||||
dev cpp-gcc -c cmake -S . -B build/worker -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DVLS_VOID_SOURCE_DIR=/home/faumaray/Projects/VoidLibrary
|
||||
dev cpp-gcc -c cmake --build build/worker
|
||||
dev cpp-gcc -c ctest --test-dir build/worker --output-on-failure
|
||||
dev cpp-gcc -c ctest --test-dir build/worker -N
|
||||
Default pin verification belongs to root after pin settles; you may use build/worker-pinned if needed and report.
|
||||
These commands write only ignored build artifacts and may fetch dependency packages. Use plain commands and capture exits. Scope clang-format to exact owned C++ paths. Do not run NixOS checks or edit environment tooling.
|
||||
|
||||
## 12. Constraints and stop conditions
|
||||
Stop and report if upstream JSON API/pin is unavailable for final integration, a change needs unowned/sibling files, a consequential API decision contradicts this contract, or toolchain access fails. Continue independent code before returning partial. After two unsuccessful repairs of same issue, return original failure, attempts and diff for Astra re-diagnosis; no third same-hypothesis loop. Do not disable tests or patch dependency as a workaround. No children.
|
||||
|
||||
## 13. Authorization and decisions
|
||||
User "Implement the plan" authorizes initial shell+repo/plans after completed discovery and READY preflight; root is executing repository/docs in parallel. Configured sol_implementer gpt-6.1-sol/XHigh; do not assert runtime routing verified. Full future product/debugger work and publishing remain gated. This full task is persisted and structurally linted before dispatch; root semantically reviewed it.
|
||||
|
||||
## 14. Return format
|
||||
Return T-001; DONE/PARTIAL/BLOCKED; summary; exact changed paths; decisions/deviations; commands with cwd, exits and test counts; every acceptance criterion evidence; unrun checks; JSON gate/pin status; residual risks and handoff. Do not contact user directly or spawn agents.
|
||||
@@ -0,0 +1,69 @@
|
||||
# Independent integrated bootstrap and roadmap review
|
||||
Task ID: T-REVIEW-001
|
||||
Role: astra_reviewer
|
||||
Status: READY
|
||||
|
||||
Execution amendment D-021: the user now requires following VoidLibrary main
|
||||
without a commit pin. Root changed CMakeLists.txt/cmake/VoidDependency.cmake and
|
||||
updated current policy docs. Judge the actual main-ref behavior; historical
|
||||
pin requirements below are superseded, and tested-commit provenance still applies.
|
||||
|
||||
## 1. Context and baseline
|
||||
Review /home/faumaray/Projects/VoidLanguageServer, main, unborn HEAD. All source/docs files are NEW relative to the initially empty source repository; only preexisting .serena runtime metadata was preserved/ignored. User approved milestone0 repository+27 detailed plans+C++26 VoidLibrary LSP shell. T-001 Sol implementer has handed back all files. Root wrote docs and inspected actual code/tests. This is a fresh final review, distinct from prior preflight. Known external blocker: VoidLibrary StrictJson at9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5 rejects decimals; user says another worker is adding them and explicitly chose upstream reuse.
|
||||
|
||||
## 2. Objective and deliverables
|
||||
Adversarial review of actual integrated source/tests/build and documentation contracts. Find actionable correctness, protocol, safety, dependency, regression-test or dishonest-status issues. Return separate verdict for independent implemented shell behavior/docs and final full shell acceptance. Do not wave away known failing required JSON tests; final acceptance is currently blocked. Identify any additional defects that should be fixed now.
|
||||
|
||||
## 3. Scope and non-goals
|
||||
Review all18 new source/build/test files and relevant roadmap architecture/01/02/08/16-23 consistency. Validate that all27 plans exist with specific dependencies/ownership/contracts/tests and retain user choices. No compiler/backend/VBS/debug implementation expected. No writes, dependency edits, toolchain installation or Git mutations; no user messages or children. Review actual diff/source, not just worker summary.
|
||||
|
||||
## 4. Files to inspect
|
||||
Read AGENTS.md, docs/agent-workflow/APPROVED_PLAN.md, PREFLIGHT.md and tasks/T-001.md. Source snapshot at build/review/integrated.patch and SHA256 manifest build/review/manifest.tsv (created before this review-task file). All changes are new files against /dev/null; git diff alone will omit untracked files.
|
||||
Actual code: CMakeLists.txt, cmake/VoidDependency.cmake, .clang-format; include/vls/{Framing,Json,Server}.hpp; src/{Framing,Json,Server,main}.cpp; tests/CMakeLists.txt, Registration.cmake, TestSupport.hpp, FramingTests.cpp, JsonTests.cpp, LifecycleTests.cpp, JsonCapabilities.cpp, ProcessTests.cpp.
|
||||
Docs: README.md, docs/DEPENDENCIES.md, docs/roadmap/README.md, REQUIREMENTS.md, ARCHITECTURE.md and relevant numbered plans. Exact worker tests/logs available in build/worker/Testing/Temporary/LastTest.log; root pinned tests build/bootstrap/Testing/Temporary/LastTest.log.
|
||||
Dependency source only if necessary: pinned build/bootstrap/_deps/voidlibrary-src/include/Void/Data/StrictJson.hpp and Unicode/Utf.hpp. Do not scan unrelated external checkout content.
|
||||
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: none
|
||||
Root owns source after handoff, but will keep it stable while review runs; verification/status documentation may be updated. .serena, dependencies and global tools non-owned. Use your own /tmp or ignored scratch directory only for non-repository test artifacts if needed; no source mutation. No editing, stage/commit/push/reset/stash/clean or changing Serena active project. All actors share the checkout.
|
||||
|
||||
## 6. Implementation or investigation approach
|
||||
Verify baseline/manifest and read actual code. Check frame byte/limit/EOF/stream semantics, JSON validation before recursive parsing, ID/envelope handling, lifecycle and stdout discipline. Inspect test assertions/failure propagation and subprocess deadlines. Check exact pin/default fetch vs override and real module linkage. Examine instructions/plans for contradictory scope, source claims, missing chosen debugger/client features and false verification.
|
||||
Root established graph project home-faumaray-Projects-VoidLanguageServer -> exact root; .gitignore excludes build/.vls/.serena/.cache/keys/env/WG.conf. Exact-path coverage reports not_tracked for all new code; structural search returns no symbols. Check coverage for relied paths as required, read source directly, do not reindex or pretend graph completeness. Serena active project is VLS; do not switch.
|
||||
If protocol facts are disputed, use current primary LSP/JSON-RPC sources. Root flags two HYPOTHESES for independent assessment: tests enforce rejection of numeric IDs spelled1.0/1e0 even though integer-valued JSON numbers may need value-based handling; implementation returns InvalidRequest for incoming response envelopes although this shell sends no server requests. These are not asserted defects or requested outcomes.
|
||||
|
||||
## 7. Interfaces and data contracts
|
||||
Original T-001 gives full binding WHAT/HOW. Core facts: default/--stdio LSP3.17 lifecycle; standalone help/version; header8KiB/body16MiB/depth64; strict UTF-8/escape validation; exact string/integer ID correlation; empty capabilities; no semantic fake success; before-init ServerNotInitialized, repeated-init InvalidRequest, unknown requests MethodNotFound, notifications silent, shutdown null, post-shutdown InvalidRequest, exit0 after shutdown or1 otherwise.
|
||||
User confirmed no competing decimal parser: wait for committed upstream revision, then validate/pin. Existing capability suite is ordinary failing tests, not skip/xfail. Full product requires GCC16 fidelity, modules/reflection, core IDE and safe rename, live+replay template/constraint/constexpr/reflection debugging, DAP+custom UI in Neovim+VSCode. Future contracts are explicitly NEW/planned with compiler/VBS/license gates.
|
||||
|
||||
## 8. Dependencies and integration
|
||||
No active source implementer remains; root integrates findings. Source header/runtime APIs from exact VoidLibrary pin were inspected, and dependency is statically linked with scoped module options. No frontend compiler fork downloaded. VBS source advanced independently and is not owned. If upstream decimal revision becomes available, root will separately validate pin/API and request re-review of affected code.
|
||||
|
||||
## 9. Edge cases security and performance
|
||||
Inspect malformed/batched envelopes, notification response behavior, integer limits/decimal representation, Unicode/escaped IDs, header duplicate/overflow, premature EOF, broken pipes/output flush and nesting scanner safety. Confirm tests are not tautological-only and actually exercise executable fragmentation/immediate response.
|
||||
Future boundaries: metadata execution authority; complete declared-context guarded rename without filesystem-atomic claims; debug memory/admission/watchdog/disconnect limits and position-scoped handles. Do not expand bootstrap into a sandbox or full semantic server.
|
||||
|
||||
## 10. Acceptance criteria
|
||||
1. Severity-ranked reproducible findings with exact location/trigger/impact/correction; distinguish hypotheses from established defects.
|
||||
2. Verify all selected user features remain in plans and implementation advertises only lifecycle.
|
||||
3. Review actual test assertions and counts, not only CTest green/red summary.
|
||||
4. State known JSON prerequisite independently of new findings; no final VERIFIED verdict while required tests fail.
|
||||
5. Return targeted validation/re-review scope for fixes and any material residual risk.
|
||||
|
||||
## 11. Verification commands and evidence
|
||||
Cwd /home/faumaray/Projects/VoidLanguageServer.
|
||||
Root observed default pinned configure: dev cpp-gcc -c cmake -S . -B build/bootstrap -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON =>exit0, clone exact9931c5f, GCC16.2/reflection pass.
|
||||
Root observed dev cpp-gcc -c cmake --build build/bootstrap --parallel2 (actual invocation uses separate '--parallel','2') =>exit0.
|
||||
Root observed dev cpp-gcc -c ctest --test-dir build/bootstrap --output-on-failure =>exit8,3/4 suites pass, only vls_json_capabilities fails (four bodies). Unit21 and process8 plus registration pass.
|
||||
Worker observed same local override build/test outcomes in build/worker; total33 bodies,29pass/4fail. Worker scoped format/whitespace/install/version checks pass, root has not independently repeated all.
|
||||
Root documentation check:27 numbered plans, each~350-420 words and all6 required sections; local markdown links0 errors.
|
||||
You may run focused existing test binaries or crafted subprocess probes with deadlines; record actual exits. No need to rebuild full dependencies for unchanged code.
|
||||
|
||||
## 12. Constraints and stop conditions
|
||||
No dependency fixes or competing JSON parser. Treat missing upstream revision as explicit blocked final acceptance, not a reason to hide or disable tests. Do not infer model routing, tests or distribution approval from role labels. Stop on unowned writes/secret risk; return precise evidence. Keep review bounded to actionable integrated defects and requirements.
|
||||
|
||||
## 13. Authorization and decisions
|
||||
User requested implementation of the approved first milestone. Prior READY preflight applies to contracts only; this fresh reviewer must independently inspect code. All roles configured XHigh; spawn metadata does not verify model runtime. No merge/release/push requested or authorized. Task persisted, linted and root semantically checked.
|
||||
|
||||
## 14. Return format
|
||||
T-REVIEW-001; verdict for independent scope and full acceptance; severity-ranked findings; acceptance evidence/gaps; exact commands/cwd/results; files changed none; checks not run and residual risks. Do not spawn or message the user.
|
||||
@@ -0,0 +1,125 @@
|
||||
# Focused re-review of lifecycle and numeric-ID corrections
|
||||
Task ID: T-REVIEW-002
|
||||
Role: astra_reviewer
|
||||
Status: READY
|
||||
|
||||
## 1. Context and baseline
|
||||
Repository/cwd /home/faumaray/Projects/VoidLanguageServer; branch main, unborn HEAD,
|
||||
no stage/commit/remote. Source and documentation are NEW relative to the initial
|
||||
empty source repository. This continues your independent T-REVIEW-001 review.
|
||||
Root owns the corrected files; Sol has released ownership and is closed.
|
||||
VoidLibrary fetched/tested HEAD is still9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5.
|
||||
D-021 follows main, without a commit pin. User confirms decimals are not implemented.
|
||||
|
||||
## 2. Objective and deliverables
|
||||
Re-review corrections to your two P2 findings and the current evidence/status
|
||||
documents. Return separate verdicts for independent shell/docs behavior and final
|
||||
JSON acceptance. Check actual source and tests, not only this report. Full
|
||||
acceptance remains blocked by the known upstream JSON prerequisite.
|
||||
|
||||
## 3. Scope and non-goals
|
||||
Focus on unmatched response handling, numeric ID expectations/adapter, regression
|
||||
tests, registration and documentation status. Prior full review of18 source files
|
||||
and27 plans remains relevant; no need to repeat unrelated work without new evidence.
|
||||
No compiler/VBS/debug implementation, upstream changes or general redesign.
|
||||
|
||||
## 4. Files to inspect
|
||||
Original contracts: docs/agent-workflow/tasks/T-001.md and T-REVIEW-001.md;
|
||||
docs/agent-workflow/APPROVED_PLAN.md and PREFLIGHT.md.
|
||||
Changed source: src/Json.cpp, src/Server.cpp, tests/LifecycleTests.cpp,
|
||||
tests/ProcessTests.cpp, tests/JsonCapabilities.cpp, tests/Registration.cmake.
|
||||
Context: include/vls/Json.hpp, include/vls/Server.hpp, tests/TestSupport.hpp.
|
||||
Changed policy/status: CMakeLists.txt, cmake/VoidDependency.cmake, README.md,
|
||||
docs/DEPENDENCIES.md, docs/roadmap/02-lsp-protocol-lifecycle.md,
|
||||
docs/agent-workflow/{STATE,TASKS,VERIFICATION,DECISIONS}.md.
|
||||
Snapshot: build/review/integrated-r2.patch and manifest-r2.tsv; initial snapshot
|
||||
predates D-021 and corrections. Current files are authoritative.
|
||||
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: none
|
||||
Read-only shared checkout. Root keeps source stable during review, may update
|
||||
verification/status records. No sibling/global/generated config edits, staging,
|
||||
commit, push, reset, stash, clean, branch switch or Serena project switch.
|
||||
Use bounded scratch artifacts only under your own /tmp or ignored build/review.
|
||||
Do not spawn agents or communicate with the user.
|
||||
|
||||
## 6. Implementation or investigation approach
|
||||
Inspect exact correction and affected contracts, then run focused existing tests
|
||||
or bounded executable probes to distinguish remaining defects. Initial correction:
|
||||
classify valid incoming success/error responses before request-ID validation;
|
||||
ignore unmatched responses (including null IDs) without state changes; preserve
|
||||
InvalidRequest for request/response hybrids. Added unit and process regressions.
|
||||
ID correction: signed32-bit value semantics; generic integral/floating visitor
|
||||
checks finite/integral/in-range before narrowing; strings preserved, bool rejected.
|
||||
Capability expectations now accept1.0/1e0 and limits, reject fractions/out-of-range.
|
||||
Current upstream has no floating variant, so runtime decimal behavior is unverified.
|
||||
Do not infer future upstream API guarantees from the generic visitor.
|
||||
Coverage for these files was not_tracked; check coverage as required, then inspect
|
||||
direct source. Graph project is home-faumaray-Projects-VoidLanguageServer; do not
|
||||
reindex or select any sibling project.
|
||||
|
||||
## 7. Interfaces and data contracts
|
||||
Existing Server::handle returns optional response/exit_code; lifecycle states remain
|
||||
awaiting_initialize/running/shutdown. Valid responses yield neither field and do not
|
||||
advance state. Requests still require a method and signed32-bit integer/string ID.
|
||||
JSON remains Void::Json::Strict::Value, parse_json adds UTF8/depth validation only;
|
||||
no competing decimal parser. String/integer ID output remains exact. Signed32-bit
|
||||
boundaries and decimal/exponent spellings must be evaluated as numeric values
|
||||
without a lossy unchecked conversion. New upstream representation must be inspected
|
||||
and tested before accepting the JSON gate.
|
||||
|
||||
## 8. Dependencies and integration
|
||||
Root integrates findings. No active source worker. Full JSON gate waits for upstream
|
||||
main; no pin, xfail or substitute parser. First P2 response fix should be independently
|
||||
acceptable now; numeric expectation correction is assessable now, numeric runtime
|
||||
support remains an upstream integration requirement. State/TASKS/VERIFICATION now
|
||||
record actual observed runs; the stale-status observation from the first review
|
||||
should be checked against current files.
|
||||
|
||||
## 9. Edge cases security and performance
|
||||
Check before-init/running/shutdown response silence, null/string/numeric response IDs,
|
||||
success versus error shape, request/response hybrids, no reply loops, lifecycle
|
||||
order and stdout framing. Check signed bounds, negative zero, fractions, exponent
|
||||
forms, nonfinite guards and bool exclusion. Subprocess checks have2s bounds and CTest
|
||||
outer timeouts. No new public listener, execution authority or semantic capabilities.
|
||||
|
||||
## 10. Acceptance criteria
|
||||
1. Disposition for each original P2 with source/test evidence and any residual defect.
|
||||
2. Verify22 unit and9 subprocess cases, registration and real executable assertions.
|
||||
3. Verify six normal failing JSON capability bodies express correct future behavior.
|
||||
4. Keep final acceptance blocked until actual upstream decimal integration passes.
|
||||
5. Report any additional actionable defect with severity, location, trigger, impact,
|
||||
expected/actual result and smallest meaningful correction/check.
|
||||
|
||||
## 11. Verification commands and evidence
|
||||
Cwd /home/faumaray/Projects/VoidLanguageServer.
|
||||
Root ran dev cpp-gcc -c cmake --build build/bootstrap --parallel 2 and same for
|
||||
build/local: both exit0 after corrections.
|
||||
Root ran dev cpp-gcc -c ctest --test-dir build/bootstrap --output-on-failure and
|
||||
same for build/local: both exit8;3/4 CTest entries pass;22unit+9process pass and
|
||||
6capability bodies fail. Current logs: build/{bootstrap,local}/Testing/Temporary/LastTest.log.
|
||||
Root ran dev cpp -c clang-format -i on the five changed C++ files: exit0.
|
||||
Root repeated git ls-remote https://git.faumaray.com/Void/VoidLibrary.git refs/heads/main:
|
||||
exit0, still9931c5f. Your focused commands may use build/bootstrap/tests/vls_unit_tests
|
||||
--no-color --filter '^LifecycleTests.unmatched_responses_do_not_reply_or_change_lifecycle$'
|
||||
and build/bootstrap/tests/vls_process_tests --no-color --filter
|
||||
'^ProcessTests.unmatched_peer_responses_do_not_create_reply_loops$'.
|
||||
No full rebuild needed unless actual evidence contradicts source/binaries.
|
||||
|
||||
## 12. Constraints and stop conditions
|
||||
Do not modify dependencies, write an alternative parser, disable failing tests or
|
||||
claim complete shell acceptance. Escalate unowned writes/secret exposure; do not
|
||||
scan secret-bearing sibling directories. No fake model/runtime verification.
|
||||
After two unsuccessful repair cycles, root must rediagnose with astra_implementer;
|
||||
these are the first corrections to each original finding.
|
||||
|
||||
## 13. Authorization and decisions
|
||||
User approved the initial milestone and later following VoidLibrary main. No merge,
|
||||
release or remote action is requested. This is a focused continuation of the fresh
|
||||
independent integrated review, by its original read-only reviewer. Root will lint
|
||||
this full task contract and send it verbatim before dispatch.
|
||||
|
||||
## 14. Return format
|
||||
T-REVIEW-002; verdict for independent scope and full acceptance; disposition of both
|
||||
P2s; remaining severity-ranked findings; exact commands/cwd/results; files changed
|
||||
none; unrun checks and residual risks. Do not spawn children or message the user.
|
||||
@@ -0,0 +1,32 @@
|
||||
# 01 — Bootstrap, dependency provenance and CLI
|
||||
|
||||
Status: PARTIAL (T-001); builds verified, final JSON acceptance blocked upstream
|
||||
Requirements: R-001,R-003,R-005,R-022,R-026
|
||||
Dependencies: None for repository/CLI; upstream VoidLibrary decimal revision gates final JSON acceptance.
|
||||
|
||||
## Ownership and boundaries
|
||||
T-001 has handed source/build ownership back to root for integration. Root owns provenance/docs and dependency-reference policy; later source tasks require explicit ownership.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Build with GCC16+, C++26 and -freflection; CMake4+/Ninja. VLS_VOID_SOURCE_DIR is an explicit development override, never an implicit sibling lookup. Follow upstream main per user decision D-021 and record the tested commit and override provenance. CLI modes are default/--stdio, standalone --help/-h and --version/-V, with invalid/mixed options returning2.
|
||||
|
||||
## Implementation sequence
|
||||
1. Select only the verified Void module closure: Configuration/Data/Unicode, with System/Testing for tests. Disable dependency tests/benchmarks and keep output in the VLS binary tree; static linkage simplifies the initial executable.
|
||||
2. Create a reusable protocol target, thin main and separate unit/subprocess test executables. Keep framework setup in the CMake binary tree. Test registration must propagate failures and must discover a nonzero count.
|
||||
3. Observe the user's upstream JSON update on main, inspect its API and run the capability suite. Baseline9931c5f lacks decimals; do not independently add decimal parsing or call an unverified upstream update accepted.
|
||||
4. Document install/run commands, version/provenance, source override and capability limitations. Preserve third-party notices; project licensing remains undecided.
|
||||
|
||||
## Failure behavior and constraints
|
||||
An unavailable dependency, missing compiler feature or failed JSON capability is an explicit prerequisite failure. Both main and local source may change, so evidence must name the actual tested commit and dirty state. Preserve prior results; never alter the external checkout to make it compile.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Build clean upstream-main and explicitly named local-source configurations in separate trees; record the resolved revision and compare dependency tracked state before/after.
|
||||
2. Verify help/version, unknown arguments and incompatible modes with output/exit assertions; test stdio default without diagnostic leakage.
|
||||
3. Require registered nonzero tests, decimal/exponent ingress, correct integer/string IDs, Unicode/depth boundaries and actual child-process lifecycle coverage.
|
||||
|
||||
## Verification and integration
|
||||
Run the documented configure/build/CTest commands from the repository README. Inspect ctest -N and test output for nonzero registration and real failures. Upstream main and local override use separate build trees.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Retain prior build/provenance records and review API changes when main advances. Do not restore a commit pin, delete unrelated build trees or rewrite global toolchain state.
|
||||
@@ -0,0 +1,32 @@
|
||||
# 02 — LSP framing, JSON envelope and lifecycle
|
||||
|
||||
Status: PARTIAL (T-001); implemented shell, final JSON acceptance blocked upstream
|
||||
Requirements: R-002,R-003,R-004,R-005
|
||||
Dependencies: 01, including the verified upstream JSON prerequisite.
|
||||
|
||||
## Ownership and boundaries
|
||||
T-001 owns bootstrap protocol/source/tests. Later extraction into dedicated protocol directories requires a new exact ownership contract.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
LSP3.17 over stdio, UTF-8 JSON and byte-count Content-Length. Limits: header8192 bytes, body16777216 bytes, depth64. NEW frame reader and lifecycle processor are separately testable but main uses the same path. IDs are signed32-bit integers or strings; capability result is empty in milestone0.
|
||||
|
||||
## Implementation sequence
|
||||
1. Read incremental headers/body with bounded allocation, support coalesced messages, reject missing/duplicate/overflow Content-Length and unsupported charset. Treat truncated/ambiguous framing as terminal rather than scan for a guessed next message.
|
||||
2. Use upstream strict JSON plus required Unicode/protocol validation. Preserve string and signed32-bit ID values; accept finite integral values such as1.0 or1e0, rejecting fractional/out-of-range values before narrowing. Handle decimals in unknown/initialization fields. Invalid envelope/batch shapes receive InvalidRequest; malformed known-length JSON receives ParseError and permits the next frame. Ignore valid unmatched response envelopes, including null correlation IDs, without mutating lifecycle state; reject request/response hybrids.
|
||||
3. Implement states before-initialize, initialized and shutdown. Pre-init requests receive ServerNotInitialized; repeated initialize is invalid; unknown initialized requests get MethodNotFound; unknown notifications produce no response.
|
||||
4. Return serverInfo/version and capabilities:{}; shutdown returns null. Check shutdown-state errors before unknown-method handling. Exit0 follows shutdown, exit1 otherwise; broken writes/EOF cannot falsely report a completed exchange.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Keep diagnostics on stderr, even after malformed input. Avoid responses to notifications. Recover only when a valid frame length gives an unambiguous boundary. Allocation/stream errors terminate with a nonzero process status. Unsupported semantic methods remain unsupported rather than yielding empty fake results.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Feed one byte at a time, split CRLF/body/UTF-8 sequences, concatenate frames and assert complete exact messages with no extra stdout.
|
||||
2. Test lifecycle ordering, repeated initialize, pre-init/post-shutdown requests, unknown notifications, both exit statuses and premature EOF.
|
||||
3. Exercise valid decimal/exponent options, integral-valued/fractional/out-of-range IDs, unmatched responses, escaped IDs/astral characters, raw controls, lone surrogates, invalid UTF-8, depth limits and length overflow; enforce subprocess deadlines. Review the actual upstream numeric representation before accepting its integration; current StrictJson cannot exercise decimal ID handling.
|
||||
|
||||
## Verification and integration
|
||||
Run the documented configure/build/CTest commands from the repository README. Inspect ctest -N and test output for nonzero registration and real failures. Upstream main and local override use separate build trees.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Keep the protocol library independent of future semantic services; added capabilities must be removable without changing lifecycle semantics. A failing JSON prerequisite blocks acceptance, not test execution.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 03 — Versioned documents, positions and overlays
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-006,R-011
|
||||
Dependencies: 02; shared revision identity with05 and09 before semantic integration.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol package: NEW include/vls/documents/, src/documents/, tests/documents/. Root owns shared revision schema.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
DocumentSnapshot contains URI, immutable bytes, version/content identity and line/encoding map. DocumentStore accepts open/change/close and returns snapshots. UTF-16 is the LSP default; negotiated UTF-8 is explicit. A snapshot's positions and text never refer to different revisions.
|
||||
|
||||
## Implementation sequence
|
||||
1. Normalize URI identity without confusing encoded separators, symlinks or platform path spelling; retain display URI separately. Establish workspace ownership from04.
|
||||
2. Implement ordered incremental edits against the exact preceding version, including multiple edits in one notification; keep old snapshots alive for outstanding requests.
|
||||
3. Maintain line indexes and UTF-8/UTF-16 conversion with Void Unicode primitives; validate boundaries, CRLF and non-BMP characters without splitting scalars.
|
||||
4. Expose overlay reads to compiler workers and dependency snapshots. Close releases the live overlay but does not invalidate references to immutable completed snapshots.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Reject impossible ranges and nonmonotonic changes; mark the document desynchronized until full replacement or reopen instead of guessing content. Do not fabricate a standard LSP request for resynchronization. Missing disk data and invalid encoding remain typed readiness failures.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Round-trip positions across ASCII, combining characters, astral code points, CRLF, empty final lines and mixed edits.
|
||||
2. Race edits/close with snapshot acquisition and prove every consumer sees a coherent revision.
|
||||
3. Test malformed ranges, stale notifications, URI aliases, reopen and full-text recovery; benchmark large-file edit/index updates.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `documents`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L documents --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Keep version/store changes behind the document interface. Invalidate derived caches on encoding/identity policy changes; never overwrite user buffers to repair state.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 04 — Workspace configuration and execution authority
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-007,R-008,R-021
|
||||
Dependencies: 02; feeds05,06,07,09 and debugger launch.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol: NEW include/vls/workspace/, src/workspace/, tests/workspace/. Root owns configuration and permission schema.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Workspace records declare roots, provider choice, selected tool identities and limits. Trust for VBS metadata evaluation is separate from compiler/plugin/wrapper execution. Repository files and compile metadata cannot grant their own authority. No remote listener or telemetry is enabled by default.
|
||||
|
||||
## Implementation sequence
|
||||
1. Define explicit CLI/user-runtime/workspace configuration precedence; security-sensitive grants come only from explicit user/launcher configuration, never repository-local booleans.
|
||||
2. Resolve configured tool executables to an identity containing canonical path and executable content/version information. Revalidate identity before a launch when mutable locations can change.
|
||||
3. Permit trusted metadata refresh/private IDE caches under the confirmed scope; expose explicit user commands for project generators and dependency builds.
|
||||
4. Publish actionable status for absent provider/tool, unsupported flags and revoked trust. Settings changes invalidate only the affected contexts and queued requests.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Reject arbitrary plugins and unapproved wrappers in v1. Recognized transparent wrappers may be unwrapped as data, never executed for discovery. A changed tool identity revokes reuse until approved configuration is refreshed. Process isolation is not advertised as a sandbox.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Use marker executables/plugins to prove passive opens and metadata reads execute nothing.
|
||||
2. Test flags nested inside response files, changed executable bytes, relative/wrapped compiler paths and workspace-supplied trust escalation.
|
||||
3. Exercise configuration precedence, multiple workspace roots, trust revocation while queued and explicit build-action cancellation.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `workspace`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L workspace --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Configuration migrations retain old user settings and reject unsupported security-sensitive values. Reverting a provider/tool selection cancels affected work and restores only verified prior identities.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 05 — Shared build contexts and profile/target selection
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-008,R-009,R-010,R-015
|
||||
Dependencies: 03,04; freeze model before parallel06/07 implementation.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra: NEW include/vls/build/model.hpp, src/build/model.cpp and model tests. Root serializes this shared model.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
BuildContext identifies provider/workspace, profile, target/alternative, language, semantic argv/cwd, toolchain/stdlib, environment identity, source mappings and readiness. AnalysisRevision joins document/context/generation/dependencies/backend. Unknown native metadata is represented explicitly, not as empty authoritative data.
|
||||
|
||||
## Implementation sequence
|
||||
1. Separate selected context from all available contexts. Follow VBS's editor selection unless overridden; retain persistent per-file target overrides and preserve alternatives.
|
||||
2. Normalize only understood typed arguments/path operands. Keep original command provenance and explain unsupported semantic operands rather than silently drop them.
|
||||
3. Associate headers with known owning translation units/include relationships; surface unresolved ownership. Do not merge incompatible macro/options sets to invent a header command.
|
||||
4. Bind active requests and index results to immutable context generations. Switching profile/target cancels or demotes obsolete work and never permits late publication as current.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Ambiguous contexts require a visible deterministic selection plus override, not merged flags. Invalidated overrides are reported and cleared only by explicit policy. Incomplete toolchain/generated metadata blocks authoritative analysis and rename.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Use one source/header under incompatible defines, debug/release and two targets; verify distinct identities and visible selection.
|
||||
2. Complete old-profile work after new-profile work and prove stale results cannot publish.
|
||||
3. Test removed targets, missing overrides, host build-description versus target contexts, header ownership and relevant environment changes.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `build-model`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L build-model --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Schema/backend identity changes rebuild derived state in a new generation. Preserve original provider records and last-good status for read-only diagnosis; never mark a stale generation current.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 06 — Native VBS tooling export and consumer
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-008,R-012,R-021,R-023
|
||||
Dependencies: 04,05; live acceptance additionally requires separately owned VBS graph/toolchain/editor/module producer work.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol consumer: NEW src/build/vbs/, include/vls/build/vbs/, tests/build/vbs/. Root owns shared export contract; VBS producer is a separate upstream task.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
NEW immutable tooling manifest and atomically published selection reference. Required sections: protocol/capabilities; workspace/build/profile/target/context identities; semantic command and environment; editable/snapshot/generated mappings; module/prerequisite graph; freshness/readiness; artifact lifetime. Configure a manifest locator explicitly until producer discovery is agreed.
|
||||
|
||||
## Implementation sequence
|
||||
1. Freeze the contract jointly with VBS's documented GraphGeneration/EditorGeneration/SelectionTicket semantics, distinguishing existing declarations from proposed resolved records.
|
||||
2. Build the consumer against valid/invalid fixtures, including source-command alternatives, host-description contexts and retained generated artifacts. Do not parse vbs_describe as a native provider.
|
||||
3. Observe publication hints, reread complete manifests and reconcile on overflow/restart. Retain generation/artifact references during analysis and define producer retention before eviction.
|
||||
4. Connect an explicitly trusted metadata-refresh operation only after upstream availability. Keep generator/package/fetch/lock changes outside automatic refresh. Add live Library/VBS acceptance once producer exists.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Unsupported major/required capability, broken selection reference, missing retained artifacts or incomplete projections produce explicit status. A last-valid export remains labeled stale. Watchers cannot steal editor selection; late generations cannot override newer selection tickets.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Test truncated publication, incompatible schema, dangling generations, restart and artifacts retained while an old consumer is active.
|
||||
2. Switch profiles with reverse completion, refresh an unselected profile and preserve all configured target alternatives.
|
||||
3. Prove passive reads run nothing; missing generated headers/BMIs remain unready; perform eventual live producer/consumer tests before claiming native support.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `vbs-provider`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L vbs-provider --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Keep prior complete manifests and selection provenance. Disable the consumer without deleting VBS-owned state; cross-repo producer changes require their own review and rollback contract.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 07 — Compilation-database compatibility provider
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-007,R-009,R-010
|
||||
Dependencies: 04,05; may implement in parallel with06 after shared model freeze.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol: NEW src/build/compdb/, include/vls/build/compdb/, tests/build/compdb/ and fixtures. No writes to database producer.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Read directory/file/arguments or command and optional output per the official schema. Prefer arguments, preserve multiple entries, resolve relative operands against directory, and retain original provenance. Compiler-specific response-file expansion is bounded and contributes content identity. No shell evaluation.
|
||||
|
||||
## Implementation sequence
|
||||
1. Parse complete JSON through bounded ingestion, validate known field types and preserve extra fields without pretending they are standard build metadata.
|
||||
2. Implement POSIX command tokenization for the Linux release and explicit driver selection; reject unsupported quoting/dialects rather than guess shell semantics.
|
||||
3. Normalize known driver flags, recursively expand response files with cycle/depth/byte limits, then classify execution-bearing options under04.
|
||||
4. Observe replacement/content changes, publish a complete new provider generation and retain the previous one as stale on errors. Provide explicit database/alternative selection.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Missing files, malformed JSON/commands, ambiguous driver dialect, unavailable response files and execution-bearing flags yield contextual errors. Native target/module/environment/readiness data absent from the schema stays unknown. Invalid explicit VBS selection does not silently switch to an unrelated database.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Cover paths/spaces/Unicode/quotes, arguments preference, command escapes, multiple entries, relative directories and optional output.
|
||||
2. Test nested/cyclic/changed response files and plugin/wrapper markers without any shell execution.
|
||||
3. Test atomic replacements, partial writes, file deletion and deterministic alternative selection with real CMake-exported fixtures.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `compdb`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L compdb --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Provider selection can return to the last verified database generation with stale status. Never rewrite a user-owned compile_commands.json or normalize it in place.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 08 — Semantic frontend feasibility, toolchain and license gate
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-010,R-012,R-013,R-016,R-026
|
||||
Dependencies: Corpus definition from24 and actual build contexts from05/07 or equivalent captured fixtures; initial shell is independent.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra compiler experiment; researcher verifies primary-source/version evidence; root owns candidate pins/decision. NEW experiments/frontend/ and tests/corpus/frontend/, no silent sibling/compiler edits.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Candidate Clang/P2996 revision562409c7942690d59ea470762515f88f24b16e23; GCC16.2 is the reference. Match actual GCC/libstdc++ source/flags, not just reflection examples using substituted libc++. Gate1 covers parsing, invalid-edit recovery and core IDE queries; Gate2 in17 separately covers debug feasibility.
|
||||
|
||||
## Implementation sequence
|
||||
1. Capture reproducible representative VoidLibrary/VBS contexts and standalone fixtures for reflection, constexpr-range expansion, templates, modules and standard-library use. Record toolchain/header identities.
|
||||
2. Build the exact candidate in an isolated explicit experiment directory under a scoped future task. Record LLVM/libstdc++/libc++ requirements and cost; do not add it to the bootstrap build.
|
||||
3. Run the real enum helper and wider corpus without hiding unsupported features, swapping the standard library silently or editing project code to obtain a pass. Compare semantic expectations against GCC.
|
||||
4. Exercise broken ^^/splices/templates, unsaved imports, completion/hover/navigation/references and editable origins. Report feature/version matrix, latency/memory, maintenance burden and dependency license facts.
|
||||
|
||||
## Failure behavior and constraints
|
||||
The pinned documentation explicitly excludes constexpr-range expansion used by VoidLibrary; treat that as likely failure requiring proof, not a small assumed workaround. Missing required semantics rejects this sole-engine candidate. Compiler repairs, GCC integration or mixed backends require a new explicit decision and task scope.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Compile/analyze exact source fixtures with reference GCC and candidate, retaining diagnostic/AST/query evidence and unsupported-feature classification.
|
||||
2. Verify meaningful IDE queries and recovery on malformed edits rather than equate successful compilation with tooling readiness.
|
||||
3. Reproduce crashes/resource limits; document untested proposals and reject silent semantic/library substitutions.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `frontend-gate`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L frontend-gate --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
No production frontend pin changes until gate review. Keep candidate artifacts/provenance for diagnosis without linking them into the shell; retain backend-neutral interfaces and an explicit failed-gate decision.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 09 — Semantic worker protocol and compiler integration
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-007,R-010,R-013,R-014,R-021
|
||||
Dependencies: 03,04,05 and successful08; shared worker protocol frozen before10-16.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra: NEW include/vls/semantic/, src/semantic/, tests/semantic/. Root owns versioned IPC/common DTOs; bounded subprocess infrastructure may be a separate Sol task.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
SemanticRequest/Result carry operation/capability, full AnalysisRevision, immutable overlays, context and cancellation identity. Typed outcomes distinguish unsupported, unready, cancelled, stale, compiler failure and valid empty results. AST/Sema objects and pointers never cross worker boundaries.
|
||||
|
||||
## Implementation sequence
|
||||
1. Implement supervisor/worker handshake with protocol/backend/capability identities and bounded messages. Use Void System/IPC only after checking their actual lifecycle/framing guarantees.
|
||||
2. Construct compiler invocations from approved normalized contexts; adapt exact overlays and generated views without mutating source. Apply tool execution policy before frontend dispatch.
|
||||
3. Implement semantic operations through the compiler's real APIs; retain source provenance and instantiate required context lazily. Avoid treating batch LibTooling alone as a complete editor engine.
|
||||
4. Recover crashed/timed-out workers, cancel obsolete requests and cap retained compiler states. Publish only matching revisions through10; use small deterministic fixtures before project-scale workloads.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Compiler crash cannot kill the session process. A worker protocol mismatch or malformed result is rejected. Cancellation kills/reaps owned processes when cooperative cancellation fails. Do not count stale/partial results as authoritative or cache failures as successful analysis.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Inject worker crash, malformed reply, version mismatch, cancellation and delayed reply; verify server survives and no stale result is published.
|
||||
2. Verify overlay-vs-disk behavior, changed dependency identity, tool policy enforcement and genuine source locations.
|
||||
3. Stress repeated open/edit/close and worker recycling; measure memory reclamation and foreground scheduling behavior.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `semantic`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L semantic --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Revert backend/protocol versions as a unit and invalidate incompatible caches. Preserve last-good read-only status where meaningful; never deserialize compiler state across incompatible versions.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 10 — Scheduling, cancellation and resource budgets
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-011,R-021
|
||||
Dependencies: 03,05,09; coordinates11,15 and18 without sharing mutable compiler state.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra for admission/revision logic; Sol for bounded queue/metrics helpers. NEW include/vls/scheduler/, src/scheduler/, tests/scheduler/; root owns shared priorities/limits.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Foreground requests outrank background indexing and artifact preparation. Every task has a revision, cancellation token, resource estimate and publication predicate. Debug admission is separate from semantic worker capacity. User-configurable budgets are validated, observable and never interpreted as permission to exhaust the host.
|
||||
|
||||
## Implementation sequence
|
||||
1. Reuse verified Void Async/Time primitives for queues, cancellation and monotonic clocks; inspect actual backpressure/join behavior rather than infer it from class names.
|
||||
2. Coalesce superseded document work, reserve foreground capacity, avoid priority inversion on module dependencies and limit concurrent compiler states. Make queued cancellation cheap and running cancellation bounded.
|
||||
3. Track worker lifetime, memory, CPU, wall time and aggregate admission. Include deliberate pauses in memory accounting while excluding them from running watchdogs. Monitor and reap all owned descendants.
|
||||
4. Expose local metrics for cold/warm latency, queue delay, cancellation, cache misses and resource failures. Record the benchmark host and workload; do not turn measurements into unverified guarantees.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Failed admission returns a useful resource/readiness status without blocking protocol handling. Watchdogs distinguish an intentional debug stop from a stuck running process. Failed/cancelled task results cannot satisfy cache/publication promises. Cleanup must handle a process-group leader exiting before descendants.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Saturate background indexing and module builds while issuing foreground queries; measure p95 with and without an admitted paused debug session.
|
||||
2. Race edit/context cancellation with completion/publication and assert exactly one terminal result per request.
|
||||
3. Inject a zero-CPU stall, memory excess, lost child and disconnect; verify deadline enforcement, process reaping and bounded queue/memory growth.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `scheduler`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L scheduler --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Restore prior scheduling policy behind the same revision contract; drain/cancel obsolete queues. Keep resource-limit diagnostics/evidence instead of silently increasing limits after failures.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 11 — Named modules, partitions, header units and artifact ownership
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-008,R-010,R-012,R-021
|
||||
Dependencies: 05,06/07,08,09,10; generated prerequisites depend on VBS availability.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra: NEW include/vls/modules/, src/modules/, tests/modules/. Root serializes module graph schema; no writes to VBS-produced artifacts.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
ModuleGraph contains provider/import edges, unit kind, owning compile context, source/generated identity and scan provenance. Artifact keys include exact frontend/toolchain/stdlib, flags/macros, transitive content, backend version and relevant physical paths. Private IDE BMIs/PCHs are never assumed binary-compatible with project artifacts.
|
||||
|
||||
## Implementation sequence
|
||||
1. Use the accepted compiler's dependency scanner/semantic APIs, with native VBS topology as additional context. Model primary interfaces, implementation units, exported/internal partitions and explicit header units.
|
||||
2. Order generated inputs and module prerequisites before analysis. Missing generators remain unready until an explicit build action; private compiler cache generation follows approved metadata/tool authority.
|
||||
3. Construct overlay-aware dependency snapshots and invalidate transitively when an unsaved interface/header/context changes, including new providers and previously absent/shadowing includes.
|
||||
4. Publish complete artifacts atomically into private cache generations, retain readers' referenced artifacts and enforce cycle/duplicate-provider diagnosis. Test imported std modules only for a proven exact toolchain configuration.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Report missing, cyclic or ambiguous providers and incompatible artifacts explicitly. A filename/mtime or compiler-family label does not establish validity. Do not load GCC CMI into Clang or relocate opaque path-sensitive artifacts on faith. Cancellation withholds publication.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Cover interfaces, implementations, both partition kinds, header units, private/global fragments and import visibility with positive/negative semantic queries.
|
||||
2. Edit an imported unsaved module, delete/add providers, switch macros/toolchains and verify importer invalidation and current diagnostics.
|
||||
3. Test missing generated source/header, duplicate/cyclic providers, corrupt cache, reverse completion and eviction while old readers remain active.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `modules`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L modules --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Quarantine incompatible cache generations and rebuild without altering project-produced artifacts. Preserve known source/module graph diagnostics; never fall back to regex-derived authoritative semantics.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 12 — Reflection, meta values and generated-source provenance
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-010,R-013,R-014,R-015,R-016
|
||||
Dependencies: 08,09,11 for module-crossing cases; shared SymbolIdentity with15/16 and events with17.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra: NEW include/vls/reflection/, src/reflection/, tests/reflection/. Root owns provenance/value DTO schemas.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Represent real compiler reflection values/entities, splices and expansions with type information and SourceOrigin chains. Distinguish editable spelling, expansion/splice site, original reflected declaration and synthesized entity. Virtual generated views are read-only semantic explanations and may not be compilable text.
|
||||
|
||||
## Implementation sequence
|
||||
1. Maintain a proposal/version capability matrix for the accepted backend, covering P2996 and associated expansion/static-data/annotation facilities actually used by Void projects.
|
||||
2. Extract reflected entities and generated members from compiler state, preserving context/instantiation identity rather than inventing symbols from source strings.
|
||||
3. Implement hover/completion/navigation adapters and virtual-source rendering with source links. Bound value expansion depth and represent cycles, unavailable or opaque values honestly.
|
||||
4. Provide the same provenance/value representation to indexing, rename and debugging. Generated names with no reliable editable origin remain navigable but not automatically renameable.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Unsupported proposals or compiler limitations produce capability errors, not downgraded lexical answers. Avoid replacing compiler-dependent std::meta facilities with guessed host evaluation. Instantiated/generated source locations may be incomplete; preserve the chain and explicitly indicate gaps.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Use real Void enum helpers, generated data members, dependent splices, expansion statements and template/module combinations.
|
||||
2. Verify reflected values, original declaration links, synthesized members and invalid-code recovery across edits.
|
||||
3. Exercise ambiguous/generated name rename rejection, value cycles/size limits, serialization round trips and stable entity identities within a snapshot.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `reflection`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L reflection --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Version the provenance/value schema and invalidate derived index/trace renderers on incompatible changes. Retain source snapshots and mark older unsupported renderings rather than fabricate origins.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 13 — Diagnostics, freshness and incomplete-edit recovery
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-004,R-006,R-014,R-021
|
||||
Dependencies: 03,05,09,10;11/12 for module/reflection cases.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol for LSP mapping and tests, Astra for compiler recovery fixes within approved backend scope. NEW src/features/diagnostics/, tests/diagnostics/.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Diagnostic batches carry full AnalysisRevision, severity/code/message, source range, related locations and readiness context. Compiler diagnostics remain distinguishable from stale/missing-build-input status. Only current batches may replace current document diagnostics.
|
||||
|
||||
## Implementation sequence
|
||||
1. Map compiler ranges and related locations through immutable source/encoding maps. Preserve include/import and reflection-origin chains where available.
|
||||
2. Debounce edits without starving foreground diagnostics; cancel superseded work and publish complete current batches. Clear obsolete diagnostics on close/context removal according to client lifecycle.
|
||||
3. Handle syntax errors around templates, splices, expansions and imports using actual backend recovery. Separate compiler crash from ordinary source errors.
|
||||
4. Expose stale-build/generated-input status without pretending old diagnostics describe new text. Keep fix-its internal until the later code-action scope has its own safety contract.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Never publish a prior revision over a newer result or label a compiler crash as successful empty diagnostics. Invalid ranges are rejected or explicitly degraded; do not clamp them into unrelated source. Missing generated inputs remain a readiness issue with an explicit build action.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Rapidly introduce and repair malformed reflection/templates/imports; verify useful current diagnostics and server survival.
|
||||
2. Race old/new contexts, document closure and worker crashes; verify clearing/publication rules.
|
||||
3. Test macro/Unicode/generated ranges, related locations across files, duplicate diagnostic suppression and absent generated prerequisites.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `diagnostics`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L diagnostics --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Switch diagnostic adapter/backend only with revision/capability invalidation. Preserve status/errors needed to explain a failed backend; do not hide failures by suppressing all diagnostics.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 14 — Completion, signatures and hover
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-011,R-013,R-014
|
||||
Dependencies: 03,05,09,10,12;15 supplies workspace candidates after its contract freezes.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol feature adapters; Astra handles compiler-semantic blockers. NEW src/features/completion/, src/features/hover/, tests/completion/, tests/hover/.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Completion queries use a position within one immutable document/context and return compiler-proven candidates with replacement ranges, type/signature and provenance. Hover reflects the selected semantic entity/type/value. Workspace index suggestions must be validated against visibility/context rather than treated as binding authority.
|
||||
|
||||
## Implementation sequence
|
||||
1. Support compiler-native recovery/completion at incomplete expressions, scopes, templates, imports and reflection/splice sites. Preserve the client request position encoding.
|
||||
2. Rank and filter candidates by semantic accessibility, active context, locality and deterministic relevance. Avoid a keyword-only substitute for reflection-generated members.
|
||||
3. Implement documentation/signature/value rendering and deferred completion detail resolution tied to the original candidate identity; bound content and escape editor rendering.
|
||||
4. Measure warm/cold operations on the real corpus, retain warmed compiler state under10's budget, and keep auto-import edits outside initial scope unless separately contracted.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Cancelled/stale resolution returns a typed cancelled/stale result rather than details for a different entity. Backend-incomplete states remain visible. Never expose inaccessible module symbols merely because the index contains them.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Cover member/scope/template completion, dependent/invalid expressions, reflected/generated members and imported visibility.
|
||||
2. Validate Unicode replacement ranges, stable resolution identities, overload/signature hover and bounded huge values/docs.
|
||||
3. Benchmark warm completion p95 near100ms and hover responsiveness with concurrent background/index/debug work; record hardware and misses.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `completion-hover`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L completion-hover --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Disable optional ranking/detail features while preserving correct compiler candidates. Cache format/identity changes invalidate entries; no stale hover/candidate references survive backend replacement.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 15 — Context-aware symbol index and persistent generations
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-008,R-014,R-015,R-021
|
||||
Dependencies: 03,05,09,10,12; coordinates16 coverage and11 dependency edges.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra schema/publication design, Sol bounded storage/query packages. NEW include/vls/index/, src/index/, tests/index/. Root owns migrations/schema.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Persist symbol identities, declarations/references, context membership, dependency edges, source content identity and provenance. Index generations record backend/schema versions and completeness domains. Valid empty query results differ from incomplete coverage. Use Void::Sqlite only after verifying transactional behavior and dependency packaging.
|
||||
|
||||
## Implementation sequence
|
||||
1. Ingest compiler-produced symbol/reference records for explicit contexts. Separate unsaved document overlay records from committed disk generations and reconcile on save/close.
|
||||
2. Build incremental dependency invalidation for edits, added/deleted/renamed sources, include shadowing, provider/context removal and module graph changes.
|
||||
3. Publish completed batches transactionally, with crash recovery and bounded readers. Never hold a global storage transaction across compiler execution.
|
||||
4. Implement workspace symbol/reference queries, context filtering and completeness reporting. Rebuild incompatible versions into a new generation; account for disk quotas without evicting active readers' data.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Corrupt/incompatible storage triggers quarantine/rebuild with visible status. Cancelled or partial indexing never marks coverage complete. A last-good index may support degraded navigation but cannot authorize rename when its coverage is unknown.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Compare incremental results with clean rebuilds after edits, deletions, context switches and restored-mtime changes.
|
||||
2. Crash during ingestion/publication and validate recovery, reader lifetime and schema/backend rejection.
|
||||
3. Test same spellings/different bindings, unsaved overlays, generated provenance, completeness queries and disk quota handling.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `index`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L index --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Retain previous complete generations during migration, never rewrite incompatible bytes in place. Reverting storage/backend versions may require rebuilding rather than loading older assumptions.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 16 — Navigation, references and guarded rename
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-013,R-014,R-015,R-020
|
||||
Dependencies: 03,05,09,12,15; guarded application requires22/23 client contracts.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra for rename coverage/transaction contract, Sol for bounded navigation adapters. NEW src/features/navigation/, src/features/rename/, tests/navigation/, tests/rename/.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Navigation resolves semantic identity within the selected context and may expose clearly labeled generated origins. Rename covers all declared workspace roots and affected provider-exported contexts, including inactive profiles/targets; it does not promise unknown external-consumer coverage. Only reliable editable origins may receive edits.
|
||||
|
||||
## Implementation sequence
|
||||
1. Implement declaration/definition and reference queries through compiler identities plus index completeness. Preserve overload/module/context distinctions and generated/source origin navigation.
|
||||
2. For rename, compute affected bindings/contexts, analyze missing coverage on demand and check conflicts, visibility and spelling changes. Reject incomplete/stale context or synthesized names without deterministic editable spelling.
|
||||
3. Have supported clients materialize affected closed files as editor buffers, synchronize the complete version vector, then recompute edits. Preserve document versions/content preconditions in the final transaction.
|
||||
4. Apply only through tested transactional BUFFER behavior and recheck preconditions at application. Refuse multi-file rename where the client cannot guarantee this; file saving remains an editor operation.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Do not return an apparently complete reference set when coverage is unknown. Conflicting bindings across contexts, macro ambiguity, generated-string names or external read-only targets reject unsafe edits. Late edits invalidate the transaction; no unversioned closed-file fallback or filesystem-atomic claim.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Navigate overloaded/template/module/reflection symbols across Library/VBS boundaries and distinguish genuinely empty from incomplete references.
|
||||
2. Use shared headers with conflicting profile bindings, incomplete index, generated names and readonly origins; verify explicit refusal.
|
||||
3. Race edits between preparation/response/apply, inject buffer-transaction failure and verify no partial edits in both Neovim and VS Code integrations.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `navigation-rename`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L navigation-rename --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Invalidate outstanding rename transactions whenever source/context/backend changes. Disable rename independently of navigation if client transaction guarantees regress; never undo unrelated user edits during rollback.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 17 — Compiler instrumentation and debugger feasibility gate
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-010,R-013,R-016,R-017,R-018
|
||||
Dependencies: Successful08;09/12 DTOs and source provenance; define Gate2 fixture before18-21.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra, tightly coupled compiler work. NEW experiments/debugger/, compiler-patches/ and debug instrumentation tests only under a later explicit scoped assignment. Root owns patch provenance/backend pin.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
EvaluationEvent carries ordered sequence, causal/instantiation parent, kind, source origin and typed event-time values. Capture template instantiation, constraint outcomes, constexpr/consteval calls/evaluation, reflection queries, splices and expansions. Instrument the evaluator actually used by the pinned fork; do not assume newer upstream bytecode support.
|
||||
|
||||
## Implementation sequence
|
||||
1. Map real pinned compiler entry/exit, evaluation and Sema re-entry paths. Distinguish stable callbacks from required instrumentation patches and obtain scope approval for compiler changes before implementing them.
|
||||
2. Build a mixed fixture that crosses template substitution, failed constraints, nested constant evaluation, reflection and generated entities. Define expected source/event/value observations independently of emitted logs.
|
||||
3. Prototype event-time capture and cooperative stop/control points with bounded serialization. Snapshot mutable values or deterministic deltas at the event; persisting final state or raw pointers is insufficient.
|
||||
4. Prove live pause/step/resume and trace replay consistency, including cancellation/error unwinding. Record instrumentation overhead, capability gaps and maintenance burden as the Gate2 verdict.
|
||||
|
||||
## Failure behavior and constraints
|
||||
A source compiler build or template trace alone is not Gate2 success. Missing evaluator/constraint visibility, corrupt state on pause, unreliable origins or inaccessible historical values block dependent debugger milestones. Source incompatibility from08 is not repaired implicitly by this experiment.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Assert nested evaluator/Sema event ordering and values for successful/failed constraints, dependent splices and template instantiations.
|
||||
2. Pause/step/cancel at supported boundaries; compare uninstrumented/instrumented semantic results and ensure normal editing remains viable.
|
||||
3. Replay captured prefixes after source changes, test truncation/worker crash and reject any fabricated missing state.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `debug-instrumentation`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L debug-instrumentation --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Keep compiler patches versioned against the exact upstream revision with reproducible application/removal. A failed gate leaves the ordinary server/backend intact and requires a reviewed alternative plan.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 18 — Live metaprogram debugger state and control
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-016,R-017,R-019,R-021
|
||||
Dependencies: 09,10,12, successful17; shared sessions with19-21.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra: NEW include/vls/debug/session/, src/debug/session/, tests/debug/session/. Root owns state-machine/control DTOs.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Launch binds a frozen translation-unit/context snapshot and selected real evaluation/source/instantiation. States preparing/running/stopped/completed/failed/cancelled/expired are explicit. DAP alone controls execution; custom queries are read-only. Inspection handles include session/snapshot/stop generation and expire on movement.
|
||||
|
||||
## Implementation sequence
|
||||
1. Validate launch/context completeness, admit one live compiler session per server instance and establish memory/process enforcement before execution. Missing explicit template arguments are not guessed.
|
||||
2. Implement source/event breakpoints, pause/continue and step-in/over/out at documented supported boundaries, with logical frames/scopes/typed values mapped to source snapshots.
|
||||
3. On source edits mark session outdated; require restart to adopt changes. Serialize control actions and bind asynchronous inspections to the current stop generation.
|
||||
4. Enforce2GiB worker/3GiB aggregate debug memory,60s running CPU,120s running wall watchdog,30min paused idle and5s disconnect cleanup. Limits are configurable; count paused memory and reap descendants.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Reject launch when enforcement or source/context prerequisites are absent. Timeout/resource excess/cancellation preserves only committed trace data with explicit status. An intentional stop is not a stuck-worker timeout. Read-only inspection excludes arbitrary state-changing evaluation/set-variable; live reverse execution is not claimed.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Exercise breakpoints and all stepping modes through nested template/constexpr/reflection calls, plus pending breakpoint resolution and failed constraints.
|
||||
2. Continue while old variable queries are in flight and reject stale handles/replies; edit source and verify frozen-session behavior.
|
||||
3. Test paused-session saturation, RSS/CPU/wall limits, zero-CPU hangs, disconnect/leader-exit descendants and foreground LSP latency during debug.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `live-debug`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L live-debug --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Cancel/reap sessions before backend/control protocol changes. Do not silently resume a paused target or reuse stale handles. Preserve recoverable trace prefixes separately from live compiler state.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 19 — Trace persistence, event-time state and replay
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-016,R-018,R-019,R-021
|
||||
Dependencies: 12,17,18; bounded storage primitives from15 may be reused after their guarantees are checked.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Astra schema/state-capture design, Sol bounded storage/query implementation. NEW include/vls/debug/trace/, src/debug/trace/, tests/debug/trace/. Root serializes schema/migrations.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
TraceManifest binds schema/backend/compiler, source/context identities, captured-source manifest, ordered event/value records and terminal status. Records reference stable session-local IDs, never compiler addresses. Replay cursor movement creates a new inspection generation. Replay performs no target re-execution or state mutation.
|
||||
|
||||
## Implementation sequence
|
||||
1. Persist event-time value snapshots or validated deltas with explicit parent dependencies, type descriptions and source origins. Bound recursive value expansion and represent cycles/opaque/unavailable state.
|
||||
2. Write append-only committed chunks with integrity checks and recoverable boundaries; publish completion only after all required records are durable. Distinguish completed, failed, cancelled, expired and truncated.
|
||||
3. Implement cursor stepping/seeking and historical frame/value reconstruction independently of a live compiler. Keep enough captured source to render a trace after project files change.
|
||||
4. Enforce256MiB/1M-event per-session limits plus memory/queue budgets. Default traces remain local/private; explicit export carries provenance and source disclosure, never automatic upload.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Reject incompatible/corrupt schemas and missing delta ancestry rather than invent historical values. Recover only a verified committed prefix after crash. Limit termination visibly marks truncation; no completion marker on partially written output. User-exported traces are not silently evicted as cache.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Compare live stop observations to replay at matching events, including nested constraints/reflection and cyclic values.
|
||||
2. Change/delete original source, restart without compiler availability and inspect captured replay correctly.
|
||||
3. Truncate/corrupt chunks, exceed limits, cancel mid-write and test cursor generation/stale handle rejection with deterministic fixtures.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `trace-replay`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L trace-replay --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Preserve old trace formats read-only or give a clear incompatibility result. Migrations write a separate output and retain the original; never reinterpret incompatible event IDs in place.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 20 — Debug Adapter Protocol service
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-017,R-018,R-019,R-020
|
||||
Dependencies: 18,19; shared session service with21 and client integrations22/23.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol protocol adapter: NEW include/vls/debug/dap/, src/debug/dap/, tests/debug/dap/. Astra reviews control-state boundary.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
C++ DAP adapter maps one identified client to the shared debug session service over private bounded IPC. Support initialize/launch/configuration/breakpoints, threads/stack/scopes/variables, continue/next/stepIn/stepOut/pause, disconnect and source retrieval where implemented. Advertise only implemented DAP capabilities and mode-specific operations.
|
||||
|
||||
## Implementation sequence
|
||||
1. Implement DAP framing/envelopes separately from LSP's JSON-RPC semantics; reuse safe byte/JSON primitives but preserve DAP seq/request_seq/event contracts.
|
||||
2. Map control to the session state machine, serialize conflicting requests and deliver required stopped/continued/terminated/progress events. Attach every response/handle to correct session/stop generation.
|
||||
3. Expose logical evaluator frames and captured source references; map replay actions to cursor movement, never to unimplemented live reverse execution.
|
||||
4. Negotiate the versioned read-only custom inspection requests for21. Bind adapter/service channels to inherited descriptors or explicitly verified private local connections; no public TCP endpoint.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Invalid state, stale handle, unsupported operation or expired session returns a DAP error rather than deadlock. Cancellation must still terminate the original request appropriately. Disconnect cleanup remains effective after client crash and partial protocol input.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Replay protocol transcripts covering full live and recorded sessions, malformed frames, out-of-order requests and capability negotiation.
|
||||
2. Verify request correlation, event ordering, stale references and cancellation/progress terminal behavior.
|
||||
3. Drive actual Neovim/VS Code adapters; test disconnect during running/stopped/replaying states with process cleanup evidence.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `dap`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L dap --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Version adapters and service protocol together; refuse incompatible clients explicitly. A DAP failure must not corrupt LSP sessions or trace storage; restart only the affected debug connection.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 21 — Shared custom inspection API and view models
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-013,R-016,R-018,R-019,R-020
|
||||
Dependencies: 12,18,19,20; contract frozen before independent22/23 view implementations.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol: NEW include/vls/debug/inspection/, src/debug/inspection/, tests/debug/inspection/. Root owns versioned response schemas consumed by both clients.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
NEW read-only custom DAP requests expose event timeline, template/constraint tree, reflection entities and generated-source views. All requests include session and stop/replay generation; responses are bounded/paged and carry the same identity. DAP remains the sole execution-control authority.
|
||||
|
||||
## Implementation sequence
|
||||
1. Define stable view DTOs with source links, event/type/entity IDs, child pagination and explicit incomplete/unavailable states. Avoid exposing raw AST structures as a public schema.
|
||||
2. Project live captured state and saved replay through the same query service, preserving the difference between source snapshot and current editor contents.
|
||||
3. Implement lazy expansion, deterministic ordering, pagination/cancellation and bounded content rendering. Generated-source views include origin chains and remain read-only.
|
||||
4. Define command bindings for clients to select an event/entity and navigate to source through standard controls, without creating a second independent debugger state machine.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Stale responses are rejected after continue/step/seek even if source bytes have not changed. Missing values, truncated trees or unsupported entity forms remain visible. Paging tokens are session/generation-bound; client text is escaped before HTML/editor rendering.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Compare identical live/replay view queries and verify stable origins/values at matched positions.
|
||||
2. Race inspection/paging against continue, replay seek, termination and backend restart; ensure obsolete content cannot replace current views.
|
||||
3. Test huge graphs, cycles, hostile display strings, incomplete traces and client cancellation within memory/latency limits.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `inspection`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L inspection --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Keep old schema versions only through explicit adapters; incompatible clients receive clear errors. Disable custom inspection without disabling standard DAP control or altering trace data.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 22 — VS Code client, DAP integration and custom views
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-015,R-019,R-020
|
||||
Dependencies: 02 for basic launch;16 and18-21 for full acceptance. May parallel23 after shared schemas freeze.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol client package: NEW clients/vscode/ with TypeScript tests and package metadata. Root serializes shared schemas/dependency-lock decisions.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Thin extension launches the C++ LSP/DAP executables, maps settings and provides timeline, template/constraint and entity/generated-source views. It does not implement compiler semantics. Guarded rename requires synchronized versioned buffers and verified transactional application. No production/debug server auto-download without explicit installation policy.
|
||||
|
||||
## Implementation sequence
|
||||
1. Use supported VS Code language/debug APIs and pinned dependencies after current official-documentation verification. Make server path/version and workspace status visible; respect configured trust/execution boundaries.
|
||||
2. Implement DAP launch and shared-session attachment plus read-only webviews driven by21. Use bounded messages and content security restrictions; preserve source/stop generation in all async updates.
|
||||
3. Provide guarded rename integration: open affected documents, synchronize/recompute, validate version/content vector and apply only if the API's transaction guarantees are verified. Refuse unsafe multi-file edits.
|
||||
4. Document install/setup, profile/target override, explicit generated-input build action, live-debug start, trace replay and stale/failed states. Ordinary LSP remains useful if debug capability is unavailable.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Missing/wrong server, rejected trust, unsupported backend or expired trace yields actionable status. Views cannot show stale data after a session switch. Do not bypass safety through a separate unguarded rename command or silently install compiler toolchains.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Run extension-host tests with the actual server for launch, edits, completion/navigation, context switches and controlled failures.
|
||||
2. Test guarded multi-file rename with concurrent changes and induced application failure; require no partial buffer mutation.
|
||||
3. Exercise live and replay debugging, custom views, source navigation, cancellation/disconnect and no-debug-backend states.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `client-vscode`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L client-vscode --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Keep extension/server compatibility ranges explicit. Disable incompatible commands/views while preserving basic launch; do not overwrite user settings or uninstall unrelated extensions during rollback.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 23 — Neovim LSP/DAP integration and inspection buffers
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-015,R-019,R-020
|
||||
Dependencies: 02 for basic launch;16,18-21 for full acceptance. May parallel22 after schema freeze.
|
||||
|
||||
## Ownership and boundaries
|
||||
Proposed Sol: NEW clients/neovim/ Lua module, help docs and headless fixtures. Root owns protocol/schema versions; no user Neovim config edits.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Use standard Neovim LSP and DAP integration with thin Lua glue. Provide commands/keymap examples and read-only split-buffer timeline/tree/entity views. Shared service supplies all compiler/debug data. Native editing/rename guarantees must be tested rather than assumed from generic LSP helpers.
|
||||
|
||||
## Implementation sequence
|
||||
1. Verify current Neovim and chosen DAP client APIs, pin/test a supported version range and expose explicit executable/settings configuration. Do not mutate the user's installed configuration.
|
||||
2. Implement session-aware read-only views with paging, source jumps and deterministic selection. Bind updates to debug position generation and close views safely on session termination.
|
||||
3. Implement guarded rename by materializing affected buffers, synchronizing/recomputing, checking versions/content and using a tested buffer transaction. If Neovim helpers cannot guarantee it, implement and test the guard or reject the operation.
|
||||
4. Document startup, profile/target selection, explicit build prerequisites, live breakpoints/stepping, replay navigation and recovery. Keep optional keybindings opt-in.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Buffer unloads, modified source, outdated callbacks and DAP disconnect cannot leave editable stale generated text or apply partial renames. Missing plugin/API support reports a compatibility error. Terminal/rendered strings cannot execute editor commands.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Use headless Neovim fixtures for initialization, incremental edits, Unicode positions, context selection and asynchronous callback invalidation.
|
||||
2. Test multi-buffer rename rollback/preconditions under concurrent edits, buffer unloads and autocmd-induced failure; reject unsupported transaction paths.
|
||||
3. Run live/replay DAP and custom-view journeys, including paging, source navigation, cancellation and disconnect cleanup.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `client-neovim`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L client-neovim --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Module setup must be reversible without replacing user config. Restore only module-owned buffers/autocmds/keymaps; never undo independent user edits or remove unrelated plugins.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 24 — Conformance corpus, robustness and performance evidence
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-003,R-005,R-010,R-011,R-012,R-013,R-015,R-021
|
||||
Dependencies: Starts with01/02 and supplies fixtures for08/17; later suites bind each implemented subsystem.
|
||||
|
||||
## Ownership and boundaries
|
||||
Root owns acceptance matrix/baselines; Sol owns bounded harnesses, Astra reviewer audits adversarial cases. NEW tests/corpus/, tests/integration/, benchmarks/ under later exact assignments.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Each case records source/provenance, context/toolchain, expected semantic/control observations and required capabilities. Distinguish compiler-validity references from IDE/debugger assertions. Test counts, exit codes, cold/warm state and hardware are part of evidence; no-test and skipped-required-suite outcomes are failures.
|
||||
|
||||
## Implementation sequence
|
||||
1. Establish synthetic fixtures plus permission-compatible pinned Library/VBS corpus slices. Avoid importing secrets or whole dirty checkouts; record exact relevant source identities.
|
||||
2. Build layered tests: unit/property-style boundary checks, actual subprocess protocols, compiler/worker fault injection, provider/module/index integration, and real editor journeys.
|
||||
3. Add appropriate ASan/UBSan and targeted race/resource tests under supported toolchains. Fuzz bounded framing/JSON/trace readers using an explicit future harness and reproducible seeds.
|
||||
4. Measure warm completion~100ms and navigation~50ms p95 with declared warmup/sample counts, cold index cost, peak memory and competing background/debug workloads. Report distributions/failures rather than one best sample.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Separate environment/dependency failures from application defects. Keep failing regression fixtures; do not weaken assertions to meet a date. A new compiler/stdlib/proposal implementation invalidates affected baselines until retested.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Require a traceable requirement-to-case matrix and execute gate-specific suites on exact revisions.
|
||||
2. Include malformed protocols, invalid Unicode, context races, unsaved modules, generated names, failed constraints, partial traces and process cleanup.
|
||||
3. Compare incremental behavior with clean analysis and show performance/resource measurements under representative concurrent loads.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `conformance`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L conformance --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Keep prior benchmark manifests and corpus expectations for comparison. Revise expectations only with a reviewed semantic requirement change; retain reproductions for resolved defects.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 25 — Packaging, CI and release gates
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-004,R-005,R-024,R-026
|
||||
Dependencies: 01 for bootstrap packaging;08 license/backend decision and24 evidence for releases; native packaging integrates26.
|
||||
|
||||
## Ownership and boundaries
|
||||
Root owns release/pin/license policy; Sol can own NEW packaging/, CI configuration and install tests under a scoped task. No remote CI/hosting changes implicit.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Local Linux packages identify server/backend/toolchain versions and dependency provenance. Bootstrap installation does not claim full product readiness. Project license and bundled dependency notices must be resolved before distribution. No release publication, tag, push or deployment follows from a review verdict.
|
||||
|
||||
## Implementation sequence
|
||||
1. Define supported Linux/compiler/runtime matrix from observed builds; avoid assuming the user's dev wrapper exists on a generic CI runner. Pin explicit runner/toolchain prerequisites.
|
||||
2. Implement configure/build/test/install smoke jobs and artifact provenance manifests. Verify installed executable dependencies/paths and separation of writable caches from immutable package contents.
|
||||
3. Add compiler/backend/client version compatibility gates and required conformance/performance evidence. Keep full toolchain packaging separate from the small bootstrap until approved feasibility.
|
||||
4. Document release, rollback and local cache/trace schema migration. If Nix packaging is later requested, modify only source modules under an explicit task and use Git-aware safe sources, never whole dirty repositories.
|
||||
|
||||
## Failure behavior and constraints
|
||||
An unavailable runner or private dependency is a blocked prerequisite, not a passing CI run. No wildcard staging, publishing credentials in artifacts or automatic remote release. Missing licensing blocks distribution while local development may continue.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Install into a temporary prefix and launch help/version/protocol from outside the build tree.
|
||||
2. Capture the exact source identities used by a release build and validate artifact/library paths, cache permissions and notices. Development follows VoidLibrary main per D-021; do not silently replace that policy with a commit pin.
|
||||
3. Exercise incompatible client/backend upgrades, cache schema rollback and CI failure propagation with actual runner evidence.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `packaging`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L packaging --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Retain the previous installable package and immutable provenance. Keep writable caches/traces separately versioned; rollback cannot delete user data or imply backward-compatible trace parsing without tests.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 26 — Native VBS build and staged Void adoption
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-008,R-010,R-014,R-020,R-022,R-023
|
||||
Dependencies: VBS native executor/toolchain/package/testing readiness;06 live producer,08 semantic gate and core IDE/debug milestones for full replacement.
|
||||
|
||||
## Ownership and boundaries
|
||||
Future joint work: root coordinates repository boundaries; Sol VLS build descriptions/adoption harnesses, Astra coupled native-tooling issues. NEW build.cpp/build profiles and tests/adoption/ only after scope approval.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
CMake is the initial seed; native VBS becomes the primary build path after verified readiness. VLS runtime consumes a resolved tooling contract independently of how VLS itself was built. Initial adoption corpus is VoidLibrary plus VBS; all remaining Void projects require explicit inventory and evidence.
|
||||
|
||||
## Implementation sequence
|
||||
1. Map the actual built VLS target/module/test closure into ordinary VBS C++ descriptions after its executor/SDK stabilizes. Keep host compiler and analyzed target toolchain identities distinct.
|
||||
2. Build/test/install VLS natively in a clean output tree using verified dependencies. Do not count reused CMake artifacts as native self-build success.
|
||||
3. Run both editor clients against Library and VBS, including build-description contexts, cross-project navigation, generated prerequisites and module/reflection cases.
|
||||
4. Complete full core IDE plus live/replay/DAP/custom-view acceptance before labeling the server a usable replacement. Expand through an approved per-project matrix with unsupported constructs and rollback documented.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Missing VBS functionality is an upstream prerequisite, never a reason to advertise a fake native command. Do not edit sibling build descriptions during this bootstrap. A project failing compiler fidelity remains on its prior tooling until the defect or scope is resolved.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Compare clean native and CMake seed target/test outputs and provenance; require no project-artifact reuse for native proof.
|
||||
2. Exercise profile selection, metadata refresh, explicit generator builds and cross-project source mapping in both clients.
|
||||
3. Record project-by-project core IDE/debug journeys, resource/performance results and a tested switch-back configuration.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `adoption`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L adoption --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Retain the CMake seed while native build confidence grows and preserve prior editor setup. Switching clients back must not rewrite project sources, compile databases or user settings without request.
|
||||
@@ -0,0 +1,37 @@
|
||||
# 27 — Later IDE parity, additional dialects and platform ports
|
||||
|
||||
Status: PLANNED; no implementation claim
|
||||
Requirements: R-004,R-024,R-025
|
||||
Dependencies: Verified core architecture and release evidence; each extension needs separate requirements and scope review.
|
||||
|
||||
## Ownership and boundaries
|
||||
Root defines each subsequent milestone; Sol bounded features/ports, Astra semantic/platform blockers, fresh reviewers. Proposed future paths are selected only after actual baseline inspection.
|
||||
Future assignments must verify the then-current baseline and exact disjoint paths;
|
||||
these proposed scopes do not authorize work in another repository.
|
||||
|
||||
## Contracts and data flow
|
||||
Deferred features include broader code actions/formatting/inlay hints/semantic highlighting/hierarchies, additional C-family dialects and Windows/macOS ports. These are planned capability areas, not first-release promises. Standard C++ handling must not imply Objective-C/CUDA/HIP correctness.
|
||||
|
||||
## Implementation sequence
|
||||
1. Prioritize new IDE features from adoption evidence and define precise semantic/edit-safety requirements, reusing provenance/index/context contracts rather than separate heuristic engines.
|
||||
2. For additional dialects, establish compiler/backend support and a separate corpus before advertising capabilities. Keep feature selection observable per context.
|
||||
3. For Windows/macOS, map process groups/termination, filesystem watchers, path/URI/quoting, IPC, resource enforcement and toolchain packaging to actual supported APIs.
|
||||
4. Build platform-specific CI/editor acceptance matrices and migration documentation. Revisit bootstrap support independently of whether a backend can analyze a target platform.
|
||||
|
||||
## Failure behavior and constraints
|
||||
Do not silently relax security/resource/rename invariants on a port. Unsupported host enforcement may disable debugging explicitly. Formatting/refactor edits need version/provenance checks; unknown dialect flags remain unsupported rather than ignored.
|
||||
|
||||
## Acceptance scenarios
|
||||
1. Add feature-specific positive/adverse cases and real client capability negotiation tests.
|
||||
2. Exercise Windows/macOS path encodings, response quoting, case behavior, symlinks, watcher overflow, process cleanup and private IPC before declaring support.
|
||||
3. Verify graceful capability degradation and compatibility with existing Linux traces/providers/clients where formats are intended portable.
|
||||
|
||||
## Verification and integration
|
||||
Proposed NEW CTest label: `future-platforms`. Once implemented, register a nonzero suite and run:
|
||||
```sh
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap -L future-platforms --output-on-failure
|
||||
```
|
||||
This future command is not evidence that the label/tests exist now. Before dispatch,
|
||||
bind the fixtures above to actual targets and record prerequisites/side effects.
|
||||
Require fresh independent review of the implemented contract and affected integrations.
|
||||
Ship optional features behind explicit capabilities and preserve prior supported-platform behavior. Remove only newly introduced integration state; user configuration/source changes are not collateral rollback material.
|
||||
@@ -0,0 +1,139 @@
|
||||
# Architecture and shared invariants
|
||||
|
||||
Status: approved design; most components below are PLANNED. Milestone0 implements
|
||||
only CLI, framing, JSON adapter and lifecycle. See README and verification records
|
||||
for actual completion. NEW record names below are design contracts, not existing APIs.
|
||||
|
||||
## Data and control flow
|
||||
```mermaid
|
||||
flowchart LR
|
||||
E[Neovim / VS Code] --> L[LSP session]
|
||||
L --> D[Versioned document store]
|
||||
V[VBS manifest / compilation database] --> C[Build contexts]
|
||||
D --> Q[Foreground scheduler]
|
||||
C --> Q
|
||||
Q --> W[Isolated semantic workers]
|
||||
W --> I[Context-aware index]
|
||||
I --> L
|
||||
W --> L
|
||||
E --> A[DAP control + read-only inspection]
|
||||
A --> S[Debug session service]
|
||||
D --> S
|
||||
C --> S
|
||||
S --> X[Isolated instrumented compiler]
|
||||
X --> T[Trace + captured values]
|
||||
T --> S
|
||||
```
|
||||
|
||||
One editor workspace launches one server instance initially; there is no shared
|
||||
multi-client daemon. DAP adapters connect only to their corresponding private
|
||||
session service through authenticated/inherited local IPC. Transport details must
|
||||
preserve workspace/session identity and never expose an unauthenticated TCP listener.
|
||||
|
||||
## Shared records
|
||||
| NEW record | Owner | Required meaning |
|
||||
| --- | --- | --- |
|
||||
| DocumentSnapshot | documents | URI, text, monotonic client version, content identity, line/encoding map |
|
||||
| BuildContext | build model | provider/context/target/profile identities, exact semantic arguments, toolchain, readiness |
|
||||
| AnalysisRevision | scheduler | document + context + build generation + dependency identities + backend version |
|
||||
| ToolingGeneration | VBS provider | complete immutable export, selection revision and retained artifact references |
|
||||
| SemanticRequest / Result | workers | capability, revision, payload/provenance, cancellation and typed failure |
|
||||
| SymbolIdentity / SourceOrigin | index/reflection | declaration identity, context membership and editable/generated origin chain |
|
||||
| DebugSession | debug service | frozen snapshots/context, launch selection, state, resource allowance |
|
||||
| EvaluationEvent / CapturedValue | instrumentation | ordered event, causal parent, source origin, typed event-time state |
|
||||
| TraceManifest | replay | schema/backend/source/context identities, committed events and terminal status |
|
||||
| InspectionHandle | debug service | session + snapshot + stop/replay generation; no raw compiler pointer |
|
||||
|
||||
Root serializes shared schemas and version changes. Freeze each interface before
|
||||
dependent parallel coding. Schema migration failures preserve old artifacts and
|
||||
report incompatibility rather than reinterpret bytes.
|
||||
|
||||
## Source state and build state
|
||||
Disk content, unsaved editor buffers, generated views and physical VBS snapshots
|
||||
are different namespaces. Every request uses immutable snapshots. Result publication
|
||||
checks the complete AnalysisRevision, including header/import changes and backend.
|
||||
A stale last-good context may support explicitly degraded read-only queries;
|
||||
rename requires fresh metadata, complete declared coverage and editable origins.
|
||||
|
||||
VBS retains all configured targets/command alternatives even if a build selects a
|
||||
subset. Follow its editor profile; a per-file target override never merges flags.
|
||||
Host build-description compilation is a separate context from target code.
|
||||
|
||||
Native VBS export uses immutable local manifests plus an atomic selection reference.
|
||||
The producer must supply versions, identities, semantic environment, source mappings,
|
||||
module/prerequisite metadata, freshness/readiness and retention rules. Consumers
|
||||
cannot infer readiness from path existence. Bootstrap vbs_describe is insufficient.
|
||||
Initially configure an explicit manifest locator; automatic discovery is introduced
|
||||
only with a versioned producer contract, not a guessed hidden-file convention.
|
||||
|
||||
Compdb supplies commands, not equivalent generation/module/provider metadata.
|
||||
Prefer arguments; parse command quoting without a shell. Expand response files with
|
||||
the declared driver's grammar, bounded recursion and content identity. Never string-
|
||||
replace paths inside arbitrary flags/macros to create snapshot/editor projections.
|
||||
|
||||
## Execution authority
|
||||
Only configured, identity-verified toolchain/VBS executables may be launched.
|
||||
Repository configuration and compdb argv[0] cannot grant trust. Arbitrary plugins
|
||||
and unapproved wrappers are unsupported in v1; inspect expanded execution-bearing
|
||||
options before dispatch and fail explicitly rather than remove semantic options.
|
||||
Trusted metadata refresh is distinct from generators, dependency builds, fetches
|
||||
and lock updates. Private IDE BMIs do not authorize project build actions.
|
||||
Compiler isolation improves recovery; it is not a security sandbox.
|
||||
|
||||
## Modules and reflection
|
||||
Use compiler-proven dependency scans plus VBS metadata; never regex module discovery
|
||||
as semantic authority. BMIs/PCHs belong to the exact backend/options/input identity,
|
||||
including transitive dependencies and relevant physical paths. No GCC-to-Clang
|
||||
binary artifact reuse. Overlay edits rebuild dependent private IDE artifacts.
|
||||
Generated declarations preserve origin chains. A displayed generated source is a
|
||||
read-only explanation of semantic structure, not necessarily compilable source text.
|
||||
Unknown origin prevents destructive edits; it does not erase the entity from navigation.
|
||||
|
||||
## Index and rename
|
||||
The index partitions results by semantic context and committed generation.
|
||||
Publication is atomic at the index-generation level; failed/cancelled work is not
|
||||
promoted. Persistent schema/backend mismatches rebuild into a new generation.
|
||||
|
||||
Rename coverage is all declared workspace roots and every provider-exported context
|
||||
that can bind the affected files/symbols, including inactive profiles/targets.
|
||||
It does not claim to cover unknown external consumers or all hypothetical defines.
|
||||
Analyze missing contexts on demand; conflicts, missing generated origins or unknown
|
||||
coverage reject the rename. Both supported clients open/synchronize affected files
|
||||
before recomputation, validate versions/content and apply a tested transactional
|
||||
buffer edit. Without that behavior, refuse multi-file edits. File saving and external
|
||||
disk conflict detection remain editor responsibilities; no filesystem atomicity claim.
|
||||
|
||||
## Debugger state and replay
|
||||
Select a translation unit/context and an existing evaluation/source point or concrete
|
||||
template instantiation; do not invent arbitrary template arguments silently.
|
||||
States: preparing, running, stopped, replaying, completed, failed, cancelled, expired.
|
||||
A session freezes source/context; later edits mark it outdated until restarted.
|
||||
DAP is the only execution-control ingress. Custom views issue read-only versioned
|
||||
queries against the same service. Each movement invalidates earlier inspection handles.
|
||||
Captured values must represent event-time state, with bounded structural serialization,
|
||||
cycles/opaque values handled explicitly. Compiler pointers never become persisted IDs.
|
||||
Replay moves a cursor over stored state and cannot mutate historical target execution.
|
||||
Live step-back/time-travel mutation is not a v1 requirement.
|
||||
|
||||
Initial limits per server instance: one live session,2GiB worker RSS,3GiB aggregate
|
||||
debug-service memory,256MiB/1M-event trace,60s running CPU,120s running wall time,
|
||||
30min paused idle,5s disconnect grace. Enforce admission before start; reject debug
|
||||
startup if required enforcement is unavailable. Exclude deliberate pause from running
|
||||
watchdogs, but count its memory. Cancellation/expiration terminates and reaps owned
|
||||
process groups; committed trace prefixes remain explicitly incomplete.
|
||||
|
||||
## Bootstrap JSON gate
|
||||
Follow VoidLibrary main per D-021 and record the exact tested commit. Accept its
|
||||
decimal update only after tests cover number grammar,
|
||||
ID preservation, controls, raw UTF-8, escaped surrogate pairing and depth limits.
|
||||
The VLS adapter supplies only remaining protocol/boundary validation; it must not
|
||||
call an unbounded recursive decoder before validating depth or substitute the old
|
||||
integer-only parser. Upstream code changes belong to its worker, not this repository.
|
||||
|
||||
## Delivery and review
|
||||
Milestone0 remains independent of compiler/VBS implementations except the JSON gate.
|
||||
Gate1 proves real GCC-context semantics; Gate2 proves actual compiler instrumentation
|
||||
and live/replay behavior. Failed gates stop dependent tasks and preserve evidence.
|
||||
Root owns contracts/pins/integration; Sol owns bounded packages, Astra coupled
|
||||
compiler/module/debug work. Fresh preflight/final review and affected behavior checks
|
||||
are required for each substantial wave. Detailed proposed ownership is in each plan.
|
||||
@@ -0,0 +1,82 @@
|
||||
# Development roadmap
|
||||
|
||||
Approved2026-11-25. This directory contains27 subsystem plans. Only01/02 belong
|
||||
to the current implementation milestone; all later capabilities require the gates
|
||||
and evidence below. Read [requirements](REQUIREMENTS.md), [architecture](ARCHITECTURE.md)
|
||||
and [current state](../agent-workflow/STATE.md) first.
|
||||
|
||||
## Plan index
|
||||
| Part | Plan | Requirements |
|
||||
| --- | --- | --- |
|
||||
| 01 | [Bootstrap, dependency provenance and CLI](01-bootstrap-dependencies.md) | R-001,R-003,R-005,R-022,R-026 |
|
||||
| 02 | [LSP framing, JSON envelope and lifecycle](02-lsp-protocol-lifecycle.md) | R-002,R-003,R-004,R-005 |
|
||||
| 03 | [Versioned documents, positions and overlays](03-documents-positions.md) | R-006,R-011 |
|
||||
| 04 | [Workspace configuration and execution authority](04-workspace-configuration-trust.md) | R-007,R-008,R-021 |
|
||||
| 05 | [Shared build contexts and profile/target selection](05-build-contexts.md) | R-008,R-009,R-010,R-015 |
|
||||
| 06 | [Native VBS tooling export and consumer](06-native-vbs-tooling.md) | R-008,R-012,R-021,R-023 |
|
||||
| 07 | [Compilation-database compatibility provider](07-compilation-database.md) | R-007,R-009,R-010 |
|
||||
| 08 | [Semantic frontend feasibility, toolchain and license gate](08-frontend-feasibility.md) | R-010,R-012,R-013,R-016,R-026 |
|
||||
| 09 | [Semantic worker protocol and compiler integration](09-semantic-workers.md) | R-007,R-010,R-013,R-014,R-021 |
|
||||
| 10 | [Scheduling, cancellation and resource budgets](10-scheduling-resources.md) | R-011,R-021 |
|
||||
| 11 | [Named modules, partitions, header units and artifact ownership](11-cpp-modules.md) | R-008,R-010,R-012,R-021 |
|
||||
| 12 | [Reflection, meta values and generated-source provenance](12-reflection-provenance.md) | R-010,R-013,R-014,R-015,R-016 |
|
||||
| 13 | [Diagnostics, freshness and incomplete-edit recovery](13-diagnostics-recovery.md) | R-004,R-006,R-014,R-021 |
|
||||
| 14 | [Completion, signatures and hover](14-completion-hover.md) | R-011,R-013,R-014 |
|
||||
| 15 | [Context-aware symbol index and persistent generations](15-index-persistence.md) | R-008,R-014,R-015,R-021 |
|
||||
| 16 | [Navigation, references and guarded rename](16-navigation-rename.md) | R-013,R-014,R-015,R-020 |
|
||||
| 17 | [Compiler instrumentation and debugger feasibility gate](17-compiler-debug-instrumentation.md) | R-010,R-013,R-016,R-017,R-018 |
|
||||
| 18 | [Live metaprogram debugger state and control](18-live-debugging.md) | R-016,R-017,R-019,R-021 |
|
||||
| 19 | [Trace persistence, event-time state and replay](19-trace-replay.md) | R-016,R-018,R-019,R-021 |
|
||||
| 20 | [Debug Adapter Protocol service](20-dap-service.md) | R-017,R-018,R-019,R-020 |
|
||||
| 21 | [Shared custom inspection API and view models](21-inspection-api.md) | R-013,R-016,R-018,R-019,R-020 |
|
||||
| 22 | [VS Code client, DAP integration and custom views](22-vscode-client.md) | R-015,R-019,R-020 |
|
||||
| 23 | [Neovim LSP/DAP integration and inspection buffers](23-neovim-client.md) | R-015,R-019,R-020 |
|
||||
| 24 | [Conformance corpus, robustness and performance evidence](24-conformance-performance.md) | R-003,R-005,R-010,R-011,R-012,R-013,R-015,R-021 |
|
||||
| 25 | [Packaging, CI and release gates](25-packaging-ci-release.md) | R-004,R-005,R-024,R-026 |
|
||||
| 26 | [Native VBS build and staged Void adoption](26-vbs-self-build-adoption.md) | R-008,R-010,R-014,R-020,R-022,R-023 |
|
||||
| 27 | [Later IDE parity, additional dialects and platform ports](27-future-parity-platforms.md) | R-004,R-024,R-025 |
|
||||
|
||||
## Delivery graph
|
||||
```mermaid
|
||||
flowchart TD
|
||||
M0[01-02: bootstrap and JSON gate] --> F[03-05: documents, workspace, contexts]
|
||||
F --> P[06-07: VBS and compdb providers]
|
||||
C[24: corpus] --> G1[08: frontend feasibility]
|
||||
F --> G1
|
||||
G1 --> W[09-10: workers and scheduling]
|
||||
W --> MR[11-12: modules and reflection]
|
||||
MR --> IDE[13-16: core IDE and index]
|
||||
MR --> G2[17: debugger feasibility]
|
||||
G2 --> DR[18-19: live and replay]
|
||||
DR --> API[20-21: DAP and shared views]
|
||||
IDE --> CL[22-23: both editor clients]
|
||||
API --> CL
|
||||
P --> A[26: native build and adoption]
|
||||
CL --> A
|
||||
A --> Q[24-25: release evidence and packaging]
|
||||
Q --> Later[27: later parity and ports]
|
||||
```
|
||||
The diagram is not a promise that native VBS production exists. Its separately
|
||||
owned producer/executor is an explicit prerequisite of06/26 live acceptance.
|
||||
|
||||
## Gates and parallel ownership
|
||||
- M0: documents, CLI/lifecycle shell, unit/subprocess tests; final JSON acceptance
|
||||
waits for a verified committed VoidLibrary decimal revision.
|
||||
- G1: actual GCC16/libstdc++ Void fidelity and interactive behavior. Current candidate
|
||||
likely fails constexpr-range expansion. Failure requires a new explicit decision;
|
||||
compiler fixes/backend substitution are not silently added.
|
||||
- G2: evaluator+Sema instrumentation, live control and reliable replay on mixed
|
||||
template/constraint/constexpr/reflection cases, including adverse outcomes.
|
||||
- Core and debugger tracks may proceed independently only after their common
|
||||
schemas/gates pass. Live and replay are BOTH required; DAP and custom views are BOTH required.
|
||||
- After build-model freeze, VBS/compdb adapters are disjoint Sol packages. After
|
||||
inspection-schema freeze, the two clients are disjoint packages. Root serializes
|
||||
shared schemas, dependency pins, root build registration and integration.
|
||||
- Fresh precise tasks are written/linted against the actual baseline before each
|
||||
assignment. The scopes in these documents are proposals, not active ownership.
|
||||
|
||||
## Evidence language
|
||||
A plan being written is not implementation. Code-complete differs from verified;
|
||||
verified differs from released. Future CTest labels are explicitly proposed and
|
||||
must become nonzero real suites before their commands count as evidence. Preserve
|
||||
failed gates/regressions and record environment limitations honestly.
|
||||
@@ -0,0 +1,49 @@
|
||||
# Requirements and acceptance ledger
|
||||
|
||||
Approved 2026-11-25. Scope approval covers milestone0 (repository, detailed plans,
|
||||
working shell). The remaining requirements describe gated future delivery.
|
||||
|
||||
| ID | Requirement | Acceptance boundary | Plans |
|
||||
| --- | --- | --- | --- |
|
||||
| R-001 | C++26 server using VoidLibrary | Actual APIs linked, GCC16 host, dependency provenance | 01 |
|
||||
| R-002 | Working stdio lifecycle shell | Real initialize/initialized/shutdown/exit and correct errors/exits | 02 |
|
||||
| R-003 | Conforming bounded JSON ingress | Decimals/exponents, integer/string IDs, Unicode/escapes and depth tests | 01,02 |
|
||||
| R-004 | Honest capabilities and status | No semantic/debug/VBS promises before implementation | All |
|
||||
| R-005 | Traceable dependency and meaningful tests | Follow VoidLibrary main per D-021; record tested commit, separate local override, nonzero tests and outcomes | 01,24,25 |
|
||||
| R-006 | Versioned unsaved documents | Correct positions, edits, snapshots and desynchronization handling | 03 |
|
||||
| R-007 | Workspace/tool execution boundaries | Metadata alone cannot authorize executables, plugins or wrappers | 04,07,09 |
|
||||
| R-008 | Native VBS integration | Resolved tooling generations, profile/target selection, readiness and live producer evidence | 05,06 |
|
||||
| R-009 | compile_commands compatibility | Standard fields, alternative commands, driver-aware quoting/response files, honest missing metadata | 07 |
|
||||
| R-010 | GCC16 Void source fidelity | Real Void/GCC/libstdc++ corpus passes frontend gate; unsupported constructs explicit | 08,09 |
|
||||
| R-011 | Responsive foreground work | Warm completion p95~100ms, navigation~50ms on recorded corpus/hardware | 10,14,24 |
|
||||
| R-012 | Native modern modules | Named modules, partitions, header units, unsaved dependency changes and compiler-specific artifacts | 11 |
|
||||
| R-013 | Reflection/meta semantics | Queries, splices, expansions, generated entities and reliable origins | 12 |
|
||||
| R-014 | Core editing features | Diagnostics, completion, hover, navigation, references | 13,14,15,16 |
|
||||
| R-015 | Safe rename | Complete declared affected contexts, editable provenance, guarded versioned buffer transaction | 16,22,23 |
|
||||
| R-016 | Metaprogram instrumentation | Templates, constraint decisions, constexpr/consteval and reflection events/values | 17 |
|
||||
| R-017 | Live metaprogram debugger | Breakpoints, pause/continue, stepping, frames, scopes and inspection | 18 |
|
||||
| R-018 | Recorded evaluation replay | Historical state/source, cursor navigation, explicit failed/truncated traces | 19 |
|
||||
| R-019 | DAP and custom views | One session/control authority, DAP plus timeline/tree/entity views | 20,21 |
|
||||
| R-020 | Neovim AND VS Code | End-to-end editing, guarded rename, live and replay debug journeys | 22,23 |
|
||||
| R-021 | Robustness and resource isolation | Worker recovery, bounded resources, cancellation and ordinary-editing capacity | 09,10,18,19,24 |
|
||||
| R-022 | CMake bootstrap then native VBS build | Independent seed now, verified native build later | 01,26 |
|
||||
| R-023 | Staged adoption across Void | VoidLibrary and VBS first; evidence-based expansion to remaining projects | 26 |
|
||||
| R-024 | Linux first; later parity/ports | Linux release matrix now; Windows/macOS and broader IDE features separate | 25,27 |
|
||||
| R-025 | Detailed durable plans and decisions | Dependency graph, contracts, ownership, failures, implementation and tests for every part | All |
|
||||
| R-026 | Deliberate licensing/release gate | License decision after backend evidence; no implicit distribution approval | 08,25 |
|
||||
|
||||
## Release definition
|
||||
Milestone0 proves the shell, not clangd replacement. The first usable replacement
|
||||
must meet R-008 through R-021 and the two-client adoption corpus, including BOTH live
|
||||
and replay debugging and BOTH DAP and custom views. A successful handshake, a compiler
|
||||
version string, a prototype trace or passing unit tests alone cannot establish this.
|
||||
|
||||
No fixed release date was selected. Lack of a deadline does not waive acceptance.
|
||||
The planned C++26 matrix is bounded by the approved GCC16 project corpus and explicitly
|
||||
enumerated proposals; do not claim complete final-standard coverage from -std=c++26.
|
||||
|
||||
## Current external prerequisites
|
||||
VoidLibrary decimal support is being developed by another worker. Confirm an exact
|
||||
committed revision and all JSON tests before final shell acceptance.
|
||||
The VBS resolved tooling producer is planned independently. The frontend and debugger
|
||||
feasibility experiments have not run. Licensing is intentionally undecided.
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <expected>
|
||||
#include <iosfwd>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace vls {
|
||||
|
||||
struct FrameLimits {
|
||||
std::size_t header_bytes{8192};
|
||||
std::size_t body_bytes{16777216};
|
||||
};
|
||||
|
||||
// A disengaged optional means EOF between frames. Framing errors are fatal: the
|
||||
// caller must not attempt to find another frame in an untrusted byte stream.
|
||||
[[nodiscard]] std::expected<std::optional<std::string>, std::string>
|
||||
read_frame(std::istream &input, FrameLimits limits = {});
|
||||
|
||||
[[nodiscard]] std::expected<void, std::string> write_frame(std::ostream &output,
|
||||
std::string_view body);
|
||||
|
||||
} // namespace vls
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <Void/Data/StrictJson.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <variant>
|
||||
|
||||
namespace vls {
|
||||
|
||||
using Json = Void::Json::Strict::Value;
|
||||
using RequestId = std::variant<std::int32_t, std::string>;
|
||||
|
||||
[[nodiscard]] std::expected<Json, std::string> parse_json(std::string_view text,
|
||||
std::size_t maximum_depth = 64);
|
||||
[[nodiscard]] std::expected<RequestId, std::string> request_id(const Json &value);
|
||||
[[nodiscard]] std::string quote_json(std::string_view text);
|
||||
[[nodiscard]] std::string encode_id(const RequestId &id);
|
||||
|
||||
} // namespace vls
|
||||
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <vls/Framing.hpp>
|
||||
|
||||
#include <iosfwd>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace vls {
|
||||
|
||||
inline constexpr std::string_view server_version = "0.1.0";
|
||||
|
||||
struct DispatchResult {
|
||||
std::optional<std::string> response;
|
||||
std::optional<int> exit_code;
|
||||
};
|
||||
|
||||
class Server {
|
||||
public:
|
||||
[[nodiscard]] DispatchResult handle(std::string_view body);
|
||||
|
||||
private:
|
||||
enum class State { awaiting_initialize, running, shutdown };
|
||||
State state_{State::awaiting_initialize};
|
||||
};
|
||||
|
||||
// Thin transport loop shared by the executable and stream-failure unit tests.
|
||||
[[nodiscard]] int run_stdio(std::istream &input, std::ostream &output, std::ostream &diagnostics,
|
||||
FrameLimits limits = {});
|
||||
|
||||
} // namespace vls
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
#include <vls/Framing.hpp>
|
||||
|
||||
#include <charconv>
|
||||
#include <istream>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
|
||||
namespace vls {
|
||||
namespace {
|
||||
|
||||
std::string_view trim(std::string_view text) {
|
||||
const auto first = text.find_first_not_of(" \t");
|
||||
if (first == std::string_view::npos)
|
||||
return {};
|
||||
return text.substr(first, text.find_last_not_of(" \t") - first + 1);
|
||||
}
|
||||
|
||||
std::string lower(std::string_view text) {
|
||||
std::string result{text};
|
||||
for (char &c : result)
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
c = static_cast<char>(c + ('a' - 'A'));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool supported_content_type(std::string_view text) {
|
||||
auto separator = text.find(';');
|
||||
const auto media = lower(trim(text.substr(0, separator)));
|
||||
if (media != "application/vscode-jsonrpc" && media != "application/json")
|
||||
return false;
|
||||
bool seen_charset = false;
|
||||
while (separator != std::string_view::npos) {
|
||||
text.remove_prefix(separator + 1);
|
||||
separator = text.find(';');
|
||||
const auto parameter = trim(text.substr(0, separator));
|
||||
const auto equals = parameter.find('=');
|
||||
if (equals == std::string_view::npos)
|
||||
return false;
|
||||
if (lower(trim(parameter.substr(0, equals))) == "charset") {
|
||||
if (seen_charset)
|
||||
return false;
|
||||
seen_charset = true;
|
||||
auto encoding = trim(parameter.substr(equals + 1));
|
||||
if (encoding.size() >= 2 && encoding.front() == '"' && encoding.back() == '"')
|
||||
encoding = encoding.substr(1, encoding.size() - 2);
|
||||
const auto name = lower(encoding);
|
||||
if (name != "utf-8" && name != "utf8")
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
std::expected<std::optional<std::string>, std::string> read_frame(std::istream &input,
|
||||
FrameLimits limits) {
|
||||
std::string header;
|
||||
while (!header.ends_with("\r\n\r\n")) {
|
||||
const auto next = input.get();
|
||||
if (next == std::char_traits<char>::eof()) {
|
||||
if (input.bad() || !input.eof())
|
||||
return std::unexpected{"input stream failure"};
|
||||
if (header.empty())
|
||||
return std::optional<std::string>{};
|
||||
return std::unexpected{"truncated frame header"};
|
||||
}
|
||||
if (header.size() >= limits.header_bytes)
|
||||
return std::unexpected{"frame header exceeds byte limit"};
|
||||
const char c = static_cast<char>(next);
|
||||
if ((c == '\n' && (header.empty() || header.back() != '\r')) ||
|
||||
(!header.empty() && header.back() == '\r' && c != '\n'))
|
||||
return std::unexpected{"frame headers require CRLF"};
|
||||
if (c != '\r' && c != '\n' && c != '\t' && (c < 0x20 || c > 0x7e))
|
||||
return std::unexpected{"non-ASCII frame header"};
|
||||
header.push_back(c);
|
||||
}
|
||||
|
||||
std::optional<std::size_t> length;
|
||||
bool seen_type = false;
|
||||
std::string_view remaining{header};
|
||||
while (!remaining.starts_with("\r\n")) {
|
||||
const auto end = remaining.find("\r\n");
|
||||
const auto line = remaining.substr(0, end);
|
||||
const auto colon = line.find(':');
|
||||
if (colon == std::string_view::npos || colon == 0)
|
||||
return std::unexpected{"invalid frame header field"};
|
||||
const auto name = line.substr(0, colon);
|
||||
if (name.find_first_of(" \t") != std::string_view::npos)
|
||||
return std::unexpected{"invalid frame header name"};
|
||||
const auto value = trim(line.substr(colon + 1));
|
||||
if (lower(name) == "content-length") {
|
||||
if (length)
|
||||
return std::unexpected{"duplicate Content-Length"};
|
||||
if (value.empty() || value.find_first_not_of("0123456789") != std::string_view::npos)
|
||||
return std::unexpected{"invalid Content-Length"};
|
||||
std::size_t parsed{};
|
||||
const auto result = std::from_chars(value.data(), value.data() + value.size(), parsed);
|
||||
if (result.ec != std::errc{} || result.ptr != value.data() + value.size())
|
||||
return std::unexpected{"Content-Length overflow"};
|
||||
if (parsed > limits.body_bytes || parsed > std::numeric_limits<std::streamsize>::max())
|
||||
return std::unexpected{"frame body exceeds byte limit"};
|
||||
length = parsed;
|
||||
} else if (lower(name) == "content-type") {
|
||||
if (seen_type || !supported_content_type(value))
|
||||
return std::unexpected{"duplicate or unsupported Content-Type/charset"};
|
||||
seen_type = true;
|
||||
}
|
||||
remaining.remove_prefix(end + 2);
|
||||
}
|
||||
if (!length)
|
||||
return std::unexpected{"missing Content-Length"};
|
||||
std::string body(*length, '\0');
|
||||
input.read(body.data(), static_cast<std::streamsize>(*length));
|
||||
if (!input)
|
||||
return std::unexpected{"truncated frame body or input failure"};
|
||||
return std::optional{std::move(body)};
|
||||
}
|
||||
|
||||
std::expected<void, std::string> write_frame(std::ostream &output, std::string_view body) {
|
||||
if (body.size() > static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()))
|
||||
return std::unexpected{"output frame exceeds stream limit"};
|
||||
output << "Content-Length: " << body.size() << "\r\n\r\n";
|
||||
output.write(body.data(), static_cast<std::streamsize>(body.size()));
|
||||
output.flush();
|
||||
if (!output)
|
||||
return std::unexpected{"output stream failure"};
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace vls
|
||||
@@ -0,0 +1,99 @@
|
||||
#include <vls/Json.hpp>
|
||||
|
||||
#include <Void/Unicode/Utf.hpp>
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace vls {
|
||||
|
||||
std::expected<Json, std::string> parse_json(std::string_view text, std::size_t maximum_depth) {
|
||||
if (!Void::Unicode::validate_utf8(text))
|
||||
return std::unexpected{"invalid UTF-8"};
|
||||
|
||||
// Bound structural nesting before calling a recursive dependency parser.
|
||||
// This scan does not parse JSON or numbers: StrictJson owns that grammar,
|
||||
// including escape validation and rejection of unpaired surrogate escapes.
|
||||
std::size_t depth{};
|
||||
bool in_string = false;
|
||||
bool escaped = false;
|
||||
for (const char c : text) {
|
||||
if (in_string) {
|
||||
if (escaped)
|
||||
escaped = false;
|
||||
else if (c == '\\')
|
||||
escaped = true;
|
||||
else if (c == '"')
|
||||
in_string = false;
|
||||
} else if (c == '"') {
|
||||
in_string = true;
|
||||
} else if (c == '{' || c == '[') {
|
||||
if (depth >= maximum_depth)
|
||||
return std::unexpected{"JSON nesting exceeds depth limit"};
|
||||
++depth;
|
||||
} else if ((c == '}' || c == ']') && depth > 0) {
|
||||
--depth;
|
||||
}
|
||||
}
|
||||
auto parsed = Void::Json::Strict::parse(text, maximum_depth);
|
||||
if (!parsed)
|
||||
return std::unexpected{parsed.error().message};
|
||||
return std::move(*parsed);
|
||||
}
|
||||
|
||||
std::expected<RequestId, std::string> request_id(const Json &value) {
|
||||
// LSP integer IDs are constrained by value, not by JSON number spelling.
|
||||
// Preserve the value only after checking integrality and the signed range.
|
||||
return std::visit(
|
||||
[](const auto &item) -> std::expected<RequestId, std::string> {
|
||||
using T = std::remove_cvref_t<decltype(item)>;
|
||||
if constexpr (std::is_same_v<T, std::string>) {
|
||||
return RequestId{item};
|
||||
} else if constexpr (std::is_integral_v<T> && !std::is_same_v<T, bool>) {
|
||||
if (std::in_range<std::int32_t>(item))
|
||||
return RequestId{static_cast<std::int32_t>(item)};
|
||||
} else if constexpr (std::is_floating_point_v<T>) {
|
||||
const long double wide = static_cast<long double>(item);
|
||||
if (std::isfinite(item) && std::trunc(item) == item &&
|
||||
wide >= std::numeric_limits<std::int32_t>::min() &&
|
||||
wide <= std::numeric_limits<std::int32_t>::max())
|
||||
return RequestId{static_cast<std::int32_t>(item)};
|
||||
}
|
||||
return std::unexpected{"request ID must be a signed 32-bit integer or string"};
|
||||
},
|
||||
value.value);
|
||||
}
|
||||
|
||||
std::string quote_json(std::string_view text) {
|
||||
constexpr char hex[] = "0123456789abcdef";
|
||||
std::string result{"\""};
|
||||
for (const unsigned char c : text) {
|
||||
if (c == '"' || c == '\\') {
|
||||
result.push_back('\\');
|
||||
result.push_back(static_cast<char>(c));
|
||||
} else if (c < 0x20) {
|
||||
result += "\\u00";
|
||||
result.push_back(hex[c >> 4]);
|
||||
result.push_back(hex[c & 15]);
|
||||
} else {
|
||||
result.push_back(static_cast<char>(c));
|
||||
}
|
||||
}
|
||||
result.push_back('"');
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string encode_id(const RequestId &id) {
|
||||
return std::visit(
|
||||
[](const auto &item) -> std::string {
|
||||
if constexpr (std::is_same_v<std::remove_cvref_t<decltype(item)>, std::string>)
|
||||
return quote_json(item);
|
||||
else
|
||||
return std::to_string(item);
|
||||
},
|
||||
id);
|
||||
}
|
||||
|
||||
} // namespace vls
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
#include <vls/Server.hpp>
|
||||
|
||||
#include <vls/Json.hpp>
|
||||
|
||||
#include <exception>
|
||||
#include <ostream>
|
||||
|
||||
namespace vls {
|
||||
namespace {
|
||||
|
||||
const Json *member(const Json::Object &object, std::string_view key) {
|
||||
const auto found = object.find(key);
|
||||
return found == object.end() ? nullptr : &found->second;
|
||||
}
|
||||
|
||||
const std::string *string(const Json *value) {
|
||||
return value ? std::get_if<std::string>(&value->value) : nullptr;
|
||||
}
|
||||
|
||||
DispatchResult error(std::string_view id, int code, std::string_view message) {
|
||||
return {.response = "{\"jsonrpc\":\"2.0\",\"id\":" + std::string{id} + ",\"error\":{\"code\":" +
|
||||
std::to_string(code) + ",\"message\":" + quote_json(message) + "}}",
|
||||
.exit_code = std::nullopt};
|
||||
}
|
||||
|
||||
DispatchResult result(std::string_view id, std::string_view value) {
|
||||
return {.response = "{\"jsonrpc\":\"2.0\",\"id\":" + std::string{id} +
|
||||
",\"result\":" + std::string{value} + "}",
|
||||
.exit_code = std::nullopt};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
DispatchResult Server::handle(std::string_view body) {
|
||||
auto parsed = parse_json(body);
|
||||
if (!parsed)
|
||||
return error("null", -32700, "Parse error");
|
||||
const auto *object = std::get_if<Json::Object>(&parsed->value);
|
||||
if (!object)
|
||||
return error("null", -32600, "Invalid Request");
|
||||
|
||||
const auto *id_value = member(*object, "id");
|
||||
const auto *method_value = member(*object, "method");
|
||||
const auto *method = string(method_value);
|
||||
const auto *version = string(member(*object, "jsonrpc"));
|
||||
const auto *params = member(*object, "params");
|
||||
const auto *result_value = member(*object, "result");
|
||||
const auto *error_value = member(*object, "error");
|
||||
|
||||
// This shell issues no requests. Valid peer responses are unmatched and
|
||||
// must be ignored, including errors whose correlation ID is null.
|
||||
if (version && *version == "2.0" && !method_value && id_value &&
|
||||
((result_value != nullptr) != (error_value != nullptr))) {
|
||||
const bool valid_id = std::holds_alternative<std::nullptr_t>(id_value->value) ||
|
||||
request_id(*id_value).has_value();
|
||||
bool valid_payload = result_value != nullptr;
|
||||
if (error_value) {
|
||||
if (const auto *details = std::get_if<Json::Object>(&error_value->value)) {
|
||||
if (const auto *code = member(*details, "code");
|
||||
code && string(member(*details, "message"))) {
|
||||
const auto checked = request_id(*code);
|
||||
valid_payload = checked && std::holds_alternative<std::int32_t>(*checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (valid_id && valid_payload)
|
||||
return {};
|
||||
}
|
||||
|
||||
const bool notification = !id_value;
|
||||
std::string id{"null"};
|
||||
if (id_value) {
|
||||
auto checked = request_id(*id_value);
|
||||
if (!checked)
|
||||
return error("null", -32600, "Invalid Request");
|
||||
id = encode_id(*checked);
|
||||
}
|
||||
if (!version || *version != "2.0" || !method || result_value || error_value) {
|
||||
// Method-bearing objects without IDs are notifications, even when
|
||||
// malformed. They must never elicit a response.
|
||||
if (notification && method_value)
|
||||
return {};
|
||||
return error(id, -32600, "Invalid Request");
|
||||
}
|
||||
if (notification) {
|
||||
if (*method == "exit")
|
||||
return {.response = std::nullopt, .exit_code = state_ == State::shutdown ? 0 : 1};
|
||||
return {};
|
||||
}
|
||||
if (state_ == State::shutdown)
|
||||
return error(id, -32600, "Invalid Request");
|
||||
if (state_ == State::awaiting_initialize && *method != "initialize")
|
||||
return error(id, -32002, "Server not initialized");
|
||||
if (*method == "initialize") {
|
||||
if (state_ != State::awaiting_initialize)
|
||||
return error(id, -32600, "Invalid Request");
|
||||
if (!params || !std::holds_alternative<Json::Object>(params->value))
|
||||
return error(id, -32602, "initialize params must be an object");
|
||||
state_ = State::running;
|
||||
return result(id, "{\"capabilities\":{},\"serverInfo\":{\"name\":\"VoidLanguageServer\","
|
||||
"\"version\":\"0.1.0\"}}");
|
||||
}
|
||||
if (params && !std::holds_alternative<Json::Object>(params->value) &&
|
||||
!std::holds_alternative<Json::Array>(params->value) &&
|
||||
!std::holds_alternative<std::nullptr_t>(params->value))
|
||||
return error(id, -32600, "Invalid Request");
|
||||
if (*method == "shutdown") {
|
||||
if (params && !std::holds_alternative<std::nullptr_t>(params->value))
|
||||
return error(id, -32602, "shutdown takes no params");
|
||||
state_ = State::shutdown;
|
||||
return result(id, "null");
|
||||
}
|
||||
return error(id, -32601, "Method not found");
|
||||
}
|
||||
|
||||
int run_stdio(std::istream &input, std::ostream &output, std::ostream &diagnostics,
|
||||
FrameLimits limits) {
|
||||
try {
|
||||
Server server;
|
||||
for (;;) {
|
||||
auto frame = read_frame(input, limits);
|
||||
if (!frame) {
|
||||
diagnostics << "vls: " << frame.error() << '\n';
|
||||
return 1;
|
||||
}
|
||||
if (!*frame) {
|
||||
diagnostics << "vls: unexpected EOF before exit notification\n";
|
||||
return 1;
|
||||
}
|
||||
auto dispatched = server.handle(**frame);
|
||||
if (dispatched.response) {
|
||||
const auto written = write_frame(output, *dispatched.response);
|
||||
if (!written) {
|
||||
diagnostics << "vls: " << written.error() << '\n';
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (dispatched.exit_code)
|
||||
return *dispatched.exit_code;
|
||||
}
|
||||
} catch (const std::exception &) {
|
||||
diagnostics << "vls: failed to process protocol stream\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace vls
|
||||
@@ -0,0 +1,39 @@
|
||||
#include <vls/Server.hpp>
|
||||
|
||||
#include <Void/Configuration/Argparse.hpp>
|
||||
|
||||
#include <csignal>
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
bool stdio = false;
|
||||
bool version = false;
|
||||
Void::Argparse::Parser parser{
|
||||
"vls", "VoidLanguageServer 0.1.0: stdio LSP lifecycle shell.\n"
|
||||
"No arguments starts stdio. Language and debugger features are planned."};
|
||||
parser.flag("--stdio", "", "run the stdio LSP lifecycle shell", stdio);
|
||||
parser.flag("--version", "-V", "show version", version);
|
||||
if (argc == 2 && (std::string_view{argv[1]} == "--help" || std::string_view{argv[1]} == "-h")) {
|
||||
std::cout << parser.help();
|
||||
return std::cout ? 0 : 1;
|
||||
}
|
||||
// Each mode is standalone. This also rejects duplicate flags deterministically.
|
||||
if (argc > 2) {
|
||||
std::cerr << "vls: options must be used alone; use --help\n";
|
||||
return 2;
|
||||
}
|
||||
const auto parsed = parser.parse(argc, argv);
|
||||
if (!parsed) {
|
||||
std::cerr << "vls: " << parsed.error() << '\n';
|
||||
return 2;
|
||||
}
|
||||
if (version) {
|
||||
std::cout << "VoidLanguageServer " << vls::server_version << '\n';
|
||||
return std::cout ? 0 : 1;
|
||||
}
|
||||
#ifdef SIGPIPE
|
||||
std::signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
return vls::run_stdio(std::cin, std::cout, std::cerr);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
add_executable(vls_unit_tests FramingTests.cpp JsonTests.cpp LifecycleTests.cpp)
|
||||
target_link_libraries(vls_unit_tests PRIVATE vls_protocol)
|
||||
void_add_tests(vls_unit_tests)
|
||||
|
||||
add_executable(vls_json_capabilities JsonCapabilities.cpp)
|
||||
target_link_libraries(vls_json_capabilities PRIVATE vls_protocol Void::System)
|
||||
target_compile_definitions(vls_json_capabilities PRIVATE "VLS_EXECUTABLE=\"$<TARGET_FILE:vls>\"")
|
||||
add_dependencies(vls_json_capabilities vls)
|
||||
void_add_tests(vls_json_capabilities)
|
||||
|
||||
add_executable(vls_process_tests ProcessTests.cpp)
|
||||
target_link_libraries(vls_process_tests PRIVATE vls_protocol Void::System)
|
||||
target_compile_definitions(vls_process_tests PRIVATE "VLS_EXECUTABLE=\"$<TARGET_FILE:vls>\"")
|
||||
add_dependencies(vls_process_tests vls)
|
||||
void_add_tests(vls_process_tests)
|
||||
|
||||
set_tests_properties(vls_unit_tests vls_json_capabilities vls_process_tests PROPERTIES TIMEOUT 30)
|
||||
add_test(NAME vls_test_registration COMMAND "${CMAKE_COMMAND}"
|
||||
"-DUNIT=$<TARGET_FILE:vls_unit_tests>"
|
||||
"-DCAPABILITIES=$<TARGET_FILE:vls_json_capabilities>"
|
||||
"-DPROCESS=$<TARGET_FILE:vls_process_tests>"
|
||||
-P "${CMAKE_CURRENT_SOURCE_DIR}/Registration.cmake")
|
||||
set_tests_properties(vls_test_registration PROPERTIES TIMEOUT 20)
|
||||
@@ -0,0 +1,92 @@
|
||||
#include "TestSupport.hpp"
|
||||
|
||||
#include <limits>
|
||||
|
||||
Void::Testing::Test consecutive_frames_preserve_byte_lengths() {
|
||||
const std::string body{"\"\xF0\x9F\x98\x83\""};
|
||||
std::istringstream input{test::frame(body) + test::frame("{}")};
|
||||
auto first = vls::read_frame(input);
|
||||
Void::Testing::require(first.has_value() && first->has_value());
|
||||
Void::Testing::expect_eq(**first, body);
|
||||
auto second = vls::read_frame(input);
|
||||
Void::Testing::require(second.has_value() && second->has_value());
|
||||
Void::Testing::expect_eq(**second, std::string{"{}"});
|
||||
auto eof = vls::read_frame(input);
|
||||
Void::Testing::expect(eof.has_value() && !eof->has_value());
|
||||
}
|
||||
|
||||
Void::Testing::Test exact_frame_limits() {
|
||||
const auto wire = test::frame("1234");
|
||||
std::istringstream exact{wire};
|
||||
Void::Testing::expect(vls::read_frame(exact, {wire.size() - 4, 4}).has_value());
|
||||
std::istringstream header_over{wire};
|
||||
Void::Testing::expect(!vls::read_frame(header_over, {wire.size() - 5, 4}).has_value());
|
||||
std::istringstream body_over{wire};
|
||||
Void::Testing::expect(!vls::read_frame(body_over, {wire.size() - 4, 3}).has_value());
|
||||
}
|
||||
|
||||
Void::Testing::Test length_validation() {
|
||||
for (const std::string header :
|
||||
{"Other: 1", "Content-Length: ", "Content-Length: -1", "Content-Length: +1",
|
||||
"Content-Length: 1x", "Content-Length: 1 0", "Content-Length: 1.0",
|
||||
"Content-Length: 999999999999999999999999999999999999", "Content-Length: 16777217",
|
||||
"Content-Length: 1\r\ncontent-length: 1"}) {
|
||||
std::istringstream input{header + "\r\n\r\nx"};
|
||||
Void::Testing::expect(!vls::read_frame(input).has_value());
|
||||
}
|
||||
std::istringstream zero{"Content-Length: 0\r\n\r\n"};
|
||||
auto result = vls::read_frame(zero);
|
||||
Void::Testing::require(result.has_value() && result->has_value());
|
||||
Void::Testing::expect((**result).empty());
|
||||
}
|
||||
|
||||
Void::Testing::Test charset_and_header_validation() {
|
||||
for (const std::string type :
|
||||
{"application/vscode-jsonrpc; charset=utf-8", "application/vscode-jsonrpc; charset=UTF8",
|
||||
"application/vscode-jsonrpc", "application/json; charset=\"utf-8\""}) {
|
||||
std::istringstream input{"content-length:\t2 \r\nContent-Type: " + type + "\r\n\r\n{}"};
|
||||
Void::Testing::expect(vls::read_frame(input).has_value());
|
||||
}
|
||||
for (const std::string wire :
|
||||
{"Content-Length: 2\n\n{}", "Content-Length: 2\rx\r\n\r\n{}", "NoColon\r\n\r\n",
|
||||
"Content-Length : 2\r\n\r\n{}",
|
||||
"Content-Length: 2\r\nContent-Type: application/json; charset=latin1\r\n\r\n{}",
|
||||
"Content-Length: 2\r\nContent-Type: application/json; charset=utf-8; "
|
||||
"charset=utf8\r\n\r\n{}",
|
||||
"Content-Length: 2\r\nContent-Type: application/json\r\nContent-Type: "
|
||||
"application/json\r\n\r\n{}"}) {
|
||||
std::istringstream input{wire};
|
||||
Void::Testing::expect(!vls::read_frame(input).has_value());
|
||||
}
|
||||
std::istringstream non_ascii{"Content-Length: 0\r\nOther: \xFF\r\n\r\n"};
|
||||
Void::Testing::expect(!vls::read_frame(non_ascii).has_value());
|
||||
}
|
||||
|
||||
Void::Testing::Test truncated_header_and_body_are_fatal() {
|
||||
for (const std::string wire : {"C", "Content-Length: 2\r\n", "Content-Length: 2\r\n\r\n{"}) {
|
||||
std::istringstream input{wire};
|
||||
Void::Testing::expect(!vls::read_frame(input).has_value());
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test stream_failures_propagate() {
|
||||
std::istringstream broken;
|
||||
broken.setstate(std::ios::badbit);
|
||||
Void::Testing::expect(!vls::read_frame(broken).has_value());
|
||||
std::ostringstream output;
|
||||
output.setstate(std::ios::badbit);
|
||||
Void::Testing::expect(!vls::write_frame(output, "{}").has_value());
|
||||
std::istringstream input{test::frame(test::initialize_request)};
|
||||
std::ostringstream diagnostics;
|
||||
Void::Testing::expect_eq(vls::run_stdio(input, output, diagnostics), 1);
|
||||
Void::Testing::expect(!diagnostics.str().empty());
|
||||
}
|
||||
|
||||
Void::Testing::Test no_resynchronization_after_framing_error() {
|
||||
std::istringstream input{"Content-Length: nope\r\n\r\n" +
|
||||
test::frame(test::initialize_request)};
|
||||
std::ostringstream output;
|
||||
std::ostringstream diagnostics;
|
||||
Void::Testing::expect_eq(vls::run_stdio(input, output, diagnostics), 1);
|
||||
Void::Testing::expect(output.str().empty());
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
#include "TestSupport.hpp"
|
||||
|
||||
#include <Void/System/Process.hpp>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
// These are upstream integration requirements, deliberately ordinary failing
|
||||
// tests until a verified StrictJson revision implements the complete grammar.
|
||||
Void::Testing::Test decimal_and_exponent_json_values() {
|
||||
for (const auto number : {"0.0", "-0.5", "1.25", "1e3", "1E+3", "-2.5e-2", "0e0"}) {
|
||||
const auto parsed = vls::parse_json(std::string{"{\"ignored\":"} + number + "}");
|
||||
Void::Testing::expect(parsed.has_value());
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test decimal_initialization_options_and_unknown_fields() {
|
||||
for (const auto number : {"1.5", "-2.5e-2", "1E+3"}) {
|
||||
vls::Server server;
|
||||
const auto reply = test::response(
|
||||
server,
|
||||
std::string{
|
||||
R"({"jsonrpc":"2.0","id":1,"method":"initialize","params":{"processId":null,"rootUri":null,"capabilities":{},"initializationOptions":{"scale":)"} +
|
||||
number + R"(},"extension":2.75e1}})");
|
||||
const auto *object = std::get_if<vls::Json::Object>(&reply.value);
|
||||
Void::Testing::require(object != nullptr);
|
||||
Void::Testing::expect(object->contains("result"));
|
||||
Void::Testing::expect(!object->contains("error"));
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test fractional_and_out_of_range_numeric_ids_are_invalid_requests() {
|
||||
for (const auto id : {"1.5", "1e-1", "2147483648.0", "-2147483649.0", "1e50"}) {
|
||||
vls::Server server;
|
||||
const auto reply = test::response(server, std::string{"{\"jsonrpc\":\"2.0\",\"id\":"} + id +
|
||||
R"(,"method":"initialize","params":{}})");
|
||||
Void::Testing::expect_eq(test::error_code(reply), std::int64_t{-32600});
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<std::nullptr_t>(test::field(reply, "id").value));
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test integer_valued_number_ids_preserve_value() {
|
||||
const std::pair<std::string_view, std::int64_t> cases[] = {{"1.0", 1},
|
||||
{"1e0", 1},
|
||||
{"-0.0", 0},
|
||||
{"2.147483647e9", 2147483647},
|
||||
{"-2.147483648e9", -2147483648}};
|
||||
for (const auto &[id, expected] : cases) {
|
||||
vls::Server server;
|
||||
const auto reply =
|
||||
test::response(server, std::string{"{\"jsonrpc\":\"2.0\",\"id\":"} + std::string{id} +
|
||||
R"(,"method":"initialize","params":{}})");
|
||||
const auto *object = std::get_if<vls::Json::Object>(&reply.value);
|
||||
Void::Testing::require(object != nullptr);
|
||||
Void::Testing::require(object->contains("result"));
|
||||
Void::Testing::expect_eq(std::get<std::int64_t>(test::field(reply, "id").value), expected);
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test numeric_ids_through_executable() {
|
||||
using namespace std::chrono_literals;
|
||||
const auto input =
|
||||
test::frame(R"({"jsonrpc":"2.0","id":1e0,"method":"initialize","params":{}})") +
|
||||
test::frame(R"({"jsonrpc":"2.0","id":2.0,"method":"unknown"})") +
|
||||
test::frame(R"({"jsonrpc":"2.0","id":-2.147483648e9,"method":"unknown"})") +
|
||||
test::frame(R"({"jsonrpc":"2.0","id":1.5,"method":"unknown"})") +
|
||||
test::frame(R"({"jsonrpc":"2.0","id":2.147483647e9,"method":"shutdown"})") +
|
||||
test::frame(test::exit);
|
||||
const auto output = Void::Process::run(VLS_EXECUTABLE, {"--stdio"}, input, 2s);
|
||||
Void::Testing::require(output.has_value());
|
||||
Void::Testing::expect_eq(output->exit_code, 0);
|
||||
Void::Testing::expect(output->err.empty());
|
||||
const auto replies = test::responses(output->out);
|
||||
Void::Testing::require_eq(replies.size(), std::size_t{5});
|
||||
Void::Testing::require(std::get<vls::Json::Object>(replies[0].value).contains("result"));
|
||||
Void::Testing::expect_eq(std::get<std::int64_t>(test::field(replies[0], "id").value),
|
||||
std::int64_t{1});
|
||||
Void::Testing::expect_eq(std::get<std::int64_t>(test::field(replies[1], "id").value),
|
||||
std::int64_t{2});
|
||||
Void::Testing::expect_eq(test::error_code(replies[1]), std::int64_t{-32601});
|
||||
Void::Testing::expect_eq(std::get<std::int64_t>(test::field(replies[2], "id").value),
|
||||
std::int64_t{-2147483648});
|
||||
Void::Testing::expect_eq(test::error_code(replies[2]), std::int64_t{-32601});
|
||||
Void::Testing::expect_eq(test::error_code(replies[3]), std::int64_t{-32600});
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<std::nullptr_t>(test::field(replies[3], "id").value));
|
||||
Void::Testing::expect_eq(std::get<std::int64_t>(test::field(replies[4], "id").value),
|
||||
std::int64_t{2147483647});
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<std::nullptr_t>(test::field(replies[4], "result").value));
|
||||
}
|
||||
|
||||
Void::Testing::Test decimal_initialization_through_executable() {
|
||||
using namespace std::chrono_literals;
|
||||
const auto input =
|
||||
test::frame(
|
||||
R"({"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{},"initializationOptions":{"scale":1.5,"exponent":-2.5e-2},"unknown":1E+3}})") +
|
||||
test::frame(test::initialized) + test::frame(test::shutdown) + test::frame(test::exit);
|
||||
const auto output = Void::Process::run(VLS_EXECUTABLE, {"--stdio"}, input, 2s);
|
||||
Void::Testing::require(output.has_value());
|
||||
Void::Testing::expect_eq(output->exit_code, 0);
|
||||
Void::Testing::expect(output->err.empty());
|
||||
const auto replies = test::responses(output->out);
|
||||
Void::Testing::require_eq(replies.size(), std::size_t{2});
|
||||
const auto *object = std::get_if<vls::Json::Object>(&replies[0].value);
|
||||
Void::Testing::require(object != nullptr);
|
||||
Void::Testing::expect(object->contains("result"));
|
||||
Void::Testing::expect(!object->contains("error"));
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
#include "TestSupport.hpp"
|
||||
|
||||
Void::Testing::Test valid_unicode_and_escapes() {
|
||||
const auto pair = vls::parse_json(R"("\uD83D\uDE03")");
|
||||
Void::Testing::require(pair.has_value());
|
||||
Void::Testing::expect_eq(std::get<std::string>(pair->value), std::string{"\xF0\x9F\x98\x83"});
|
||||
std::string source{"quote\" slash\\ line\n\t"};
|
||||
source.push_back('\0');
|
||||
source += "\xD0\x96";
|
||||
auto round_trip = vls::parse_json(vls::quote_json(source));
|
||||
Void::Testing::require(round_trip.has_value());
|
||||
Void::Testing::expect_eq(std::get<std::string>(round_trip->value), source);
|
||||
}
|
||||
|
||||
Void::Testing::Test rejects_invalid_utf8_and_raw_controls() {
|
||||
for (const std::string bytes :
|
||||
{std::string{"\x80"}, std::string{"\xC0\xAF"}, std::string{"\xE0\x80\xAF"},
|
||||
std::string{"\xED\xA0\x80"}, std::string{"\xF4\x90\x80\x80"}, std::string{"\xF0\x9F"},
|
||||
std::string{"\n"}, std::string(1, '\0')}) {
|
||||
Void::Testing::expect(!vls::parse_json("\"" + bytes + "\"").has_value());
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test rejects_invalid_escapes_and_surrogates() {
|
||||
for (const auto text : {R"("\uD800")", R"("\uDC00")", R"("\uD800\u0041")", R"("\uD800\uD800")",
|
||||
R"("\uDE03\uD83D")", R"("\uGGGG")", R"("\u12")", R"("\x20")",
|
||||
R"("unterminated)", R"("\")"})
|
||||
Void::Testing::expect(!vls::parse_json(text).has_value());
|
||||
}
|
||||
|
||||
Void::Testing::Test depth_is_bounded_before_recursive_parse() {
|
||||
Void::Testing::expect(
|
||||
vls::parse_json(std::string(64, '[') + "0" + std::string(64, ']')).has_value());
|
||||
Void::Testing::expect(
|
||||
!vls::parse_json(std::string(65, '[') + "0" + std::string(65, ']')).has_value());
|
||||
Void::Testing::expect(vls::parse_json(R"({"text":"[\"{\\]"})", 1).has_value());
|
||||
Void::Testing::expect(vls::parse_json("{}", 1).has_value());
|
||||
Void::Testing::expect(!vls::parse_json("[{}]", 1).has_value());
|
||||
Void::Testing::expect(!vls::parse_json(std::string(100000, '[')).has_value());
|
||||
}
|
||||
|
||||
Void::Testing::Test request_ids_preserve_strings_and_signed32_range() {
|
||||
for (const auto text : {"-2147483648", "2147483647", "0", "-1", R"("quote\"\\\n\u0416")"}) {
|
||||
const auto json = vls::parse_json(text);
|
||||
Void::Testing::require(json.has_value());
|
||||
const auto id = vls::request_id(*json);
|
||||
Void::Testing::require(id.has_value());
|
||||
const auto decoded = vls::parse_json(vls::encode_id(*id));
|
||||
Void::Testing::require(decoded.has_value());
|
||||
const auto again = vls::request_id(*decoded);
|
||||
Void::Testing::require(again.has_value());
|
||||
Void::Testing::expect(*id == *again);
|
||||
}
|
||||
for (const auto text : {"-2147483649", "2147483648", "null", "true", "{}", "[]"}) {
|
||||
const auto json = vls::parse_json(text);
|
||||
Void::Testing::require(json.has_value());
|
||||
Void::Testing::expect(!vls::request_id(*json).has_value());
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test malformed_json_is_rejected() {
|
||||
for (const auto text :
|
||||
{"", "{} x", "{", "[1,]", "{\"a\":1,}", "true false", R"({"same":1,"same":2})", "01", "-",
|
||||
"NaN", "Infinity", "1.", "1e", "1e+", "+1", ".1", "--1"})
|
||||
Void::Testing::expect(!vls::parse_json(text).has_value());
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
#include "TestSupport.hpp"
|
||||
|
||||
Void::Testing::Test complete_lifecycle_advertises_empty_capabilities() {
|
||||
vls::Server server;
|
||||
const auto initialized = test::response(server, test::initialize_request);
|
||||
const auto &result = test::field(initialized, "result");
|
||||
Void::Testing::expect(
|
||||
std::get<vls::Json::Object>(test::field(result, "capabilities").value).empty());
|
||||
const auto &info = test::field(result, "serverInfo");
|
||||
Void::Testing::expect_eq(std::get<std::string>(test::field(info, "name").value),
|
||||
std::string{"VoidLanguageServer"});
|
||||
Void::Testing::expect_eq(std::get<std::string>(test::field(info, "version").value),
|
||||
std::string{"0.1.0"});
|
||||
Void::Testing::expect(!server.handle(test::initialized).response.has_value());
|
||||
const auto stopped = test::response(server, test::shutdown);
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<std::nullptr_t>(test::field(stopped, "result").value));
|
||||
const auto exited = server.handle(test::exit);
|
||||
Void::Testing::expect(!exited.response.has_value());
|
||||
Void::Testing::require(exited.exit_code.has_value());
|
||||
Void::Testing::expect_eq(*exited.exit_code, 0);
|
||||
}
|
||||
|
||||
Void::Testing::Test requests_before_initialize_and_premature_exit() {
|
||||
vls::Server server;
|
||||
test::expect_error(server, test::shutdown, -32002);
|
||||
test::expect_error(server, R"({"jsonrpc":"2.0","id":3,"method":"unknown"})", -32002);
|
||||
Void::Testing::expect(!server.handle(test::initialized).response.has_value());
|
||||
auto exited = server.handle(test::exit);
|
||||
Void::Testing::require(exited.exit_code.has_value());
|
||||
Void::Testing::expect_eq(*exited.exit_code, 1);
|
||||
}
|
||||
|
||||
Void::Testing::Test initialize_requires_object_and_only_runs_once() {
|
||||
vls::Server server;
|
||||
for (const auto params : {"", ",\"params\":[]", ",\"params\":null", ",\"params\":true"})
|
||||
test::expect_error(
|
||||
server, std::string{R"({"jsonrpc":"2.0","id":1,"method":"initialize")"} + params + "}",
|
||||
-32602);
|
||||
Void::Testing::expect(!server.handle(R"({"jsonrpc":"2.0","method":"initialize","params":{}})")
|
||||
.response.has_value());
|
||||
test::initialize(server);
|
||||
test::expect_error(server, test::initialize_request, -32600);
|
||||
}
|
||||
|
||||
Void::Testing::Test unknown_methods_notifications_and_exit_request() {
|
||||
vls::Server server;
|
||||
test::initialize(server);
|
||||
test::expect_error(
|
||||
server, R"({"jsonrpc":"2.0","id":3,"method":"textDocument/hover","params":{}})", -32601);
|
||||
test::expect_error(server, R"({"jsonrpc":"2.0","id":4,"method":"exit"})", -32601);
|
||||
for (const auto text :
|
||||
{R"({"jsonrpc":"2.0","method":"unknown"})", R"({"jsonrpc":"2.0","method":7})",
|
||||
R"({"jsonrpc":"wrong","method":"unknown"})", R"({"jsonrpc":"2.0","method":"shutdown"})"})
|
||||
Void::Testing::expect(!server.handle(text).response.has_value());
|
||||
Void::Testing::expect_eq(*server.handle(test::exit).exit_code, 1);
|
||||
}
|
||||
|
||||
Void::Testing::Test post_shutdown_precedes_all_request_methods() {
|
||||
vls::Server server;
|
||||
test::initialize(server);
|
||||
static_cast<void>(test::response(server, test::shutdown));
|
||||
for (const auto text : {test::initialize_request, test::shutdown,
|
||||
std::string_view{R"({"jsonrpc":"2.0","id":4,"method":"unknown"})"}})
|
||||
test::expect_error(server, text, -32600);
|
||||
Void::Testing::expect_eq(*server.handle(test::exit).exit_code, 0);
|
||||
}
|
||||
|
||||
Void::Testing::Test malformed_envelopes_and_ids() {
|
||||
vls::Server server;
|
||||
for (const auto text :
|
||||
{"[]", "[{}]", "null", "true", "{}", R"({"jsonrpc":"1.0","id":1,"method":"initialize"})",
|
||||
R"({"jsonrpc":"2.0","id":null,"method":"initialize"})",
|
||||
R"({"jsonrpc":"2.0","id":true,"method":"initialize"})",
|
||||
R"({"jsonrpc":"2.0","id":2147483648,"method":"initialize"})",
|
||||
R"({"jsonrpc":"2.0","id":-2147483649,"method":"initialize"})",
|
||||
R"({"jsonrpc":"2.0","id":{},"method":"initialize"})",
|
||||
R"({"jsonrpc":"2.0","id":[],"method":"initialize"})",
|
||||
R"({"jsonrpc":"2.0","id":1,"method":false})",
|
||||
R"({"jsonrpc":"2.0","id":1,"method":"initialize","result":null})",
|
||||
R"({"jsonrpc":"2.0","id":1,"result":null,"error":{"code":-32600,"message":"bad"}})"})
|
||||
test::expect_error(server, text, -32600);
|
||||
const auto string_id =
|
||||
test::response(server, R"({"jsonrpc":"2.0","id":"\"\u0416\n","method":"unknown"})");
|
||||
Void::Testing::expect_eq(std::get<std::string>(test::field(string_id, "id").value),
|
||||
std::string{"\"\xD0\x96\n"});
|
||||
}
|
||||
|
||||
Void::Testing::Test unmatched_responses_do_not_reply_or_change_lifecycle() {
|
||||
vls::Server server;
|
||||
const auto ignore_responses = [&] {
|
||||
for (const auto text :
|
||||
{R"({"jsonrpc":"2.0","id":77,"result":{"ok":true}})",
|
||||
R"({"jsonrpc":"2.0","id":null,"result":null})",
|
||||
R"({"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error"}})",
|
||||
R"({"jsonrpc":"2.0","id":"unknown","error":{"code":-32601,"message":"unknown"}})"}) {
|
||||
const auto dispatched = server.handle(text);
|
||||
Void::Testing::expect(!dispatched.response.has_value());
|
||||
Void::Testing::expect(!dispatched.exit_code.has_value());
|
||||
}
|
||||
};
|
||||
ignore_responses();
|
||||
test::expect_error(server, test::shutdown, -32002);
|
||||
test::initialize(server);
|
||||
ignore_responses();
|
||||
static_cast<void>(test::response(server, test::shutdown));
|
||||
ignore_responses();
|
||||
Void::Testing::expect_eq(*server.handle(test::exit).exit_code, 0);
|
||||
}
|
||||
|
||||
Void::Testing::Test parse_errors_use_null_id_and_do_not_mutate_state() {
|
||||
vls::Server server;
|
||||
const auto malformed = test::response(server, "{bad");
|
||||
Void::Testing::expect_eq(test::error_code(malformed), std::int64_t{-32700});
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<std::nullptr_t>(test::field(malformed, "id").value));
|
||||
test::initialize(server);
|
||||
test::expect_error(server, "{bad", -32700);
|
||||
static_cast<void>(test::response(server, test::shutdown));
|
||||
}
|
||||
|
||||
Void::Testing::Test eof_never_reports_success_without_exit() {
|
||||
for (const auto wire : {std::string{}, test::frame(test::initialize_request),
|
||||
test::frame(test::initialize_request) + test::frame(test::shutdown)}) {
|
||||
std::istringstream input{wire};
|
||||
std::ostringstream output;
|
||||
std::ostringstream diagnostics;
|
||||
Void::Testing::expect_eq(vls::run_stdio(input, output, diagnostics), 1);
|
||||
Void::Testing::expect(!diagnostics.str().empty());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
#include "TestSupport.hpp"
|
||||
|
||||
#include <Void/System/Process.hpp>
|
||||
|
||||
#include <cerrno>
|
||||
#include <chrono>
|
||||
#include <poll.h>
|
||||
#include <stdexcept>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace {
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
Void::Process::Child spawn(const std::vector<std::string> &arguments = {}) {
|
||||
Void::Process::SpawnOptions options;
|
||||
options.executable = VLS_EXECUTABLE;
|
||||
options.arguments = arguments;
|
||||
options.search_path = false;
|
||||
options.kill_grace = 100ms;
|
||||
auto child = Void::Process::spawn(options);
|
||||
Void::Testing::require(child.has_value());
|
||||
return std::move(*child);
|
||||
}
|
||||
|
||||
Void::Process::CommunicateResult finish(Void::Process::Child &child, std::string_view input = {}) {
|
||||
Void::Process::CaptureLimits limits;
|
||||
limits.max_stdin_bytes = 65536;
|
||||
limits.max_stdout_bytes = 65536;
|
||||
limits.max_stderr_bytes = 16384;
|
||||
auto output = Void::Process::communicate_blocking(child, input, limits, 2s);
|
||||
Void::Testing::require(output.has_value());
|
||||
Void::Testing::require(!output->timed_out && !output->cancelled && !output->overflowed);
|
||||
Void::Testing::require(output->status.exited);
|
||||
return std::move(*output);
|
||||
}
|
||||
|
||||
Void::Process::CommunicateResult run(std::string_view input = {},
|
||||
const std::vector<std::string> &arguments = {}) {
|
||||
auto child = spawn(arguments);
|
||||
return finish(child, input);
|
||||
}
|
||||
|
||||
void write_fragment(Void::Process::Child &child, std::string_view fragment) {
|
||||
const auto deadline = std::chrono::steady_clock::now() + 2s;
|
||||
while (!fragment.empty()) {
|
||||
if (std::chrono::steady_clock::now() >= deadline)
|
||||
throw std::runtime_error{"child stdin deadline"};
|
||||
pollfd descriptor{child.stdin_fd(), POLLOUT, 0};
|
||||
const int ready = ::poll(&descriptor, 1, 20);
|
||||
if (ready < 0 && errno == EINTR)
|
||||
continue;
|
||||
Void::Testing::require(ready >= 0);
|
||||
if (ready == 0)
|
||||
continue;
|
||||
Void::Testing::require((descriptor.revents & POLLOUT) != 0);
|
||||
// Tiny fragments fit within PIPE_BUF after writable readiness.
|
||||
const auto count = ::write(child.stdin_fd(), fragment.data(), fragment.size());
|
||||
if (count < 0 && errno == EINTR)
|
||||
continue;
|
||||
Void::Testing::require(count > 0);
|
||||
fragment.remove_prefix(static_cast<std::size_t>(count));
|
||||
}
|
||||
}
|
||||
|
||||
void expect_no_early_output(Void::Process::Child &child) {
|
||||
pollfd descriptor{child.stdout_fd(), POLLIN, 0};
|
||||
const int ready = ::poll(&descriptor, 1, 20);
|
||||
Void::Testing::require(ready >= 0);
|
||||
Void::Testing::expect_eq(ready, 0);
|
||||
}
|
||||
|
||||
std::string read_early_response(Void::Process::Child &child) {
|
||||
const auto deadline = std::chrono::steady_clock::now() + 2s;
|
||||
std::string bytes;
|
||||
while (std::chrono::steady_clock::now() < deadline && bytes.size() < 8192) {
|
||||
pollfd descriptor{child.stdout_fd(), POLLIN, 0};
|
||||
const int ready = ::poll(&descriptor, 1, 20);
|
||||
if (ready < 0 && errno == EINTR)
|
||||
continue;
|
||||
Void::Testing::require(ready >= 0);
|
||||
if (ready == 0)
|
||||
continue;
|
||||
char byte{};
|
||||
Void::Testing::require(::read(child.stdout_fd(), &byte, 1) == 1);
|
||||
bytes.push_back(byte);
|
||||
std::istringstream probe{bytes};
|
||||
const auto complete = vls::read_frame(probe);
|
||||
if (complete.has_value() && complete->has_value())
|
||||
return bytes;
|
||||
}
|
||||
throw std::runtime_error{"child response deadline or byte limit"};
|
||||
}
|
||||
|
||||
std::string lifecycle() {
|
||||
return test::frame(test::initialize_request) + test::frame(test::initialized) +
|
||||
test::frame(test::shutdown) + test::frame(test::exit);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Void::Testing::Test cli_standalone_and_invalid_modes() {
|
||||
for (const auto flag : {"--help", "-h", "--version", "-V"}) {
|
||||
const auto output = run({}, {flag});
|
||||
Void::Testing::expect_eq(output.status.code, 0);
|
||||
Void::Testing::expect(!output.out.empty());
|
||||
Void::Testing::expect(output.err.empty());
|
||||
Void::Testing::expect(output.out.find("Content-Length:") == std::string::npos);
|
||||
Void::Testing::expect(output.out.find("VoidLanguageServer") != std::string::npos);
|
||||
}
|
||||
const auto version = run({}, {"--version"});
|
||||
Void::Testing::expect_eq(version.out, std::string{"VoidLanguageServer 0.1.0\n"});
|
||||
for (const auto &args : std::vector<std::vector<std::string>>{{"--unknown"},
|
||||
{"build"},
|
||||
{"--"},
|
||||
{"--stdio=true"},
|
||||
{"-s"},
|
||||
{"--help", "--stdio"},
|
||||
{"--stdio", "--help"},
|
||||
{"--version", "--stdio"},
|
||||
{"--version", "--help"},
|
||||
{"--stdio", "--stdio"},
|
||||
{"-V", "-V"}}) {
|
||||
const auto output = run({}, args);
|
||||
Void::Testing::expect_eq(output.status.code, 2);
|
||||
Void::Testing::expect(output.out.empty());
|
||||
Void::Testing::expect(!output.err.empty());
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test default_and_explicit_stdio_lifecycle() {
|
||||
for (const auto &args : std::vector<std::vector<std::string>>{{}, {"--stdio"}}) {
|
||||
const auto output = run(lifecycle(), args);
|
||||
Void::Testing::expect_eq(output.status.code, 0);
|
||||
Void::Testing::expect(output.err.empty());
|
||||
const auto replies = test::responses(output.out);
|
||||
Void::Testing::require_eq(replies.size(), std::size_t{2});
|
||||
const auto &result = test::field(replies[0], "result");
|
||||
Void::Testing::expect(
|
||||
std::get<vls::Json::Object>(test::field(result, "capabilities").value).empty());
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<std::nullptr_t>(test::field(replies[1], "result").value));
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test fragmented_headers_bodies_and_immediate_flush() {
|
||||
auto child = spawn({"--stdio"});
|
||||
const auto input = test::frame(test::initialize_request);
|
||||
const auto split = input.find("\r\n\r\n") + 5;
|
||||
write_fragment(child, std::string_view{input}.substr(0, 10));
|
||||
expect_no_early_output(child);
|
||||
write_fragment(child, std::string_view{input}.substr(10, split - 10));
|
||||
expect_no_early_output(child);
|
||||
for (std::size_t offset = split; offset < input.size(); ++offset)
|
||||
write_fragment(child, std::string_view{input}.substr(offset, 1));
|
||||
// Read initialize's response while stdin is still open: detects buffering
|
||||
// bugs that a single communicate-at-EOF test would miss.
|
||||
const auto early = read_early_response(child);
|
||||
const auto rest =
|
||||
finish(child, test::frame(test::initialized) +
|
||||
test::frame(R"({"jsonrpc":"2.0","method":"unknown"})") +
|
||||
test::frame(R"({"jsonrpc":"2.0","id":3,"method":"unknown"})") +
|
||||
test::frame(test::shutdown) + test::frame(test::exit));
|
||||
Void::Testing::expect_eq(rest.status.code, 0);
|
||||
Void::Testing::expect(rest.err.empty());
|
||||
const auto replies = test::responses(early + rest.out);
|
||||
Void::Testing::require_eq(replies.size(), std::size_t{3});
|
||||
Void::Testing::expect_eq(test::error_code(replies[1]), std::int64_t{-32601});
|
||||
}
|
||||
|
||||
Void::Testing::Test unmatched_peer_responses_do_not_create_reply_loops() {
|
||||
const auto responses =
|
||||
test::frame(R"({"jsonrpc":"2.0","id":77,"result":{"ok":true}})") +
|
||||
test::frame(R"({"jsonrpc":"2.0","id":null,"result":null})") +
|
||||
test::frame(
|
||||
R"({"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error"}})") +
|
||||
test::frame(
|
||||
R"({"jsonrpc":"2.0","id":"unknown","error":{"code":-32601,"message":"unknown"}})");
|
||||
const auto output = run(responses + test::frame(test::initialize_request) + responses +
|
||||
test::frame(test::shutdown) + responses + test::frame(test::exit));
|
||||
Void::Testing::expect_eq(output.status.code, 0);
|
||||
Void::Testing::expect(output.err.empty());
|
||||
const auto replies = test::responses(output.out);
|
||||
Void::Testing::require_eq(replies.size(), std::size_t{2});
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<vls::Json::Object>(test::field(replies[0], "result").value));
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<std::nullptr_t>(test::field(replies[1], "result").value));
|
||||
}
|
||||
|
||||
Void::Testing::Test known_size_malformed_json_continues() {
|
||||
const auto output = run(test::frame("{bad") + test::frame("[{}]") + lifecycle());
|
||||
Void::Testing::expect_eq(output.status.code, 0);
|
||||
Void::Testing::expect(output.err.empty());
|
||||
const auto replies = test::responses(output.out);
|
||||
Void::Testing::require_eq(replies.size(), std::size_t{4});
|
||||
Void::Testing::expect_eq(test::error_code(replies[0]), std::int64_t{-32700});
|
||||
Void::Testing::expect(
|
||||
std::holds_alternative<std::nullptr_t>(test::field(replies[0], "id").value));
|
||||
Void::Testing::expect_eq(test::error_code(replies[1]), std::int64_t{-32600});
|
||||
}
|
||||
|
||||
Void::Testing::Test invalid_encoding_and_surrogates_continue() {
|
||||
const auto output = run(test::frame(std::string{"\"\xED\xA0\x80\""}) +
|
||||
test::frame(R"({"bad":"\uDC00"})") + lifecycle());
|
||||
Void::Testing::expect_eq(output.status.code, 0);
|
||||
const auto replies = test::responses(output.out);
|
||||
Void::Testing::require_eq(replies.size(), std::size_t{4});
|
||||
Void::Testing::expect_eq(test::error_code(replies[0]), std::int64_t{-32700});
|
||||
Void::Testing::expect_eq(test::error_code(replies[1]), std::int64_t{-32700});
|
||||
}
|
||||
|
||||
Void::Testing::Test framing_errors_exit_without_resynchronization() {
|
||||
for (const auto prefix :
|
||||
{"Content-Length: invalid\r\n\r\n", "Other: 2\r\n\r\n", "Content-Length: 16777217\r\n\r\n",
|
||||
"Content-Length: 1\r\nContent-Length: 1\r\n\r\n",
|
||||
"Content-Length: 1\r\nContent-Type: application/json; charset=utf-16\r\n\r\n"}) {
|
||||
const auto output = run(std::string{prefix} + lifecycle());
|
||||
Void::Testing::expect_eq(output.status.code, 1);
|
||||
Void::Testing::expect(output.out.empty());
|
||||
Void::Testing::expect(!output.err.empty());
|
||||
}
|
||||
for (const auto prefix : {"Content-Length: 2\r\n", "Content-Length: 2\r\n\r\n{"}) {
|
||||
const auto output = run(prefix);
|
||||
Void::Testing::expect_eq(output.status.code, 1);
|
||||
Void::Testing::expect(output.out.empty());
|
||||
Void::Testing::expect(!output.err.empty());
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test premature_exit_and_unexpected_eof() {
|
||||
for (const auto input : {std::string{}, test::frame(test::exit),
|
||||
test::frame(test::initialize_request) + test::frame(test::exit),
|
||||
test::frame(test::initialize_request) + test::frame(test::shutdown)}) {
|
||||
const auto output = run(input);
|
||||
Void::Testing::expect_eq(output.status.code, 1);
|
||||
// Every byte of stdout must still be framed JSON.
|
||||
static_cast<void>(test::responses(output.out));
|
||||
}
|
||||
}
|
||||
|
||||
Void::Testing::Test lifecycle_error_precedence_and_string_ids() {
|
||||
const auto output = run(test::frame(test::shutdown) + test::frame(test::initialize_request) +
|
||||
test::frame(test::initialize_request) +
|
||||
test::frame(R"({"jsonrpc":"2.0","id":"\"\u0416","method":"unknown"})") +
|
||||
test::frame(test::shutdown) +
|
||||
test::frame(R"({"jsonrpc":"2.0","id":9,"method":"unknown"})") +
|
||||
test::frame(test::shutdown) + test::frame(test::exit));
|
||||
Void::Testing::expect_eq(output.status.code, 0);
|
||||
const auto replies = test::responses(output.out);
|
||||
Void::Testing::require_eq(replies.size(), std::size_t{7});
|
||||
Void::Testing::expect_eq(test::error_code(replies[0]), std::int64_t{-32002});
|
||||
Void::Testing::expect_eq(test::error_code(replies[2]), std::int64_t{-32600});
|
||||
Void::Testing::expect_eq(test::error_code(replies[3]), std::int64_t{-32601});
|
||||
Void::Testing::expect_eq(std::get<std::string>(test::field(replies[3], "id").value),
|
||||
std::string{"\"\xD0\x96"});
|
||||
Void::Testing::expect_eq(test::error_code(replies[5]), std::int64_t{-32600});
|
||||
Void::Testing::expect_eq(test::error_code(replies[6]), std::int64_t{-32600});
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
cmake_minimum_required(VERSION 4.0)
|
||||
|
||||
foreach(suite IN ITEMS UNIT CAPABILITIES PROCESS)
|
||||
execute_process(COMMAND "${${suite}}" --list --no-color
|
||||
RESULT_VARIABLE code OUTPUT_VARIABLE out ERROR_VARIABLE err TIMEOUT 5)
|
||||
if(NOT "${code}" STREQUAL "0" OR NOT "${err}" STREQUAL "")
|
||||
message(FATAL_ERROR "${suite} discovery failed: ${code}\n${out}\n${err}")
|
||||
endif()
|
||||
string(REPLACE "\n" ";" cases "${out}")
|
||||
list(FILTER cases EXCLUDE REGEX "^$")
|
||||
list(LENGTH cases count)
|
||||
if(suite STREQUAL "UNIT")
|
||||
set(minimum 22)
|
||||
elseif(suite STREQUAL "CAPABILITIES")
|
||||
set(minimum 6)
|
||||
else()
|
||||
set(minimum 9)
|
||||
endif()
|
||||
if(count LESS minimum)
|
||||
message(FATAL_ERROR "${suite} registered ${count} tests; expected at least ${minimum}")
|
||||
endif()
|
||||
message(STATUS "${suite}: ${count} registered cases")
|
||||
endforeach()
|
||||
|
||||
# Execute an actual body, observing runner count and exit code rather than relying
|
||||
# only on a nonempty list from the source scanner.
|
||||
execute_process(COMMAND "${UNIT}" --no-color --filter "^FramingTests.exact_frame_limits$"
|
||||
RESULT_VARIABLE code OUTPUT_VARIABLE out ERROR_VARIABLE err TIMEOUT 5)
|
||||
if(NOT "${code}" STREQUAL "0" OR NOT out MATCHES "1 tests:" OR
|
||||
NOT out MATCHES "exact_frame_limits")
|
||||
message(FATAL_ERROR "Named regression did not execute successfully: ${code}\n${out}\n${err}")
|
||||
endif()
|
||||
@@ -0,0 +1,76 @@
|
||||
#pragma once
|
||||
|
||||
#include <vls/Framing.hpp>
|
||||
#include <vls/Json.hpp>
|
||||
#include <vls/Server.hpp>
|
||||
|
||||
#include <Void/Testing/Assert.hpp>
|
||||
#include <Void/Testing/Test.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace test {
|
||||
|
||||
inline std::string frame(std::string_view text) {
|
||||
std::ostringstream output;
|
||||
Void::Testing::require(vls::write_frame(output, text).has_value());
|
||||
return output.str();
|
||||
}
|
||||
|
||||
inline std::vector<vls::Json> responses(std::string_view wire) {
|
||||
std::istringstream input{std::string{wire}};
|
||||
std::vector<vls::Json> result;
|
||||
for (;;) {
|
||||
const auto next = vls::read_frame(input);
|
||||
Void::Testing::require(next.has_value());
|
||||
if (!*next)
|
||||
return result;
|
||||
auto json = vls::parse_json(**next);
|
||||
Void::Testing::require(json.has_value());
|
||||
result.push_back(std::move(*json));
|
||||
}
|
||||
}
|
||||
|
||||
inline const vls::Json &field(const vls::Json &json, std::string_view key) {
|
||||
const auto *object = std::get_if<vls::Json::Object>(&json.value);
|
||||
Void::Testing::require(object != nullptr);
|
||||
const auto found = object->find(key);
|
||||
Void::Testing::require(found != object->end());
|
||||
return found->second;
|
||||
}
|
||||
|
||||
inline vls::Json response(vls::Server &server, std::string_view request) {
|
||||
const auto result = server.handle(request);
|
||||
Void::Testing::require(result.response.has_value());
|
||||
auto parsed = vls::parse_json(*result.response);
|
||||
Void::Testing::require(parsed.has_value());
|
||||
Void::Testing::expect(!result.exit_code.has_value());
|
||||
return std::move(*parsed);
|
||||
}
|
||||
|
||||
inline std::int64_t error_code(const vls::Json &response) {
|
||||
return std::get<std::int64_t>(field(field(response, "error"), "code").value);
|
||||
}
|
||||
|
||||
inline void expect_error(vls::Server &server, std::string_view request, std::int64_t code) {
|
||||
Void::Testing::expect_eq(error_code(response(server, request)), code);
|
||||
}
|
||||
|
||||
inline void initialize(vls::Server &server) {
|
||||
const auto result =
|
||||
response(server, R"({"jsonrpc":"2.0","id":1,"method":"initialize","params":{}})");
|
||||
Void::Testing::expect(
|
||||
std::get<vls::Json::Object>(field(field(result, "result"), "capabilities").value).empty());
|
||||
}
|
||||
|
||||
inline constexpr std::string_view initialize_request =
|
||||
R"({"jsonrpc":"2.0","id":"init","method":"initialize","params":{"processId":null,"clientInfo":{"name":"test client","version":"1"},"locale":"en","rootUri":"file:///tmp/workspace","capabilities":{"general":{"positionEncodings":["utf-16"]}},"workspaceFolders":null,"initializationOptions":{"ignored":true},"unknownExtension":{}}})";
|
||||
inline constexpr std::string_view initialized =
|
||||
R"({"jsonrpc":"2.0","method":"initialized","params":{}})";
|
||||
inline constexpr std::string_view shutdown = R"({"jsonrpc":"2.0","id":2,"method":"shutdown"})";
|
||||
inline constexpr std::string_view exit = R"({"jsonrpc":"2.0","method":"exit"})";
|
||||
|
||||
} // namespace test
|
||||
Reference in new issue
Block a user