docs(workflow): add P0 baseline implementation task specs (X-BASE-01..05)

This commit is contained in:
faumaray committed 2026-11-24 02:05:08 +03:00
1 parent faa8a5198d
commit 563da02c0f
5 files changed
+180

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
# P0 Process Test Environment Isolation
Task ID: X-BASE-01
Phase: P0
Status: APPROVED
## 1. Context and baseline
`tests/standalone/System/Process.cpp` currently invokes `/bin/echo`, `/bin/cat`, and `shell("seq 1 10000")`. On NixOS and minimal container hosts without `/bin/echo`, `/bin/cat`, or `seq` in `PATH`, those tests fail with child exit code 127.
## 2. Deliverables
- Controlled standard-library helper executable `tests/helpers/ProcessHelper.cpp` (`VoidProcessHelper`).
- CMake wiring in `tests/CMakeLists.txt` defining `VOID_PROCESS_HELPER_PATH` when `VoidTests` and `Void::System` are built.
- Updated `tests/standalone/System/Process.cpp` using `VOID_PROCESS_HELPER_PATH` instead of host `/bin/echo`, `/bin/cat`, or `seq`.
## 3. Exact files and interfaces
- `tests/helpers/ProcessHelper.cpp`:
- `echo [args...]`: prints space-separated args + `\n`, exits `0`.
- `cat`: copies raw stdin to stdout in 4096-byte chunks until EOF, exits `0`.
- `seq <start> <end>`: prints signed 64-bit integers inclusive one per line, exits `0`.
- `streams`: writes `"to_stdout\n"` to `stdout` and `"to_stderr\n"` to `stderr`, exits `0`.
- `exit <code>`: exits with parsed integer status code.
- `lines [--no-newline] [--stderr] [items...]`: emits lines to stdout or stderr.
- Invalid usage: prints diagnostic to `stderr` and exits `2`.
- `tests/CMakeLists.txt`: build `VoidProcessHelper` with C++26 (`VOID_TESTING_NO_AUTO_SCAN TRUE`) and pass `VOID_PROCESS_HELPER_PATH="$<TARGET_FILE:VoidProcessHelper>"` to `VoidTests`.
- `tests/standalone/System/Process.cpp`: replace hardcoded host commands; keep shell builtin tests (`/bin/sh` `echo`/`exit`) and `run_missing_executable_returns_code_127`; add direct argv `exit 42` and `streams` tests via `VOID_PROCESS_HELPER_PATH`.
## 4. Edge cases
- Helper binary uses only the C++ standard library (no `Void::` module dependencies) so it cannot mask failures in `Void::System`.
- Numeric parsing in `seq` and `exit` uses `std::from_chars` and rejects malformed/partial inputs with exit `2`.
## 5. Acceptance criteria
- `Process` and `ProcessStream` suites pass with 0 failures on NixOS without `/bin/echo`, `/bin/cat`, or `seq`.
- Full `VoidTests` passes with 0 failures (only existing intentional skip demonstrations in `Testing/Math.cpp`).
## 6. Verification commands
```sh
cmake --build /tmp/void-p0-base --parallel 4
/tmp/void-p0-base/tests/VoidTests --filter "Process*"
```
+33
View File
@@ -0,0 +1,33 @@
# P0 Warnings-as-Errors Isolation for Boost Headers
Task ID: X-BASE-02
Phase: P0
Status: APPROVED
## 1. Context and baseline
Building with `-DVOID_WARNINGS_AS_ERRORS=ON` on GCC 16.2.0 (`-std=c++26`) fails inside fetched Boost 1.84.0 headers (`boost/intrusive/detail/ebo_functor_holder.hpp`, `boost/beast/core/detail/string.hpp`, `boost/beast/http/span_body.hpp`) when compiling `src/Net/Http.cpp`.
## 2. Deliverables
- Mark FetchContent Boost headers as `SYSTEM` in `cmake/Dependencies.cmake`.
- Keep `-Wall -Wextra -Wpedantic -Werror` strict across all Void-owned sources in `cmake/Module.cmake`.
## 3. Exact files and interfaces
- `cmake/Dependencies.cmake`: add `SYSTEM` to `FetchContent_Declare(Boost ...)`; ensure Boost target properties preserve `SYSTEM TRUE` without modifying global warning flags.
- `src/Net/Http.cpp` (only if template instantiation inside Void TU still surfaces a Boost diagnostic): isolate strictly at the offending `#include`/site via scoped `#pragma GCC diagnostic push/pop`.
## 4. Edge cases
- Do NOT disable warnings globally or weaken `VOID_WARNINGS_AS_ERRORS` in `cmake/Module.cmake`.
- Any warning originating in Void's own code must be fixed at its source.
## 5. Acceptance criteria
- Full all-module configure/build with `-DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=ON` exits `0` with zero warnings or errors.
- Full `VoidTests` runs and passes.
## 6. Verification commands
```sh
cmake -S . -B /tmp/void-p0-werror -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=ON \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
-DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src
cmake --build /tmp/void-p0-werror --parallel 4
/tmp/void-p0-werror/tests/VoidTests
```
+37
View File
@@ -0,0 +1,37 @@
# P0 Module Closures, Header Ownership, and Consumer Matrix
Task ID: X-BASE-03
Phase: P0
Status: APPROVED
## 1. Context and baseline
Audit of `src/*/module.cmake` vs `#include <Void/...>` reveals:
1. `<Void/Log/Log.hpp>` is used by `LogState`, `Async`, `System`, `Stacktrace`, `Configuration`, `Plugin`, and `Service`, yet is installed only by `Void_Log`.
2. Undeclared acyclic internal dependencies in `Containers`, `Data`, `Configuration`, `Service`, `Plugin`, `Fsm`, `Testing`, `TestingMock`, and `Log`.
3. `Core/Uuid.hpp` still leaks `<Void/Math/Random.hpp>` (resolved in `M-CORE-02`); `Functional/Detail/Repr.hpp` includes `<Void/Core/Meta.hpp>`.
4. `tests/CMakeLists.txt` fails when `VOID_ENABLED_MODULES` builds subsets, and `InstalledComponents.cmake` lacks foundation, embedded, static, and relocated checks.
## 2. Deliverables
- Extend `cmake/Module.cmake` with `EXTRA_HEADERS` / `EXCLUDE_HEADERS`; transfer `<Void/Log/Log.hpp>` ownership to `LogState`.
- Reconcile acyclic `INTERNAL_DEPS` across `src/*/module.cmake` files and introduce `Void::FunctionalCoreFormatting`.
- Filter `VoidTests` sources in `tests/CMakeLists.txt` by required `ACTIVE_MODULES` and forward `ACTIVE_MODULES`, `CMAKE_GENERATOR`, and `CMAKE_MAKE_PROGRAM` to `InstalledComponents.cmake`.
- Add `tests/package/Foundation`, `tests/package/Embedded`, and relocated-prefix validation in `InstalledComponents.cmake`.
## 3. Exact files and interfaces
- `cmake/Module.cmake`, `src/LogState/module.cmake`, `src/Log/module.cmake`
- `src/Containers/module.cmake`, `src/Data/module.cmake`, `src/Configuration/module.cmake`, `src/Service/module.cmake`, `src/Plugin/module.cmake`, `src/Fsm/module.cmake`, `src/Testing/module.cmake`, `src/TestingMock/module.cmake`
- `include/Void/FunctionalCoreFormatting/Repr.hpp`, `src/FunctionalCoreFormatting/module.cmake`
- `tests/CMakeLists.txt`, `tests/package/InstalledComponents.cmake`, `tests/package/Foundation/*`, `tests/package/Embedded/*`
## 4. Edge cases
- Do not add `Math` to `Core/module.cmake` (violates C-01); keep `Core -> Math` documented until `M-CORE-02`.
- Keep `Void/Functional/Detail/Repr.hpp` installed with `Functional` for Wave A+B while providing `Void::FunctionalCoreFormatting`.
- Fail loudly if `VOID_ENABLE_TESTING=ON` without `Testing` enabled or if 0 package consumers run.
## 5. Acceptance criteria
- Full `ctest` (including relocated `VoidInstalledComponentConsumers`) passes with `-Werror`.
- Minimal foundation subset (`Time;Math;Text;Binary;Functional;Testing`) builds and passes with external packages disabled.
- `System;Testing` without `Log` installs `include/Void/Log/Log.hpp` and passes `Process*`.
- Static (`-DBUILD_SHARED_LIBS=OFF`) and embedded `add_subdirectory` (`tests/package/Embedded`) consumers build and pass.
## 6. Verification commands
See `VERIFICATION.md` commands for `/tmp/void-p0-closures`, `/tmp/void-p0-minimal`, `/tmp/void-p0-system`, `/tmp/void-p0-embedded`, and `/tmp/void-p0-static`.
+33
View File
@@ -0,0 +1,33 @@
# P0 Compiler, Reflection, and Sanitizer Capability Probes
Task ID: X-BASE-04
Phase: P0
Status: APPROVED
## 1. Context and baseline
`CMakeLists.txt` defines ASan/UBSan/Coverage options without verifying compiler+linker support or mutual exclusion with TSan, and lacks feature probes for C++26 reflection (`<meta>`, `^^int`) and `std::expected`.
## 2. Deliverables
- `cmake/Capabilities.cmake`: `check_cxx_source_compiles` probes for `VOID_HAS_CXX26_REFLECTION`, `VOID_HAS_STD_EXPECTED`, and requested sanitizer options (`VOID_ENABLE_ASAN`, `VOID_ENABLE_UBSAN`, `VOID_ENABLE_TSAN`), plus `void_report_capabilities()`.
- Mutual-exclusion guard (`ASAN` + `TSAN`) and `VOID_ENABLE_TSAN` wiring in `CMakeLists.txt` and `cmake/Module.cmake`.
## 3. Exact files and interfaces
- `cmake/Capabilities.cmake`
- `CMakeLists.txt`
- `cmake/Module.cmake`
## 4. Edge cases
- Probes must respect existing `-freflection` flags on GNU >= 16.
- Unsupported sanitizer flags fail configure cleanly with a clear diagnostic rather than silently skipping checks.
## 5. Acceptance criteria
- Full Debug ASan+UBSan+`-Werror` build compiles cleanly and passes `VoidTests` with `detect_leaks=1:halt_on_error=1`.
- TSan subset (`Async;Time;Core;Functional;Testing`) configures, compiles, and passes tests.
## 6. Verification commands
```sh
cmake -S . -B /tmp/void-p0-asan -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug \
-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_TESTING=ON \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src
cmake --build /tmp/void-p0-asan --parallel 4
ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-p0-asan/tests/VoidTests
```
+39
View File
@@ -0,0 +1,39 @@
# P0 Reproducible Benchmark Harness and Initial Baseline
Task ID: X-BASE-05
Phase: P0
Status: APPROVED
## 1. Context and baseline
`PERFORMANCE.md` requires reproducible workload manifests, separate empty-harness baselines, median/p95/p99/95%-CI statistics over >= 5 warmup and >= 20 measured repetitions, and JSON raw sample artifacts before optimizing foundation code.
## 2. Deliverables
- `VOID_ENABLE_BENCHMARKS` CMake option in `CMakeLists.txt`.
- `benchmarks/CMakeLists.txt` and `benchmarks/FoundationBench.cpp` (`VoidFoundationBench`).
- `tests/corpus/README.md` defining seeded parser/codec corpus layout.
## 3. Exact files and interfaces
- `CMakeLists.txt`: add `option(VOID_ENABLE_BENCHMARKS ... OFF)` and `add_subdirectory(benchmarks)` when enabled.
- `benchmarks/CMakeLists.txt`: build `VoidFoundationBench` linking available foundation targets (`Core`, `Functional`, `Containers`, `Math`, `Time`, `Binary`, `Data`).
- `benchmarks/FoundationBench.cpp`:
- Flags: `--warmup <N>` (5), `--reps <N>` (20), `--ops <N>` (10000), `--json <path>`, `--filter <substr>`.
- Empty harness baseline (`harness_empty_loop`) plus 12 foundation workloads (`core_uuid_*`, `core_hash_*`, `functional_*`, `math_checked_add_loop`, `containers_*`, `binary_reader_u64_be`, `data_json_*`).
- Reports median, min, max, p95, p99 (nearest-rank), 95% CI half-width, ops/sec, raw samples, and environment metadata.
- `tests/corpus/README.md`: corpus conventions for `Binary`, `Data`, `Text`.
## 4. Edge cases
- Do not subtract harness baseline into negative latencies; report harness baseline separately.
- Must compile cleanly under `-DVOID_WARNINGS_AS_ERRORS=ON` and work in selected foundation builds.
## 5. Acceptance criteria
- `VoidFoundationBench --json /tmp/void-p0-bench/baseline.json` exits `0` and produces valid parseable JSON with all 13 records (harness + 12 workloads).
- P0 records (`STATE.md`, `TASKS.md`, `VERIFICATION.md`) updated with exact observed command outputs.
## 6. Verification commands
```sh
cmake -S . -B /tmp/void-p0-bench -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DVOID_ENABLED_MODULES="Core;Functional;Containers;Math;Time;Binary;Data" \
-DVOID_ENABLE_TESTING=OFF -DVOID_ENABLE_BENCHMARKS=ON -DVOID_WARNINGS_AS_ERRORS=ON
cmake --build /tmp/void-p0-bench --parallel 4
/tmp/void-p0-bench/benchmarks/VoidFoundationBench --json /tmp/void-p0-bench/baseline.json
python3 -m json.tool /tmp/void-p0-bench/baseline.json >/dev/null
```