diff --git a/docs/agent-workflow/STATE.md b/docs/agent-workflow/STATE.md index 5596624..a080355 100644 --- a/docs/agent-workflow/STATE.md +++ b/docs/agent-workflow/STATE.md @@ -404,3 +404,7 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B - **Superiority plan ([22-superiority-and-gaps.md](../roadmap/22-superiority-and-gaps.md), 2026-12-05)**: revised platform strategy - **macOS deferred**, **Windows via MinGW-w64 cross-compilation + Wine execution** (`dev cpp-gcc -p pkgsCross.mingwW64.stdenv.cc`, `dev cpp-gcc -p wine64`), native MSVC deferred; plus packaging parity (ZIP/DEB/RPM), IDE ecosystem, migration tooling, test-runner parity, benchmarks, CI runners, and remote execution in prioritized order. - **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. + +- **Remaining upgrade plan ([23-remaining-upgrade-plan.md](../roadmap/23-remaining-upgrade-plan.md))**: Tracks F1–F14 close the post-1.0 gaps — hermetic sandboxing, Windows IPC/watcher/native backends, macOS and MSVC hosts, multi-machine orchestration, registry mirrors/federation/key distribution/vcpkg, a BEP stream, 10k-target scaling and change-proportional snapshots, deeper CMake/Meson migration, a native Windows CI runner, cross-platform determinism, PKG/APK/IFW installers and installer SBOMs, GUI/completions/LSP polish, and CI housekeeping. + +- **Superiority tracks ([24-superiority-tracks.md](../roadmap/24-superiority-tracks.md))**: Tracks G1–G12 target being *better* than CMake, Meson, build2 and Cargo — Cargo-grade lifecycle commands (`new`/`add`/`remove`/`run`/`bench`/`doc`/`fmt`/`lint`/`why`/`tree`/`audit`/`vendor`/`install-binary`), additive C++ feature flags (today `Dependency::feature` is recorded but not applied), per-package profiles and toolchain pinning, polyglot Rust/Fortran/CUDA/Zig, SLSA attestations and advisories with the sandboxed descriptor, versioned metadata schemas with DAP and plugin protocols, affected builds/tests and build scans, doctests/sharding/coverage gates/fuzzing, zero-config onboarding and actionable errors, distribution ecosystem, policy-as-code with `vbs ci`, and two-way CMake/Cargo interop. diff --git a/docs/agent-workflow/TASKS.md b/docs/agent-workflow/TASKS.md index e9a84cb..587cbd9 100644 --- a/docs/agent-workflow/TASKS.md +++ b/docs/agent-workflow/TASKS.md @@ -36,7 +36,7 @@ Base HEAD: `fe0d1a6` | Wave 27 (Track E3 editor long-poll watch) | `watch_wait` daemon request + `vbs daemon ide wait --timeout-ms`: bounded 0-5000 ms long poll over the warm watcher returning changed paths/sequence/timed_out | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 13/13, full CTest 8/8) | `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/DaemonTests.cpp`, `tests/CliContracts.cmake`, docs | | Wave 28 (Registry binary-variant endpoints) | `BinaryReleaseMeta` storage, `PUT .../binaries/` + `GET .../binaries//download`, metadata persistence/detail listing, signature header validation, immutable conflicts | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Registry suite 6/6, full CTest 8/8) | `registry/include/Void/Build/Registry/RegistryService.hpp`, `registry/service/RegistryService.cpp`, `tests/RegistryTests.cpp`, docs | | Wave 29 (RegistryClient binary API + signed CLI) | `publish_binary_variant`/`fetch_binary_variants` in RegistryClient; `vbs publish-binary` CLI with optional signing; registry test extended | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Registry suite 6/6, full CTest 8/8) | `include/Void/Build/Package/RegistryClient.hpp`, `src/Package/RegistryClient.cpp`, `src/Main.cpp`, `tests/RegistryTests.cpp`, `tests/CliContracts.cmake`, docs | -| Wave 30 (`vbs binaries list|fetch`) | CLI over `fetch_binary_variants`: list id/digest/size/signature state; fetch resolves the variant and downloads with SHA-256 verification | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Registry suite 6/6, full CTest 8/8) | `src/Main.cpp`, `tests/RegistryTests.cpp`, `tests/CliContracts.cmake`, docs | +| Wave 30 (`vbs binaries list\|fetch`) | CLI over `fetch_binary_variants`: list id/digest/size/signature state; fetch resolves the variant and downloads with SHA-256 verification | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Registry suite 6/6, full CTest 8/8) | `src/Main.cpp`, `tests/RegistryTests.cpp`, `tests/CliContracts.cmake`, docs | | Wave 31 (Daemon workspace support) | Workspace `describe` member summaries; workspace `build` with `member` + shared root lock (`DaemonOptions::lock_root`) | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 13/13, full CTest 8/8) | `include/Void/Build/Daemon/Daemon.hpp`, `src/Daemon/Daemon.cpp`, `tests/DaemonTests.cpp`, docs | | Wave 32 (Member-scoped daemon IDE) | `resolve_member_options` shared by daemon IDE query/generate and compdb export; `--member` CLI flags; workspace member IDE coverage | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 13/13, full CTest 8/8) | `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/DaemonTests.cpp`, docs | | Wave 33 (Daemon workspace-wide build) | `execute_project_build`/`BuildOutcome` split; workspace build without `member` builds all members in order with per-member and aggregate results | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 13/13, full CTest 8/8) | `src/Daemon/Daemon.cpp`, `tests/DaemonTests.cpp`, docs | @@ -146,4 +146,4 @@ Base HEAD: `fe0d1a6` | Wave 144 (NuGet generator) | `--archive-format nuget`: `.nupkg` with nuspec, OPC parts and `runtimes//native` assets | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Python validates the package, install test passes, full CTest 8/8) | `src/Install/Installer.cpp`, `src/Main.cpp`, `tests/FullV1Tests.cpp`, docs | | Wave 145 (Coverage reporting) | `vbs test --coverage DIR`; gcov JSON -> lcov + summary | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; E2E passes, full CTest 8/8) | `include/Void/Build/Report/Coverage.hpp`, `src/Report/Coverage.cpp`, `src/Main.cpp`, `tests/FullV1Tests.cpp`, docs | | Wave 146 (CI hardening, explainability, shared caches, CLI surface, migration breadth) | CI image tool upgrades + coverage lane; test `--repeat/--retry/--shuffle/--stop-on-failure`; `vbs explain`; `--trace` Chrome traces; shared descriptor/probe caches; `vbs completions`/`vbs man`; `vbs migrate --from meson`; `vbs init --template`; `vbs presets --export`; MSI installer | COMPLETE & VERIFIED (GCC 16.2; new FullV1Tests cases for every feature pass, CLI contract suite passes; cold build 3897 -> 755 ms measured) | `src/Main.cpp`, `src/Execution/Scheduler.{hpp,cpp}`, `src/Cli/CommandModel.{hpp,cpp}`, `src/Config/{Frontend,Scaffold,CmakeImport}.cpp`, `src/Toolchain/Driver.cpp`, `include/Void/Build/Util/UserCache.hpp`, `.gitea/workflows/ci.yml`, [Void/CI-Images](https://git.faumaray.com/Void/CI-Images), `tests/{FullV1Tests,CliContracts}`, 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) | +| Future (Plans 23–24) | Gap closure and superiority tracks | PLANNED (see the plans for per-track acceptance gates) | [23-remaining-upgrade-plan.md](../roadmap/23-remaining-upgrade-plan.md), [24-superiority-tracks.md](../roadmap/24-superiority-tracks.md) | diff --git a/docs/roadmap/23-remaining-upgrade-plan.md b/docs/roadmap/23-remaining-upgrade-plan.md new file mode 100644 index 0000000..cde117d --- /dev/null +++ b/docs/roadmap/23-remaining-upgrade-plan.md @@ -0,0 +1,651 @@ +# 23 — Remaining upgrade plan (Track F) + +Status: **planned (2026-12-06)**. Nothing in this plan is implemented unless it is listed in +[§1 Verified baseline](#1-verified-baseline). Every interface shown here is a *proposed* interface, +not an existing one. + +This plan continues [21 — Post-v1 expansion roadmap](21-expansion-roadmap.md) and +[22 — Superiority roadmap](22-superiority-and-gaps.md). It exists because Plan 22's gap inventory +was written before the Wave 146 work (CI hardening, explainability, shared caches, CLI surface, +migration breadth); this document re-baselines the gaps and turns the remaining ones into +executable tracks with acceptance gates. + +Sources: [REQUIREMENTS](REQUIREMENTS.md), [ARCHITECTURE](ARCHITECTURE.md), plans 01–22, +[STATE](../agent-workflow/STATE.md), [TASKS](../agent-workflow/TASKS.md), +[VERIFICATION](../agent-workflow/VERIFICATION.md), and the observed results recorded there. + +Legend: **S** = days, **M** = 1–2 weeks, **L** = multi-week. *Blocked* means the work cannot be +accepted until the named external prerequisite exists. + +--- + +## 1. Verified baseline + +These are done and are **not** re-planned here. Evidence lives in `STATE.md` (Wave 146) and the +named tests. + +| Capability | Evidence | +| --- | --- | +| `vbs explain [--format text\|json]` (why an action runs) | `FullV1Tests.explain_reports_stale_actions_and_trace_writes_chrome_json` | +| `vbs build\|test --trace FILE` Chrome traces | same test parses the trace JSON | +| Test controls `--repeat`, `--retry`, `--shuffle`, `--stop-on-failure` | `FullV1Tests.test_repeat_retry_shuffle_and_stop_on_failure` | +| Shared descriptor and probe caches (cold 3897 → 755 ms on the 20-source fixture) | `FullV1Tests.shared_user_cache_reuses_descriptor_and_probes_across_build_dirs` | +| `vbs completions --shell bash\|zsh\|fish`, `vbs man` (86 pages) | `FullV1Tests.completions_and_man_pages_are_generated_from_the_cli` | +| `vbs migrate --from meson` | `FullV1Tests.meson_build_import_renders_build_cpp_scaffold` | +| `vbs init --template app\|library\|header-only\|shared` | `FullV1Tests.init_templates_scaffold_buildable_projects` | +| `vbs presets --export FILE` | `FullV1Tests.presets_export_round_trips_through_the_importer` | +| JetBrains run configurations from `vbs ide generate` | IDE integration test | +| Sanitizer-instrumented build descriptor (`VBS_HOST_CXX_FLAGS`) | local ASan symbol check | +| CI coverage lane (lcov) | lcov capture/summary verified locally; CI run 2105 | +| Registry worker attempt budget and dead-letter list | `RegistryTests.worker_queue_abandons_actions_after_repeated_leases` | +| CI images with msitools, rpm-tools, dpkg, meson, lcov | `Void/CI-Images` runs 2099, 2104 | +| MSI installer (`--archive-format msi`) | local `wixl` output verified; CI ships `wixl` now | +| Blocking Wine/installer lanes, release asset replacement | CI run 2102 (end to end) | + +Also verified and stable: Linux + MinGW/Wine targets, modules/PCH/header units/unity/LTO, +workspaces, package manager + registry, SBOM/signing, daemon (Unix sockets, 30+ requests), +remote worker protocol/queue/parallel workers, CTest-parity runner (labels, resources, fixtures, +JUnit, CDash, coverage), all nine installer formats, pkg-config, ASM/shader bundles. + +--- + +## 2. Updated gap inventory + +| Area | Status | Blocker / note | +| --- | --- | --- | +| Hermetic sandboxing | **Missing** | snapshots define inputs, but actions can still read the whole filesystem | +| Windows daemon transport | **Missing** | Unix sockets only; named pipes return "not implemented (Track C3)" | +| Native Windows host backends | **Missing** | `src/Platform/Linux` and `src/Watch/Linux` `#error` on non-Linux hosts | +| Windows watcher (ReadDirectoryChangesW) | **Missing** | inotify only | +| macOS host (Apple Clang, `ld64`, FSEvents) | **Deferred** | no macOS host available | +| Native MSVC / clang-cl | **Deferred** | needs a Windows host; MSVC also lacks P1689 modules | +| Multi-machine orchestration | **Missing** | workers/queue/leases exist; no capacity, retries across machines, affinity | +| Registry federation / mirrors / key distribution | **Missing** | single registry; trusted keys are loaded, not distributed | +| vcpkg interop | **Missing** | Conan/CMake/Meson/pkg-config only | +| Build Event Protocol stream | **Missing** | Chrome trace exists; BEP does not | +| 10k-target scaling benchmark | **Missing** | 20-source fixture only; Debug binary baseline | +| Snapshot work proportional to changed files | **Partial** | parallel hashing, but full revalidation per run | +| CMake/Meson migration depth | **Partial** | bounded subset; `add_subdirectory`, `configure_file`, `custom_target` are notes | +| Native Windows CI runner | **Missing** | Wine cannot run `vbs_v1_tests`/`vbs_selfhost_tests` | +| Cross-platform determinism | **Linux only** | Stage 2 == Stage 3 proven on Linux | +| PKG / APK / IFW installers, installer SBOM | **Missing** | tar, sh, zip, deb, rpm, wix, msi, dmg, nuget exist | +| GUI template | **Missing** | app, library, header-only, shared exist | +| LSP server / plugin marketplace | **Missing** | compdb + File API + plugin assets exist | +| Windows sanitizers | **Blocked** | Arch `mingw-w64-gcc 16.2` ships no `libasan`/`libubsan` | +| CI/artifact housekeeping | **Pending** | old runs and stuck runs were requested for deletion | + +--- + +## 3. Tracks + +### F1 — Hermetic sandboxing *(L)* + +**Goal.** Make "actions see only their snapshot inputs" a guarantee, not a convention: an action +inherits a mount namespace in which the project snapshot tree is read-only, the profile build +directory is writable, the toolchain and system libraries are read-only, and nothing else of the +user's filesystem is visible. + +**Planned interfaces** (`include/Void/Build/Sandbox/Sandbox.hpp`): + +```cpp +// PLANNED — not implemented. +namespace Void::Build::Sandbox { +enum class SandboxMode { Off, Warn, Strict }; +struct SandboxOptions { + std::filesystem::path project_root; + std::filesystem::path profile_build_dir; + std::vector toolchain_roots; // compiler sysroot, /usr, nix store + bool allow_network{false}; + bool allow_tmp{true}; +}; +[[nodiscard]] bool sandbox_supported() noexcept; // user namespaces available +[[nodiscard]] Void::Result::Result +run_in_sandbox(const SandboxOptions &options, const Platform::ProcessRequest &request); +} +``` + +**Work items.** + +1. Linux backend in `src/Sandbox/Linux/NamespaceSandbox.cpp`: `unshare(CLONE_NEWUSER | + CLONE_NEWNS | CLONE_NEWNET)`, uid/gid maps, `mount --bind` of the snapshot tree (read-only), + the profile build dir, `/dev`, `/proc` (or a minimal procfs), the toolchain sysroot, and the + Nix store when present. Fall back to `Warn` when user namespaces are unavailable. +2. Wire it into `Execution::execute_graph` behind `vbs build|test --sandbox=off|warn|strict` + (default `off` until the suite is green under `strict`). +3. Cache keys stay unchanged (sandboxing must not change results, only visibility). +4. CI lane: `--sandbox=strict` for the SDK/core suites; a dedicated negative test. +5. Document the hermeticity contract and its escape hatches (`--sandbox=warn`, env allowlist). + +**Acceptance gates.** + +- `FullV1Tests.sandbox_hides_undeclared_files`: an action that opens a file outside the snapshot + fails under `strict` and only warns under `warn`. +- `FullV1Tests.sandbox_allows_toolchain_and_build_dir`: a normal compile/link/test succeeds under + `strict`. +- The full SDK/core suite passes under `strict` in CI. +- No measurable warm-build regression beyond 5% on the 20-source fixture. + +**Risks.** Unprivileged user namespaces are disabled on some hosts; compilers need `/tmp` and +`/proc/self`; Nix store paths must be exposed; `strict` may break third-party generators. + +**Dependencies.** None (Linux only). Needed by F11 for meaningful reproducibility claims. + +--- + +### F2 — Windows daemon transport and watcher *(M for IPC; L with native backends)* + +**Goal.** Remove the last `#error` between the daemon/editor protocol and Windows. + +**Planned interfaces** (`include/Void/Build/Platform/Ipc.hpp`): + +```cpp +// PLANNED — not implemented. +namespace Void::Build::Platform { +struct IpcEndpoint { + enum class Kind { UnixSocket, NamedPipe } kind; + std::filesystem::path unix_path; // Unix + std::wstring pipe_name; // Windows, \\.\pipe\vbs- +}; +[[nodiscard]] IpcEndpoint daemon_endpoint(const std::filesystem::path &build_root); +[[nodiscard]] Result connect_ipc(const IpcEndpoint &endpoint); +} +``` + +**Work items.** + +1. Named-pipe server (`CreateNamedPipe` + overlapped I/O) and client in + `src/Platform/Windows/Ipc.cpp`; the daemon loop keeps its newline-delimited JSON protocol. +2. `ReadDirectoryChangesW` watcher in `src/Watch/Windows/Watcher.cpp` with the same + `MetadataOnly`/`FullBuild` and overflow-rescan semantics as inotify. +3. Windows `FileOps`/`ProcessSupervisor` backends (`CreateProcessW` with job objects for the + descendant-supervision guarantees) so the daemon can run as a native Windows process. +4. Keep the Unix implementation untouched; select the backend at compile time. +5. Daemon tests run under Wine where possible, and on a native Windows runner once F10 exists. + +**Acceptance gates.** + +- `DaemonTests` (all requests) pass against the named-pipe transport on a Windows host. +- The watcher reports created/changed/deleted paths and overflow rescan identically to inotify + (shared conformance test). +- `vbs daemon build` from a native Windows `vbs.exe` builds a sample project. + +**Risks.** Wine's named-pipe fidelity is partial; overlapped I/O errors are easy to get wrong; +job-object supervision differs from POSIX process groups. + +**Dependencies.** F10 for acceptance (native Windows runner). F2a (IPC + watcher) can be +implemented and unit-tested under Wine earlier. + +--- + +### F3 — macOS host support *(L; blocked on hardware)* + +**Goal.** First-class macOS host: Apple Clang, `ld64`, `.dylib`/`.bundle`, FSEvents. + +**Work items.** + +1. `src/Platform/Darwin/{FileOps,ProcessSupervisor}.cpp` (`kqueue`/`posix_spawn`, `F_SETNOSIGPIPE`, + `proc_pidinfo` for group reaping) and `HostOs::MacOS`. +2. Apple Clang discovery and flag lowering (`-arch`, `-mmacosx-version-min`, + `-Wl,-install_name`, `@rpath`, `-undefined dynamic_lookup`), `libtool -static` for archives. +3. `src/Watch/Darwin/Watcher.cpp` on FSEvents with the same overflow/rescan contract. +4. `vbs install --archive-format dmg` becomes mountable: HFS+/APFS payload writer instead of the + current UDIF wrapper. +5. Codesign hook: `--codesign-identity`, `--entitlements`, notarization as a documented external + step. +6. CI: a `macos` runner label and lane; until then, the platform stays *unsupported*. + +**Acceptance gates.** + +- Configure, build and test a sample and VBS itself on macOS (observed run, version recorded). +- `vbs test` passes the SDK/core suites on macOS. +- `.dmg` mounts and installs on macOS (Plan 22 acceptance gate). + +**Risks.** No host today; Apple Clang lacks some GCC flags; FSEvents coalescing differs from +inotify. + +**Dependencies.** A macOS machine or CI runner. + +--- + +### F4 — Native MSVC / clang-cl *(L; blocked on hardware)* + +**Goal.** `CompilerFamily::Msvc` with direct `cl.exe`/`link.exe` invocation (no generator), and +clang-cl as the module-capable variant. + +**Planned interface changes.** + +```cpp +// PLANNED — not implemented. +enum class CompilerFamily { Gcc, Clang, Msvc, ClangCl }; +enum class ModuleSupport { Full, ScanDepsOnly, Unavailable }; +``` + +**Work items.** + +1. Toolchain probe: `cl.exe` version banner, `link.exe`/`lib.exe`, Windows SDK + MSVC include/lib + discovery (`vswhere`), `/std:c++latest`, `/EHsc`, `/MD`/`/MT`, `/Zi`, `/O2`, `/utf-8`. +2. Response files (`@file.rsp`) for long command lines; `.obj`/`.lib`/`.exe`/`.dll` naming and + import libraries. +3. Incrementality: `/showIncludes` parsing into discovered inputs (the MSVC equivalent of + depfiles), `/Fd` PDB handling, `/Brepro` for reproducible links. +4. Modules: clang-cl via `clang-scan-deps`; MSVC via `/scanDependencies` where available, else + capability-gated `Unavailable` with an explicit diagnostic. +5. Exception/SEH/sanitizer capability probes; `clang-cl` sanitizer flags. + +**Acceptance gates.** + +- Build and test a sample with `cl.exe` and with `clang-cl` on Windows; header-change + incrementality proven (`/showIncludes`). +- VBS itself builds with clang-cl (self-host stretch goal). +- Modules either work (clang-cl) or fail with an explicit capability message (MSVC), never + silently. + +**Risks.** MSVC's module story is version-dependent; `/showIncludes` localization; PDB +determinism. + +**Dependencies.** F2 (Windows process backends) and F10. + +--- + +### F5 — Multi-machine orchestration *(M)* + +**Goal.** Turn the existing worker/lease/queue protocol into a scheduler that distributes +cacheable actions across machines with capacity awareness, retries and result verification. + +**Planned interface** (`Execution::ExecutionOptions` additions): + +```cpp +// PLANNED — not implemented. +struct RemoteExecutionOptions { + std::string registry_url; + std::string bearer_token_env; + std::size_t max_remote_actions{0}; // 0 = unlimited + std::vector labels; // worker label affinity + std::chrono::seconds lease{600}; + int retries{2}; +}; +``` + +**Work items.** + +1. Registry: worker capacity and labels (`platform`, `os`, `arch`, `compiler`, `jobs`), heartbeat + load, `GET /api/v1/workers?available=1`, lease TTL bounded by capacity. +2. Planner: classify actions as local-only (non-cacheable, host-dependent generators) vs + remote-capable; prefer remote when the local queue is saturated and a matching worker exists. +3. Client: submit action specs to the CAS, enqueue, wait for results with lease renewal, verify + every output digest locally, retry on worker loss (bounded, reusing the attempt budget). +4. Aggregate remote results into the normal `ExecutionReport` and `vbs explain` (source = remote). +5. CLI: `vbs build --remote --registry URL --remote-jobs N --worker-label k=v`. + +**Acceptance gates.** + +- Two local worker processes drain a 20-action graph; actions never duplicate. +- Killing one worker mid-action makes its action retried on the other; the build succeeds. +- Outputs are byte-identical to a local build (digest comparison). +- `--remote` with no workers falls back to local execution with a warning. + +**Risks.** Network flakiness, lease expiry vs long compiles, trusting remote outputs (mitigated by +digest verification), debugging distributed failures. + +**Dependencies.** None beyond the existing registry; benefits from F11 to trust remote artifacts. + +--- + +### F6 — Registry ecosystem: mirrors, federation, key distribution, vcpkg *(L)* + +**Goal.** Make the registry usable beyond one server and one toolchain ecosystem. + +**Work items.** + +1. **Mirrors**: `--registry-mirror URL` / `VBS_REGISTRY_MIRRORS` read-through list; downloads + fall back in order, every artifact digest-verified, negative caching documented. +2. **Federation**: `GET /api/v1/federate//` proxy that fetches from an upstream + registry once, stores it locally, and serves it afterwards; immutable releases keep 409 + semantics; upstream credentials are never persisted. +3. **Trusted-key distribution**: `GET /api/v1/keys` (public keys, fingerprints, rotation metadata) + and `vbs keys fetch --registry URL --output vbs.keys`; keys are still validated locally. +4. **vcpkg interop**: `Dependency::vcpkg("fmt")` resolving `vcpkg.json` + `installed/` + (headers, libraries, and `.pc`/CMake config files) into an imported target; `vbs migrate + --from vcpkg` maps `vcpkg.json` dependencies into `vbs.deps.toml` notes. +5. Document trust: mirrors and federation serve bytes, never signatures; key fetch does not + grant trust. + +**Acceptance gates.** + +- Mirror fallback E2E with two loopback registries (first down, second serves the artifact; digest + verified). +- Federation E2E: upstream package fetched once, served locally while upstream is stopped. +- `vbs keys fetch` round-trips through `load_trusted_keys` and enforces signatures. +- vcpkg fixture: a real installed vcpkg package builds and links. + +**Risks.** vcpkg has no stable machine-readable install description (heuristics needed); +federation doubles storage; mirror ordering can hide stale artifacts. + +**Dependencies.** None. + +--- + +### F7 — Build Event Protocol stream *(S)* + +**Goal.** Emit a machine-readable event stream for CI dashboards, beyond the Chrome trace. + +**Planned interface.** + +```cpp +// PLANNED — not implemented. +struct BepEvent { + std::string id; + enum class Kind { BuildStarted, TargetStarted, ActionStarted, ActionFinished, + TestFinished, BuildFinished } kind; + std::string label; + std::optional exit_code; + std::chrono::milliseconds duration; + std::string detail; // bounded +}; +``` + +**Work items.** + +1. `--bep FILE` writes newline-delimited JSON (one event per line) with monotonic ids. +2. Reuse the trace hooks in `execute_build_or_test`; add test-finished events from the runner. +3. Bounded payloads (same 240-byte truncation rule as CI logs) and no secrets. +4. `--bep-http URL` is explicitly out of scope until a consumer exists. + +**Acceptance gates.** + +- `FullV1Tests.bep_stream_contains_phase_action_and_test_events` parses every line as JSON and + checks the event kinds. +- A failing build emits `ActionFinished` with a non-zero exit code and a terminal + `BuildFinished` event. + +**Risks.** Low; scope creep toward a full BEP schema. + +**Dependencies.** None. + +--- + +### F8 — Performance: 10k targets, Release baseline, change-proportional snapshots *(M)* + +**Goal.** Replace anecdotal performance claims with measured, repeatable ones, and keep snapshot +cost proportional to changed files. + +**Work items.** + +1. Extend `benchmarks/compare.sh` with `--targets N` (generated targets, not just sources) and + `--json` output; add fixtures for 20 / 1,000 / 10,000 targets. +2. Record a **Release** `vbs` baseline (cold, warm, incremental single-file change) next to + CMake/Ninja and Meson; store the numbers in Plan 22 §6 with the binary's build type. +3. Snapshot memo: reuse the previous manifest when the stat fingerprint (size + mtime + inode) + and the content digest of every *declared* input are unchanged, instead of re-hashing every + file in every scan root. The manifest keeps full content hashes; a full revalidation runs when + the memo is missing or the fingerprint changed. +4. Profile the remaining warm path (`config` 1–2 ms, toolchain 7–11 ms, snapshot ~20 ms) and set + explicit gates: warm no-op and single-file incremental budgets per fixture size. + +**Acceptance gates.** + +- `benchmarks/compare.sh --targets 10000 --json` runs and reports VBS cold/warm/incremental. +- Warm no-op on the 20-source fixture stays ≤ 150 ms (Debug) and is recorded for Release. +- A single changed source rebuilds only its compile + link closure (asserted by action counts). +- No snapshot correctness regression: the existing snapshot mutation tests still pass. + +**Risks.** Stat-based memoization can miss same-size/same-mtime edits — mitigated by reusing only +manifest entries whose digest was content-verified, plus periodic full revalidation. + +**Dependencies.** None. + +--- + +### F9 — Migration depth: CMake and Meson *(M)* + +**Goal.** Raise `vbs migrate` from "bounded subset" to "covers the common project shape", always +reporting what it cannot translate. + +**Work items.** + +1. CMake: `add_subdirectory` recursion (with cycle detection), `target_compile_options`, + `target_compile_features`, `CMAKE_CXX_STANDARD`, a generator-expression subset + (`$`, `$`, `$`), `find_package` → + typed notes, `configure_file` detection, `install(FILES|DIRECTORY)`. +2. Meson: `configure_file`, `custom_target` → `custom_action`, `subdir`, `install_headers`, + `declare_dependency`, `dependency(...)` → `.pkgconfig()`, `add_project_arguments`. +3. Golden-file tests: fixture project → expected `build.cpp` snapshot; and the rendered scaffold + must build and test for the fixtures that are fully covered. +4. `--strict` mode that fails when unsupported constructs exist (CI migration gate). + +**Acceptance gates.** + +- Golden-file tests for at least four CMake and four Meson fixtures. +- Every fully covered fixture's generated `build.cpp` builds and its tests pass. +- `--strict` exits non-zero on a fixture with `add_custom_command`/`custom_target`. +- `vbs migrate` dry-run over this repository's own `CMakeLists.txt` still works. + +**Risks.** CMake is Turing-complete; keep the subset explicit and the notes honest. + +**Dependencies.** None. + +--- + +### F10 — Native Windows CI runner *(M–L; blocked on a Windows runner)* + +**Goal.** Run the suites that Wine cannot run (`vbs_v1_tests`, `vbs_selfhost_tests`) on Windows, +and produce Windows installers with a native `vbs.exe`. + +**Work items.** + +1. New `Void/CI-Images` image `windows-native` (Windows Server Core + MSVC Build Tools + LLVM + + Ninja + Python + WiX toolset) and a matching runner label. +2. CI lane: build with CMake + MSVC *and* with the native `vbs` (self-host), run all suites, + publish JUnit. +3. Windows installer job runs `vbs.exe install --archive-format msi` natively (WiX `candle`/ + `light`), replacing the cross-built MSI when both exist. +4. Keep the Wine lane as the fast cross-build check. + +**Acceptance gates.** + +- `vbs_sdk_tests`, `vbs_core_tests`, `vbs_v1_tests`, `vbs_selfhost_tests` pass on Windows. +- A native MSI installs and runs `vbs --version` on a clean Windows image. +- The release publishes native-Windows assets next to the Linux and cross-built ones. + +**Risks.** Windows runners are expensive and licensing-bound; the suite may expose POSIX-isms. + +**Dependencies.** A Windows runner (hardware or hosted). F2/F4 benefit but are not prerequisites +for the lane itself. + +--- + +### F11 — Cross-platform determinism *(M)* + +**Goal.** Define and prove what "reproducible" means across hosts, and fix the gaps. + +**Work items.** + +1. Contract: identical inputs + identical toolchain version + same target ⇒ identical artifacts; + different hosts may differ only in documented ways (debug paths, timestamps). +2. Windows target: PE timestamp zeroing, deterministic COFF/archive ordering, path-case + normalization in keys, CRLF normalization for generated sources. +3. `vbs verify-repro --a DIR --b DIR` comparing two build trees by digest and reporting the first + divergence per target. +4. Extend the Stage 2 == Stage 3 test to the Windows target (two independent trees) and record + which formats are bit-identical. + +**Acceptance gates.** + +- `vbs verify-repro` reports zero divergences for a Windows-target double build. +- Linux Stage 2 == Stage 3 remains green. +- Documented table of reproducible artifacts (binaries, archives, installers) and the exceptions. + +**Risks.** Linker nondeterminism in MinGW/PE; full cross-host identity may be impossible — +scope it honestly. + +**Dependencies.** F8 (measurement harness), F10 for native Windows verification. + +--- + +### F12 — Packaging parity: PKG, APK, IFW, installer SBOM *(M)* + +**Goal.** Close the remaining CPack generator gaps. + +**Work items.** + +1. `--archive-format pkg`: macOS flat package (`Distribution` XML + component packages) built from + the staged prefix; structural validation on Linux, install validation on macOS (F3). +2. `--archive-format apk`: Alpine package (`.PKGINFO`, data tar, optional signature with + `abuild-sign` semantics documented). +3. `--archive-format ifw`: Qt Installer Framework tree (`config/config.xml`, `packages//meta` + + `data`), guarded by `binarycreator` availability. +4. `vbs install --installer-sbom spdx|cyclonedx`: SBOM written next to every installer, reusing + `Provenance::Sbom` with installer metadata. +5. Extend the install test matrix and the CI installer job to the new formats (guarded like MSI). + +**Acceptance gates.** + +- Each new format has a structural validator test mirroring the existing DEB/RPM/ZIP tests. +- `apk` output is accepted by `tar` + a `.PKGINFO` parser; `pkg` installs on macOS when F3 exists. +- Every installer gets a sibling SBOM with the package name/version and file digests. + +**Risks.** PKG/IFW need platform tools; APK signing is an external step. + +**Dependencies.** F3 for PKG install validation. + +--- + +### F13 — Developer-experience leftovers *(S each)* + +**Goal.** Finish the small items that make daily use pleasant. + +**Work items.** + +1. `vbs init --template gui`: Qt 6/GTK skeleton chosen by a `--gui-toolkit` flag, with a + dependency note instead of a hard dependency. +2. `vbs completions --install`: writes the script into the shell's completion directory + (`$XDG_DATA_HOME/bash-completion/completions`, zsh `site-functions`, fish `vendor_completions.d`). +3. LSP surface: document the clangd + compdb path and add `vbs daemon lsp-status` reporting + compdb freshness, diagnostics gaps and the active profile (a full LSP server stays out of + scope; clangd already consumes the compdb). +4. Plugin distribution: `vbs ide plugin --editor vscode --vsix` already packages; add + `--publish` notes and CI for the three plugin repositories. +5. `vbs doctor --json` for machine-readable diagnostics. + +**Acceptance gates.** + +- GUI template scaffolds and builds (with Qt/GTK present; skipped otherwise). +- `--install` writes to the documented paths (temp-HOME test). +- `lsp-status` returns bounded JSON and is covered by a daemon test. + +**Risks.** GUI template choice is opinionated; LSP scope creep. + +**Dependencies.** None. + +--- + +### F14 — Maintenance and hygiene *(S)* + +**Goal.** Keep the repository and CI clean. + +**Work items.** + +1. Delete CI runs/artifacts outside the agreed retention set (completed v0.1.0, v1.0.0, current + main runs) and clear stuck runs. +2. Scheduled `vbs gc` in CI (weekly) with a size cap. +3. Dependency pin cadence: a documented rule (bump when VoidLibrary fixes affect VBS; record the + pin in STATE). +4. Release notes automation from `git log` between tags. +5. Keep `VERIFICATION.md` current (its header still says 2026-12-03 and references the old + working directory). + +**Acceptance gates.** + +- The Actions runs list matches the retention policy. +- A weekly GC job exists and reports reclaimed bytes. +- `VERIFICATION.md` matches the latest verified state. + +**Risks.** Low. + +**Dependencies.** None. + +--- + +## 4. Milestones and order + +| Milestone | Tracks | Rationale | +| --- | --- | --- | +| M1 — no new hardware | F7, F9, F12 (structural), F8 baseline, F14 | Highest value per effort; all verifiable on Linux | +| M2 — Linux depth | F1, F5, F6, F13 | Differentiators and ecosystem; still Linux-only | +| M3 — Windows host | F2, F4, F10, then F11 | Requires Windows runners; unlocks native MSI + full suites | +| M4 — macOS | F3, F12 (PKG install validation) | Requires a macOS host | + +Recommended within M1: F8 first (it produces the numbers that gate later performance work), then +F9, then F7, with F14 running alongside. + +--- + +## 5. Global acceptance gates + +These apply to every track, mirroring Plan 22 §7: + +1. **Evidence in the repo suite.** A feature is done only when a test in `tests/` covers it. +2. **Observed runs.** Platform claims require an observed run on that platform (or under Wine, + labelled as such). +3. **Docs move with code.** `STATE.md` gets a wave entry, `TASKS.md` a row, and this plan's status + column is updated; the plan is the ledger, not a wish list. +4. **Formatting and YAML.** `clang-format --dry-run --Werror` on owned C++ files; `yamllint` on + workflows. +5. **Performance claims.** Measured with a Release binary, cold and warm, on a documented fixture. +6. **Honest partials.** Anything unverified is marked planned or blocked with the reason, never + described as implemented. + +--- + +## 6. Planned interfaces (summary) + +Everything below is **proposed**, not present in the codebase today: + +```cpp +// F1 +enum class SandboxMode { Off, Warn, Strict }; +bool sandbox_supported() noexcept; + +// F2 +struct IpcEndpoint { enum class Kind { UnixSocket, NamedPipe } kind; }; + +// F4 +enum class CompilerFamily { Gcc, Clang, Msvc, ClangCl }; +enum class ModuleSupport { Full, ScanDepsOnly, Unavailable }; + +// F5 +struct RemoteExecutionOptions { std::string registry_url; std::size_t max_remote_actions{0}; }; + +// F7 +enum class BepEventKind { BuildStarted, TargetStarted, ActionStarted, ActionFinished, + TestFinished, BuildFinished }; + +// F8 +// benchmarks/compare.sh --targets N --json + +// F11 +// vbs verify-repro --a DIR --b DIR + +// F12 +// vbs install --archive-format pkg|apk|ifw --installer-sbom spdx|cyclonedx +``` + +--- + +## 7. Explicit non-goals + +- **Windows sanitizers** until MinGW ships `libasan`/`libubsan` (Arch's `mingw-w64-gcc` 16.2 does + not). Documented as blocked, not scheduled. +- **Full BEP schema coverage** and BEP-over-HTTP until a consumer exists. +- **A from-scratch LSP server**; clangd + compdb + `lsp-status` is the supported path. +- **Bit-identical artifacts across different compilers or hosts**; the contract is same toolchain, + same target, same inputs. +- **build2 feature-parity claims** without measured runs (Plan 22 requires measured comparisons). + +--- + +## 8. Definition of done for this plan + +This plan is complete when every track's acceptance gates are green in CI and recorded in +`STATE.md`, the gap inventory in §2 has no "Missing" rows that are not explicitly deferred with a +reason, and Plan 22's parity table reflects measured results rather than design intent. diff --git a/docs/roadmap/24-superiority-tracks.md b/docs/roadmap/24-superiority-tracks.md new file mode 100644 index 0000000..011daa4 --- /dev/null +++ b/docs/roadmap/24-superiority-tracks.md @@ -0,0 +1,477 @@ +# 24 — Superiority tracks: beyond CMake, Meson, build2 and Cargo + +Status: **planned (2026-12-06)**. Nothing here is implemented unless it is listed in +[Plan 23 §1](23-remaining-upgrade-plan.md#1-verified-baseline). Interfaces are proposals. + +Plan 23 closes the remaining *gaps*. This plan is different: it lists what would make VBS +**better** than the incumbents rather than merely equal — including Cargo, which is the current +benchmark for build-system UX. + +## 1. Positioning + +| Capability | CMake | Meson | build2 | Cargo | VBS today | VBS target (this plan) | +| --- | --- | --- | --- | --- | --- | --- | +| Build description | DSL | DSL | `bsl` | TOML | compiled C++ `build.cpp` | `build.cpp` + zero-config inference (G9) | +| Package manager | external | wrapdb | built-in | built-in + crates.io | built-in registry, lock, signatures, binary variants, SBOM | federation, mirrors, advisories (G5, G10) | +| Binary packages | no | no | limited | no | yes, signed + ABI metadata | `vbs install-binary` (G10) | +| Hermetic sandbox | no | no | partial | no | no | yes (Plan 23 F1, enforced by G5) | +| “Why did this rebuild?” | no | no | no | no | **`vbs explain` (done)** | explain + cache analytics (G7) | +| Remote execution | add-ons | no | no | no | worker protocol, queue, leases | multi-machine (Plan 23 F5, G7) | +| Determinism | opt-in | opt-in | partial | partial | default on Linux, Stage2==Stage3 proven | cross-host contract (Plan 23 F11) | +| Installers | CPack | dist scripts | no | external | **9 formats built in** | + PKG/APK/IFW, bundles (Plan 23 F12, G10) | +| Feature flags | global options | global options | config | **additive, unified** | declared but **not applied** | additive C++ features (G2) | +| Profiles | build types | buildtype | config | **+ per-package overrides** | profiles, per-package planned | per-package + toolchain pin (G3) | +| Polyglot | C/C++/CUDA/Fortran/… | C/C++/Rust/D/Fortran | C/C++ | **Rust only** | C/C++/ASM/shaders | **+ Rust, Fortran, CUDA/HIP** (G4) | +| Machine-readable metadata | File API | introspect | limited | **`cargo metadata`** | `describe`, `graph`, `explain` | stable schemas + `vbs metadata` (G6) | +| Editor/debug protocol | File API/CompDB | introspect | no | rust-analyzer (external) | daemon + CompDB + File API | **DAP + LSP-status** (G6) | +| Test runner | CTest | `meson test` | test module | `cargo test` | CTest parity incl. fixtures/JUnit/CDash | doctests, sharding, impact analysis (G8) | +| Benchmarks | no | no | no | `cargo bench` | benchmark harness | target kind + regression gates (G8) | +| Docs | no | no | no | **`cargo doc`** | no | `vbs doc` (G1) | +| Format/lint | external | external | external | **rustfmt/clippy** | no | `vbs fmt`, `vbs lint` (G1) | +| Policy as code | no | no | no | `cargo-deny` external | no | `vbs policy` + `vbs ci` (G11) | +| One-tool lifecycle | no | no | partial | **yes** | build/test/install/publish/explain | **yes** (G1) | + +What the incumbents get right, and what this plan copies or beats: + +- **Cargo**: zero-config start, one-tool lifecycle, additive features, per-package profiles, + `metadata`, `cargo doc`, doctests, `cargo install`, `--frozen`, vendor. VBS can match all of + these *and* manage native code, binaries, installers and remote execution. +- **CMake**: ecosystem reach, `find_package`/`install(EXPORT)`, File API, CPack, CUDA/Fortran, + configure-time checks. VBS already consumes CMake projects (`bridge`, translation, presets); + G4 and G6 close the language and tooling gaps. +- **Meson**: clean semantics, fast configure, `introspect`, wrapdb, `devenv`, `dist`. VBS's + registry and explainability beat wrapdb and introspection; G9 adds the developer-environment + equivalent. +- **build2**: hermeticity and package semantics. VBS's snapshots/CAS already match this; F1 makes + it enforced. + +## 2. Tracks + +Legend: **S** days, **M** 1–2 weeks, **L** multi-week. Each track lists the incumbent it beats and +the concrete acceptance gate. + +### G1 — Cargo-grade lifecycle CLI *(S–M per command)* + +**Beats:** Cargo (parity), CMake/Meson/build2 (they have no unified lifecycle). + +| Planned command | Behaviour | +| --- | --- | +| `vbs new NAME [--template app\|library\|header-only\|shared\|gui\|bench\|plugin\|workspace]` | `init` plus VCS init and a `build.cpp` that already passes `vbs test` | +| `vbs add DEP[@RANGE] [--dev\|--build\|--optional] [--features a,b] [--path\|--git\|--registry]` | edits `vbs.deps.toml`, resolves and writes `vbs.lock`, prints the resolved version | +| `vbs remove DEP` | removes the manifest entry and unlocks the package | +| `vbs run [TARGET] [-- ARGS...]` | builds then runs the executable with per-target args/env/cwd; passes the exit code through | +| `vbs bench [--baseline FILE] [--max-regression 5%]` | benchmark targets, machine-readable results, fails on regression | +| `vbs doc [--open] [--coverage]` | Doxygen/Sphinx orchestration, reports undocumented public symbols | +| `vbs fmt [--check] [--changed-only]` | clang-format over owned sources, cached results | +| `vbs lint [--fix] [--changed-only]` | clang-tidy with a shared compile database, cached diagnostics | +| `vbs why DEP\|TARGET` | shortest path(s) explaining why a dependency or target is in the graph | +| `vbs tree [--duplicates] [--features] [--depth N]` | dependency tree with versions, sources, features | +| `vbs outdated`, `vbs update -p NAME [--precise V]` | registry-aware upgrade workflow | +| `vbs audit [--advisories URL]`, `vbs deny` | OSV advisories and license/ban policy | +| `vbs vendor [--output DIR]` | offline vendoring of the resolved graph | +| `vbs metadata [--format json]` | stable workspace metadata (G6) | +| `vbs install-binary NAME [--version V] [--prefix DIR]` | installs a published binary variant into `~/.local/bin` | +| `vbs build\|test --frozen` | lock + offline + no registry access, one flag | + +**Work items.** + +1. Shared `Manifest` editor (`Package::Toml` writer, preserving comments and ordering). +2. `run` configs in `build.cpp` (`target.run({.args = {...}, .env = {...}, .cwd = "..."})`) and a + `vbs.json`-free design (all in `build.cpp`). +3. Benchmark target kind (`p.benchmark(name)`) plus result parsing (Google Benchmark JSON, + `nanobench`, custom `VBS_BENCH` output) and baseline comparison with tolerance. +4. `doc`/`fmt`/`lint` as orchestrated action graphs (so they are cached and parallel), not shell + wrappers; `--changed-only` uses the graph's changed inputs. +5. `vendor` reuses the CAS: copy blobs into `vendor/` and rewrite `vbs.lock` sources. +6. `--frozen` is validated as the CI default for release lanes. + +**Acceptance gates.** CLI contracts for every command; `add`/`remove` round-trip a manifest +byte-for-byte apart from the dependency; `run` propagates exit codes; `bench --max-regression` +fails on a 10% slowdown fixture; `fmt --check` fails on unformatted input; `vendor` builds with +the registry offline; `install-binary` installs and runs the registry artifact. + +**Effort.** S per command; **M** for `bench`/`doc`/`lint`. + +--- + +### G2 — Feature flags that actually work *(M–L)* + +**Beats:** Cargo's best idea, applied to C++ — no C++ build system has additive, unified features. + +Current state: `Dependency::feature(name)` is recorded and serialized into the lockfile but **is +not consumed** by any provider or target; there is no project-level feature model. This track +makes features real. + +**Planned interfaces.** + +```cpp +// PLANNED — not implemented. +p.feature("ssl", {.default_on = true, .description = "TLS support"}); +p.feature("simd", {.default_on = false}); +auto dep = p.dependency("zlib").package("zlib", "^1.3"); + +target.requires("ssl"); // enables the feature +target.define_when("VBS_HAS_SSL", "ssl"); // VBS_FEATURE_SSL + this define +dependency.optional("zlib", "ssl"); // dep only when the feature is on +p.conditional("windows", [](Target &t) { ... }); +``` + +**Work items.** + +1. Project feature table (name, default, description, implies) and additive unification over the + target graph (`a` enables `ssl` ⇒ every consumer sees `ssl`; conflicts are explicit). +2. `--features a,b` / `--no-default-features` CLI, recorded in the profile identity and action + keys so switching features never reuses wrong artifacts. +3. Optional dependencies: resolved only when their feature is active; the lockfile records the + activation set (Cargo does this; CMake options cannot). +4. Diagnostics: `vbs explain --features` prints the unified set and the enabling path (which + target enabled what), similar to Cargo's resolver explanation. +5. Capability-conditioned features (`requires compiler_flag(...)`, `os == ...`), reusing the + cached toolchain probes. +6. ABI rule documented: features may only add defines/compile options, never change layout of + types that cross a feature boundary (enforced by a lint on `define_when` placement). + +**Acceptance gates.** Two dependents enabling different subsets unify correctly; the artifact +digest changes when the feature set changes; `--features` changes are visible in `vbs metadata`; +an optional dependency absent from the graph when disabled; `vbs explain --features` names the +enabling path. + +**Risk.** Feature unification can silently create ODR issues in C++; the plan constrains features +to additive preprocessor-visible configuration and documents the rule. + +**Effort.** L (design-heavy). + +--- + +### G3 — Profiles, per-package overrides and toolchain pinning *(M)* + +**Beats:** Cargo (per-package profile overrides), CMake/Meson (no per-package profiles). + +**Work items.** + +1. Profile inheritance (`relwithdebinfo` inherits `release` + debug info) — partially present via + `Profiles::inherit`; expose in `build.cpp` ergonomically. +2. Per-package profile overrides: `p.package("fmt").profile("release", {.lto = LtoMode::Thin})`, + applied to dependency builds (native builder options already carry `VBS_DEP_OPTION_*`). +3. Project toolchain pin: `vbs-toolchain.toml` (compiler family/version, stdlib, sysroot, + min/max standard) checked at configure time; drift warns or fails with `--locked-toolchain`. +4. Profile matrix sugar: `--profile-matrix linux-x64,windows-x64 --profile debug,release` + expanding to the existing multi-profile support with target triples. +5. `vbs profile list|show|diff A B` printing resolved flags per profile. + +**Acceptance gates.** A dependency built with a per-package release override differs from the +default; `vbs-toolchain.toml` mismatch fails with a clear message; matrix expansion matches +explicit invocations; `profile diff` shows only the differing flags. + +**Effort.** M. + +--- + +### G4 — Polyglot: Rust, Fortran, CUDA/HIP, Zig cc *(L)* + +**Beats:** Cargo (cannot build C++ safely), CMake (weak package UX), Meson (no packages). + +VBS already builds C, C++, assembly and shaders (GLSL/HLSL/Slang) with one dependency model. +Adding these languages makes it the only tool that builds a modern mixed-language project with a +single lockfile, registry and cache. + +**Work items.** + +1. **Rust provider**: `dependency("crate").rust({.manifest = "rust/Cargo.toml"})` runs + `cargo build --message-format=json-render-diagnostics`, imports `staticlib`/`rlib` artifacts + and includes; `p.cxx_bridge("src/lib.rs")` (cxx crate) generates the C++ side. The Rust + toolchain is probed and pinned; `cargo` output participates in the action cache key. +2. **Fortran**: gfortran compile/link rules, `.mod` module dependency scanning (like P1689 for + Fortran), mixed-language link ordering, `CStandard`-style `FortranStandard`. +3. **CUDA/HIP**: `nvcc`/`hipcc` actions with `-gencode arch=...` matrix, separable compilation, + device link step, and capability probes; `p.cuda_library(name).cuda_sources({...})`. +4. **Zig cc backend**: `--compiler zig` / `profile.compiler_path = "zig cc"` for hermetic + cross-compilation without a sysroot (Zig ships libc); probe and record the Zig version. +5. `vbs migrate --from cargo` for the C++-adjacent parts (workspace members, `cxx` bridges) — + only if the mapping is honest; otherwise document the manual path. + +**Acceptance gates.** A C++ executable calling Rust via a `cxx` bridge builds and runs; a +Fortran + C++ mixed target compiles with `.mod` dependency tracking (changing a module rebuilds +its users); a CUDA (or HIP, when available) target produces a valid binary; `zig cc` builds a +sample with no system compiler; `vbs metadata` reports the mixed languages. + +**Risks.** Toolchain availability in CI (CUDA needs a GPU-less compile-only lane; Rust and +Fortran are cheap to add to images); each language's incremental model differs. + +**Effort.** L per language; Rust first (highest demand). + +--- + +### G5 — Trust: enforced hermeticity, attestations, reproducibility, advisories *(L)* + +**Beats:** all four. Cargo has `cargo-deny` externally; CMake/Meson/build2 have nothing built in. + +Plan 23 already schedules the sandbox (F1) and reproducibility (F11); this track adds the +supply-chain layer that makes the guarantees usable. + +**Work items.** + +1. **SLSA/in-toto attestations**: `vbs attest create --output FILE` produces an in-toto statement + (builder identity, invocation, resolved lock digest, input snapshot id, output digests, + toolchain probe), signed with the existing Ed25519 primitives; `vbs publish --attestation` + stores it; `vbs verify --attestation` checks signer + subject digests. +2. **Descriptor sandbox**: run `build.cpp` under the same namespace sandbox with an explicit + capability list (env allowlist, network off by default for `--offline`, write access limited to + the build dir). Untrusted project descriptors become safe to evaluate in CI. +3. **Advisories**: `vbs audit` queries an OSV-format source (file or URL), matches lockfile + packages, and fails on severity threshold; SBOM export already exists. +4. **Dependency-confusion guards**: registry namespace ownership (exists), typosquat warnings on + `vbs add` (edit distance against popular names), and signature-required mode + (`--require-signatures`) for CI. +5. **Policy as code** (shared with G11): minimum compiler, allowed licenses, banned packages, + signature policy, coverage floor. +6. **`vbs verify-repro`** (Plan 23 F11) consumed by a CI job that builds twice and compares. + +**Acceptance gates.** An attestation verifies against the published artifact and fails when the +artifact changes; a descriptor that reads `$HOME` fails under strict sandbox; `vbs audit` fails on +a fixture with a known-vulnerable version; `--require-signatures` rejects an unsigned package; +policy violation exits non-zero in CI. + +**Effort.** L (attestation + descriptor sandbox), M for the rest. + +--- + +### G6 — Machine-readable everything and tooling protocols *(M)* + +**Beats:** Cargo (`metadata`), CMake (File API), Meson (introspect) — VBS can expose a single, +versioned, cross-cutting model. + +**Work items.** + +1. `vbs metadata` emits one workspace document: packages, members, targets (kind, sources, + outputs, features, labels), resolved dependencies (versions, sources, features, signatures), + profiles (resolved flags), artifacts (digests, install paths). Stable JSON with a schema + version. +2. Published schemas under `schemas/` for `metadata`, `describe`, `graph`, `explain`, `trace`, + `bep`, `doctor` and the daemon wire protocol; a compatibility test fails when a schema changes + without a version bump. +3. **DAP server**: `vbs dap --target NAME` speaks the Debug Adapter Protocol, launches gdb/lldb + with the target's artifact, working directory and environment, and maps source paths from the + compdb. No C++ build system ships this; editors currently reimplement it per project. +4. **LSP-status request** (`vbs daemon lsp-status`, Plan 23 F13) reporting compdb freshness and + diagnostics gaps for clangd. +5. **Plugin protocol**: out-of-process providers speaking newline-delimited JSON (the daemon + protocol is the template) so third-party ecosystems (vcpkg, SwiftPM, Zig, Bazel interop) can be + added without recompiling VBS; plugins declare capabilities and are sandboxed like actions. +6. `vbs doctor --json` and `vbs cache stats --json` for dashboards. + +**Acceptance gates.** A JSON schema test validates every emitted document; `metadata` is consumed +by a small external script in the test suite; a DAP integration test launches a debuggee through +a minimal DAP client and reads a breakpoint hit; a sample plugin provider builds a target. + +**Effort.** M (metadata + schemas), M (DAP), M (plugin protocol). + +--- + +### G7 — Speed and CI economics *(M–L)* + +**Beats:** all four on CI cost; Cargo/Ninja are fast locally but have no affected-test selection +or build scans. + +**Work items.** + +1. **Affected builds and tests**: `vbs build\|test --affected [--since REF]` selects the target + closure whose inputs changed (using the graph, depfiles and snapshot digests) — not just + workspace members. CI stops rebuilding and retesting everything. +2. **Daemon-first loop**: `vbs watch --fast` keeps a warm daemon, debounces changes, re-evaluates + only affected targets, and reports the first failing action; target < 100 ms feedback for + no-op/single-file edits on the 20-source fixture. +3. **Remote cache + distributed execution** (Plan 23 F5) with a shared HTTP CAS; `vbs build + --remote-cache` exists — add statistics and automatic enablement in CI. +4. **Build scans**: `vbs build --scan URL` uploads the trace, cache hit/miss per action, and + critical path to the registry (new `/api/v1/scans`), with a web view. Gradle Build Scan class, + novel for C++. +5. **Cache analytics**: `vbs cache stats` (hit rate by target, top misses, bytes saved) and a + `vbs explain --aggregate` summary for the whole build. +6. **Link-time parallelism and PCH/module reuse** measured and tuned; `--timings` prints a + sorted critical-path report. + +**Acceptance gates.** `--affected` on a one-file change runs only the expected target closure +(asserted by action counts); warm single-file feedback budget met; scan upload round-trips to the +registry and lists the same action count; `cache stats` matches the report counters. + +**Effort.** M for `--affected`/stats, L for scans + remote distribution. + +--- + +### G8 — Test and benchmark depth *(M)* + +**Beats:** CTest (no doctests, no impact analysis), Cargo (no sharding in stable, no coverage +gates), everyone (no benchmark regression gate built in). + +**Work items.** + +1. **Doctests**: `p.doctest("include/foo.hpp")` extracts fenced/`///` code blocks and compiles and + runs them as tests; failures point at the doc line. Cargo's best feature, absent from C++. +2. **Sharding**: `vbs test --shard I/N` partitions by expected duration (from previous JUnit + timings) and merges results; CI matrix uses it for the slow suites. +3. **Impact analysis**: `vbs test --affected` (shared with G7). +4. **Flaky management**: `--known-flaky FILE` quarantines tests (reported, not blocking), + `--rerun-failed` re-runs only failures, and a `--repeat until-pass` already exists. +5. **Coverage gates**: merge shard reports, `--coverage-min 80`, `--coverage-diff BASE` for PRs, + and per-file thresholds. +6. **Benchmark regression gate** (shared with G1): baseline file, statistical comparison, CI + failure on regression. +7. **Fuzzing command**: `vbs fuzz --target parsers --runs N --corpus DIR` wraps libFuzzer/AFL + targets, stores corpora in the CAS, and reports crashes with reproducers. +8. **Sanitizer matrix**: built-in profiles for ASan/UBSan/TSan/MSan with suppression files and + per-test isolation. + +**Acceptance gates.** A doctest failing in a header fails the suite with a file:line; sharding +splits and merges to the same totals; `--known-flaky` turns a failing test non-blocking but +visible; coverage gate fails below the floor; `vbs fuzz` runs a seeded corpus and reports zero +findings for the parser fixtures. + +**Effort.** M (doctests and fuzz are the larger pieces). + +--- + +### G9 — Onboarding and error quality *(M)* + +**Beats:** Cargo on first-run experience for native code; CMake/Meson on error messages. + +**Work items.** + +1. **Zero-config mode**: with no `build.cpp`, infer a conventional project (`src/**` sources, + `include/**` public headers, `tests/**` test executables, `app`/`lib` targets by shape) so + `vbs build` works in an empty checkout. `vbs init --from-sources` materializes the inferred + `build.cpp` for customization. Cargo-grade first five minutes. +2. **Actionable errors**: unknown target suggests the nearest name; missing dependency suggests + `vbs add`; missing compiler suggests `vbs doctor --fix`; feature conflicts name the enabling + path. Snapshot/lock errors include the exact path and the remedy. +3. **`vbs doctor --fix`**: installs missing tools on supported hosts (guarded, prints the command + first), checks compilers, registry connectivity. +4. **`vbs tui`**: live dashboard (targets, running actions, cache hit rate, timings, failures) — + no incumbent has one. +5. **Book and examples**: `docs/book/` (getting started, build.cpp guide, migration from + CMake/Meson/Cargo, cookbook), `examples/` with CI-built samples, and generated API reference + via `vbs doc`. +6. **`vbs tutorial`** (optional): a guided first project. + +**Acceptance gates.** `vbs build` in an empty conventional project succeeds; error-message tests +assert the suggestion text; `doctor --fix` is dry-run by default; the book builds and its code +samples are tested; examples build in CI. + +**Effort.** M (zero-config + errors), S each for TUI/book scaffolding. + +--- + +### G10 — Distribution and ecosystem *(M)* + +**Beats:** Cargo (`install-binary` parity, plus native installers), CPack (formats), wrapdb +(registry UX). + +**Work items.** + +1. **`vbs install-binary NAME`** from signed binary variants (with ABI matching: compiler family, + stdlib, C++ standard) into `~/.local/bin`; `--list` shows available variants. +2. **`vbs bundle`**: self-contained app bundles — Linux AppImage-style, macOS `.app` when F3 + exists, Windows portable folder — bundling runtime DLLs (the installer already does this). +3. **`vbs deploy`**: recipe-driven install (systemd unit, Windows service, launchd plist) generated + from a declarative `deploy` block. +4. **`vbs package --dry-run`/`--list`**: pre-publish preflight (files, sizes, license presence, + missing docs) before `publish`. +5. **Registry ecosystem** (Plan 23 F6): federation, mirrors, key distribution; plus search + relevance, download stats, org namespaces, ownership transfer. +6. **Template registry**: `vbs new --template gh:org/repo` fetches a template with provenance + checks. + +**Acceptance gates.** `install-binary` installs a published artifact and runs it; `bundle` +produces a runnable bundle on Linux; `package --dry-run` lists exactly the published file set; +registry search/stats endpoints have tests. + +**Effort.** M. + +--- + +### G11 — Policy as code and `vbs ci` *(S–M)* + +**Beats:** Cargo (`cargo-deny` is external), CMake/Meson/build2 (nothing). + +**Work items.** + +1. `vbs.policy` (TOML): minimum compiler version, allowed licenses, banned/advisory-threshold + dependencies, required signatures, coverage floor, required test labels, max build time. +2. `vbs check` enforces the policy locally and in CI with a single exit code and a summary. +3. `vbs ci`: runs the local equivalent of the pipeline (build matrix, tests with JUnit, coverage, + SBOM, policy) so developers reproduce CI failures without pushing. +4. Publish policy results in `vbs metadata`/`vbs doctor --json`. + +**Acceptance gates.** A policy violation fails `vbs check` with a precise reason; `vbs ci` on a +sample produces JUnit + SBOM + coverage and exits non-zero on a failing test; policy file +schema is documented and validated. + +**Effort.** S–M. + +--- + +### G12 — Interop without lock-in *(M)* + +**Beats:** everyone, by making migration two-way. + +**Work items.** + +1. **CMake consumes VBS**: ship `VbsPackageConfig.cmake` so `find_package(VbsPackage)` works for + every installed VBS package (the `VbsDeps.cmake` bridge and native exports already exist). +2. **VBS consumes CMake**: already supported (providers, translation, presets import); add + `vbs migrate --from cmake --strict` and document the unsupported surface. +3. **Cargo interop** (G4): build Rust crates as dependencies and expose C++ to Rust; no lock-in + either direction. +4. **Meson subproject** consumption as a provider option (today only CMake/Meson projects are + translated as dependencies). +5. `vbs compat` report: which constructs of a CMake/Meson/Cargo project map to VBS and which need + manual work. + +**Acceptance gates.** A CMake project links a VBS-installed package via `find_package`; a CMake +dependency translated by VBS builds with `--native-foreign`; a Cargo workspace with a `cxx` +bridge builds under VBS; `vbs compat` output is covered by a fixture test. + +**Effort.** M. + +--- + +## 3. Priority + +| Wave | Tracks | Why first | +| --- | --- | --- | +| 147 | G1 (`run/add/remove/fmt/lint/doc`), G9 (zero-config, errors) | Biggest adoption lever: Cargo-grade first five minutes | +| 148 | G2 (features), G3 (profiles/toolchain pin) | The C++-specific differentiators no incumbent has | +| 149 | G5 (sandboxed descriptor + attestations), G6 (metadata/schemas) | Trust and tooling ecosystem | +| 150 | G7 (`--affected`, cache stats, watch loop), G8 (doctests, sharding, coverage gates) | CI economics and test depth | +| 151 | G4 (Rust, Fortran, CUDA), G10 (`install-binary`, bundle), G12 (interop) | Polyglot and distribution | +| 152 | G11 (policy, `vbs ci`), G9 (TUI, book) | Enterprise policy and polish | + +Dependency notes: G2 must land before G3's per-package feature/profile overrides are meaningful; +G5 depends on Plan 23 F1 (sandbox) and F11 (reproducibility); G7 depends on Plan 23 F5 for +distributed execution; G10 depends on Plan 23 F6 for the registry ecosystem; G4's Rust provider +benefits from G6's plugin protocol but does not require it. + +## 4. Acceptance gates + +Plan 23's global gates apply unchanged: a test in `tests/` per feature, an observed run per +platform claim, docs (STATE/TASKS/plan status) in the same change, formatted C++ and valid YAML, +Release-binary performance numbers, and honest "planned/blocked" labels. + +Additional gates for this plan: + +1. **No parity-only work.** A track must name the incumbent it beats and the observable behaviour + that proves it. +2. **Feature flags are either applied or rejected.** No API may be recorded and ignored (the + current `Dependency::feature` state is treated as a bug to fix in G2). +3. **Machine-readable outputs are versioned.** Any JSON surface ships with a schema and a + compatibility test. +4. **Doctests and policies are CI-enforced** before they are documented as features. + +## 5. Non-goals + +- Reimplementing every CMake command or generator (the bounded translator stays bounded). +- A full LSP implementation; clangd + compdb + `lsp-status` is the supported path. +- Feature flags that change C++ ABI/layout across a feature boundary (documented restriction). +- Replacing `build.cpp` with a DSL; compiled C++ remains the differentiator. +- Bit-identical artifacts across different compilers or hosts (Plan 23 F11 defines the contract). +- A GUI/TUI as the primary interface; both are conveniences over the CLI. diff --git a/docs/roadmap/README.md b/docs/roadmap/README.md index 3e9dd53..05943db 100644 --- a/docs/roadmap/README.md +++ b/docs/roadmap/README.md @@ -1,7 +1,7 @@ # Roadmap and delivery graph Plans **01–19**, **Plan 20 Slices 1, 2A, 2B, & 2C** (bounded native C/C++ CMake & Meson translation, hermetic `build.ninja` `CUSTOM_COMMAND` rules, and CMake C++20 `CXX_MODULES` `fileSets`), **Track A**, **Track B**, **Track E1**, and **Track E3 IDE config/query tooling** are implemented and verified in the native codebase and CTest -suites; **Plan 20 Slice 3** (Windows/MSVC, macOS/Apple Clang, remote execution, plus live `conan` CLI verification) and the remaining post-v1 tracks (**C, D, E2 `workspace.cpp`, E3 `vbs daemon`, & E4**) in [21 — Post-v1 expansion roadmap](21-expansion-roadmap.md) define the next phases. For implemented +suites; **Plan 20 Slice 3** (Windows/MSVC, macOS/Apple Clang, remote execution, plus live `conan` CLI verification) and the remaining post-v1 tracks (**C, D, E2 `workspace.cpp`, E3 `vbs daemon`, & E4**) in [21 — Post-v1 expansion roadmap](21-expansion-roadmap.md) define the next phases. Two follow-on plans record what is left after the 1.0 line: [23 — Remaining upgrade plan](23-remaining-upgrade-plan.md) closes gaps, and [24 — Superiority tracks](24-superiority-tracks.md) targets being better than CMake, Meson, build2 and Cargo. For implemented commands, targets, and workflow usage, see the [project README](../../README.md) and [verification record](../agent-workflow/VERIFICATION.md). @@ -30,10 +30,12 @@ Authority: [requirements](REQUIREMENTS.md), [architecture](ARCHITECTURE.md), | [16 — Hosted package registry service](16-registry-service.md) | Implemented & Verified | [HttpServer.cpp](../../registry/service/HttpServer.cpp), [RegistryService.cpp](../../registry/service/RegistryService.cpp) | | [17 — Registry web administration](17-registry-ui.md) | Implemented & Verified | [registry/web/](../../registry/web/index.html) | | [18 — Native self-hosting and VoidLibrary migration](18-self-host-voidlibrary.md) | Implemented & Verified | [VoidLibraryRecipe.cpp](../../recipes/VoidLibrary/VoidLibraryRecipe.cpp), [TestRegistryGen.cpp](../../src/SelfHost/TestRegistryGen.cpp) | -| [19 — Quality, performance and CI](19-quality-performance-ci.md) | Implemented & Verified | [tests/](../../tests/CMakeLists.txt), [EngineBenchmarks.cpp](../../benchmarks/EngineBenchmarks.cpp), [.github/workflows/ci.yml](../../.github/workflows/ci.yml) | +| [19 — Quality, performance and CI](19-quality-performance-ci.md) | Implemented & Verified | [tests/](../../tests/CMakeLists.txt), [EngineBenchmarks.cpp](../../benchmarks/EngineBenchmarks.cpp), [.gitea/workflows/ci.yml](../../.gitea/workflows/ci.yml) | | [20 — Later native foreign execution and platform ports](20-future-translation-platforms.md) | Slices 1, 2A, 2B, & 2C Implemented & Verified; Slice 3 OS/remote ports planned | [Translator.hpp](../../include/Void/Build/Provider/Translator.hpp), [Translator.cpp](../../src/Provider/Translator.cpp) (C/C++ CMake & Meson translation, Ninja `CUSTOM_COMMAND`, foreign C++20 `CXX_MODULES`, unified fallback & `--native-foreign`); Windows/macOS/remote execution planned | | [21 — Post-v1 expansion roadmap](21-expansion-roadmap.md) | Tracks A, B (incl. live `conan`), D1–D3, E1–E4 implemented & verified; Track C1 done (Linux), C2 deferred, C3 redesigned as Wine-first | Five-track expansion roadmap (see [STATE](../agent-workflow/STATE.md) for the verified wave history) | | [22 — Superiority roadmap and gaps](22-superiority-and-gaps.md) | Analysis plan (2026-12-05) | Gap inventory, revised platform strategy (macOS dropped for now, Windows via MinGW-w64 + Wine, native MSVC deferred), parity roadmap vs CMake/Meson/build2, differentiators, prioritized order and acceptance gates | +| [23 — Remaining upgrade plan](23-remaining-upgrade-plan.md) | Planned (2026-12-06) | Tracks F1–F14 for the gaps left after Wave 146: hermetic sandboxing, Windows IPC/watcher and native backends, macOS/MSVC, multi-machine orchestration, registry mirrors/federation/keys/vcpkg, BEP, 10k scaling, migration depth, native Windows CI, cross-platform determinism, PKG/APK/IFW/SBOM installers, GUI template/LSP/plugin polish, maintenance | +| [24 — Superiority tracks beyond CMake, Meson, build2 and Cargo](24-superiority-tracks.md) | Planned (2026-12-06) | Tracks G1–G12 for being *better* rather than equal: Cargo-grade lifecycle CLI, additive C++ feature flags, per-package profiles and toolchain pinning, polyglot Rust/Fortran/CUDA/Zig, hermeticity plus SLSA attestations and advisories, versioned metadata/schemas and DAP/plugin protocols, affected builds and build scans, doctests/sharding/coverage gates/fuzzing, zero-config onboarding and error quality, distribution ecosystem, policy-as-code and `vbs ci`, two-way interop | ## Dependency graph