diff --git a/docs/agent-workflow/STATE.md b/docs/agent-workflow/STATE.md index 391f01c..746731a 100644 --- a/docs/agent-workflow/STATE.md +++ b/docs/agent-workflow/STATE.md @@ -165,26 +165,70 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B - Added `POST /api/v1/packages///binaries//yank` to `vbs-registry` (auth + CSRF, publish authority, `{"yanked":bool}` body defaulting to true) with `BinaryReleaseMeta::yanked` persisted and listed in detail JSON. `RegistryClient::fetch_binary_variants` now exposes `yanked` and never returns yanked variants for selection. - The registry binary-variant test now checks unauthenticated yank rejection, CSRF-protected session yank, the yanked flag in the detail JSON, and that the yanked variant disappears from the client variant list. -- **Wave 37 (Daemon Graph Export)**:\n - Added the `graph` daemon request (`vbs daemon graph [--profile] [--format dot|json] [--member]`): evaluates the project (workspace-member aware) and returns the target dependency graph as Graphviz DOT or JSON inside a bounded JSON envelope (`profile`, `format`, `graph`).\n - Added `Daemon.graph_exports_target_dependencies_as_json_and_dot` (JSON and DOT payloads, invalid format rejected) and a CLI help contract; Daemon suite is now 16 cases.\n\n- **Wave 38 (Daemon Test Request)**: - - Added the `test` daemon request (`vbs daemon test [--profile] [--target] [--jobs]`): after the build succeeds it runs every declared `TargetKind::Test` binary (300 s timeout, bounded 4 KiB stdout/stderr tails) and reports `tests` entries with `tests_passed`/`tests_failed`; any failing test marks the response `ok=false`. Workspace-wide `test` aggregates per-member results. - - Added `Daemon.test_builds_and_runs_declared_tests` (one passing and one failing test target → `tests_passed=1`, `tests_failed=1`, `ok=false`) and a CLI help contract; Daemon suite is now 17 cases. +- **Wave 37 (Daemon Graph Export)**: added the `graph` daemon request (`vbs daemon graph [--profile] [--format dot|json] [--member]`) returning the target dependency graph in a JSON envelope, plus `Daemon.graph_exports_target_dependencies_as_json_and_dot`. -- **Wave 39 (Compdb Entries Query)**: - - 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 38 (Daemon Test Request)**: `vbs daemon test [--profile] [--target] [--jobs]` runs declared test targets after the build (bounded output, pass/fail counts) and works for workspace-wide runs; `Daemon.test_builds_and_runs_declared_tests`. -- **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- **Wave 54 (Track E4 `Void::Net` Registry HTTP Server)**:\n - `Registry::HttpServer` now serves through `Void::Net::HttpServer` when `VBS_HAS_VOID_NET` is defined: a catch-all route per HTTP method bridges `Void::Net::ServerRequest`/`ServerResponse` to the registry's transport-neutral `HttpRequest`/`HttpResponse` (method, path, query, lowercase headers, cookies, body, `Set-Cookie`). The default security headers were extracted into one helper applied by both transports. The POSIX server remains the fallback.\n - Registry suite passes on both transports (7/7 each); full CTest with Net enabled passes 8/8.\n\n- **Wave 55 (Track E4 `Void::Net` Remote Cache Transport)**:\n - `RemoteCache`'s HTTP exchange now uses `Void::Net::HttpClient::secure()` for the shared action cache (blob/action GET/PUT/HEAD) when `VBS_HAS_VOID_NET` is defined, keeping the POSIX/curl fallback otherwise.\n - Remote CAS tests pass on both transports (`shared_remote_action_cache_blob_and_record_roundtrip`, `shared_remote_cache_cold_populates_then_clean_build_all_hits`).\n\n- **Wave 56 (Track C1 Host Reporting in `vbs doctor`)**:\n - `vbs doctor` now reports the host platform through the `Platform::HostOs`/`host_supported()` abstraction (the first consumer of `Host.hpp`) and whether the optional `Void::Sqlite` and `Void::Net` backends are compiled in, making the Track C/E4 portability state visible without guessing.\n - Added CLI contract checks for the host and backend lines.\n\n- **Wave 57 (Daemon Clean Request)**:\n - Extracted build-tree cleaning into `Config::clean_build_tree` (`include/Void/Build/Config/BuildTree.hpp`, `src/Config/BuildTree.cpp`) returning a structured `CleanReport`; the CLI `vbs clean` is now a thin adapter.\n - Added the `clean` daemon request (`vbs daemon clean [--all]`): removes `profiles/` and the root compdb alias (or the whole build root with `--all`) and returns `existed`/`removed_all`/`removed_paths`. Added `Daemon.clean_removes_profile_outputs_and_preserves_cache` (build, clean, profiles gone while `.vbs` remains, invalid `all` rejected) and a CLI help contract; Daemon suite is now 23 cases.\n\n- **Wave 58 (Daemon Target Info Request)**:\n - Added the `target_info` daemon request (`vbs daemon target info --name TARGET [--profile] [--member]`): lowers the project graph and returns one target's kind, enabled state, expanded sources, primary outputs, and runtime shared libraries as real JSON arrays. Unknown targets and missing names are rejected explicitly.\n - Added `Daemon.target_info_reports_target_details` and a CLI help contract; Daemon suite is now 24 cases.\n\n- **Wave 59 (Daemon Pack Request)**:\n - Added the `pack` daemon request (`vbs daemon pack [--output REL]`): creates the deterministic USTAR source archive under the build root and returns `archive` + `sha256`. Output paths are confined to the build root (absolute/escaping paths and the build root itself are rejected), and non-string values are rejected.\n - Added `Daemon.pack_creates_archive_confined_to_build_root` and a CLI help contract; Daemon suite is now 25 cases.\n\n- **Wave 60 (Daemon Actions Request & Binary Variant Detail)**: - - Added the `actions` daemon request (`vbs daemon actions [--profile] [--limit]`): lists the lowered graph's actions with `id`, `kind`, `target`, `cacheable`, and bounded `outputs` (first 8), reporting `total`/`returned`. An optional `target` filter yields `total=0` when nothing matches; `limit` is bounded to 1000. - - Added `GET /api/v1/packages///binaries/` returning one binary variant's metadata and download URL; missing variants return 404. - - Tests: `Daemon.actions_lists_lowered_actions` and extended registry binary-variant assertions; Daemon suite is now 26 cases. - - Note: a swarm retried for the daemon half stalled on its planning step again and was stopped; the work was then implemented directly. +- **Wave 39 (Compdb Entries Query)**: `compdb_entries` daemon request (`vbs daemon compdb entries [--file SUFFIX] [--limit N]`) serves bounded projected entries from the active compilation database; `Daemon.compdb_entries_queries_published_database`. -- **Wave 61 (Registry Package Ownership API)**:\n - Added `GET/PUT/DELETE /api/v1/packages//owners[/]`: listing honors read permissions, mutations require authentication, CSRF for browser sessions, and ownership/publish authority; unknown users return 404 and removing the last owner returns 409. Owner changes are audited (`package.owner_add`/`package.owner_remove`) and persisted.\n - Extended the registry RBAC test with a dedicated package: list, add, unknown user, reader-with-ownership still denied (403), remove, and last-owner rejection.\n\n- **Wave 62 (`vbs releases list`)**:\n - Added `vbs releases list --registry URL --name PKG [--token-env VAR]` over `Package::fetch_package_releases`, printing `version sha256 active|yanked binaries=N` per release.\n - Covered by CLI contracts (help + required-argument error) and the live registry E2E (both published versions listed as active).\n\n- **Wave 63 (Daemon Install Request)**:\n - Added the `install` daemon request (`vbs daemon install --prefix DIR [--package-version]`): builds the member graph, stages a relocatable install via `Install::install_project`, and returns `prefix`, `manifest`, and file count. Request fields cover `package_name` (defaults to the project/member directory name), `package_version`, `component`, and `export_cmake`/`export_native` booleans. `prefix` is required and bounded.\n - Added `Daemon.install_stages_prefix_and_writes_manifest` (installed binary + manifest present, missing prefix rejected) and a CLI help contract; Daemon suite is now 27 cases.\n\n- **Wave 64 (Daemon Uninstall Request)**:\n - Added the `uninstall` daemon request (`vbs daemon uninstall --prefix DIR`): removes only VBS-owned files recorded in the install manifest via `Install::uninstall_prefix` and returns `prefix` + removed count. `prefix` is required and bounded.\n - Extended `Daemon.install_stages_prefix_and_writes_manifest` to uninstall after asserting the install artifacts and check the binary is gone; added a CLI help contract.\n\n- **Wave 65 (Daemon Gen-Tests Request)**:\n - Added the `gen_tests` daemon request (`vbs daemon gen-tests --input --output-dir`): generates the native `Void::Testing` registration unit and returns the generated path and case count. The input must resolve inside the project root and the output directory inside the build root (relative paths resolve against those roots).\n - Added `Daemon.gen_tests_generates_registration_unit_confined` (two cases generated inside the build root; escaping input/output rejected) and a CLI help contract; Daemon suite is now 28 cases.\n\n- **Wave 66 (Signed `vbs binaries fetch`)**:\n - `vbs binaries fetch` accepts `--trusted-public-key`/`--trusted-key-file` (plus the `vbs.keys`/`VBS_TRUSTED_PUBLIC_KEYS` sources) and requires a verified variant signature before downloading; without trusted keys it keeps the digest-only behavior.\n - The live registry E2E asserts that an unsigned variant fails when a trusted key is required.\n\n- **Wave 67 (Daemon Init Request)**:\n - Extracted the project scaffolding into `Config::scaffold_project` (`include/Void/Build/Config/Scaffold.hpp`, `src/Config/Scaffold.cpp`) returning a structured `ScaffoldReport`; the CLI `vbs init` is now a thin adapter.\n - Added the `init` daemon request (`vbs daemon init [--dir] [--name] [--library] [--with-toml] [--force]`): the target directory must stay inside the project root, and the response lists the written files. Added `Daemon.init_scaffolds_project_confined_to_root` (create, existing-without-force rejected, forced overwrite, escaping dir rejected) and a CLI help contract; Daemon suite is now 29 cases.\n\n## Remaining future scope"}"}"}"}"}"}"}"}"}"}, {"oldString": "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).", "newString": "Track E4 (`Void::Net` now backs both the registry client transport and the registry HTTP server when enabled, and `Void::Sqlite` backs the StateStore; the POSIX fallbacks remain for minimal toolchains)."}]"}, {"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."} +- **Wave 40 (Authenticated Binary-Variant Downloads)**: `download_binary_artifact` accepts `RegistryAuth`, `BinaryFetchOptions` carries a bearer token, and `vbs binaries fetch` forwards it; `RegistryTests.private_binary_variant_download_requires_auth`. -- **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. +- **Wave 41 (Yanked Binary Variants in Listing)**: `fetch_binary_variants(include_yanked)`; listings mark yanked variants while selection and fetch never see them. -## Environment notes & upstream boundaries +- **Wave 42 (Registry Binary-Variant Listing Endpoint)**: `GET .../binaries`; the client queries it directly instead of parsing package detail JSON. -- External VoidLibrary pin `0002e74a7da94a756f55a4a5574d20b77736c185` is set in [CMakeLists.txt](../../CMakeLists.txt) (`VBS_VOID_REVISION`, consumed by [cmake/VoidDependency.cmake](../../cmake/VoidDependency.cmake)) and [build.cpp](../../build.cpp). VBS never writes to `/home/faumaray/Projects/VoidLibrary`. -- `Void::Crypto` and `Void::Archive` now build unconditionally with zero external dependencies in `dev cpp-gcc`; only `SQLite3`, `Boost`/`OpenSSL` (`Void::Net`), and `conan` remain optional external prerequisites. -- See [VERIFICATION.md](VERIFICATION.md) for all observed builds, tests, Clang 23 matrix runs, formatting checks, benchmark results, and real self-build verification. +- **Wave 43 (Workspace Members Request)**: `workspace_members` daemon request lists declared members without evaluating them. + +- **Wave 44 (IDE Configs Request)**: `ide_configs` daemon request reports which editor configuration files exist. + +- **Wave 45 (Compdb Generations Request)**: `compdb_generations` daemon request lists immutable editor generations with the active selection, status and entry counts (profile names validated). + +- **Wave 46 (Registry Package Search Pagination)**: `GET /api/v1/packages?limit&offset` with a total envelope and 400 validation. + +- **Wave 47 (Registry Release Detail)**: `GET /api/v1/packages//` with metadata and binary summaries. + +- **Wave 48 (Daemon Deps Request)**: `deps` daemon request resolves/materializes dependencies and returns the lock context entries. + +- **Wave 49 (Daemon Info Request)**: `info` daemon request exposes version, host, roots, and socket path. + +- **Wave 50 (Registry Audit Query Filters)**: `/api/v1/audit` supports actor/action/outcome/limit/offset with an envelope. + +- **Wave 51 (Track E4 `Void::Sqlite` StateStore)**: with `VBS_HAS_VOID_SQLITE` the StateStore keeps its cache in `state.v2.sqlite` (Void::Sqlite) and imports the legacy JSON once; the JSON fallback remains. + +- **Wave 52 (Live Conan2 Verification)**: `FullV1Tests.track_b3_live_conan_provider_install` creates a real package in an isolated `CONAN_HOME` and runs a real `conan install` through the provider. + +- **Wave 53 (Track E4 `Void::Net` Registry Client)**: `Void::Net` is enabled when Boost/OpenSSL/Threads are found; `RegistryClient` uses `Void::Net::HttpClient::secure()`, keeping the POSIX/curl fallback. + +- **Wave 54 (Track E4 `Void::Net` Registry Server)**: `Registry::HttpServer` serves through `Void::Net::HttpServer` behind `VBS_HAS_VOID_NET` with a request/response bridge and shared security headers. + +- **Wave 55 (Track E4 `Void::Net` Remote Cache)**: `RemoteCache` HTTP exchange uses `Void::Net` when available. + +- **Wave 56 (Host Reporting in `vbs doctor`)**: reports `HostOs`/`host_supported()` and the optional Sqlite/Net backends. + +- **Wave 57 (Daemon Clean Request)**: `Config::clean_build_tree` extraction; `clean` daemon request with structured report. + +- **Wave 58 (Daemon Target Info Request)**: `target_info` daemon request reports a target's kind, sources, outputs and runtime libraries. + +- **Wave 59 (Daemon Pack Request)**: `pack` daemon request creates the deterministic source archive confined to the build root. + +- **Wave 60 (Daemon Actions Request & Binary Variant Detail)**: `actions` daemon request lists bounded lowered actions; `GET .../binaries/` returns one variant's metadata. + +- **Wave 61 (Registry Package Ownership API)**: audited `GET/PUT/DELETE .../owners[/]` with authority, CSRF, 404/409 handling. + +- **Wave 62 (`vbs releases list`)**: registry client release listing CLI. + +- **Wave 63 (Daemon Install Request)**: `install` daemon request builds and stages an install prefix, returning manifest and file count. + +- **Wave 64 (Daemon Uninstall Request)**: `uninstall` daemon request removes only manifest-owned files. + +- **Wave 65 (Daemon Gen-Tests Request)**: `gen_tests` daemon request generates the native registration unit, confined to project/build roots. + +- **Wave 66 (Signed `vbs binaries fetch`)**: fetch requires a verified variant signature when trusted keys are configured. + +- **Wave 67 (Daemon Init Request)**: `Config::scaffold_project` extraction; `init` daemon request scaffolds confined projects. + +- **Wave 68 (Daemon `clean --all` Coverage)**: `Daemon.clean_all_removes_entire_build_root` verifies whole-build-root removal while the connected client still receives the response. + +## Remaining future 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))**: Track C (macOS/Windows ports + dual-profile cross-compilation) and dedicated external editor plugins remain planned; Track D3 signing (SBOM, Ed25519 primitives, trusted-key enforcement/distribution, binary-variant signing/distribution) and Track E3 daemon capabilities are implemented, and Track E4 now uses `Void::Net` for the registry client/server and remote cache plus `Void::Sqlite` for the StateStore when available. diff --git a/docs/agent-workflow/VERIFICATION.md b/docs/agent-workflow/VERIFICATION.md index 2e9d6c8..7eaa108 100644 --- a/docs/agent-workflow/VERIFICATION.md +++ b/docs/agent-workflow/VERIFICATION.md @@ -1097,6 +1097,19 @@ dev cpp-gcc -c ctest --test-dir build/pinned --output-on-failure - Full CTest: **8 / 8 passed** in 242.56 s. - `clang-format --dry-run --Werror` passes on the changed C++ files. +## Daemon `clean --all` Semantics (GCC 16.2, pin `0002e74`) + +```sh +dev cpp-gcc -c cmake --build build/pinned --parallel 8 +dev cpp-gcc -c build/pinned/bin/vbs_v1_tests --suite Daemon --no-color +``` + +- `Daemon.clean_all_removes_entire_build_root` runs a daemon with `max_requests=2`: it builds, then + `{"op":"clean","all":true}` removes the entire build root (including the socket and state store) + while the already-connected client still receives `ok`/`removed_all`, and the daemon exits on its + own. Asserted: response correct and `build_root` no longer exists. +- Daemon suite: **30 / 30 passed** in 55.81 s. + ## 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/tests/DaemonTests.cpp b/tests/DaemonTests.cpp index 3dc2ae0..28051a5 100644 --- a/tests/DaemonTests.cpp +++ b/tests/DaemonTests.cpp @@ -1254,6 +1254,54 @@ void build(Void::Build::Project &project) { Void::Testing::expect(run_result.has_value()); } +VOID_TEST(Daemon, clean_all_removes_entire_build_root) { + auto temp = Void::FileSystem::TempDir::open("vbs_daemon_"); + Void::Testing::require(temp.has_value()); + auto options = make_options(temp->path()); + // The daemon exits on its own after the two requests, since `clean --all` removes the socket. + options.max_requests = 2; + + { + std::ofstream descriptor{options.project_root / "build.cpp"}; + descriptor << R"cpp(#include + +void build(Void::Build::Project &project) { + auto app = project.executable("app"); + app.sources({"main.cpp"}); +} +)cpp"; + Void::Testing::require(descriptor.good()); + } + { + std::ofstream source{options.project_root / "main.cpp"}; + source << "int main() { return 0; }\n"; + Void::Testing::require(source.good()); + } + + auto server = Void::Build::Daemon::DaemonServer::create(options); + Void::Testing::require(server.has_value()); + const auto socket = server->socket_path(); + + Void::Result::Result run_result; + std::jthread worker{[&] { run_result = server->run(); }}; + Void::Testing::require(wait_for_path(socket, std::chrono::seconds{5})); + + auto build = request_object(socket, R"({"op":"build"})", std::chrono::seconds{120}); + Void::Testing::require(build.has_value()); + Void::Testing::expect(bool_field(*build, "ok")); + + // The response is written over the already-connected socket even though the daemon deletes + // the socket and the whole build root while handling the request. + auto cleaned = request_object(socket, R"({"op":"clean","all":true})"); + worker.join(); + Void::Testing::expect(run_result.has_value()); + + Void::Testing::require(cleaned.has_value()); + Void::Testing::expect(bool_field(*cleaned, "ok")); + Void::Testing::expect(bool_field(*cleaned, "removed_all")); + Void::Testing::expect(!std::filesystem::exists(options.build_root)); +} + VOID_TEST(Daemon, target_info_reports_target_details) { auto temp = Void::FileSystem::TempDir::open("vbs_daemon_"); Void::Testing::require(temp.has_value());