From b69a7d15161c47cab6b1437e5dc43853bae322bb Mon Sep 17 00:00:00 2001 From: "Aleksei (Faumaray) Selikhov" Date: Fri, 4 Dec 2026 01:34:23 +0300 Subject: [PATCH] feat(net): adopt Void::Net for the registry HTTP transport when available --- CMakeLists.txt | 4 +++ cmake/VoidDependency.cmake | 12 ++++++++ docs/agent-workflow/STATE.md | 2 +- docs/agent-workflow/TASKS.md | 3 +- docs/agent-workflow/VERIFICATION.md | 17 +++++++++++ docs/roadmap/21-expansion-roadmap.md | 2 +- src/Package/RegistryClient.cpp | 42 ++++++++++++++++++++++++++++ 7 files changed, 79 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fd75ed..e9966f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,10 @@ if(VBS_HAS_VOID_SQLITE) target_link_libraries(VoidBuild_Core PUBLIC Void::Sqlite) target_compile_definitions(VoidBuild_Core PUBLIC VBS_HAS_VOID_SQLITE=1) endif() +if(VBS_HAS_VOID_NET) + target_link_libraries(VoidBuild_Core PUBLIC Void::Net) + target_compile_definitions(VoidBuild_Core PUBLIC VBS_HAS_VOID_NET=1) +endif() add_library(VoidBuild_Registry STATIC registry/service/HttpServer.cpp diff --git a/cmake/VoidDependency.cmake b/cmake/VoidDependency.cmake index 6e0a0c6..54799fb 100644 --- a/cmake/VoidDependency.cmake +++ b/cmake/VoidDependency.cmake @@ -21,6 +21,18 @@ function(vbs_add_void_dependency) set(VBS_HAS_VOID_SQLITE OFF PARENT_SCOPE) endif() + # Void::Net (Track E4) needs Boost url/beast/asio and OpenSSL; enable it only when the + # environment actually provides both, so minimal shells keep the pure-POSIX transport. + find_package(Boost CONFIG QUIET COMPONENTS url) + find_package(OpenSSL QUIET) + find_package(Threads QUIET) + if(Boost_FOUND AND OpenSSL_FOUND AND Threads_FOUND) + list(APPEND VOID_ENABLED_MODULES Net) + set(VBS_HAS_VOID_NET ON PARENT_SCOPE) + else() + set(VBS_HAS_VOID_NET OFF PARENT_SCOPE) + endif() + if(VBS_VOID_SOURCE_DIR) get_filename_component(_vbs_void_source "${VBS_VOID_SOURCE_DIR}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/docs/agent-workflow/STATE.md b/docs/agent-workflow/STATE.md index a53b932..2fc8dff 100644 --- a/docs/agent-workflow/STATE.md +++ b/docs/agent-workflow/STATE.md @@ -173,7 +173,7 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B - Added the `compdb_entries` daemon request (`vbs daemon compdb entries [--file SUFFIX] [--limit N]`): reads the active published compilation database (selection state or root alias), returns bounded projected entries (`file`, `directory`, `output`, `command`, bounded `arguments`), reports `total`/`returned`, and errors explicitly when nothing is published. - Added `Daemon.compdb_entries_queries_published_database` (unpublished → error, then all entries, a `main.cpp` filter with `limit:1`, and an invalid limit) and a CLI help contract; Daemon suite is now 18 cases. -- **Wave 40 (Authenticated Binary-Variant Downloads)**:\n - `download_binary_artifact` now accepts `RegistryAuth` and sends the bearer token, so private registry binary artifacts can be fetched; `BinaryFetchOptions` gained `bearer_token` and `materialize_binary_variant` forwards it; `vbs binaries fetch` passes the configured token.\n - Added `RegistryTests.private_binary_variant_download_requires_auth`: anonymous download of a private binary → 401, authenticated client download and signed materialization succeed.\n\n- **Wave 41 (Yanked Binary Variants in Listing)**:\n - `fetch_binary_variants` gained `include_yanked` (default false, so selection/materialization still never sees yanked variants); `vbs binaries list` opts in and marks yanked entries while `binaries fetch` keeps the filtered view.\n - Extended the registry binary-variant test to assert the yanked variant is returned with `yanked=true` only when requested.\n\n- **Wave 42 (Registry Binary-Variant Listing Endpoint)**:\n - Added `GET /api/v1/packages///binaries` returning the release's binary variants (`variant_id`, `sha256`, `size_bytes`, `yanked`, optional signature/public key) under normal read permissions; `RegistryClient::fetch_binary_variants` now queries this endpoint directly instead of parsing package detail JSON.\n - The registry binary-variant test asserts the listing endpoint returns the published variant with `yanked:false`.\n\n- **Wave 43 (Workspace Members Request)**:\n - Added the `workspace_members` daemon request (`vbs daemon workspace members`): lists declared workspace members (`name`, canonical `path`) without evaluating member build descriptions; non-workspace roots return `workspace:false` with an empty list.\n - Added `Daemon.workspace_members_lists_declared_members` and a CLI help contract; Daemon suite is now 19 cases.\n\n- **Wave 44 (IDE Configs Request)**:\n - Added the `ide_configs` daemon request (`vbs daemon ide configs`): reports presence of `.clangd`, `.vscode/tasks.json`, `.zed/tasks.json`, and `.idea/customTargets.xml` so editor extensions can see what is configured.\n - Added `Daemon.ide_configs_reports_generated_files` (absent before generation, present after `ide_generate`) and a CLI help contract; Daemon suite is now 20 cases.\n\n- **Wave 45 (Compdb Generations Request)**:\n - Added the `compdb_generations` daemon request (`vbs daemon compdb generations --profile`): lists immutable editor generations (bounded 128) with active flag, per-generation entry counts, and the per-profile status/diagnostic record; profile names are validated against `[A-Za-z0-9._-]` to prevent traversal.\n - Added `Daemon.compdb_generations_lists_history_and_active_generation` (empty before export, then a valid generation with entries and an active selection; invalid profile rejected) and a CLI help contract; Daemon suite is now 21 cases.\n\n- **Wave 46 (Registry Package Search Pagination)**:\n - `GET /api/v1/packages` now supports bounded `limit` (0-500, default 100) and `offset` (0-1,000,000) pagination with a `total`/`limit`/`offset` envelope; malformed values return 400.\n - The registry RBAC test asserts a `limit=1` page contains exactly one package and that `limit=501` is rejected.\n\n- **Wave 47 (Registry Release Detail Endpoint)**:\n - Added `GET /api/v1/packages//` returning release metadata (digest, size, yank state, publisher/epoch, optional signature/public key, binary variant summaries) under normal read permissions; unknown packages/releases return 404.\n - The registry binary-variant test asserts the release detail includes the version and published binary variant, and that an unknown version returns 404.\n\n- **Wave 48 (Daemon Deps Request)**:\n - Added the `deps` daemon request (`vbs daemon deps [--profile] [--member]`): evaluates the project, merges TOML/declared dependencies, resolves and materializes them with the pinned lock, registry environment, and trusted keys, then returns the lock context key and per-entry metadata (`alias`, `source_kind`, `package_name`, `version`, `sha256`, `signed`). Shared dependency-merge and resolve-option helpers were extracted for reuse by the build path.\n - Extended `Daemon.build_materializes_path_dependency` to assert a `deps` response with the `helper` path entry before building, plus a CLI help contract.\n\n- **Wave 49 (Daemon Info Request)**:\n - Added the `info` daemon request (`vbs daemon info`): reports the daemon version, host OS/architecture, project/build/lock roots, and socket path so editor extensions can discover the environment without guessing.\n - Added `Daemon.info_reports_daemon_paths_and_host` and a CLI help contract; Daemon suite is now 22 cases.\n\n- **Wave 50 (Registry Audit Query Filters)**:\n - `GET /api/v1/audit` now supports `actor`, `action` (substring), `outcome`, `limit` (0–2000, default 100) and `offset` filters with a `total`/`limit`/`offset` envelope; malformed limits return 400.\n - The registry RBAC test asserts the audit envelope and an action-filtered `limit=1` page contains a single entry.\n\n- **Wave 51 (Track E4 `Void::Sqlite` Alignment for the StateStore)**:\n - When built with SQLite3 (`VBS_HAS_VOID_SQLITE`, now available via `dev cpp-gcc -p sqlite`), `StateStore` keeps its transactional action cache in `state/state.v2.sqlite` using `Void::Sqlite` (`meta`, `actions`, `generations` tables, one transaction per publication) and imports an existing `state.v1.json` once. Without SQLite the journaled atomic JSON store remains unchanged.\n - `Void::Net` alignment is still pending: it requires OpenSSL, while only Boost is provided by `-p boost`.\n\n- **Wave 52 (Live Conan2 Verification)**:\n - `conan` 2.32.0 is available via `dev cpp-gcc -p conan`. Added `FullV1Tests.track_b3_live_conan_provider_install`: it builds a real local header-only package with `conan create` in an isolated `CONAN_HOME` (restored afterwards), then runs the Conan2 provider so a real `conan install` executes (verified by the generated `conanbuild.sh`). Skips when `conan` is absent.\n\n## Remaining future scope"}, {"oldString": "Live `conan` CLI verification (Track B3), Track C", "newString": "Track C"}"}, {"oldString": "Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.", "newString": "Track E4 (`Void::Net` alignment; `Void::Sqlite` is now used by the StateStore when SQLite3 is available) remain planned scope."} +- **Wave 40 (Authenticated Binary-Variant Downloads)**:\n - `download_binary_artifact` now accepts `RegistryAuth` and sends the bearer token, so private registry binary artifacts can be fetched; `BinaryFetchOptions` gained `bearer_token` and `materialize_binary_variant` forwards it; `vbs binaries fetch` passes the configured token.\n - Added `RegistryTests.private_binary_variant_download_requires_auth`: anonymous download of a private binary → 401, authenticated client download and signed materialization succeed.\n\n- **Wave 41 (Yanked Binary Variants in Listing)**:\n - `fetch_binary_variants` gained `include_yanked` (default false, so selection/materialization still never sees yanked variants); `vbs binaries list` opts in and marks yanked entries while `binaries fetch` keeps the filtered view.\n - Extended the registry binary-variant test to assert the yanked variant is returned with `yanked=true` only when requested.\n\n- **Wave 42 (Registry Binary-Variant Listing Endpoint)**:\n - Added `GET /api/v1/packages///binaries` returning the release's binary variants (`variant_id`, `sha256`, `size_bytes`, `yanked`, optional signature/public key) under normal read permissions; `RegistryClient::fetch_binary_variants` now queries this endpoint directly instead of parsing package detail JSON.\n - The registry binary-variant test asserts the listing endpoint returns the published variant with `yanked:false`.\n\n- **Wave 43 (Workspace Members Request)**:\n - Added the `workspace_members` daemon request (`vbs daemon workspace members`): lists declared workspace members (`name`, canonical `path`) without evaluating member build descriptions; non-workspace roots return `workspace:false` with an empty list.\n - Added `Daemon.workspace_members_lists_declared_members` and a CLI help contract; Daemon suite is now 19 cases.\n\n- **Wave 44 (IDE Configs Request)**:\n - Added the `ide_configs` daemon request (`vbs daemon ide configs`): reports presence of `.clangd`, `.vscode/tasks.json`, `.zed/tasks.json`, and `.idea/customTargets.xml` so editor extensions can see what is configured.\n - Added `Daemon.ide_configs_reports_generated_files` (absent before generation, present after `ide_generate`) and a CLI help contract; Daemon suite is now 20 cases.\n\n- **Wave 45 (Compdb Generations Request)**:\n - Added the `compdb_generations` daemon request (`vbs daemon compdb generations --profile`): lists immutable editor generations (bounded 128) with active flag, per-generation entry counts, and the per-profile status/diagnostic record; profile names are validated against `[A-Za-z0-9._-]` to prevent traversal.\n - Added `Daemon.compdb_generations_lists_history_and_active_generation` (empty before export, then a valid generation with entries and an active selection; invalid profile rejected) and a CLI help contract; Daemon suite is now 21 cases.\n\n- **Wave 46 (Registry Package Search Pagination)**:\n - `GET /api/v1/packages` now supports bounded `limit` (0-500, default 100) and `offset` (0-1,000,000) pagination with a `total`/`limit`/`offset` envelope; malformed values return 400.\n - The registry RBAC test asserts a `limit=1` page contains exactly one package and that `limit=501` is rejected.\n\n- **Wave 47 (Registry Release Detail Endpoint)**:\n - Added `GET /api/v1/packages//` returning release metadata (digest, size, yank state, publisher/epoch, optional signature/public key, binary variant summaries) under normal read permissions; unknown packages/releases return 404.\n - The registry binary-variant test asserts the release detail includes the version and published binary variant, and that an unknown version returns 404.\n\n- **Wave 48 (Daemon Deps Request)**:\n - Added the `deps` daemon request (`vbs daemon deps [--profile] [--member]`): evaluates the project, merges TOML/declared dependencies, resolves and materializes them with the pinned lock, registry environment, and trusted keys, then returns the lock context key and per-entry metadata (`alias`, `source_kind`, `package_name`, `version`, `sha256`, `signed`). Shared dependency-merge and resolve-option helpers were extracted for reuse by the build path.\n - Extended `Daemon.build_materializes_path_dependency` to assert a `deps` response with the `helper` path entry before building, plus a CLI help contract.\n\n- **Wave 49 (Daemon Info Request)**:\n - Added the `info` daemon request (`vbs daemon info`): reports the daemon version, host OS/architecture, project/build/lock roots, and socket path so editor extensions can discover the environment without guessing.\n - Added `Daemon.info_reports_daemon_paths_and_host` and a CLI help contract; Daemon suite is now 22 cases.\n\n- **Wave 50 (Registry Audit Query Filters)**:\n - `GET /api/v1/audit` now supports `actor`, `action` (substring), `outcome`, `limit` (0–2000, default 100) and `offset` filters with a `total`/`limit`/`offset` envelope; malformed limits return 400.\n - The registry RBAC test asserts the audit envelope and an action-filtered `limit=1` page contains a single entry.\n\n- **Wave 51 (Track E4 `Void::Sqlite` Alignment for the StateStore)**:\n - When built with SQLite3 (`VBS_HAS_VOID_SQLITE`, now available via `dev cpp-gcc -p sqlite`), `StateStore` keeps its transactional action cache in `state/state.v2.sqlite` using `Void::Sqlite` (`meta`, `actions`, `generations` tables, one transaction per publication) and imports an existing `state.v1.json` once. Without SQLite the journaled atomic JSON store remains unchanged.\n - `Void::Net` alignment is still pending: it requires OpenSSL, while only Boost is provided by `-p boost`.\n\n- **Wave 52 (Live Conan2 Verification)**:\n - `conan` 2.32.0 is available via `dev cpp-gcc -p conan`. Added `FullV1Tests.track_b3_live_conan_provider_install`: it builds a real local header-only package with `conan create` in an isolated `CONAN_HOME` (restored afterwards), then runs the Conan2 provider so a real `conan install` executes (verified by the generated `conanbuild.sh`). Skips when `conan` is absent.\n\n- **Wave 53 (Track E4 `Void::Net` Alignment for the Registry Client)**:\n - `cmake/VoidDependency.cmake` now enables the `Net` module when Boost (url; beast/asio are synthesized), OpenSSL and Threads are found (`VBS_HAS_VOID_NET`), and `VoidBuild_Core` links `Void::Net` with `VBS_HAS_VOID_NET=1`.\n - `RegistryClient`'s HTTP transport uses `Void::Net::HttpClient::secure()` (TLS-verifying) for every registry request when `VBS_HAS_VOID_NET` is defined, keeping the pure-POSIX/curl fallback otherwise. All registry client tests pass on the Net transport.\n\n## Remaining future scope"}, {"oldString": "Track E4 (`Void::Net` alignment; `Void::Sqlite` is now used by the StateStore when SQLite3 is available) remain planned scope.", "newString": "Track E4 (the `Void::Net` registry-client transport and `Void::Sqlite` StateStore are adopted; further Net surfaces such as the registry HTTP server remain planned scope)."}, {"oldString": "Live `conan` CLI verification (Track B3), Track C", "newString": "Track C"}"}, {"oldString": "Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.", "newString": "Track E4 (`Void::Net` alignment; `Void::Sqlite` is now used by the StateStore when SQLite3 is available) remain planned scope."} - **Post-v1 Expansion Roadmap ([21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md) & [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md))**: Live `conan` CLI verification (Track B3), Track C (macOS/Windows ports + dual-profile cross-compilation), Track D3 signing (SBOM, Ed25519 primitives, trusted-key enforcement and distribution, binary-variant signing and distribution materialization, the #52 built-in-backend capability probe, and the VoidLibrary pin bump to `0002e74` done), Track E3 (daemon core, bounded `describe`, build-serving, dependency materialization, daemon-backed IDE metadata, compdb export, IDE config generation, editor watch poll and bounded long-poll done; dedicated external editor plugins remain), and Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope. diff --git a/docs/agent-workflow/TASKS.md b/docs/agent-workflow/TASKS.md index 7c54503..fee9413 100644 --- a/docs/agent-workflow/TASKS.md +++ b/docs/agent-workflow/TASKS.md @@ -58,4 +58,5 @@ Base HEAD: `fe0d1a6` | Wave 49 (Daemon info request) | `info` daemon request + `vbs daemon info`: version, host, project/build/lock roots, socket | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 22/22, full CTest 8/8) | `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/DaemonTests.cpp`, `tests/CliContracts.cmake`, docs | | Wave 50 (Audit query filters) | `/api/v1/audit` actor/action/outcome/limit/offset filters with envelope and 400 validation | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Registry 7/7, full CTest 8/8) | `registry/service/RegistryService.cpp`, `tests/RegistryTests.cpp`, docs | | Wave 51 (Track E4 Sqlite alignment) | SQLite-backed `StateStore` (`state.v2.sqlite`) with one-time JSON import when `VBS_HAS_VOID_SQLITE`; JSON fallback unchanged; `Void::Net` still needs OpenSSL | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`, `-p sqlite -p boost`: core 6/6 and full CTest 8/8; default JSON backend core 6/6) | `include/Void/Build/State/StateStore.hpp`, `src/State/StateStore.cpp`, docs |\n| Wave 52 (Live conan verification) | `FullV1Tests.track_b3_live_conan_provider_install`: isolated `CONAN_HOME`, real `conan create`, real `conan install` through the Conan2 provider | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`, `-p conan`, conan 2.32.0; full CTest 8/8) | `tests/FullV1Tests.cpp`, docs | -| Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions, E4 Net alignment) |"}] Live `conan` CLI verification; macOS/Windows/cross-compile; binary-variant signing and key distribution; daemon-side dependency materialization and editor plugins; `Void::Net`/`Void::Sqlite` alignment | PLANNED (unimplemented) | [21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md), [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md) | +| Wave 53 (Track E4 Net alignment) | Enable `Void::Net` when Boost/OpenSSL/Threads are found; `RegistryClient` HTTP transport on `Void::Net::HttpClient::secure()` with POSIX/curl fallback | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`, `-p openssl -p boost`: registry 7/7 and full CTest 8/8 on the Net transport; default build unaffected) | `cmake/VoidDependency.cmake`, `CMakeLists.txt`, `src/Package/RegistryClient.cpp`, docs | +| Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions, E4 Net server) |"}] Live `conan` CLI verification; macOS/Windows/cross-compile; binary-variant signing and key distribution; daemon-side dependency materialization and editor plugins; `Void::Net`/`Void::Sqlite` alignment | PLANNED (unimplemented) | [21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md), [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md) | diff --git a/docs/agent-workflow/VERIFICATION.md b/docs/agent-workflow/VERIFICATION.md index 07b6b04..d1f1acd 100644 --- a/docs/agent-workflow/VERIFICATION.md +++ b/docs/agent-workflow/VERIFICATION.md @@ -865,6 +865,23 @@ dev cpp-gcc -p conan -c ctest --test-dir build/pinned --output-on-failure executed. `CONAN_HOME` is restored afterwards; the test skips when `conan` is absent. - Full CTest with conan available: **8 / 8 passed** in 241.62 s. +## Track E4 `Void::Net` Registry-Client Alignment (GCC 16.2, pin `0002e74`) + +With `dev cpp-gcc -p openssl -p boost`, `cmake/VoidDependency.cmake` now appends `Net` to the enabled Void modules (the dev shell reports `modules=16` and `Void_Net` appears in the generated build). `RegistryClient` then uses `Void::Net::HttpClient::secure()` for every registry request. + +```sh +dev cpp-gcc -p openssl -p boost -c cmake -S . -B build/net -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVBS_VOID_SOURCE_DIR=/tmp/opencode/vl-pin +dev cpp-gcc -p openssl -p boost -c cmake --build build/net --parallel 8 +dev cpp-gcc -p openssl -p boost -c build/net/bin/vbs_registry_tests --no-color +dev cpp-gcc -p openssl -p boost -c ctest --test-dir build/net --output-on-failure +``` + +- Net-enabled build: exit 0. Registry suite on the Net transport: **7 / 7 passed** (10.58 s), + including the signed-publish, private-download, binary-variant, and live CLI E2E cases. +- Full CTest with `Void::Net`: **8 / 8 passed** in 204.76 s. +- Default build (no Net): rebuild exit 0 and registry suite **7 / 7 passed** (12.60 s); the + pure-POSIX/curl transport remains the fallback. + ## Limits and Unrun Checks 1. **HTTPS git fetch**: the host shell is proxy-restricted, but the Docker container could clone `https://git.faumaray.com/Void/VoidLibrary.git`; the pinned commit `3e254055e081a104f08df68dde39711bc7813518` was fetched directly for the verification above. A separate configure against the local `/home/faumaray/Projects/Library` checkout via `VBS_VOID_SOURCE_DIR` also succeeded (development-only override, checkout unmodified). diff --git a/docs/roadmap/21-expansion-roadmap.md b/docs/roadmap/21-expansion-roadmap.md index 3f996c4..1c6ae1f 100644 --- a/docs/roadmap/21-expansion-roadmap.md +++ b/docs/roadmap/21-expansion-roadmap.md @@ -74,7 +74,7 @@ flowchart LR | **E1 — Everyday CLI Ergonomics (Implemented in Wave 8)** | `vbs init` project scaffolding, `vbs clean`, `vbs doctor` environment diagnostics, `vbs graph --format dot|json`, and `vbs build --native-foreign`. | End-to-end CLI & integration tests passing in `vbs_cli_contract` and `vbs_v1_tests`. | | **E2 — Multi-Package Workspaces (`workspace.cpp`)** *(verified in Docker GCC 16)* | Shared root `vbs.lock` and `build/.vbs` CAS, `workspace_dependency()` cross-member native linking, and affected-member selection (`vbs build/test --member ` / `--changed-since `). | 3-package workspace fixture (shared library + app + tests) builds/tests with one root lockfile; member selection and `--changed-since` verified in `FullV1Tests.workspace_members_shared_build_and_member_selection`. | | **E3 — IDE Config/Query & Background Daemon** | `build.cpp`/`build.profiles.cpp`/`build-support/` SDK entries in `compile_commands.json` + `vbs ide generate` (`.clangd`, `.vscode/`, `.zed/`, `.idea/customTargets.xml`) & `vbs ide query` (**Implemented & Verified in Wave 10**); Unix-socket daemon core holding a warm `StateStore` + project `DirectoryWatcher` with `vbs daemon run\|status\|stop\|gc\|recover\|describe` (**Implemented & Verified in Wave 14; bounded `describe` added in the post-v1 daemon follow-up**). `describe` returns a bounded graph summary (`target_names` ≤ 128 entries × 200 bytes, `profile` ≤ 128 bytes, 10 s evaluation timeout); `vbs daemon build` executes the lowered graph in-process against the warm state store with bounded `profile`/`targets`/`jobs`, including daemon-side dependency resolution/materialization and provider import via `Package::resolve_and_materialize_dependencies`; `vbs daemon ide query` publishes/selects the profile compilation database and serves the IDE workspace/target metadata JSON over the socket, `vbs daemon compdb export` returns the published compilation-database path and entry count, `vbs daemon ide generate` writes the editor presets over the socket, `vbs daemon ide poll` exposes a bounded editor-extension watch protocol (changed paths, sequence, overflow state), `vbs daemon ide wait` adds a bounded long-poll variant, `vbs daemon ide status` reports the active editor selection and compdb state, `vbs daemon compdb use` switches the active editor profile under the selection lock, `vbs daemon graph` exports the target dependency graph (DOT/JSON), `vbs daemon test` builds and runs declared test targets, `vbs daemon compdb entries` serves bounded per-file compile arguments to editor extensions, `vbs daemon workspace members` lists workspace members cheaply, `vbs daemon ide configs` reports which editor configuration files exist, `vbs daemon compdb generations` lists editor generation history with the active selection, `vbs daemon info` exposes the daemon environment, `vbs daemon deps` resolves/materializes dependencies over the socket, registry package search and audit queries support bounded pagination/filters, and releases expose a version-specific detail endpoint. Daemon workspace support describes members, builds all members in order (or a selected member) with the shared root lock, and serves member-scoped IDE query/generate/compdb requests via `--member`. Dedicated editor extensions remain planned. | `vbs ide` & `build.cpp` syntax-check verified in `FullV1Tests.cpp`; daemon lifecycle/status/gc/shutdown/describe verified in `DaemonTests.cpp` (6/6 under `dev cpp-gcc`); the live `vbs daemon describe` CLI round-trip is verified in `vbs_cli_contract`. | -| **E4 — Transport & Storage Upstream Alignment** | Adopt `Void::Net` (`VL-004`/`VL-005`) and `Void::Sqlite` (`VL-011b`) when lightweight/bundled builds become available in minimal Nix toolchains, reducing VBS transport code further. | All `vbs_registry_tests` and `vbs_core_tests` pass on both minimal and full toolchains. | +| **E4 — Transport & Storage Upstream Alignment** *(Sqlite and Net client adopted)* | Adopt `Void::Net` (`VL-004`/`VL-005`) and `Void::Sqlite` (`VL-011b`) when lightweight/bundled builds become available in minimal Nix toolchains, reducing VBS transport code further. `Void::Sqlite` backs the `StateStore` when SQLite3 is present, and `RegistryClient` uses the TLS-verifying `Void::Net::HttpClient` when `Net` is enabled (`-p openssl -p boost`), keeping the pure-POSIX fallback. | All `vbs_registry_tests` and `vbs_core_tests` pass on both minimal and full toolchains (verified: registry 7/7 on the Net transport; default and SQLite builds 8/8). | --- diff --git a/src/Package/RegistryClient.cpp b/src/Package/RegistryClient.cpp index 08927bd..571215b 100644 --- a/src/Package/RegistryClient.cpp +++ b/src/Package/RegistryClient.cpp @@ -13,6 +13,9 @@ #include #include #include +#if defined(VBS_HAS_VOID_NET) +#include +#endif #include #include @@ -111,6 +114,44 @@ send_http_request(const ParsedHttpUrl &parsed, std::string_view method, std::str std::string_view body) { const std::string full_path = parsed.base_path + std::string{path}; +#if defined(VBS_HAS_VOID_NET) + // Track E4: Void::Net transport handles both http:// and verified TLS https://. + Void::Net::Request request; + if (method == "GET") { + request.method = Void::Net::Method::Get; + } else if (method == "PUT") { + request.method = Void::Net::Method::Put; + } else if (method == "POST") { + request.method = Void::Net::Method::Post; + } else if (method == "DELETE") { + request.method = Void::Net::Method::Delete; + } else { + request.method = Void::Net::Method::Get; + } + request.url = std::format("{}://{}:{}{}", parsed.scheme, parsed.host, parsed.port, full_path); + for (const auto &[name, value] : headers) { + request.headers.push_back(Void::Net::Header{name, value}); + } + if (!body.empty()) { + request.body = std::string{body}; + } + request.timeout = std::chrono::seconds{30}; + const Void::Net::HttpClient net_client = Void::Net::HttpClient::secure(); + auto net_response = net_client.send(request); + if (!net_response) { + return std::unexpected{ + make_error(Void::System::SystemErrorCode::io_error, + std::format("registry client: Void::Net request failed: {}", + net_response.error().message()))}; + } + RawHttpReply net_reply; + net_reply.status = net_response->status; + for (const auto &header : net_response->headers) { + net_reply.headers[Void::Str::to_lower_ascii(header.name)] = header.value; + } + net_reply.body = std::move(net_response->body); + return net_reply; +#else // Plain TCP HTTP/1.1 client for http:// (loopback/local registry without external deps). if (parsed.scheme == "http") { struct addrinfo hints{}; @@ -249,6 +290,7 @@ send_http_request(const ParsedHttpUrl &parsed, std::string_view method, std::str reply.body = proc->stdout_data.substr(0, nl); } return reply; +#endif } std::string get_str(const JsonVal::Object &obj, const std::string &k) {