diff --git a/docs/agent-workflow/STATE.md b/docs/agent-workflow/STATE.md index fb125f5..54440c9 100644 --- a/docs/agent-workflow/STATE.md +++ b/docs/agent-workflow/STATE.md @@ -233,6 +233,8 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B - **Wave 70 (Track C1: Portable Executable Path & Daemon Host Reporting)**: added `Platform::current_executable_path()` (`FileOps.hpp`, implemented in `src/Platform/Linux/FileOps.cpp` with an explicit error on failure) and replaced the hard-coded `/proc/self/exe` reads in `src/Main.cpp`; `CoreEngineTests.current_executable_path_resolves_running_binary` covers it. A swarm worker (5/5 tasks) extended the daemon `info` response with `host_os`, `host_supported`, and a `backends` object (file ops, process supervisor, directory watcher, sqlite, net), asserted in `Daemon.info_reports_daemon_paths_and_host`. +- **Wave 71 (Member-Filtered Daemon `describe` & Test Executable-Path Cleanup)**: `describe` accepts an optional `member` (workspace roots only; unknown members rejected) so one member can be described without evaluating the others. A swarm worker replaced the remaining `/proc/self/exe` lookups in `tests/{Registry,FullV1,SelfHost}Tests.cpp` with `Platform::current_executable_path()` (5/5 substantive tasks; its final build task was stopped and re-run by the orchestrator). + ## 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/TASKS.md b/docs/agent-workflow/TASKS.md index 5bdd720..2e2dccf 100644 --- a/docs/agent-workflow/TASKS.md +++ b/docs/agent-workflow/TASKS.md @@ -74,4 +74,5 @@ Base HEAD: `fe0d1a6` | Wave 67 (Daemon init request) | `Config::scaffold_project` extraction; `init` daemon request + `vbs daemon init --dir`: confined project scaffolding | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 29/29, full CTest 8/8) | `include/Void/Build/Config/Scaffold.hpp`, `src/Config/Scaffold.cpp`, `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/DaemonTests.cpp`, `tests/CliContracts.cmake`, build lists, docs | | Wave 69 (RegistryClient owners helper, via swarm) | `fetch_package_owners` in RegistryClient + RegistryTests coverage (owners list, missing package 404, anonymous private 401) | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Registry 7/7, full CTest 8/8) | `include/Void/Build/Package/RegistryClient.hpp`, `src/Package/RegistryClient.cpp`, `tests/RegistryTests.cpp`, docs | | Wave 70 (Track C1 executable path + daemon host info) | `Platform::current_executable_path()` replacing `/proc/self/exe` in Main.cpp; daemon `info` reports `host_os`/`host_supported`/`backends` (swarm, 5/5 tasks) | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Core and Daemon suites pass, full CTest 8/8) | `include/Void/Build/Platform/FileOps.hpp`, `src/Platform/Linux/FileOps.cpp`, `src/Main.cpp`, `src/Daemon/Daemon.cpp`, `tests/{CoreEngineTests,DaemonTests}.cpp`, docs | +| Wave 71 (Member-filtered describe + test path cleanup) | `describe` `member` filter in the daemon; swarm replaced `/proc/self/exe` in three test files | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon suite and full CTest 8/8) | `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/{DaemonTests,RegistryTests,FullV1Tests,SelfHostTests}.cpp`, docs | | Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions) |"}] 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 feac2d1..23f0682 100644 --- a/docs/agent-workflow/VERIFICATION.md +++ b/docs/agent-workflow/VERIFICATION.md @@ -1129,6 +1129,16 @@ dev cpp-gcc -c build/pinned/bin/vbs_v1_tests --suite Daemon --no-color passes. - Full CTest after both slices: **8 / 8 passed** in 242.99 s. +## Member-Filtered Describe & Test Path Cleanup (GCC 16.2, pin `0002e74`) + +- `{"op":"describe","member":"app"}` on a two-member workspace returns exactly one member entry + named `app` (`workspace:true`), and an unknown member is rejected; asserted in + `Daemon.describe_and_build_workspace_members` (7.14 s). +- Swarm `swarm_mx8alvtt_xn4n` (one worker) replaced the `/proc/self/exe` lookups in + `tests/{Registry,FullV1,SelfHost}Tests.cpp` with `Platform::current_executable_path()` (5/5 + substantive tasks; its last build task was stopped and re-run by the orchestrator). +- Full CTest: **8 / 8 passed** in 241.04 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/docs/roadmap/21-expansion-roadmap.md b/docs/roadmap/21-expansion-roadmap.md index 9f33d28..25796e7 100644 --- a/docs/roadmap/21-expansion-roadmap.md +++ b/docs/roadmap/21-expansion-roadmap.md @@ -46,7 +46,7 @@ flowchart LR | Phase | Concrete Scope | Acceptance Gate | | --- | --- | --- | -| **C1 — Platform Backend Split** *(Linux backend split implemented; macOS/Windows pending)* | Split `src/Platform/` into `Linux/`, `MacOS/`, and `Windows/` behind clean interfaces (`FileOps`, `ProcessSupervisor`, `DirectoryWatcher`), delegating to `Void::System` as upstream adds OS backends. Linux implementations now live under `src/Platform/Linux/` and `src/Watch/Linux/` (inotify watcher) with an explicit `HostOs`/`host_supported()` boundary in `include/Void/Build/Platform/Host.hpp`; macOS/Windows backends await real hosts (`vbs doctor` and the daemon `info` request report the detected host and enabled backends, and `Platform::current_executable_path()` isolates the executable-path lookup). | Zero Linux regressions; clean platform abstraction boundary. | +| **C1 — Platform Backend Split** *(Linux backend split implemented; macOS/Windows pending)* | Split `src/Platform/` into `Linux/`, `MacOS/`, and `Windows/` behind clean interfaces (`FileOps`, `ProcessSupervisor`, `DirectoryWatcher`), delegating to `Void::System` as upstream adds OS backends. Linux implementations now live under `src/Platform/Linux/` and `src/Watch/Linux/` (inotify watcher) with an explicit `HostOs`/`host_supported()` boundary in `include/Void/Build/Platform/Host.hpp`; macOS/Windows backends await real hosts (`vbs doctor` and the daemon `info` request report the detected host and enabled backends, `Platform::current_executable_path()` isolates the executable-path lookup across sources and tests, and the daemon `describe` request can be scoped to one workspace member). | Zero Linux regressions; clean platform abstraction boundary. | | **C2 — macOS / Apple Clang & `ld64`** | Apple Clang toolchain probes, `.dylib` + `@rpath`/`@loader_path` install-name lowering, `FSEvents` watcher, Mach-O deterministic timestamps. | Real macOS CI runner passing all SDK, core, module, and install tests. | | **C3 — Windows / MSVC & `clang-cl`** | MSVC (`cl.exe`, `lib.exe`, `link.exe`, `/showIncludes`, `.pdb`, `/FS`, `.dll`/`.lib` import libraries), Job Object process-tree kill, `ReadDirectoryChangesW` watcher, case-insensitive path conflict detection. | Real Windows CI runner passing process-tree kill, header-shadowing, and install relocation tests. | | **C4 — True Host-vs-Target Cross-Compilation** | Dual-context evaluation (`host` profile for code generators and `build_dependency` tools vs `target` profile for cross-compiled products), sysroot & `--target=` triple propagation. | `linux-x86_64` host cross-compiling `linux-aarch64` fixture while executing host-compiled generator natively. | diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index c2b066f..dc25085 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -1643,14 +1643,25 @@ std::string ide_query_project(const DaemonOptions &options, std::string_view pro // Lowers the project graph to a bounded summary without executing it. std::string describe_project(const DaemonOptions &options, std::string_view profile_name, - std::optional compiler_override) { + std::optional compiler_override, + std::string_view selected_member) { if (Config::is_workspace_root(options.project_root)) { auto members = evaluate_workspace_members(options); if (!members) { return error_response(members.error()); } + if (!selected_member.empty() && + std::ranges::none_of(*members, [&](const WorkspaceMemberDir &member) { + return member.name == selected_member; + })) { + return error_response( + std::format("describe: unknown workspace member '{}'", selected_member)); + } JsonValue::Array member_array; for (const auto &member : *members) { + if (!selected_member.empty() && member.name != selected_member) { + continue; + } const auto member_opts = member_options(options, member.path); auto evaluated = evaluate_project_graph(member_opts, profile_name, compiler_override, "describe"); @@ -2207,7 +2218,7 @@ DaemonServer::Impl::DispatchResult DaemonServer::Impl::dispatch(std::string_view member = *value; } if (*name == "describe") { - return {describe_project(options, profile_name, compiler_override), false}; + return {describe_project(options, profile_name, compiler_override, member), false}; } if (*name == "ide_query") { return {ide_query_project(options, profile_name, compiler_override, member), false}; diff --git a/src/Main.cpp b/src/Main.cpp index d2c16e5..0cf2d37 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -1625,8 +1625,10 @@ int execute_daemon_command(std::string_view sub, const DaemonCmdOptions &opts) { std::cerr << "vbs daemon describe: --profile must not be empty\n"; return 2; } - request_json = - std::format(R"({{"op":"describe","profile":{}}})", Util::json_quote(opts.profile_arg)); + request_json = std::format( + R"({{"op":"describe","profile":{}{}}})", Util::json_quote(opts.profile_arg), + opts.member_arg ? std::format(",\"member\":{}", Util::json_quote(*opts.member_arg)) + : std::string{}); } else if (sub == "graph") { request_json = std::format(R"({{"op":"graph","profile":{},"format":{}}})", Util::json_quote(opts.profile_arg), @@ -2658,8 +2660,10 @@ int main(int argc, char **argv) { auto &daemon_describe_cmd = daemon_cmd.subcommand("describe", "Describe a project's build graph via the daemon"); configure_daemon_common(daemon_describe_cmd); - daemon_describe_cmd.option_default("--profile", "-p", "Profile to evaluate", - daemon_opts.profile_arg, "debug"); + daemon_describe_cmd + .option_default("--profile", "-p", "Profile to evaluate", daemon_opts.profile_arg, + "debug") + .option("--member", "", "Workspace member to describe (default: all)", daemon_opts.member_arg); auto &daemon_build_cmd = daemon_cmd.subcommand("build", "Build a project graph via the daemon"); configure_daemon_common(daemon_build_cmd); daemon_build_cmd diff --git a/tests/DaemonTests.cpp b/tests/DaemonTests.cpp index f0fd8bd..16447cc 100644 --- a/tests/DaemonTests.cpp +++ b/tests/DaemonTests.cpp @@ -1788,6 +1788,11 @@ void build(Void::Build::Project &project) { Void::Testing::expect(describe_raw->find("\"name\":\"lib\"") != std::string::npos); Void::Testing::expect(describe_raw->find("\"name\":\"app\"") != std::string::npos); + auto member_raw = Void::Build::Daemon::request( + socket, R"({"op":"describe","member":"app"})", std::chrono::seconds{120}); + auto unknown_member = request_object(socket, R"({"op":"describe","member":"nope"})", + std::chrono::seconds{120}); + auto workspace_build = Void::Build::Daemon::request(socket, R"({"op":"build"})", std::chrono::seconds{120}); Void::Testing::require(workspace_build.has_value()); @@ -1830,5 +1835,25 @@ void build(Void::Build::Project &project) { Void::Testing::require(ide_generate.has_value()); Void::Testing::expect(ide_generate->find("\"ok\":true") != std::string::npos); Void::Testing::expect(std::filesystem::exists(ws / "packages" / "app" / ".clangd")); + + Void::Testing::require(member_raw.has_value()); + const auto member_parsed = parse_json(*member_raw); + Void::Testing::require(member_parsed.has_value()); + const auto *member_object = as_object(*member_parsed); + Void::Testing::require(member_object != nullptr); + Void::Testing::expect(bool_field(*member_object, "workspace")); + const auto *members_value = field(*member_object, "members"); + Void::Testing::require(members_value != nullptr); + const auto *members_array = std::get_if(&members_value->value); + Void::Testing::require(members_array != nullptr); + Void::Testing::expect_eq(members_array->size(), std::size_t{1}); + if (members_array->size() == 1) { + const auto *only = std::get_if(&members_array->front().value); + Void::Testing::require(only != nullptr); + Void::Testing::expect_eq(str_field(*only, "name"), std::string{"app"}); + } + Void::Testing::require(unknown_member.has_value()); + Void::Testing::expect(!bool_field(*unknown_member, "ok", true)); + Void::Testing::expect(!std::filesystem::exists(socket)); } diff --git a/tests/FullV1Tests.cpp b/tests/FullV1Tests.cpp index 1b17a24..b3035b3 100644 --- a/tests/FullV1Tests.cpp +++ b/tests/FullV1Tests.cpp @@ -89,9 +89,8 @@ void write_raw_tar(const std::filesystem::path &tar_path, std::filesystem::path locate_vbs_binary() { std::error_code ec; - if (const auto self = std::filesystem::read_symlink("/proc/self/exe", ec); - !ec && !self.empty()) { - const auto sibling = self.parent_path() / "vbs"; + if (const auto self_exe = Platform::current_executable_path(); self_exe) { + const auto sibling = self_exe->parent_path() / "vbs"; if (std::filesystem::exists(sibling, ec)) { return sibling; } diff --git a/tests/RegistryTests.cpp b/tests/RegistryTests.cpp index d276a89..eb66a23 100644 --- a/tests/RegistryTests.cpp +++ b/tests/RegistryTests.cpp @@ -52,9 +52,8 @@ std::string extract_json_str(std::string_view json, const std::string &key) { std::filesystem::path locate_vbs_binary() { std::error_code ec; - if (const auto self = std::filesystem::read_symlink("/proc/self/exe", ec); - !ec && !self.empty()) { - const auto sibling = self.parent_path() / "vbs"; + if (const auto self_exe = Platform::current_executable_path(); self_exe) { + const auto sibling = self_exe->parent_path() / "vbs"; if (std::filesystem::exists(sibling, ec)) { return sibling; } diff --git a/tests/SelfHostTests.cpp b/tests/SelfHostTests.cpp index 6992694..b613fdc 100644 --- a/tests/SelfHostTests.cpp +++ b/tests/SelfHostTests.cpp @@ -43,9 +43,8 @@ std::filesystem::path locate_void_source_dir() { std::filesystem::path locate_vbs_binary() { std::error_code ec; - if (const auto self = std::filesystem::read_symlink("/proc/self/exe", ec); - !ec && !self.empty()) { - const auto sibling = self.parent_path() / "vbs"; + if (const auto self_exe = Platform::current_executable_path(); self_exe) { + const auto sibling = self_exe->parent_path() / "vbs"; if (std::filesystem::exists(sibling, ec)) { return sibling; }