Compare commits
58
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ef425c36c | ||
|
|
47736cb6ce | ||
|
|
00d7478335 | ||
|
|
713d2dc656 | ||
|
|
eb42228604 | ||
|
|
8a1c15f9c0 | ||
|
|
acd77ee67a | ||
|
|
9931c5ffc4 | ||
|
|
e43eee738c | ||
|
|
39a48d5c0a | ||
|
|
9a3c5d86ef | ||
|
|
fcdbc063b2 | ||
|
|
3f67b1ecb7 | ||
|
|
44799602c9 | ||
|
|
1e2fb8b5c6 | ||
|
|
7b57b355cd | ||
|
|
3d8dfb0ea2 | ||
|
|
a74a402938 | ||
|
|
18a623aa62 | ||
|
|
fe99051ded | ||
|
|
809b6f548d | ||
|
|
1e901ce256 | ||
|
|
f6c359400a | ||
|
|
de8a981893 | ||
|
|
1b3331e3a8 | ||
|
|
673bb7e8b4 | ||
|
|
9918ed4760 | ||
|
|
2e5d1ef5e5 | ||
|
|
b0cb598aad | ||
|
|
c75056fe07 | ||
|
|
4369fde867 | ||
|
|
bfd6246d32 | ||
|
|
710a9c1833 | ||
|
|
5754a7fd06 | ||
|
|
155b47d4d5 | ||
|
|
692f5ba5b2 | ||
|
|
eacb8a4602 | ||
|
|
9ac76bbcf9 | ||
|
|
883bbdcf38 | ||
|
|
68963fcd1d | ||
|
|
1d34a93a3f | ||
|
|
6cac781f3a | ||
|
|
91e2beb5d4 | ||
|
|
4d48f2a8f2 | ||
|
|
4227348051 | ||
|
|
7f3395cb74 | ||
|
|
284d9635b5 | ||
|
|
cbc900412b | ||
|
|
8d28c7e3c4 | ||
|
|
196ed251f9 | ||
|
|
c64fa93373 | ||
|
|
cd6fc7e5f5 | ||
|
|
e385746b74 | ||
|
|
340acaec34 | ||
|
|
563da02c0f | ||
|
|
faa8a5198d | ||
|
|
f1f9ba375b | ||
|
|
5464e9fa35 |
No files matched your search
+9
-1
@@ -8,9 +8,11 @@ elseif(NOT DEFINED BUILD_SHARED_LIBS)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
endif()
|
||||
option(VOID_ENABLE_TESTING "Build the test suite" ON)
|
||||
option(VOID_ENABLE_BENCHMARKS "Build reproducible benchmark baselines" OFF)
|
||||
option(VOID_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
|
||||
option(VOID_ENABLE_ASAN "Enable AddressSanitizer (Clang/GCC)" OFF)
|
||||
option(VOID_ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (Clang/GCC)" OFF)
|
||||
option(VOID_ENABLE_TSAN "Enable ThreadSanitizer (Clang/GCC)" OFF)
|
||||
option(VOID_ENABLE_COVERAGE "Enable code coverage instrumentation" OFF)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 26)
|
||||
@@ -28,6 +30,8 @@ include(CMakePackageConfigHelpers)
|
||||
|
||||
set(EXPORT_SET_NAME ${PROJECT_NAME}Targets)
|
||||
|
||||
include(cmake/Capabilities.cmake)
|
||||
void_probe_capabilities()
|
||||
include(cmake/Module.cmake)
|
||||
|
||||
# Modules to configure, with the modules they need (INTERNAL_DEPS, followed
|
||||
@@ -56,7 +60,7 @@ if(VOID_ENABLED_MODULES)
|
||||
if(_void_text MATCHES "INTERNAL_DEPS([^)]*)")
|
||||
separate_arguments(_void_words UNIX_COMMAND "${CMAKE_MATCH_1}")
|
||||
foreach(_void_word IN LISTS _void_words)
|
||||
if(_void_word MATCHES "^[A-Z0-9_]+$")
|
||||
if(_void_word MATCHES "^(INTERNAL_DEPS|EXTERNAL_DEPS|OPTIONAL_DEPS|DEPS_WIN32|DEPS_UNIX|OPTIONS_WIN32|OPTIONS_UNIX|EXTRA_HEADERS|EXCLUDE_HEADERS)$")
|
||||
break()
|
||||
endif()
|
||||
list(APPEND _void_pending ${_void_word})
|
||||
@@ -80,12 +84,16 @@ foreach(module_path ${children})
|
||||
endif()
|
||||
endforeach()
|
||||
void_finalize_modules()
|
||||
void_report_capabilities()
|
||||
if(VOID_ENABLE_TESTING)
|
||||
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
|
||||
endif()
|
||||
if(VOID_ENABLE_BENCHMARKS)
|
||||
add_subdirectory(benchmarks)
|
||||
endif()
|
||||
get_property(ALL_DISCOVERED_MODULES GLOBAL PROPERTY VOID_MODULES)
|
||||
get_property(ALL_MODULE_DEPENDENCY_RECORDS GLOBAL PROPERTY
|
||||
VOID_MODULE_DEPENDENCY_RECORDS)
|
||||
|
||||
@@ -4,6 +4,10 @@ A modular C++26 shared library. Each module is an independently installable
|
||||
CMake target under the `Void::` namespace; the build system auto-discovers
|
||||
modules under `src/` and links them together.
|
||||
|
||||
The [expansion roadmap](docs/roadmap/README.md) contains the approved architecture,
|
||||
module and subsystem plans, delivery phases, and verification requirements for future
|
||||
development. Planned capabilities are distinguished from the current implementation.
|
||||
|
||||
## Build
|
||||
|
||||
Requires CMake 4.0+ and a C++26 compiler. GCC 16+ is the default — it ships
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
foreach(_req IN ITEMS Core Functional Containers Math Time Binary Data)
|
||||
if(NOT TARGET Void::${_req})
|
||||
message(FATAL_ERROR
|
||||
"[Void] VOID_ENABLE_BENCHMARKS=ON requires foundation module '${_req}' to be enabled")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(_void_git_rev "unknown")
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND)
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse --short=12 HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE _git_out
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
if(_git_out)
|
||||
set(_void_git_rev "${_git_out}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_executable(VoidFoundationBench FoundationBench.cpp)
|
||||
set_target_properties(VoidFoundationBench PROPERTIES
|
||||
CXX_STANDARD 26
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF
|
||||
VOID_TESTING_NO_AUTO_SCAN TRUE
|
||||
)
|
||||
target_link_libraries(VoidFoundationBench PRIVATE
|
||||
Void::Core
|
||||
Void::Functional
|
||||
Void::Containers
|
||||
Void::Math
|
||||
Void::Time
|
||||
Void::Binary
|
||||
Void::Data
|
||||
)
|
||||
target_compile_definitions(VoidFoundationBench PRIVATE
|
||||
VOID_GIT_REVISION="${_void_git_rev}"
|
||||
VOID_BUILD_TYPE="$<IF:$<BOOL:${CMAKE_BUILD_TYPE}>,${CMAKE_BUILD_TYPE},unspecified>"
|
||||
)
|
||||
|
||||
if(VOID_WARNINGS_AS_ERRORS)
|
||||
target_compile_options(VoidFoundationBench PRIVATE
|
||||
"$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-Wall;-Wextra;-Wpedantic;-Werror;-Wno-missing-field-initializers>"
|
||||
"$<$<CXX_COMPILER_ID:Clang,AppleClang>:-Wno-missing-designated-field-initializers>"
|
||||
"$<$<CXX_COMPILER_ID:MSVC>:/W4;/WX>"
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,441 @@
|
||||
#include <Void/Binary/Reader.hpp>
|
||||
#include <Void/Containers/LRU.hpp>
|
||||
#include <Void/Containers/Ring.hpp>
|
||||
#include <Void/Core/Hash.hpp>
|
||||
#include <Void/Core/Uuid.hpp>
|
||||
#include <Void/Data/Json.hpp>
|
||||
#include <Void/Functional/Error.hpp>
|
||||
#include <Void/Functional/Result.hpp>
|
||||
#include <Void/Math/Numeric.hpp>
|
||||
#include <Void/Time/Bench.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <bit>
|
||||
#include <charconv>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <numeric>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
struct CliOptions {
|
||||
std::size_t warmup = 5;
|
||||
std::size_t reps = 20;
|
||||
std::size_t ops = 10'000;
|
||||
std::string json_path;
|
||||
std::string filter;
|
||||
};
|
||||
|
||||
bool parse_size(std::string_view text, std::size_t& out) noexcept
|
||||
{
|
||||
if (text.empty()) {
|
||||
return false;
|
||||
}
|
||||
const char* begin = text.data();
|
||||
const char* end = text.data() + text.size();
|
||||
auto [ptr, ec] = std::from_chars(begin, end, out, 10);
|
||||
return ec == std::errc{} && ptr == end && out > 0;
|
||||
}
|
||||
|
||||
bool parse_args(int argc, char** argv, CliOptions& opts)
|
||||
{
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
const std::string_view arg{argv[i]};
|
||||
auto need_val = [&](std::string_view flag) -> const char* {
|
||||
if (i + 1 >= argc) {
|
||||
std::cerr << "VoidFoundationBench: missing value for " << flag
|
||||
<< '\n';
|
||||
return nullptr;
|
||||
}
|
||||
return argv[++i];
|
||||
};
|
||||
if (arg == "--warmup") {
|
||||
const char* v = need_val(arg);
|
||||
if (!v || !parse_size(v, opts.warmup)) {
|
||||
return false;
|
||||
}
|
||||
} else if (arg == "--reps") {
|
||||
const char* v = need_val(arg);
|
||||
if (!v || !parse_size(v, opts.reps)) {
|
||||
return false;
|
||||
}
|
||||
} else if (arg == "--ops") {
|
||||
const char* v = need_val(arg);
|
||||
if (!v || !parse_size(v, opts.ops)) {
|
||||
return false;
|
||||
}
|
||||
} else if (arg == "--json") {
|
||||
const char* v = need_val(arg);
|
||||
if (!v) {
|
||||
return false;
|
||||
}
|
||||
opts.json_path = v;
|
||||
} else if (arg == "--filter") {
|
||||
const char* v = need_val(arg);
|
||||
if (!v) {
|
||||
return false;
|
||||
}
|
||||
opts.filter = v;
|
||||
} else {
|
||||
std::cerr << "VoidFoundationBench: unknown argument: " << arg
|
||||
<< '\n';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct Stats {
|
||||
double median_ns_per_op{0.0};
|
||||
double min_ns_per_op{0.0};
|
||||
double max_ns_per_op{0.0};
|
||||
double p95_ns_per_op{0.0};
|
||||
double p99_ns_per_op{0.0};
|
||||
double ci95_half_width_ns{0.0};
|
||||
double ops_per_sec{0.0};
|
||||
};
|
||||
|
||||
double nearest_rank(const std::vector<double>& sorted, double quantile)
|
||||
{
|
||||
if (sorted.empty()) {
|
||||
return 0.0;
|
||||
}
|
||||
const std::size_t n = sorted.size();
|
||||
const double raw = std::ceil(quantile * static_cast<double>(n));
|
||||
const std::size_t rank =
|
||||
std::clamp(static_cast<std::size_t>(raw), std::size_t{1}, n);
|
||||
return sorted[rank - 1];
|
||||
}
|
||||
|
||||
Stats summarize(const std::vector<double>& samples_ns_per_op)
|
||||
{
|
||||
Stats s{};
|
||||
if (samples_ns_per_op.empty()) {
|
||||
return s;
|
||||
}
|
||||
std::vector<double> sorted = samples_ns_per_op;
|
||||
std::sort(sorted.begin(), sorted.end());
|
||||
|
||||
const std::size_t n = sorted.size();
|
||||
s.min_ns_per_op = sorted.front();
|
||||
s.max_ns_per_op = sorted.back();
|
||||
if (n % 2 == 1) {
|
||||
s.median_ns_per_op = sorted[n / 2];
|
||||
} else {
|
||||
s.median_ns_per_op = 0.5 * (sorted[n / 2 - 1] + sorted[n / 2]);
|
||||
}
|
||||
s.p95_ns_per_op = nearest_rank(sorted, 0.95);
|
||||
s.p99_ns_per_op = nearest_rank(sorted, 0.99);
|
||||
|
||||
const double mean =
|
||||
std::accumulate(sorted.begin(), sorted.end(), 0.0) /
|
||||
static_cast<double>(n);
|
||||
if (n > 1) {
|
||||
double sq = 0.0;
|
||||
for (double v : sorted) {
|
||||
const double d = v - mean;
|
||||
sq += d * d;
|
||||
}
|
||||
const double stdev = std::sqrt(sq / static_cast<double>(n - 1));
|
||||
s.ci95_half_width_ns =
|
||||
1.96 * stdev / std::sqrt(static_cast<double>(n));
|
||||
}
|
||||
s.ops_per_sec =
|
||||
s.median_ns_per_op > 0.0 ? 1'000'000'000.0 / s.median_ns_per_op : 0.0;
|
||||
return s;
|
||||
}
|
||||
|
||||
struct WorkloadRecord {
|
||||
std::string name;
|
||||
std::vector<double> raw_ns_per_op;
|
||||
Stats stats;
|
||||
};
|
||||
|
||||
template <class Fn>
|
||||
WorkloadRecord run_workload(std::string name, const CliOptions& opts, Fn&& fn)
|
||||
{
|
||||
using Clock = std::chrono::steady_clock;
|
||||
|
||||
for (std::size_t w = 0; w < opts.warmup; ++w) {
|
||||
for (std::size_t i = 0; i < opts.ops; ++i) {
|
||||
fn(i);
|
||||
}
|
||||
}
|
||||
|
||||
WorkloadRecord rec;
|
||||
rec.name = std::move(name);
|
||||
rec.raw_ns_per_op.reserve(opts.reps);
|
||||
|
||||
for (std::size_t r = 0; r < opts.reps; ++r) {
|
||||
const auto t0 = Clock::now();
|
||||
for (std::size_t i = 0; i < opts.ops; ++i) {
|
||||
fn(i);
|
||||
}
|
||||
const auto dt = std::chrono::duration<double, std::nano>(Clock::now() - t0).count();
|
||||
rec.raw_ns_per_op.push_back(dt / static_cast<double>(opts.ops));
|
||||
}
|
||||
rec.stats = summarize(rec.raw_ns_per_op);
|
||||
return rec;
|
||||
}
|
||||
|
||||
std::string json_escape(std::string_view in)
|
||||
{
|
||||
std::string out;
|
||||
out.reserve(in.size() + 8);
|
||||
for (char ch : in) {
|
||||
switch (ch) {
|
||||
case '"': out += "\\\""; break;
|
||||
case '\\': out += "\\\\"; break;
|
||||
case '\n': out += "\\n"; break;
|
||||
case '\r': out += "\\r"; break;
|
||||
case '\t': out += "\\t"; break;
|
||||
default: out += ch; break;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
std::string compiler_label()
|
||||
{
|
||||
std::ostringstream oss;
|
||||
#if defined(__clang__)
|
||||
oss << "Clang " << __clang_major__ << "." << __clang_minor__ << "."
|
||||
<< __clang_patchlevel__;
|
||||
#elif defined(__GNUC__)
|
||||
oss << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "."
|
||||
<< __GNUC_PATCHLEVEL__;
|
||||
#else
|
||||
oss << "unknown";
|
||||
#endif
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
void write_json(const std::string& path, const CliOptions& opts,
|
||||
const WorkloadRecord& harness,
|
||||
const std::vector<WorkloadRecord>& records)
|
||||
{
|
||||
std::ofstream out{path};
|
||||
if (!out) {
|
||||
std::cerr << "VoidFoundationBench: failed to open JSON output: "
|
||||
<< path << '\n';
|
||||
return;
|
||||
}
|
||||
|
||||
auto emit_record = [&](const WorkloadRecord& rec, const char* indent) {
|
||||
out << indent << "{\n";
|
||||
out << indent << " \"name\": \"" << json_escape(rec.name) << "\",\n";
|
||||
out << indent << " \"median_ns_per_op\": " << std::fixed
|
||||
<< std::setprecision(4) << rec.stats.median_ns_per_op << ",\n";
|
||||
out << indent << " \"min_ns_per_op\": " << rec.stats.min_ns_per_op
|
||||
<< ",\n";
|
||||
out << indent << " \"max_ns_per_op\": " << rec.stats.max_ns_per_op
|
||||
<< ",\n";
|
||||
out << indent << " \"p95_ns_per_op\": " << rec.stats.p95_ns_per_op
|
||||
<< ",\n";
|
||||
out << indent << " \"p99_ns_per_op\": " << rec.stats.p99_ns_per_op
|
||||
<< ",\n";
|
||||
out << indent << " \"ci95_half_width_ns\": "
|
||||
<< rec.stats.ci95_half_width_ns << ",\n";
|
||||
out << indent << " \"ops_per_sec\": " << std::setprecision(2)
|
||||
<< rec.stats.ops_per_sec << ",\n";
|
||||
out << indent << " \"raw_samples_ns_per_op\": [";
|
||||
out << std::setprecision(4);
|
||||
for (std::size_t i = 0; i < rec.raw_ns_per_op.size(); ++i) {
|
||||
if (i > 0) {
|
||||
out << ", ";
|
||||
}
|
||||
out << rec.raw_ns_per_op[i];
|
||||
}
|
||||
out << "]\n";
|
||||
out << indent << "}";
|
||||
};
|
||||
|
||||
out << "{\n";
|
||||
out << " \"schema_version\": 1,\n";
|
||||
out << " \"git_revision\": \"" << json_escape(VOID_GIT_REVISION) << "\",\n";
|
||||
out << " \"compiler\": \"" << json_escape(compiler_label()) << "\",\n";
|
||||
out << " \"build_type\": \"" << json_escape(VOID_BUILD_TYPE) << "\",\n";
|
||||
out << " \"hardware_concurrency\": "
|
||||
<< std::thread::hardware_concurrency() << ",\n";
|
||||
out << " \"warmup\": " << opts.warmup << ",\n";
|
||||
out << " \"repetitions\": " << opts.reps << ",\n";
|
||||
out << " \"ops_per_rep\": " << opts.ops << ",\n";
|
||||
out << " \"harness_baseline\": ";
|
||||
emit_record(harness, " ");
|
||||
out << ",\n";
|
||||
out << " \"workloads\": [\n";
|
||||
for (std::size_t i = 0; i < records.size(); ++i) {
|
||||
emit_record(records[i], " ");
|
||||
if (i + 1 < records.size()) {
|
||||
out << ",";
|
||||
}
|
||||
out << "\n";
|
||||
}
|
||||
out << " ]\n";
|
||||
out << "}\n";
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
CliOptions opts;
|
||||
if (!parse_args(argc, argv, opts)) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
// Separate empty-loop harness baseline (not subtracted from results).
|
||||
const auto harness = run_workload("harness_empty_loop", opts, [](std::size_t i) {
|
||||
Void::Bench::do_not_optimize(i);
|
||||
});
|
||||
|
||||
std::array<std::byte, 256> payload{};
|
||||
for (std::size_t i = 0; i < payload.size(); ++i) {
|
||||
payload[i] = static_cast<std::byte>((i * 131u + 17u) & 0xFFu);
|
||||
}
|
||||
const std::string_view payload_sv{
|
||||
reinterpret_cast<const char*>(payload.data()), payload.size()};
|
||||
const std::string_view uuid_text = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
|
||||
const auto parsed_uuid = Void::Uuid::parse(uuid_text).value();
|
||||
const std::string_view small_json_text =
|
||||
R"({"id":42,"name":"void-bench","active":true,"tags":["p0","foundation"]})";
|
||||
const auto small_json_val = Void::Json::parse(small_json_text).value();
|
||||
const std::array<std::byte, 8> be_u64{
|
||||
std::byte{0x01}, std::byte{0x23}, std::byte{0x45}, std::byte{0x67},
|
||||
std::byte{0x89}, std::byte{0xAB}, std::byte{0xCD}, std::byte{0xEF}};
|
||||
|
||||
Void::Ring::SpscRing<std::uint64_t, 64> ring;
|
||||
Void::LRU::LruCache<std::uint64_t, std::uint64_t> lru{128};
|
||||
for (std::uint64_t k = 0; k < 128; ++k) {
|
||||
lru.put(k, k * 3);
|
||||
}
|
||||
|
||||
std::vector<WorkloadRecord> records;
|
||||
auto maybe_run = [&](std::string_view name, auto&& fn) {
|
||||
if (!opts.filter.empty() && name.find(opts.filter) == std::string_view::npos) {
|
||||
return;
|
||||
}
|
||||
records.push_back(run_workload(std::string{name}, opts, fn));
|
||||
};
|
||||
|
||||
maybe_run("core_uuid_parse_hyphenated", [&](std::size_t) {
|
||||
auto u = Void::Uuid::parse(uuid_text);
|
||||
Void::Bench::do_not_optimize(u);
|
||||
});
|
||||
|
||||
maybe_run("core_uuid_to_string", [&](std::size_t) {
|
||||
auto s = parsed_uuid.to_string();
|
||||
Void::Bench::do_not_optimize(s);
|
||||
});
|
||||
|
||||
maybe_run("core_hash_fnv1a64_256b", [&](std::size_t) {
|
||||
auto h = Void::Hash::fnv1a64(std::span<const std::byte>{payload});
|
||||
Void::Bench::do_not_optimize(h);
|
||||
});
|
||||
|
||||
maybe_run("core_hash_murmur3_256b", [&](std::size_t i) {
|
||||
auto h = Void::Hash::murmur3_32(payload_sv, static_cast<std::uint32_t>(i));
|
||||
Void::Bench::do_not_optimize(h);
|
||||
});
|
||||
|
||||
maybe_run("functional_result_ok_chain", [&](std::size_t i) {
|
||||
auto r = Void::Result::ok(static_cast<int>(i))
|
||||
.transform([](int v) { return v + 1; })
|
||||
.and_then([](int v) -> Void::Result::Result<int> {
|
||||
return Void::Result::ok(v * 2);
|
||||
});
|
||||
Void::Bench::do_not_optimize(r);
|
||||
});
|
||||
|
||||
maybe_run("functional_error_with_context", [&](std::size_t) {
|
||||
Void::Result::Result<int> base = Void::Result::fail("io error");
|
||||
auto wrapped = Void::Result::with_context(std::move(base), "read header");
|
||||
Void::Bench::do_not_optimize(wrapped);
|
||||
});
|
||||
|
||||
maybe_run("math_checked_add_loop", [&](std::size_t i) {
|
||||
auto r = Void::Numeric::checked_add(static_cast<std::uint64_t>(i),
|
||||
std::uint64_t{42});
|
||||
Void::Bench::do_not_optimize(r);
|
||||
});
|
||||
|
||||
maybe_run("containers_spsc_ring_push_pop", [&](std::size_t i) {
|
||||
const bool pushed = ring.push(static_cast<std::uint64_t>(i));
|
||||
auto popped = ring.pop();
|
||||
Void::Bench::do_not_optimize(pushed);
|
||||
Void::Bench::do_not_optimize(popped);
|
||||
});
|
||||
|
||||
maybe_run("containers_lru_get_put", [&](std::size_t i) {
|
||||
const std::uint64_t key = static_cast<std::uint64_t>(i) & 255u;
|
||||
auto hit = lru.get(key);
|
||||
if (!hit) {
|
||||
lru.put(key, key * 3);
|
||||
}
|
||||
Void::Bench::do_not_optimize(hit);
|
||||
});
|
||||
|
||||
maybe_run("binary_reader_u64_be", [&](std::size_t) {
|
||||
Void::Binary::Reader reader{be_u64};
|
||||
auto v = reader.read<std::uint64_t>(std::endian::big);
|
||||
Void::Bench::do_not_optimize(v);
|
||||
});
|
||||
|
||||
maybe_run("data_json_parse_small_object", [&](std::size_t) {
|
||||
auto v = Void::Json::parse(small_json_text);
|
||||
Void::Bench::do_not_optimize(v);
|
||||
});
|
||||
|
||||
maybe_run("data_json_serialize_small_object", [&](std::size_t) {
|
||||
auto s = Void::Json::serialize(small_json_val);
|
||||
Void::Bench::do_not_optimize(s);
|
||||
});
|
||||
|
||||
std::cout << "VoidFoundationBench (rev=" << VOID_GIT_REVISION
|
||||
<< ", build=" << VOID_BUILD_TYPE
|
||||
<< ", compiler=" << compiler_label()
|
||||
<< ", warmup=" << opts.warmup
|
||||
<< ", reps=" << opts.reps
|
||||
<< ", ops=" << opts.ops << ")\n\n";
|
||||
std::cout << std::left << std::setw(34) << "Workload"
|
||||
<< std::right << std::setw(11) << "Med(ns)"
|
||||
<< std::setw(11) << "p95(ns)"
|
||||
<< std::setw(11) << "p99(ns)"
|
||||
<< std::setw(11) << "CI95(+-)"
|
||||
<< std::setw(14) << "Ops/s\n";
|
||||
std::cout << std::string(92, '-') << '\n';
|
||||
|
||||
auto print_row = [](const WorkloadRecord& r) {
|
||||
std::cout << std::left << std::setw(34) << r.name
|
||||
<< std::right << std::fixed << std::setprecision(2)
|
||||
<< std::setw(11) << r.stats.median_ns_per_op
|
||||
<< std::setw(11) << r.stats.p95_ns_per_op
|
||||
<< std::setw(11) << r.stats.p99_ns_per_op
|
||||
<< std::setw(11) << r.stats.ci95_half_width_ns
|
||||
<< std::setprecision(0)
|
||||
<< std::setw(13) << r.stats.ops_per_sec << '\n';
|
||||
};
|
||||
|
||||
print_row(harness);
|
||||
for (const auto& rec : records) {
|
||||
print_row(rec);
|
||||
}
|
||||
|
||||
if (!opts.json_path.empty()) {
|
||||
write_json(opts.json_path, opts, harness, records);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(CMakePushCheckState)
|
||||
|
||||
function(_void_probe_sanitizer option_name compile_flags link_flag cache_var)
|
||||
if(NOT ${option_name})
|
||||
return()
|
||||
endif()
|
||||
if(MSVC)
|
||||
message(FATAL_ERROR
|
||||
"[Void] ${option_name}=ON is not supported with MSVC via this probe")
|
||||
endif()
|
||||
|
||||
cmake_push_check_state(RESET)
|
||||
set(CMAKE_REQUIRED_FLAGS "${compile_flags}")
|
||||
set(CMAKE_REQUIRED_LINK_OPTIONS "${link_flag}")
|
||||
check_cxx_source_compiles(
|
||||
"int main() { int x = 0; return x; }\n"
|
||||
${cache_var}
|
||||
)
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(NOT ${cache_var})
|
||||
message(FATAL_ERROR
|
||||
"[Void] ${option_name}=ON requested, but ${CMAKE_CXX_COMPILER_ID} "
|
||||
"${CMAKE_CXX_COMPILER_VERSION} failed to compile/link with '${link_flag}'.")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(void_probe_capabilities)
|
||||
if(VOID_ENABLE_ASAN AND VOID_ENABLE_TSAN)
|
||||
message(FATAL_ERROR
|
||||
"[Void] VOID_ENABLE_ASAN and VOID_ENABLE_TSAN are mutually exclusive")
|
||||
endif()
|
||||
|
||||
cmake_push_check_state(RESET)
|
||||
set(CMAKE_REQUIRED_FLAGS "-std=c++26")
|
||||
check_cxx_source_compiles(
|
||||
"#include <expected>\nint main() { std::expected<int, int> e{0}; return *e; }\n"
|
||||
VOID_HAS_STD_EXPECTED
|
||||
)
|
||||
cmake_pop_check_state()
|
||||
|
||||
if(NOT VOID_HAS_STD_EXPECTED)
|
||||
message(FATAL_ERROR
|
||||
"[Void] Compiler/stdlib lacks C++23/26 <expected> support required by Void")
|
||||
endif()
|
||||
|
||||
cmake_push_check_state(RESET)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16)
|
||||
set(CMAKE_REQUIRED_FLAGS "-std=c++26 -freflection")
|
||||
else()
|
||||
set(CMAKE_REQUIRED_FLAGS "-std=c++26")
|
||||
endif()
|
||||
check_cxx_source_compiles(
|
||||
"#include <meta>\nconsteval bool probe() { constexpr auto r = ^^int; return std::meta::is_type(r); }\nstatic_assert(probe());\nint main() { return 0; }\n"
|
||||
VOID_HAS_CXX26_REFLECTION
|
||||
)
|
||||
cmake_pop_check_state()
|
||||
|
||||
_void_probe_sanitizer(VOID_ENABLE_ASAN
|
||||
"-fsanitize=address -fno-omit-frame-pointer" "-fsanitize=address"
|
||||
VOID_COMPILER_SUPPORTS_ASAN)
|
||||
_void_probe_sanitizer(VOID_ENABLE_UBSAN
|
||||
"-fsanitize=undefined" "-fsanitize=undefined"
|
||||
VOID_COMPILER_SUPPORTS_UBSAN)
|
||||
_void_probe_sanitizer(VOID_ENABLE_TSAN
|
||||
"-fsanitize=thread" "-fsanitize=thread"
|
||||
VOID_COMPILER_SUPPORTS_TSAN)
|
||||
endfunction()
|
||||
|
||||
function(void_report_capabilities)
|
||||
get_property(_mods GLOBAL PROPERTY VOID_MODULES)
|
||||
list(LENGTH _mods _mod_count)
|
||||
|
||||
if(VOID_HAS_CXX26_REFLECTION)
|
||||
set(_refl "yes")
|
||||
else()
|
||||
set(_refl "no")
|
||||
endif()
|
||||
|
||||
if(VOID_HAS_STD_EXPECTED)
|
||||
set(_exp "yes")
|
||||
else()
|
||||
set(_exp "no")
|
||||
endif()
|
||||
|
||||
set(_sans "")
|
||||
if(VOID_ENABLE_ASAN)
|
||||
list(APPEND _sans "ASan")
|
||||
endif()
|
||||
if(VOID_ENABLE_UBSAN)
|
||||
list(APPEND _sans "UBSan")
|
||||
endif()
|
||||
if(VOID_ENABLE_TSAN)
|
||||
list(APPEND _sans "TSan")
|
||||
endif()
|
||||
if(NOT _sans)
|
||||
set(_sans_str "none")
|
||||
else()
|
||||
string(REPLACE ";" "+" _sans_str "${_sans}")
|
||||
endif()
|
||||
|
||||
message(STATUS
|
||||
"[Void] Capabilities: compiler=${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}, "
|
||||
"reflection=${_refl}, expected=${_exp}, shared=${BUILD_SHARED_LIBS}, "
|
||||
"werror=${VOID_WARNINGS_AS_ERRORS}, sanitizers=${_sans_str}, modules=${_mod_count}")
|
||||
endfunction()
|
||||
@@ -112,9 +112,26 @@ function(void_fetch_dependency DEP_NAME)
|
||||
FetchContent_Declare(Boost
|
||||
URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.xz
|
||||
URL_HASH SHA256=2e64e5d79a738d0fa6fb546c6e5c2bd28f88d268a2a080546f74e5ff98f29d0e
|
||||
SYSTEM
|
||||
)
|
||||
FetchContent_MakeAvailable(Boost)
|
||||
|
||||
foreach(_boost_target IN ITEMS
|
||||
boost_headers
|
||||
boost_beast
|
||||
boost_asio
|
||||
boost_url
|
||||
boost_system
|
||||
boost_stacktrace_addr2line
|
||||
boost_stacktrace_windbg
|
||||
boost_intrusive
|
||||
boost_core
|
||||
boost_mp11)
|
||||
if(TARGET ${_boost_target})
|
||||
set_property(TARGET ${_boost_target} PROPERTY SYSTEM TRUE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT TARGET Boost::${_stacktrace_component} AND
|
||||
TARGET boost_${_stacktrace_component})
|
||||
add_library(Boost::${_stacktrace_component}
|
||||
|
||||
+50
-13
@@ -1,10 +1,11 @@
|
||||
set_property(GLOBAL PROPERTY VOID_MODULES "")
|
||||
set_property(GLOBAL PROPERTY VOID_MODULE_DEPENDENCY_RECORDS "")
|
||||
set_property(GLOBAL PROPERTY VOID_PENDING_OPTIONAL_DEPS "")
|
||||
set_property(GLOBAL PROPERTY VOID_ACTIVE_PUBLIC_HEADERS "")
|
||||
|
||||
function(void_add_module MODULE_NAME)
|
||||
cmake_parse_arguments(ARG "" ""
|
||||
"INTERNAL_DEPS;EXTERNAL_DEPS;OPTIONAL_DEPS;DEPS_WIN32;DEPS_UNIX;OPTIONS_WIN32;OPTIONS_UNIX"
|
||||
"INTERNAL_DEPS;EXTERNAL_DEPS;OPTIONAL_DEPS;DEPS_WIN32;DEPS_UNIX;OPTIONS_WIN32;OPTIONS_UNIX;EXTRA_HEADERS;EXCLUDE_HEADERS"
|
||||
${ARGN})
|
||||
|
||||
set(TGT ${PROJECT_NAME}_${MODULE_NAME})
|
||||
@@ -12,6 +13,15 @@ function(void_add_module MODULE_NAME)
|
||||
|
||||
file(GLOB_RECURSE SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/${MODULE_NAME}/*.cpp")
|
||||
file(GLOB_RECURSE HDR CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/Void/${MODULE_NAME}/*.hpp")
|
||||
foreach(_excl IN LISTS ARG_EXCLUDE_HEADERS)
|
||||
list(REMOVE_ITEM HDR "${CMAKE_CURRENT_SOURCE_DIR}/include/${_excl}")
|
||||
endforeach()
|
||||
foreach(_extra IN LISTS ARG_EXTRA_HEADERS)
|
||||
list(APPEND HDR "${CMAKE_CURRENT_SOURCE_DIR}/include/${_extra}")
|
||||
endforeach()
|
||||
if(HDR)
|
||||
list(REMOVE_DUPLICATES HDR)
|
||||
endif()
|
||||
|
||||
if(NOT SRC AND NOT HDR)
|
||||
return()
|
||||
@@ -52,6 +62,10 @@ function(void_add_module MODULE_NAME)
|
||||
add_library(${ALIAS} ALIAS ${TGT})
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY VOID_MODULES ${MODULE_NAME})
|
||||
foreach(_hdr IN LISTS HDR)
|
||||
file(RELATIVE_PATH _rel_hdr "${CMAKE_CURRENT_SOURCE_DIR}/include" "${_hdr}")
|
||||
set_property(GLOBAL APPEND PROPERTY VOID_ACTIVE_PUBLIC_HEADERS "${_rel_hdr}")
|
||||
endforeach()
|
||||
set(_module_external_deps "")
|
||||
foreach(ext_dep IN LISTS ARG_EXTERNAL_DEPS)
|
||||
# FindSQLite3's package name and imported-target namespace differ.
|
||||
@@ -183,6 +197,15 @@ function(void_add_module MODULE_NAME)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(VOID_ENABLE_TSAN)
|
||||
target_compile_options(${TGT} PUBLIC
|
||||
"$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-fsanitize=thread>"
|
||||
)
|
||||
target_link_options(${TGT} PUBLIC
|
||||
"$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-fsanitize=thread>"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(VOID_ENABLE_COVERAGE)
|
||||
target_compile_options(${TGT} PUBLIC
|
||||
"$<$<CXX_COMPILER_ID:GNU>:--coverage;-fprofile-update=atomic>"
|
||||
@@ -202,7 +225,10 @@ function(void_add_module MODULE_NAME)
|
||||
EXPORT_NAME ${MODULE_NAME}
|
||||
)
|
||||
if(UNIX AND _module_target_type STREQUAL "SHARED_LIBRARY")
|
||||
set_property(TARGET ${TGT} PROPERTY INSTALL_RPATH "$ORIGIN")
|
||||
set_target_properties(${TGT} PROPERTIES
|
||||
INSTALL_RPATH "$ORIGIN"
|
||||
INSTALL_RPATH_USE_LINK_PATH TRUE
|
||||
)
|
||||
endif()
|
||||
if(WIN32 AND _module_target_type STREQUAL "SHARED_LIBRARY")
|
||||
# Void's public headers do not require consumers to opt into a DLL
|
||||
@@ -212,23 +238,34 @@ function(void_add_module MODULE_NAME)
|
||||
endif()
|
||||
|
||||
# GCC 16+ exposes experimental C++26 reflection (P2996) via -freflection.
|
||||
# Apply it to every module unconditionally so any module is free to use
|
||||
# ^^T / std::meta::* without per-module wiring.
|
||||
if(SRC AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16)
|
||||
target_compile_options(${TGT} PUBLIC -freflection)
|
||||
# Propagate it on every module (including INTERFACE modules like Core and
|
||||
# Data) so standalone installed consumers receive the required flag.
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16)
|
||||
target_compile_options(${TGT} ${SCOPE}
|
||||
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,16>>:-freflection>")
|
||||
endif()
|
||||
if(HDR)
|
||||
target_sources(${TGT} ${SCOPE} FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" FILES ${HDR})
|
||||
endif()
|
||||
target_sources(${TGT} ${SCOPE} FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" FILES ${HDR})
|
||||
target_include_directories(${TGT} ${SCOPE}
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
install(TARGETS ${TGT} EXPORT ${EXPORT_SET_NAME}
|
||||
FILE_SET HEADERS DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
if(HDR)
|
||||
install(TARGETS ${TGT} EXPORT ${EXPORT_SET_NAME}
|
||||
FILE_SET HEADERS DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
else()
|
||||
install(TARGETS ${TGT} EXPORT ${EXPORT_SET_NAME}
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Resolve OPTIONAL_DEPS recorded by void_add_module(). Must be called once
|
||||
|
||||
@@ -2,7 +2,14 @@ if(NOT INPUT_FILE OR NOT OUTPUT_FILE OR NOT SUITE_NAME)
|
||||
message(FATAL_ERROR "INPUT_FILE, OUTPUT_FILE, and SUITE_NAME must be provided.")
|
||||
endif()
|
||||
|
||||
file(STRINGS ${INPUT_FILE} lines)
|
||||
file(READ "${INPUT_FILE}" _raw_content)
|
||||
string(REPLACE "\r\n" "\n" _raw_content "${_raw_content}")
|
||||
string(REPLACE "\r" "\n" _raw_content "${_raw_content}")
|
||||
string(REPLACE "\\" "__VOID_SCAN_BS__" _raw_content "${_raw_content}")
|
||||
string(REPLACE ";" "__VOID_SCAN_SC__" _raw_content "${_raw_content}")
|
||||
string(REPLACE "[" "__VOID_SCAN_LB__" _raw_content "${_raw_content}")
|
||||
string(REPLACE "]" "__VOID_SCAN_RB__" _raw_content "${_raw_content}")
|
||||
string(REPLACE "\n" ";" lines "${_raw_content}")
|
||||
|
||||
# Forward-slash path for C++ string literals / #include (always set, so files
|
||||
# whose tests are all reflection-registered Suite<> structs still emit a valid
|
||||
@@ -21,6 +28,10 @@ set(current_skip "")
|
||||
|
||||
foreach(line IN LISTS lines)
|
||||
math(EXPR line_number "${line_number} + 1")
|
||||
string(REPLACE "__VOID_SCAN_RB__" "]" line "${line}")
|
||||
string(REPLACE "__VOID_SCAN_LB__" "[" line "${line}")
|
||||
string(REPLACE "__VOID_SCAN_SC__" ";" line "${line}")
|
||||
string(REPLACE "__VOID_SCAN_BS__" "\\" line "${line}")
|
||||
|
||||
# Parse preceding comments for @tag and @skip
|
||||
string(REGEX MATCH "//[ \t]*@tag[ \t]+(.*)" _tag_match "${line}")
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# Decision ledger
|
||||
|
||||
Date: 2026-11-24. Baseline: `main` at `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
|
||||
## User-confirmed decisions
|
||||
|
||||
| ID | Decision | Status/source |
|
||||
| --- | --- | --- |
|
||||
| D-001 | Generic library spanning small foundations, complete modules, and full optional application platforms | CONFIRMED; discovery correction and follow-up answers |
|
||||
| D-002 | Linux-first portable design | CONFIRMED |
|
||||
| D-003 | Versioned modernization, with major-release breaks and migration guidance | CONFIRMED |
|
||||
| D-004 | C++26 and reflection remain defining choices | CONFIRMED |
|
||||
| D-005 | Full roadmap with phased delivery and expanded plans throughout | CONFIRMED |
|
||||
| D-006 | General software infrastructure domain; no GUI/media/scientific/embedded platform expansion | CONFIRMED domain selection; general Math utilities remain in scope |
|
||||
| D-007 | Prefer native implementations, deciding backend use separately for each module | CONFIRMED correction to blanket dependency choices |
|
||||
| D-008 | Prioritize runtime/memory and separate workload profiles together | CONFIRMED combined selection |
|
||||
| D-009 | Embedded and managed execution modes | CONFIRMED |
|
||||
| D-010 | Include broad module completion, networked platform, and reloadable platform | CONFIRMED all three; sequencing follows dependencies |
|
||||
| D-011 | First-class SQLite API using SQLite, plus a separate original Void engine | CONFIRMED explicit clarification |
|
||||
| D-012 | Original engine starts with a transactional key-value core | CONFIRMED |
|
||||
| D-013 | Full distributed platform roadmap in later phases | CONFIRMED |
|
||||
| D-014 | Convenient C++ plugins plus a stable C boundary | CONFIRMED |
|
||||
| D-015 | Standard-library-only foundation | CONFIRMED |
|
||||
| D-016 | One expanded file per public module and new area | CONFIRMED |
|
||||
| D-017 | Author the approved planning package now; feature implementation follows separately | APPROVED by “Implement the plan” after the proposal explicitly bounded that deliverable |
|
||||
|
||||
## Root-owned technical defaults
|
||||
|
||||
These are design choices made within the approved planning scope, not claims that the
|
||||
user individually selected each algorithm or that any new implementation exists.
|
||||
|
||||
| ID | Choice and rationale | Contract |
|
||||
| --- | --- | --- |
|
||||
| D-018 | One authoritative owner for each shared interface; acyclic layered packages | C-01, C-13 |
|
||||
| D-019 | Native level-triggered epoll sockets, bounded file workers, optional later io_uring | C-06; simple initial semantics and portable operation contract |
|
||||
| D-020 | Original append WAL, ordered memory index, immutable sorted tables/checkpoints; serialized writer first | C-08; explicit durable core before concurrency/compaction expansion |
|
||||
| D-021 | Preserve OpenSSL/libsodium for initial cryptographic implementations | C-06; native surrounding logic without changing cryptographic primitives |
|
||||
| D-022 | Cooperative structured cancellation, one terminal completion, explicit admission bounds | C-03–C-05 |
|
||||
| D-023 | Fixed-membership Raft first; deterministic core and separate replication adapters | C-12; avoid bootstrap cycles and unsupported reliability claims |
|
||||
| D-024 | Quorum-confirmed consistent reads; stale reads explicit; no implied cross-shard transaction | C-12 |
|
||||
| D-025 | Existing strict signed parsing, exact payloads, update commit markers, and frozen V1 remain protected | C-07, C-09, C-10 |
|
||||
| D-026 | No deadline or staffing assumption; evidence-gated milestones | Delivery plan |
|
||||
|
||||
## Approved execution fallback
|
||||
|
||||
On 2026-11-24 the configured Sol model for T-DOC-104 reported capacity exhaustion before
|
||||
starting the assignment. The user explicitly selected “Use configured Astra implementer.”
|
||||
T-DOC-104 therefore uses the configured astra_implementer at XHigh with exactly the same
|
||||
ten documentation files and task contract. The failed worker was closed. Other task
|
||||
ownership and the documentation-only objective are unchanged. Model execution identity
|
||||
remains configured rather than independently attested.
|
||||
|
||||
## Review decisions
|
||||
|
||||
- T-DISC-001: configured astra_planner completed the architecture investigation; source
|
||||
and coverage gaps were reported. Runtime model identity was not independently attested.
|
||||
- T-DISC-002: configured astra_researcher checked primary documentation for I/O,
|
||||
persistence, consensus, and TLS; no runtime claims came from that research.
|
||||
- T-PLAN-003: fresh configured astra_reviewer returned READY for plan-file authoring.
|
||||
Its P3 distinction between future reference apps/proposed commands and existing
|
||||
artifacts/evidence was incorporated. This was preflight, not review of written files.
|
||||
|
||||
Further decisions must identify affected contract IDs, compatibility impact, and the
|
||||
plans requiring updates. Do not record a proposal as user approval.
|
||||
|
||||
## User-confirmed implementation decisions (2026-11-24)
|
||||
|
||||
| ID | Decision | Status/source |
|
||||
| --- | --- | --- |
|
||||
| D-027 | Execute in roadmap order: complete P0 baseline (`X-BASE-01`..`X-BASE-05`), then start P1 foundations (`Core`, `Functional`, `Time`, `Memory`, `Math`) | CONFIRMED by user |
|
||||
| D-028 | Keep `docs/roadmap/` clean; author detailed per-task implementation specifications under `docs/agent-workflow/tasks/` prior to coding each wave | CONFIRMED by user |
|
||||
| D-029 | Follow `MIGRATION.md` Wave A+B: keep 1.x public APIs and existing tests compiling/passing while introducing NEW APIs and adapters beside them | CONFIRMED by user |
|
||||
| D-030 | Create dedicated git branch (`feat/roadmap-p0-p1-foundations`) and make focused commits per completed milestone/task; leave local untracked files (`.env`, `.serena/`, `WG.conf`, `keys`) untouched | CONFIRMED by user |
|
||||
| D-031 | Proceed continuously across roadmap waves without pausing for confirmation between waves, and merge verified waves locally into `main` (without pushing to remote) | CONFIRMED by user |
|
||||
| D-032 | Push verified `main` (and active feature branches) to `origin` (`git@git.faumaray.com:Void/VoidLibrary.git`) after each verified wave merge, superseding the local-only constraint in `D-031` | CONFIRMED by user ("dont forget to push") |
|
||||
@@ -0,0 +1,311 @@
|
||||
# Workflow state
|
||||
|
||||
Updated: 2026-11-25.
|
||||
Repository: VoidLibrary; active branch `feat/roadmap-p2-wave6b` (from `main`
|
||||
at `acd77ee`, merged Waves 1–6A plus RFC 8259 decimal `StrictJson` and pushed
|
||||
to `origin/main`).
|
||||
|
||||
## Completed objective
|
||||
|
||||
1. Approved multi-file expansion planning package committed (`faa8a51`): 54 roadmap
|
||||
documents with 300 planned feature tasks and workflow records.
|
||||
2. **Wave 1 / P0 Reliable Baseline (`X-BASE-01`..`X-BASE-05`) implemented & verified**:
|
||||
- `X-BASE-01`: Replaced hardcoded `/bin/echo`, `/bin/cat`, and `seq` in process tests
|
||||
with standard-library `VoidProcessHelper`.
|
||||
- `X-BASE-02`: Marked FetchContent Boost 1.84 as `SYSTEM` so `-DVOID_WARNINGS_AS_ERRORS=ON`
|
||||
succeeds cleanly on GCC 16.2.0 (`-std=c++26`).
|
||||
- `X-BASE-03`: Transferred `<Void/Log/Log.hpp>` header ownership to `LogState`,
|
||||
reconciled acyclic `INTERNAL_DEPS` across 10 `module.cmake` files, added
|
||||
`Void::FunctionalCoreFormatting`, propagated `-freflection` on `INTERFACE` modules,
|
||||
filtered `VoidTests` by `ACTIVE_MODULES`, and verified minimal, `System`-only,
|
||||
embedded `add_subdirectory`, static, and relocated installed consumers.
|
||||
- `X-BASE-04`: Added `cmake/Capabilities.cmake` (`VOID_HAS_STD_EXPECTED`,
|
||||
`VOID_HAS_CXX26_REFLECTION`, sanitizer probes, `ASan`+`TSan` mutual exclusion) and
|
||||
`VOID_ENABLE_TSAN`; verified Debug ASan+UBSan+`-Werror` full suite and TSan subset.
|
||||
- `X-BASE-05`: Added `VOID_ENABLE_BENCHMARKS` (`benchmarks/FoundationBench.cpp`) and
|
||||
`tests/corpus/README.md`; recorded P0 foundation benchmark manifest.
|
||||
3. **Wave 2 / P1 Foundations Gate 1 implemented & verified**:
|
||||
- Specs authored under `docs/agent-workflow/tasks/` (`8d28c7e`).
|
||||
- `Core` (`M-CORE-02`, `M-CORE-03`, `cbc9004`): detached `Uuid` from `Math`/`<format>`,
|
||||
added `GenerateError`, `v4(G&)`, `try_v4()`, span-safe `constexpr` `parse`/`v5_lite`/
|
||||
`format_chars`, `CheckedBits`, endian-portable `Hash` helpers, and `CoreOnly` consumer.
|
||||
- `VoidTestScanner` fix (`284d963`): prevented unbalanced `[` in C++ strings from dropping
|
||||
downstream test discovery in `cmake/VoidTestScanner.cmake`.
|
||||
- `Functional` (`M-FUNCTIONAL-02`, `7f3395c`): added `ErrorKind`/`ErrorCode`, zero-alloc
|
||||
`Status`, bounded `Error` chains (16 frames / 1 KiB / 16 KiB) with iterative destructor,
|
||||
`Result::fail` overloads, and `Adapters.hpp`.
|
||||
- `Time` (`M-TIME-02`, `4227348`): added `Clock.hpp` (`MonotonicClock`, `CivilClock`,
|
||||
`SystemMonotonicClock`, `SystemCivilClock`, atomic `ManualClock`, `ManualCivilClock`,
|
||||
`remaining_until`) and upgraded `Stopwatch` with clock injection, `resume()`,
|
||||
`try_lap()`, single-sample `split()`, and `kDefaultMaxLaps = 4096`.
|
||||
- `Memory` subsystem (`S-MEMORY-02..04`, `4d48f2a`): added `Resource.hpp`,
|
||||
`BudgetResource.hpp`, `Arena.hpp` (`Arena::Checkpoint`, `Arena::TypedScope`,
|
||||
`ArenaResource`), `BlockPool.hpp` (`BlockPool`, `SynchronizedBlockPool`), and
|
||||
`MemoryOnly` installed consumer.
|
||||
- `Math` (`M-MATH-02`, `91e2beb`, `6cac781`): added `Error::{Inexact,NonFinite}`,
|
||||
`Rounding`, `kMaxNumericTokenBytes = 256`, portable `constexpr` overflow helpers with
|
||||
guarded builtins, `checked_mul_add`, `checked_cast`, span-safe `parse_integer`/
|
||||
`parse_real`, and delegated `parse_int`/`parse_double`.
|
||||
4. **Wave 3 / P1 Text, Containers, Binary, Data implemented & verified**:
|
||||
- Task specs committed under `docs/agent-workflow/tasks/` (`68963fc`) plus user
|
||||
decision `D-031` in `DECISIONS.md`.
|
||||
- `Text` (`M-TEXT-02`, `883bbdc`): added locale-independent ASCII-only helpers in
|
||||
`include/Void/Text/Str.hpp`, new `include/Void/Text/Bounded.hpp` (`TextLimits`,
|
||||
`TextError`, `split_views`, `replace_bounded`, `repeat_bounded`, `join_bounded`), and
|
||||
boundary tests in `tests/standalone/Text/{Str,Bounded}.cpp`.
|
||||
- `Containers` (`M-CONTAINERS-02`, `M-CONTAINERS-03`, `9ac76bb`): updated
|
||||
`src/Containers/module.cmake` to `INTERNAL_DEPS Core Memory`; upgraded `ObjectPool` and
|
||||
`BufferPool` with stationary `std::shared_ptr<State>`, zero-alloc recycling, explicit
|
||||
`std::pmr::memory_resource*`, admission/byte limits, and exception-safe slot rollback;
|
||||
upgraded `Ring.hpp` with Vyukov sequence-based non-spinning `MpscRing::try_pop()`,
|
||||
`close()`, and quiesced destructor cleanup.
|
||||
- `Binary` (`M-BINARY-02`, `M-BINARY-03`, `eacb8a4`): updated `src/Binary/module.cmake`
|
||||
to `INTERNAL_DEPS Functional Memory`; added `Budget.hpp` (`BinaryErrorCode`,
|
||||
`DecodeLimits`, `DecodeBudget`), `Writer.hpp`, `ByteBuffer.hpp` (`FrozenBytes`,
|
||||
`ByteBuffer`), and upgraded `Reader.hpp` (pre-consume endian check, strict `readBool`,
|
||||
IEEE `readF32`/`readF64`, `Transaction`, checked cumulative budget readers); expanded
|
||||
installed `Binary` consumer.
|
||||
- `Data` (`M-DATA-02`, `692f5ba`): updated `src/Data/module.cmake` to
|
||||
`INTERNAL_DEPS Core Math Time`; added `std::int64_t`/`std::uint64_t`/`double`
|
||||
alternatives to `Void::Json::Value`, `NumberKind`, `number_as`, strict RFC 8259
|
||||
number parsing, exact cross-type `operator==`, `try_serialize`, typed SAX
|
||||
`on_int`/`on_uint`, and exact reflection/config formatting (`StrictJson` untouched).
|
||||
|
||||
## Baseline and authorization
|
||||
|
||||
User decisions D-027..D-032 authorize continuous roadmap-order execution across dedicated
|
||||
wave branches (`feat/roadmap-*`), per-task workflow specs in
|
||||
`docs/agent-workflow/tasks/`, Wave A+B API compatibility, `--no-ff` merges of verified
|
||||
waves into `main`, and pushing verified `main` and active feature branches to `origin`
|
||||
while leaving local untracked files untouched.
|
||||
|
||||
## Verification already observed (P0)
|
||||
|
||||
- Full RelWithDebInfo + `-DVOID_WARNINGS_AS_ERRORS=ON` via
|
||||
`dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium`: build passed (exit 0);
|
||||
`ctest` 2/2 passed (`VoidTests` 1,249 passed / 3 intentional skips / 0 failed;
|
||||
`VoidInstalledComponentConsumers` including relocated `Foundation` and `External` passed).
|
||||
- Minimal foundation subset, `System` without `Log` (`Log.hpp` installed), embedded
|
||||
`add_subdirectory`, and static (`BUILD_SHARED_LIBS=OFF`) builds/tests all passed.
|
||||
- Full Debug ASan+UBSan+`-Werror`: `VoidTests` 1,249 passed, 3 skipped, 0 failed, 0 leaks/UB.
|
||||
- Debug TSan subset (`Async;Time;Core;Functional;Testing`): 389 passed, 2 skipped, 0 failed.
|
||||
- `VoidFoundationBench` (RelWithDebInfo, 5 warmup, 20 reps, 10,000 ops/rep): 12 workloads +
|
||||
empty-harness baseline recorded to `/tmp/void-p0-bench/baseline.json`.
|
||||
|
||||
## Verification already observed (P1 Gate 1)
|
||||
|
||||
- Full RelWithDebInfo + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-p1-full`, 29 modules,
|
||||
`6cac781`): `VoidTests` 1,310 tests — 1,307 passed, 3 intentional skips
|
||||
(`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (3.72s);
|
||||
`ctest` 2/2 passed (`VoidTests` 3.81s, `VoidInstalledComponentConsumers` 11.95s, total
|
||||
15.75s).
|
||||
- Full Debug ASan + UBSan + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-p1-asan`, 29 modules,
|
||||
`6cac781`): `VoidTests` 1,310 tests — 1,307 passed, 3 skipped, 0 failed (10.70s), 0 leaks,
|
||||
0 UB.
|
||||
- Standalone `Memory;Testing` (`8/8`) + isolated `-DVOID_ENABLED_MODULES=Memory` consumer
|
||||
`/tmp/void-p1-memory-only-consumer/void_memory_only_consumer` passed (`4d48f2a`).
|
||||
- `VoidFoundationBench` post-P1 (`rev=6cac781f3a5f`, `/tmp/void-p1-full/post-p1.json`):
|
||||
`harness_empty_loop` 0.20 ns, `core_uuid_parse_hyphenated` 25.26 ns (down from 88.76 ns),
|
||||
`core_uuid_to_string` 16.73 ns (down from 498.11 ns).
|
||||
|
||||
## Verification already observed (Wave 3)
|
||||
|
||||
- Full RelWithDebInfo + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w3-full`, 29 modules,
|
||||
`692f5ba`): `VoidTests` 1,332 tests — 1,329 passed, 3 intentional skips
|
||||
(`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (3.83s);
|
||||
`ctest` 2/2 passed (`VoidTests` 3.81s, `VoidInstalledComponentConsumers` 12.38s, total
|
||||
16.20s).
|
||||
- Full Debug ASan + UBSan + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w3-asan`, 29 modules,
|
||||
`692f5ba`): `VoidTests` 1,332 tests — 1,329 passed, 3 skipped, 0 failed (10.83s), 0 leaks,
|
||||
0 UB.
|
||||
- Debug TSan subset (`Containers;Async;Time;Testing`, `/tmp/void-w3-tsan`, `692f5ba`):
|
||||
`Ring*|Pool*|BufferPool*|Clock*|Stopwatch*` 67/67 passed (69.8ms), 0 TSan data races.
|
||||
- `VoidFoundationBench` post-W3 (`rev=692f5ba5b2f9`, `/tmp/void-w3-full/post-w3.json`):
|
||||
`harness_empty_loop` 0.39 ns, `core_uuid_parse_hyphenated` 24.94 ns,
|
||||
`core_uuid_to_string` 16.88 ns, `containers_spsc_ring_push_pop` 8.85 ns,
|
||||
`containers_lru_get_put` 20.59 ns, `binary_reader_u64_be` 1.31 ns,
|
||||
`data_json_parse_small_object` 325.73 ns, `data_json_serialize_small_object` 164.76 ns.
|
||||
|
||||
## Verification already observed (Wave 4A — P1 Algorithms, Unicode, Async)
|
||||
|
||||
- Standalone `Algorithms;Testing` (`-Werror`, `/tmp/void-w4a-alg`, `bfd6246`): `Graph`
|
||||
4/4 passed (64.2ms); `ctest` 2/2 passed (including `AlgorithmsOnly` installed consumer).
|
||||
- Standalone `Unicode;Testing` (`-Werror`, `/tmp/void-w4a-unicode`, `4369fde`): `Utf`
|
||||
4/4 passed (0.3ms); `ctest` 2/2 passed (including `UnicodeOnly` installed consumer).
|
||||
- Standalone `Async;Testing` (`-Werror`, `/tmp/void-w4a-async`, `c75056f`):
|
||||
`OperationScope*|Executor*|Coro*` 28/28 passed (4.1ms); `ctest` 2/2 passed.
|
||||
- Debug TSan subset (`Async;Testing`, `/tmp/void-w4a-async-tsan`, `c75056f`):
|
||||
`OperationScope*|Executor*|ThreadPool*` 20/20 passed (34.6ms), 0 TSan races.
|
||||
- Full RelWithDebInfo + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w4a-full`, 31 modules,
|
||||
`c75056f`): `VoidTests` 1,345 tests — 1,342 passed, 3 intentional skips
|
||||
(`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (3.75s);
|
||||
`ctest` 2/2 passed (`VoidTests` 3.77s, `VoidInstalledComponentConsumers` 14.45s, total
|
||||
18.21s).
|
||||
- Full Debug ASan + UBSan + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w4a-asan`, 31 modules,
|
||||
`c75056f`): `VoidTests` 1,345 tests — 1,342 passed, 3 skipped, 0 failed (11.00s), 0 leaks,
|
||||
0 UB.
|
||||
- `VoidFoundationBench` post-W4A (`rev=c75056fe0707`, `/tmp/void-w4a-full/post-w4a.json`):
|
||||
`harness_empty_loop` 0.39 ns, `core_uuid_parse_hyphenated` 25.48 ns,
|
||||
`core_uuid_to_string` 17.09 ns, `containers_spsc_ring_push_pop` 9.16 ns,
|
||||
`containers_lru_get_put` 21.81 ns, `binary_reader_u64_be` 1.36 ns,
|
||||
`data_json_parse_small_object` 319.83 ns, `data_json_serialize_small_object` 168.13 ns.
|
||||
|
||||
## Verification already observed (Wave 4B — P1 IO, Runtime, Testing)
|
||||
|
||||
- Standalone `IO` (`-Werror`, `/tmp/void-w4b-io`, `673bb7e`): `IoDriver` 4/4 passed (7.5 ms);
|
||||
`ctest` 2/2 passed (`VoidTests` 1.50 s, `VoidInstalledComponentConsumers` including `IOOnly`
|
||||
6.08 s); Debug TSan `/tmp/void-w4b-io-tsan` `IoDriver` 4/4 passed (12.8 ms, 0 races).
|
||||
- Standalone `Runtime` (`-Werror`, `/tmp/void-w4b-runtime`, 11 modules, `1b3331e`):
|
||||
`RuntimeHost` 3/3 passed (0.5 ms); `ctest` 2/2 passed (`VoidTests` 1.54 s,
|
||||
`VoidInstalledComponentConsumers` including `RuntimeOnly` 8.01 s).
|
||||
- Standalone `Testing` (`Core;Testing`, `-Werror`, `/tmp/void-w4b-testing`, `de8a981`):
|
||||
`FrameworkHardening*|Deterministic*|Math*|ContainerFixture*|StructRepr*` 16 tests — 14
|
||||
passed, 2 intentional skips (`broken_feature`, `unquoted_skip`), 0 failed (301.1 ms);
|
||||
`ctest` 2/2 passed (2.82 s).
|
||||
- Full RelWithDebInfo + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w4b-full`, 33 modules,
|
||||
`de8a981`): `VoidTests` 1,359 tests — 1,356 passed, 3 intentional skips
|
||||
(`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (5.08 s);
|
||||
`ctest` 2/2 passed (`VoidTests` 4.50 s, `VoidInstalledComponentConsumers` 19.77 s, total
|
||||
24.27 s).
|
||||
- Full Debug ASan + UBSan + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w4b-asan`, 33 modules,
|
||||
`de8a981`): `VoidTests` 1,359 tests — 1,356 passed, 3 skipped, 0 failed (14.87 s), 0 leaks,
|
||||
0 UB.
|
||||
- Debug TSan subset (`IO;Async;Containers;Time;Testing`, `/tmp/void-w4b-tsan`, 9 active
|
||||
modules, `de8a981`): `Io*|OperationScope*|Executor*|Ring*|Pool*|Clock*` 80/80 passed
|
||||
(60.7 ms), 0 TSan data races.
|
||||
- `VoidFoundationBench` post-W4B (`rev=de8a981893d8`, `/tmp/void-w4b-full`, `post-w4b.json`):
|
||||
`harness_empty_loop` 0.39 ns, `core_uuid_parse_hyphenated` 25.28 ns,
|
||||
`core_uuid_to_string` 16.94 ns, `core_hash_fnv1a64_256b` 184.30 ns,
|
||||
`core_hash_murmur3_256b` 69.63 ns, `functional_result_ok_chain` 1.16 ns,
|
||||
`functional_error_with_context` 60.17 ns, `math_checked_add_loop` 0.48 ns,
|
||||
`containers_spsc_ring_push_pop` 9.06 ns, `containers_lru_get_put` 21.30 ns,
|
||||
`binary_reader_u64_be` 1.35 ns, `data_json_parse_small_object` 316.78 ns,
|
||||
`data_json_serialize_small_object` 168.16 ns.
|
||||
|
||||
## Verification already observed (Wave 5 — P2 Operations Foundations)
|
||||
|
||||
- `ObservabilityHooks` + `Observability` (`fe99051`): `Observability*` 4/4 passed
|
||||
(12.1 ms); `ctest` 2/2 passed (including `ObservabilityHooksOnly` &
|
||||
`ObservabilityOnly`, 7.03 s).
|
||||
- `Resilience` + `ResilienceAsync` + P2 error domains (`18a623a`): standalone 21/21
|
||||
(2.8 ms) + `AsyncPolicy*` 6/6 (1.3 ms); `ctest` 2/2 (5.99 s including `ResilienceOnly`).
|
||||
- `LogState` + `Log` + `LogConfig` (`a74a402`): `Log;Testing` `724 ✔`, `2 ⊘`
|
||||
(`broken_feature`, `unquoted_skip`), `0 ✘` (799.2 ms); `ctest` 2/2 (`LogOnly` 7.15 s,
|
||||
total 8.09 s); `LogConfig;Testing` 12/12 (28.9 ms).
|
||||
- CMake `VOID_ACTIVE_PUBLIC_HEADERS` fix (`3d8dfb0`) + `Stacktrace` (`7b57b35`):
|
||||
`Stacktrace;Testing` `Stacktrace*` 4/4 passed (374.2 ms) without selecting `Log`.
|
||||
- Full RelWithDebInfo + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w5-full`, 37 modules,
|
||||
`7b57b35`): `VoidTests` 1,378 tests — 1,375 passed, 3 intentional skips
|
||||
(`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (7.49 s);
|
||||
`ctest` 2/2 passed (`VoidTests` 8.09 s, `VoidInstalledComponentConsumers` all 16 consumers
|
||||
66.12 s, total 74.22 s).
|
||||
- Full Debug ASan + UBSan + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w5-asan`, 37
|
||||
modules, `7b57b35`): initial run hit 1 timing assertion in unrelated existing
|
||||
`internal_fsm_service_hot_reload_under_load` (`FsmServiceHotReload.cpp:119`); clean
|
||||
re-run passed all 1,378 tests — 1,375 passed, 3 skipped, 0 failed (50.16 s), 0 leaks,
|
||||
0 UB.
|
||||
- Wave 5 Debug TSan subset (`/tmp/void-w5-tsan`, 15 modules, `7b57b35`):
|
||||
`Observability*|ResilienceHardening*|AsyncPolicy*|Log*|AsyncLogger*|LogScopeSnapshot*|Io*|OperationScope*`
|
||||
68/68 passed (7.01 s), 0 TSan data races.
|
||||
- `VoidFoundationBench` post-W5 (`rev=7b57b355cd75`, `/tmp/void-w5-full`, `post-w5.json`):
|
||||
`harness_empty_loop` 0.75 ns, `core_uuid_parse_hyphenated` 43.49 ns,
|
||||
`core_uuid_to_string` 32.51 ns, `core_hash_fnv1a64_256b` 213.37 ns,
|
||||
`core_hash_murmur3_256b` 92.34 ns, `functional_result_ok_chain` 1.65 ns,
|
||||
`functional_error_with_context` 94.82 ns, `math_checked_add_loop` 0.86 ns,
|
||||
`containers_spsc_ring_push_pop` 10.76 ns, `containers_lru_get_put` 31.99 ns,
|
||||
`binary_reader_u64_be` 2.24 ns, `data_json_parse_small_object` 576.81 ns,
|
||||
`data_json_serialize_small_object` 284.87 ns.
|
||||
|
||||
## Verification already observed (Wave 6A — P2 System, SystemAsync, IPC)
|
||||
|
||||
- Wave 6A prep & P2/P3 error domains (`3f67b1e`): reserved `kIpcErrorDomain = 16`..
|
||||
`kSqliteErrorDomain = 21` in `Error.hpp`, added thread-safe pipe `ENOTSOCK` fallback in
|
||||
`EpollDriver.cpp`, enabled `VoidProcessHelper` for `Void::System` OR `Void::IPC`, added
|
||||
`M-SYSTEM-01-05.md` and `S-IPC-01-03.md`.
|
||||
- `System` (`fcdbc06`): `System;Testing` (`/tmp/void-w6a-system`, `-Werror`) `System*`
|
||||
53/53 passed (226.6 ms); `ctest` 2/2 (`VoidTests` 0.57 s,
|
||||
`VoidInstalledComponentConsumers` including `SystemOnly` 3.95 s).
|
||||
- `SystemAsync` (`9a3c5d8`): `SystemAsync;Testing` (`/tmp/void-w6a-sysasync`, `-Werror`)
|
||||
`SystemAsync*` 2/2 passed (211.5 ms); `ctest` 2/2 (`VoidTests` 1.15 s,
|
||||
`VoidInstalledComponentConsumers` including `SystemAsyncOnly` 9.43 s).
|
||||
- `IPC` (`39a48d5`): `IPC;Testing` (`/tmp/void-w6a-ipc`, `-Werror`) `Ipc*` 3/3 passed
|
||||
(8.8 ms); `ctest` 2/2 (`VoidTests` 0.49 s, `VoidInstalledComponentConsumers` including
|
||||
`IPCOnly` 12.20 s, total 12.70 s).
|
||||
- Full RelWithDebInfo + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w6a-full`, 39 modules,
|
||||
`39a48d5`): `VoidTests` 1,386 tests — 1,383 passed, 3 intentional skips
|
||||
(`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (4.68 s);
|
||||
`ctest` 2/2 passed (`VoidTests` 4.58 s, `VoidInstalledComponentConsumers` 19 consumer
|
||||
builds incl. `SystemOnly`, `SystemAsyncOnly`, `IPCOnly`, `RelocatedFoundation`,
|
||||
`RelocatedExternal`, 31.05 s, total 35.63 s).
|
||||
- Full Debug ASan + UBSan + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w6a-asan`, 39
|
||||
modules, `39a48d5`): `VoidTests` 1,386 tests — 1,383 passed, 3 skipped, 0 failed
|
||||
(19.34 s), 0 ASan/LSan leaks, 0 UBSan errors.
|
||||
- Wave 6A Debug TSan subset (`/tmp/void-w6a-tsan`, 14 modules, `39a48d5`):
|
||||
`Process*|SystemHardening*|SystemAsync*|Ipc*|FileWatcher*|IoDriver*|OperationScope*`
|
||||
35/35 passed (609.4 ms), 0 TSan data races.
|
||||
- `VoidFoundationBench` post-W6A (`rev=39a48d5c0a72`, `/tmp/void-w6a-full/post-w6a.json`):
|
||||
`harness_empty_loop` 0.38 ns, `core_uuid_parse_hyphenated` 24.92 ns,
|
||||
`core_uuid_to_string` 17.45 ns, `core_hash_fnv1a64_256b` 181.41 ns,
|
||||
`core_hash_murmur3_256b` 67.93 ns, `functional_result_ok_chain` 1.13 ns,
|
||||
`functional_error_with_context` 58.77 ns, `math_checked_add_loop` 0.47 ns,
|
||||
`containers_spsc_ring_push_pop` 8.80 ns, `containers_lru_get_put` 20.61 ns,
|
||||
`binary_reader_u64_be` 1.31 ns, `data_json_parse_small_object` 311.16 ns,
|
||||
`data_json_serialize_small_object` 162.52 ns.
|
||||
|
||||
## Verification already observed (StrictJson RFC 8259 decimals — `acd77ee`, on `main`)
|
||||
|
||||
- Added `ParseOptions{maximumDepth, allowDecimals = true}` and `double` variant
|
||||
alternative to `Void::Json::Strict` (`include/Void/Data/StrictJson.hpp`) for LSP
|
||||
messages while preserving exact `int64_t` integer semantics and `allowDecimals = false`
|
||||
opt-out (`tests/standalone/Data/StrictJson.cpp` 6/6 tests).
|
||||
- Verified in RelWithDebInfo `-Werror` (`49/49`, `ctest` 2/2) and Debug ASan+UBSan
|
||||
`-Werror` (`/tmp/void-strictjson-asan`, `49/49` in 7.0 ms, 0 leaks, 0 UB); pushed to
|
||||
`origin/main`.
|
||||
|
||||
## Verification already observed (Wave 6B — P2 Crypto, Security, Archive, Update)
|
||||
|
||||
- Wave 6B task specs (`8a1c15f`): added `M-CRYPTO-01-05.md`, `M-SECURITY-01-04.md`,
|
||||
`M-ARCHIVE-01-05.md`, and `M-UPDATE-01-06.md`.
|
||||
- `Crypto` & `CryptoAsync` (`eb42228`): `Crypto;CryptoAsync;Testing` (`/tmp/void-w6b-crypto`,
|
||||
`-Werror`, `-p openssl`, 10 modules) `Crypto*|crypto_*` 8/8 (`Crypto` 3,
|
||||
`CryptoHardening` 3, `CryptoAsync` 2); `ctest` 2/2 (`7.22 s`, including `CryptoOnly` &
|
||||
`CryptoAsyncOnly`).
|
||||
- `Security` & `SecurityAsync` (`713d2dc`): `Security;SecurityAsync;Testing`
|
||||
(`/tmp/void-w6b-security`, `-Werror`, `-p libsodium`, 10 modules) `Security*|security_*`
|
||||
14/14 (`720.7 ms`: `SecurityTests` 8, `SecurityHardening` 4, `SecurityAsync` 2);
|
||||
`ctest` 2/2 (`8.46 s`, including `SecurityOnly` & `SecurityAsyncOnly`).
|
||||
- `Archive` (`00d7478`): `Archive;Testing` (`/tmp/void-w6b-archive`, `-Werror`,
|
||||
`-p libarchive`, 7 modules) `Archive*|archive_*` 9/9 (`259.0 ms`: `Archive` 6,
|
||||
`ArchiveHardening` 3); `ctest` 2/2 (`5.76 s`, including `ArchiveOnly`).
|
||||
- `Update` (`47736cb`): `Update;Testing` (`/tmp/void-w6b-update`, `-Werror`,
|
||||
`-p libarchive -p openssl`, 12 modules) `Update*|update_*|component_feed_*|readable_component_*|version_store_*`
|
||||
25/25 (`1.91 s`: `Update` 22, `UpdateHardening` 3); `ctest` 2/2 (`10.64 s`, including
|
||||
`UpdateOnly`).
|
||||
- Full RelWithDebInfo + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w6b-full`, 41 modules,
|
||||
`47736cb`): `VoidTests` 1,406 tests — 1,403 passed, 3 intentional skips
|
||||
(`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed
|
||||
(`6.26 s`); `ctest` 2/2 passed (`VoidTests` 7.34 s, `VoidInstalledComponentConsumers`
|
||||
all 25 consumers incl. `CryptoOnly`, `CryptoAsyncOnly`, `SecurityOnly`,
|
||||
`SecurityAsyncOnly`, `ArchiveOnly`, `UpdateOnly`, `RelocatedFoundation`,
|
||||
`RelocatedExternal`, 40.73 s, total 48.07 s).
|
||||
- Full Debug ASan + UBSan + `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w6b-asan`, 41
|
||||
modules, `47736cb`): `VoidTests` 1,406 tests — 1,403 passed, 3 skipped, 0 failed
|
||||
(`21.78 s`), 0 ASan/LSan leaks, 0 UBSan errors.
|
||||
- Wave 6B Debug TSan subset (`CryptoAsync;SecurityAsync;Update;Testing`,
|
||||
`/tmp/void-w6b-tsan`, 20 modules, `47736cb`): 56/56 passed (`4.86 s`), 0 TSan data races.
|
||||
- `VoidFoundationBench` post-W6B (`rev=47736cb6ce2f`, `/tmp/void-w6b-full/post-w6b.json`):
|
||||
`harness_empty_loop` 0.38 ns, `core_uuid_parse_hyphenated` 24.52 ns,
|
||||
`core_uuid_to_string` 16.53 ns, `core_hash_fnv1a64_256b` 179.95 ns,
|
||||
`core_hash_murmur3_256b` 67.37 ns, `functional_result_ok_chain` 1.12 ns,
|
||||
`functional_error_with_context` 58.37 ns, `math_checked_add_loop` 0.47 ns,
|
||||
`containers_spsc_ring_push_pop` 8.76 ns, `containers_lru_get_put` 21.02 ns,
|
||||
`binary_reader_u64_be` 1.31 ns, `data_json_parse_small_object` 333.32 ns,
|
||||
`data_json_serialize_small_object` 165.99 ns.
|
||||
|
||||
## Ownership and next step
|
||||
|
||||
Waves 1–6B (`P0`, `P1`, `P2` Operations Foundations, `System`/`SystemAsync`/`IPC`, and
|
||||
`Crypto`/`CryptoAsync`/`Security`/`SecurityAsync`/`Archive`/`Update`) are complete and
|
||||
verified on `feat/roadmap-p2-wave6b`, ready to merge into `main`, push to `origin`, and
|
||||
proceed continuously to **Wave 7 (`Sqlite`, `SqliteAsync`, and NEW original `Storage`
|
||||
engine — `G-STORE` gate)**.
|
||||
@@ -0,0 +1,101 @@
|
||||
# Documentation delivery tasks
|
||||
|
||||
Baseline: `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`; approved 2026-11-24.
|
||||
These tasks author plans. Future feature task IDs inside those plans remain planned.
|
||||
|
||||
| ID | Deliverable | Owner | State | Dependencies |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| T-DOC-ROOT | Shared contracts, requirements, index, delivery, quality, migration and workflow records | Root | VERIFIED | All 54 roadmap files present; complete-package checks pass; independent reviews A/B READY |
|
||||
| T-DOC-101 | Foundation/data module and subsystem plans | sol_implementer | VERIFIED | 11 plans, 70 planned feature tasks; worker checks passed; review A READY after corrections |
|
||||
| T-DOC-102 | Runtime/system/service plans and reloadable platform | sol_implementer | VERIFIED | 11 plans, 59 planned feature tasks; worker checks passed; review B READY after corrections |
|
||||
| T-DOC-103 | Network/security/distributed plans | sol_implementer | VERIFIED | 12 plans, 73 planned feature tasks; worker checks passed; review B READY |
|
||||
| T-DOC-104 | Storage/operations/quality plans and networked platform | astra_implementer | VERIFIED | 10 plans, 66 planned feature tasks; worker checks passed; user-approved fallback; review B READY after corrections |
|
||||
| T-DOC-REVIEW-A | Fresh independent shared/foundation review | astra_reviewer | READY | All 21 documents reviewed; P2 dependency correction and current/proposed Update wording rechecked; no remaining actionable findings |
|
||||
| T-DOC-REVIEW-B | Fresh independent runtime/storage/network/platform review | astra_reviewer | READY | All 33 area plans reviewed; three P2 corrections and affected acceptance rows rechecked; no remaining actionable findings |
|
||||
|
||||
## Wave 1 — P0 Baseline Implementation (`feat/roadmap-p0-p1-foundations`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| X-BASE-01 | Controlled `VoidProcessHelper` replacing `/bin/echo`, `/bin/cat`, `seq` | [X-BASE-01](tasks/X-BASE-01.md) | VERIFIED | `Process`/`ProcessStream` 13/13; full `VoidTests` 1,249 passed, 3 skipped |
|
||||
| X-BASE-02 | Boost 1.84 FetchContent `SYSTEM` isolation for `-Werror` | [X-BASE-02](tasks/X-BASE-02.md) | VERIFIED | Full `-DVOID_WARNINGS_AS_ERRORS=ON` build exit 0; `VoidTests` 1,249 passed |
|
||||
| X-BASE-03 | `Log.hpp` in `LogState`, acyclic closures, `FunctionalCoreFormatting`, `-freflection` propagation, subset/relocated/static/embedded checks | [X-BASE-03](tasks/X-BASE-03.md) | VERIFIED | Full `ctest` 2/2 passed (`VoidTests` + relocated consumers), plus minimal, `System`-only, embedded, static passed |
|
||||
| X-BASE-04 | `cmake/Capabilities.cmake`, reflection/`expected`/sanitizer probes, `VOID_ENABLE_TSAN` | [X-BASE-04](tasks/X-BASE-04.md) | VERIFIED | ASan+UBSan+`-Werror` full `VoidTests` 1,249 passed (0 leaks/UB); TSan subset 389 passed |
|
||||
| X-BASE-05 | `benchmarks/FoundationBench.cpp` (`VOID_ENABLE_BENCHMARKS`) + `tests/corpus/README.md` | [X-BASE-05](tasks/X-BASE-05.md) | VERIFIED | RelWithDebInfo `-Werror` build passed; 12 workloads + harness JSON baseline validated |
|
||||
|
||||
## Wave 2 — P1 Foundations Gate 1 (`feat/roadmap-p0-p1-foundations`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| M-CORE-02, M-CORE-03 | Detached zero-alloc `Uuid`, `CheckedBits`, endian-portable `Hash`, `CoreOnly` consumer (`cbc9004`) | [M-CORE-02-03](tasks/M-CORE-02-03.md) | VERIFIED | `Uuid` 21/21, `Bits` 23/23, `Hash` 18/18 passed in full RelWithDebInfo & ASan+UBSan; `CoreOnly` consumer passed |
|
||||
| VoidTestScanner fix | Escape `[`/`]` in `cmake/VoidTestScanner.cmake` preventing dropped tests (`284d963`) | — | VERIFIED | Restored missing suites; full `VoidTests` discovers 1,310 tests |
|
||||
| M-FUNCTIONAL-02 | `ErrorKind`/`ErrorCode`, compact `Status`, bounded `Error` chains, `Adapters.hpp` (`7f3395c`) | [M-FUNCTIONAL-02](tasks/M-FUNCTIONAL-02.md) | VERIFIED | `ErrorStatus` 6/6 and `Result*` passed in full RelWithDebInfo & ASan+UBSan |
|
||||
| M-TIME-02 | `Clock.hpp` (`MonotonicClock`, `CivilClock`, `ManualClock`) & clock-injected bounded `Stopwatch` (`4227348`) | [M-TIME-02](tasks/M-TIME-02.md) | VERIFIED | `Clock` 6/6 and `Stopwatch` 14/14 passed in full RelWithDebInfo & ASan+UBSan |
|
||||
| S-MEMORY-02..04 | `Memory` subsystem (`Resource`, `BudgetResource`, `Arena`, `BlockPool`, `MemoryOnly`) (`4d48f2a`) | [S-MEMORY-02-04](tasks/S-MEMORY-02-04.md) | VERIFIED | `Arena` 3/3, `BlockPool` 2/2, `BudgetResource` 3/3 passed; isolated `MemoryOnly` & integrated consumers passed |
|
||||
| M-MATH-02 | Span-safe `parse_integer`/`parse_real`, `checked_cast`, `checked_mul_add`, portable overflow (`91e2beb`, `6cac781`) | [M-MATH-02](tasks/M-MATH-02.md) | VERIFIED | `Numeric` 35/35 passed in Debug `-Werror`, full RelWithDebInfo, & full Debug ASan+UBSan |
|
||||
|
||||
## Wave 3 — P1 Text, Containers, Binary, Data (`feat/roadmap-p0-p1-foundations`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| M-TEXT-02 | ASCII-explicit helpers in `Str.hpp` + `Bounded.hpp` (`883bbdc`) | [M-TEXT-02](tasks/M-TEXT-02.md) | VERIFIED | `Str` 25/25, `Bounded` 2/2 passed in `Text;Testing` `-Werror`, full RelWithDebInfo, & ASan+UBSan |
|
||||
| M-CONTAINERS-02, M-CONTAINERS-03 | Stationary `shared_ptr<State>` & bounded `ObjectPool`/`BufferPool` + Vyukov non-spinning `MpscRing` (`9ac76bb`) | [M-CONTAINERS-02-03](tasks/M-CONTAINERS-02-03.md) | VERIFIED | `Pool` 13/13, `BufferPoolTests` 8/8, `Ring` 15/15 passed in RelWithDebInfo, ASan+UBSan, & Debug TSan (`67/67`, 0 races) |
|
||||
| M-BINARY-02, M-BINARY-03 | `Budget.hpp`, `Writer.hpp`, `ByteBuffer.hpp`, upgraded `Reader.hpp`, expanded `Binary` consumer (`eacb8a4`) | [M-BINARY-02-03](tasks/M-BINARY-02-03.md) | VERIFIED | `Reader` 4/4, `Writer` 2/2, `ByteBuffer` 1/1 passed; `VoidInstalledComponentConsumers` (`Binary`, `RelocatedBinary`) passed |
|
||||
| M-DATA-02 | Exact `int64`/`uint64` JSON numbers, `number_as`, strict parser, exact `operator==`, `try_serialize`, SAX `on_int`/`on_uint`, exact reflection/config (`692f5ba`) | [M-DATA-02](tasks/M-DATA-02.md) | VERIFIED | `Json` 34/34, `Reflect` 14/14, `StrictJson` 3/3, `Update` 22/22, `Config` 12/12 passed in full RelWithDebInfo & ASan+UBSan |
|
||||
|
||||
## Wave 4A — P1 Algorithms, Unicode, Async (`feat/roadmap-p1-wave4a`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| S-ALGORITHMS-02 | `src/Algorithms/module.cmake`, `Graph.hpp` (`WorkLimits`, `IndexedGraphView`, `HasVersionStamp`, `AdjacencyView`, iterative `bfs`/`dfs`/`shortest_path_unweighted`/`topological_order` + cycle witness), `AlgorithmsOnly` consumer (`bfd6246`) | [S-ALGORITHMS-02](tasks/S-ALGORITHMS-02.md) | VERIFIED | `Graph` 4/4 and `AlgorithmsOnly` passed in `Algorithms;Testing`, full RelWithDebInfo (1,342 ✔), & ASan+UBSan (0 leaks/UB) |
|
||||
| S-UNICODE-01, S-UNICODE-02 | `src/Unicode/module.cmake`, `MANIFEST.md` (Unicode 17.0.0), `Utf.hpp` (`data_version`, `Scalar`, `UtfPolicy`, strict/one-unit-repair codecs, `_into` span transcoders, `Utf8StreamDecoder`/`Utf16StreamDecoder`), `UnicodeOnly` consumer (`4369fde`) | [S-UNICODE-01-02](tasks/S-UNICODE-01-02.md) | VERIFIED | `Utf` 4/4 and `UnicodeOnly` passed in `Unicode;Testing`, full RelWithDebInfo (1,342 ✔), & ASan+UBSan (0 leaks/UB) |
|
||||
| M-ASYNC-02, M-ASYNC-03 | `src/Async/module.cmake` (`INTERNAL_DEPS Functional Time LogState`), `Detail/Types.hpp`, `Operation.hpp` (`ResumeTicket`, `OperationState`), upgraded `Executor.hpp` (`try_post`, `post_completion`, bounded `ManualExecutor`, clock/stop `schedule_on`), `TaskScope.hpp` (`TaskScope`, `JoinHandle`, `DetachedOwner`) (`c75056f`) | [M-ASYNC-02-03](tasks/M-ASYNC-02-03.md) | VERIFIED | `OperationScope*|Executor*|Coro*` 28/28, Debug TSan 20/20 (0 races), full RelWithDebInfo (1,342 ✔), & ASan+UBSan (0 leaks/UB) |
|
||||
|
||||
## Wave 4B — P1 IO, Runtime, Testing (`feat/roadmap-p1-wave4b`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| S-IO-01, S-IO-02 | `src/IO/module.cmake` (`Core Functional Time Memory Async`), `Types.hpp`, `Detail/Backend.hpp`, `Stream.hpp`, `Driver.hpp`, `src/IO/EpollDriver.cpp` (mock + Linux level-triggered epoll, `(slot, generation)` tokens, `eventfd`, `BufferLease` PMR/quota, `MockController`, `read_exact`/`write_all`), `IOOnly` consumer (`673bb7e`) | [S-IO-01-02](tasks/S-IO-01-02.md) | VERIFIED | `IoDriver` 4/4, `IOOnly` & `ctest` 2/2 passed; Debug TSan `IoDriver` 4/4 (0 races), full RelWithDebInfo (1,356 ✔) & ASan+UBSan (0 leaks/UB) |
|
||||
| S-RUNTIME-01 | `CMakeLists.txt` explicit `void_add_module` keyword matching fix, `src/Runtime/module.cmake` (`Core Functional Time Memory Algorithms Async IO`), `Options.hpp`, `ResourceGraph.hpp`, `Host.hpp`, `RuntimeOnly` consumer (`1b3331e`) | [S-RUNTIME-01](tasks/S-RUNTIME-01.md) | VERIFIED | `RuntimeHost` 3/3, `RuntimeOnly` & `ctest` 2/2 passed (11-module closure); full RelWithDebInfo (1,356 ✔) & ASan+UBSan (0 leaks/UB) |
|
||||
| M-TESTING-02, M-TESTING-03 | `OwningJUnitReporter`, strict CLI/config validation (`--allow-empty`, `--selftest-child`), bounded assertion/failure capture, `Subprocess` POSIX runner, frozen v1 `DeterministicRng`/`ReplayToken`/`check_property` shrinker & `DeterministicRun` (`de8a981`) | [M-TESTING-02-03](tasks/M-TESTING-02-03.md) | VERIFIED | `Core;Testing` 14 ✔ / 2 ⊘ & `ctest` 2/2 passed; full RelWithDebInfo (1,356 ✔) & ASan+UBSan (0 leaks/UB) |
|
||||
|
||||
## Wave 5 — P2 Operations Foundations (`feat/roadmap-p2-wave5`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Wave 5 specs & P2 error domains | Per-task specs under `docs/agent-workflow/tasks/` and reserved P2 domain IDs (`kRuntimeErrorDomain = 11`, `kLogErrorDomain = 12`, `kStacktraceErrorDomain = 13`, `kObservabilityErrorDomain = 14`, `kResilienceErrorDomain = 15`) (`809b6f5`, fixed in `18a623a`) | — | VERIFIED | Integrated RelWithDebInfo & ASan+UBSan passed with zero domain collisions |
|
||||
| S-OBSERVABILITY-01..04 | `ObservabilityHooks` std-only `INTERFACE`, `Observability` (`Hooks`, `Context`, `AsyncContext`, thread-sharded `Metrics`, sampled/budgeted `Tracing`), `ObservabilityHooksOnly` & `ObservabilityOnly` consumers (`fe99051`) | [S-OBSERVABILITY-01-04](tasks/S-OBSERVABILITY-01-04.md) | VERIFIED | `Observability` 4/4, Debug TSan 4/4 (0 races), `ObservabilityHooksOnly`/`ObservabilityOnly` consumers, full RelWithDebInfo (1,375 ✔) & ASan+UBSan (0 leaks/UB) |
|
||||
| M-RESILIENCE-01..04 | `Resilience` (`Types`, `RateLimiter`, bounded cursor `KeyedRateLimiter`, generation-bound `Breaker`/`BreakerPermit`, overflow-safe `ResourceMonitor`/`ResourcePermit`) & `ResilienceAsync` (`AsyncPolicy` FIFO `Bulkhead`, `execute_resilient`), `ResilienceOnly` consumer (`18a623a`) | [M-RESILIENCE-01-04](tasks/M-RESILIENCE-01-04.md) | VERIFIED | Standalone 21/21 & `AsyncPolicy` 6/6, Debug TSan `ResilienceHardening`+`AsyncPolicy` 6/6 (0 races), `ResilienceOnly` consumer, full RelWithDebInfo (1,375 ✔) & ASan+UBSan |
|
||||
| M-LOG-01..05 | Hardened `LogState` (`SinkRegistration`, `detach_and_drain`, reentrancy cap 8), bounded `Logger` (`DeliveryLimits`, `LoggerOptions`, `try_submit`, `flush_through`, quarantine, `set_mode` barrier), redaction/escaping `Formatter`, `MultiLogger::try_add` cap 8 + cycle check, `FileLogger`/`RotatingFileLogger` `fsync`/`reopen`, separate `LogConfig`, `LogOnly` consumer (`a74a402`) | [M-LOG-01-05](tasks/M-LOG-01-05.md) | VERIFIED | `Log;Testing` 724 ✔ / 2 ⊘ & `LogConfig;Testing` 12/12, Debug TSan 36/36 (`Log*`, `AsyncLogger*`, `LogScopeSnapshot*`, `LogHardening*`), `LogOnly` consumer, full RelWithDebInfo & ASan+UBSan |
|
||||
| CMake test header check fix | Track `VOID_ACTIVE_PUBLIC_HEADERS` in `cmake/Module.cmake` so `tests/CMakeLists.txt` maps split `EXTRA_HEADERS` (e.g. `Void/Log/Log.hpp` -> `LogState`) accurately (`3d8dfb0`) | — | VERIFIED | `Stacktrace;Testing` discovers and passes `Stacktrace*` 4/4 without `Log`; full suite discovers all 1,378 tests |
|
||||
| M-STACKTRACE-01..04 | `src/Stacktrace/module.cmake` (`INTERNAL_DEPS Functional Time LogState`), split `capture()` (<=256 frames, zero log/source IO) & `Resolver` (1024-entry / 4 MiB cache, `invalidate_module`), `Capabilities`, checked `read_source_snippet_checked` (roots, symlink-escape & `..` rejection, overflow-safe `int64_t` math), `format_resolved_trace`, `write_fatal_signal_marker`, `tests/standalone/Stacktrace/Stacktrace.cpp` (`7b57b35`) | [M-STACKTRACE-01-04](tasks/M-STACKTRACE-01-04.md) | VERIFIED | `Stacktrace;Testing` `Stacktrace*` 4/4 (374.2ms), full RelWithDebInfo (1,375 ✔) & ASan+UBSan (0 leaks/UB) |
|
||||
|
||||
## Wave 6A — P2 System, SystemAsync, IPC (`feat/roadmap-p2-wave6a`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Wave 6A prep, error domains & helper modes | Reserved P2/P3 domain IDs (`kIpcErrorDomain = 16`..`kSqliteErrorDomain = 21`) in `Error.hpp`, thread-safe pipe `ENOTSOCK` fallback in `EpollDriver.cpp`, enabled `VoidProcessHelper` for `Void::System` OR `Void::IPC` with `ignore-sigterm`, `simultaneous-io`, `flood`, `long-line`, `check-fds`, `env-dump`, `cwd`, `ipc-pipe-echo`, task specs (`3f67b1e`) | — | VERIFIED | Compiled cleanly with `-Werror`; verified via Wave 6A `System`, `SystemAsync`, `IPC`, ASan+UBSan, and TSan suites |
|
||||
| M-SYSTEM-01..05 | Hardened `System` (`Types.hpp`, `Process.{hpp,cpp}`, `Path.hpp`, `Query.hpp`, `TempFile.hpp`, `TempDir.hpp`, `Metrics.hpp`), strict non-shell spawning + fd hygiene, pipe/arg limits, duplex `communicate()` & bounded escalation, `query_process` /proc validation, symlink-safe atomic `TempFile`/`TempDir`, `/bin/sh`-free `ProcessStream.cpp`, `SystemHardening.cpp`, `SystemOnly` consumer (`fcdbc06`) | [M-SYSTEM-01-05](tasks/M-SYSTEM-01-05.md) | VERIFIED | `System*` 53/53 (`226.6ms`), `ctest` 2/2 (`SystemOnly` `3.95s`), full RelWithDebInfo (`1,383 ✔`), ASan+UBSan (0 leaks/UB), TSan `16/16` (0 races) |
|
||||
| M-SYSTEM-06 | Split async `SystemAsync` (`INTERNAL_DEPS System Async IO Time Functional LogState`, `EXTRA_HEADERS` `AsyncProcess.hpp`/`AsyncWatcher.hpp`), `ProcessManager`, `ManagedChild`, async `communicate`/`wait`/`close_and_join`, `WatcherService`/`WatchSubscription`, `SystemAsync.cpp`, `SystemAsyncOnly` consumer (`9a3c5d8`) | [M-SYSTEM-01-05](tasks/M-SYSTEM-01-05.md) | VERIFIED | `SystemAsync*` 2/2 (`211.5ms`), `ctest` 2/2 (`SystemAsyncOnly` `9.43s`), full RelWithDebInfo (`1,383 ✔`), ASan+UBSan (0 leaks/UB), TSan `2/2` (0 races) |
|
||||
| S-IPC-01..03 | New `IPC` module (`src/IPC/module.cmake`, `Types.hpp`, `Codec.hpp`, `Transport.hpp`, `Session.hpp`, `IPC.hpp`), V1 `VDIP` 24B big-endian framing & pre-alloc `BufferQuota`/`QuotaPermit`, `LocalListener`/`connect_local` (`O_NOFOLLOW`, `0700`/`0600`, `flock`, `SO_PEERCRED` fail-closed), `adopt_pipe_pair`/`create_socket_pair_transports`, full-duplex `Session` with control lane/tombstones/token-bucket/graceful drain, `Ipc.cpp`, `IPCOnly` consumer (`39a48d5`) | [S-IPC-01-03](tasks/S-IPC-01-03.md) | VERIFIED | `Ipc*` 3/3 (`8.8ms`), `ctest` 2/2 (`IPCOnly` `12.20s`), full RelWithDebInfo (`1,383 ✔`), ASan+UBSan (0 leaks/UB), TSan `3/3` (0 races) |
|
||||
|
||||
## Out-of-band Priority Fix (`main`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| StrictJson decimals | RFC 8259 decimal numbers (`double` variant alternative + `ParseOptions::allowDecimals = true`) in `Void::Json::Strict` (`include/Void/Data/StrictJson.hpp`, `tests/standalone/Data/StrictJson.cpp`) (`acd77ee`) | — | VERIFIED | `StrictJson` 6/6 (`49/49` Data suite, `ctest` 2/2), Debug ASan+UBSan `49/49` (0 leaks/UB); pushed to `origin/main` |
|
||||
|
||||
## Wave 6B — P2 Crypto, Security, Archive, Update (`feat/roadmap-p2-wave6b`)
|
||||
|
||||
| ID | Deliverable | Spec | State | Verification summary |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| M-CRYPTO-01..05 | Hardened `Crypto` (OpenSSL 3.5.9 non-deprecated `EVP_MD`/`EVP_MAC`/`EVP_KDF`/`EVP_PKEY`, poisoned `Hasher`, 16 MiB Ed25519 cap, 4 KiB HKDF cap & overlap/wipe guards, `constant_time_equal`, `secure_wipe`, `kCryptoErrorDomain = 18`) + optional `CryptoAsync` (`hash_stream`, `AsyncFileHasher` 8/32/8 MiB budget, `close_and_join`), `CryptoOnly` & `CryptoAsyncOnly` consumers (`8a1c15f`, `eb42228`) | [M-CRYPTO-01-05](tasks/M-CRYPTO-01-05.md) | VERIFIED | `Crypto` 3 + `CryptoHardening` 3 + `CryptoAsync` 2 = 8/8, `ctest` 2/2 (`7.22s`), full RelWithDebInfo (`1,403 ✔`), ASan+UBSan (0 leaks/UB), TSan 8/8 (0 races) |
|
||||
| M-SECURITY-01..04 | Hardened `Security` (`kSecurityErrorDomain = 19`, `SecureBuffer` with lock policies & wipe counter, input caps, `parse_argon2id_cost`, `verify_password_budgeted`, `VSEC` v1 `xchacha20poly1305_ietf` `Envelope`/`SecretKeyRing` without legacy fallback, bounded default-deny `Authorization`) + `SecurityAsync` (`Authenticator`, `AccountSessionPort`, fail-closed `AuditSink`, `PasswordJobBudget`, `SessionPolicy`, dummy-hash parity, version CAS, `close_and_join`), `SecurityOnly` & `SecurityAsyncOnly` consumers (`713d2dc`) | [M-SECURITY-01-04](tasks/M-SECURITY-01-04.md) | VERIFIED | `SecurityTests` 8 + `SecurityHardening` 4 + `SecurityAsync` 2 = 14/14 (`720.7ms`), `ctest` 2/2 (`8.46s`), full RelWithDebInfo (`1,403 ✔`), ASan+UBSan (0 leaks/UB), TSan 14/14 (0 races) |
|
||||
| M-ARCHIVE-01..05 | Hardened `Archive` (`kArchiveErrorDomain = 17`, streaming `Reader` + forensic listing, file-as-parent conflict rejection, exclusive `0700` `StagedTree` + bottom-up `fsync` + Linux `SYS_renameat2(RENAME_NOREPLACE)` atomic `publish()` with `PublicationOutcome::Unknown`, `cleanup_stale_staging`, reproducible `O_NOFOLLOW` `create_archive`, isolated `VoidArchiveWorker` extraction with rlimits + RSS check + parent inventory verification), `ArchiveOnly` consumer (`00d7478`) | [M-ARCHIVE-01-05](tasks/M-ARCHIVE-01-05.md) | VERIFIED | `Archive` 6 + `ArchiveHardening` 3 = 9/9 (`259.0ms`), `ctest` 2/2 (`5.76s`), full RelWithDebInfo (`1,403 ✔`), ASan+UBSan (0 leaks/UB), TSan 9/9 (0 races) |
|
||||
| M-UPDATE-01..06 | Hardened `Update` (`kUpdateErrorDomain = 20`, schema-3 verify-before-payload-parse fix, `StrictJsonProfile` integer-only option, non-forgeable `VerifiedSelection`, `VersionStore::pruneWithPins`, atomic checksummed `ReplayFloorStore`, Ed25519 `TrustStore` rotation/revocation, `ArtifactTransport`, `LifecycleHooks`, checksummed `OperationJournal` halting with `RecoveryRequired`, `InstallCoordinator` with staged archive + `CleanupPending` + idempotent `reconcile`/`retry_cleanup`), `UpdateOnly` consumer (`47736cb`) | [M-UPDATE-01-06](tasks/M-UPDATE-01-06.md) | VERIFIED | `Update` 22 + `UpdateHardening` 3 = 25/25 (`1.91s`), `ctest` 2/2 (`10.64s`), full RelWithDebInfo (`1,403 ✔`), ASan+UBSan (0 leaks/UB), TSan 25/25 (0 races) |
|
||||
|
||||
All workers share the checkout and have disjoint file ownership defined in their
|
||||
persisted task specifications. Root owns all cross-cutting files and resolves contract
|
||||
changes. No worker owns application code, build files, existing docs/short-url.md, or Git
|
||||
operations. Configured roles use XHigh; runtime model identity is not independently
|
||||
verified by the available spawn response.
|
||||
@@ -0,0 +1,269 @@
|
||||
# Verification record
|
||||
|
||||
Repository baseline: `main`, `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
Date: 2026-11-24. Cwd for repository commands: `/home/faumaray/Projects/VoidLibrary`.
|
||||
|
||||
## Discovery baseline, before document authoring
|
||||
|
||||
| Check | Outcome |
|
||||
| --- | --- |
|
||||
| Git root/branch/HEAD/status | Correct repository and baseline; tracked tree clean; unrelated untracked files preserved |
|
||||
| Serena manual/project | Manual read; active VoidLibrary project confirmed |
|
||||
| Code graph identity/freshness/coverage | Exact repository project verified; cited paths checked; flagged ranges read directly; graph remains best-effort evidence |
|
||||
| Configure fresh full build | Passed with existing cached Boost source path |
|
||||
| Build with warnings-as-errors | Failed in Boost 1.84 headers due to GCC 16/C++26 deprecation diagnostics |
|
||||
| Ordinary full build | Passed, exit 0 |
|
||||
| CTest | Exit 8: VoidTests 1,245 passed, 2 failed, 3 skipped; installed consumers passed |
|
||||
| Two process-test failures | Explicit absent `/bin/echo` and `/bin/cat` paths; exit 127 matches inspected exec failure path |
|
||||
| Tracked diff after discovery | Empty |
|
||||
|
||||
Exact build/test commands and environmental prerequisites are in
|
||||
[VALIDATION.md](../roadmap/VALIDATION.md). Results were observed during the same
|
||||
conversation before authoring; they are not new-feature verification.
|
||||
|
||||
## Planning and delegation evidence
|
||||
|
||||
- T-DISC-001: architecture planner returned source-backed dependencies and opportunities;
|
||||
no file edits or tests by that worker.
|
||||
- T-DISC-002: researcher returned primary-source guidance for I/O, durability, consensus,
|
||||
and TLS; no runtime evidence claimed.
|
||||
- T-PLAN-003: fresh reviewer returned READY for the authoring contract. P3 wording about
|
||||
future examples/commands was corrected before execution.
|
||||
- Persisted T-DOC-101 through T-DOC-104 specifications passed the supplied task linter.
|
||||
Structural lint is not semantic approval; root reviewed ownership/contracts separately.
|
||||
- T-DOC-104's configured Sol model reported capacity exhaustion. The user approved the
|
||||
configured Astra implementer/XHigh fallback; the revised specification passed lint.
|
||||
- Model roles/efforts are configured; the spawn response does not independently attest
|
||||
the actual executing model identity.
|
||||
|
||||
## Documentation verification
|
||||
|
||||
Status: COMPLETE. Both independent review slices are READY after all four P2 findings
|
||||
were corrected and rechecked. Complete-package documentation checks pass. This verdict
|
||||
applies to planning quality, not implementation or release readiness.
|
||||
|
||||
| Authored packet | Worker-reported scoped checks | Integration status |
|
||||
| --- | --- | --- |
|
||||
| T-DOC-101 | 11 files, 70 unique planned tasks; source links, placeholders, fences/whitespace and scoped diff checks passed; 122 source/test/build paths received coverage checks and flagged ranges were read | Review A READY after focused corrections |
|
||||
| T-DOC-102 | 11 files, 59 planned tasks; source links, task DAG, status/fences/whitespace and scoped diff checks passed; 76 cited source paths checked with partial ranges read | Review B READY after focused corrections |
|
||||
| T-DOC-103 | 12 files, 73 planned tasks; source links, task DAG, placeholders/fences/whitespace and scoped diff checks passed; 38 source/document paths checked | Review B READY |
|
||||
| T-DOC-104 | 10 files, 66 planned tasks; 155 local links, whitespace/fences/placeholders and scoped diff checks passed; 106 scoped source paths checked and 13 partially parsed files read directly | Review B READY after focused corrections |
|
||||
|
||||
Root's read-only `/tmp/void-roadmap-check.py` currently checks expected coverage against
|
||||
the actual src module inventory, relative files/headings, task definitions/references and
|
||||
explicit dependency cycles, and required content signals. Partial runs at 45 and 47 of
|
||||
54 documents, followed by 51 and 53 of 54, reported only links/files still being authored;
|
||||
they were not final passes. Direct whitespace/fence/final-newline checks passed for the
|
||||
53 present roadmap documents, workflow Markdown and README. Graph coverage for those 53
|
||||
roadmap paths reported no recorded issue with matching metadata; source evidence still
|
||||
received separate exact-path coverage and direct reads. Root additionally checked 42
|
||||
source anchors in packet104, reading all five partial files' reported ranges.
|
||||
The script reads documentation only and does not change repository state. Its heuristic
|
||||
task graph does not replace semantic review of named cross-area gates.
|
||||
|
||||
`git diff --check` passed, and the scoped implementation/build/existing ShortUrl-document
|
||||
diff was empty. New untracked Markdown also requires direct checker/worker inspection;
|
||||
tracked Git diff alone does not cover it.
|
||||
|
||||
Root integration identified two ownership/wording issues: Storage checksum helpers belong
|
||||
to Storage rather than an undeclared Binary feature; replication recovery must follow the
|
||||
durably published CURRENT/generation pointer, never select an uncommitted newer manifest.
|
||||
These corrections are subject to the integrated review, not claims of runtime behavior.
|
||||
|
||||
Independent review A inspected the ten shared documents and eleven foundation plans and
|
||||
reported one P2 dependency contradiction. The root map allowed Algorithms to import
|
||||
Containers while the detailed plans required Containers→Algorithms; Math's vague container
|
||||
prerequisite could also close that cycle. Root split the map, prohibited those reverse
|
||||
imports, and made Algorithms' scalar arithmetic prerequisite explicitly M-MATH-02.
|
||||
ARCHITECTURE, DEPENDENCIES, Math and Algorithms now state the same direction. Review A
|
||||
rechecked the affected contracts and marked the original finding resolved.
|
||||
|
||||
Root also reconciled the finished Update plan with C-07 and Data's baseline wording.
|
||||
Direct inspection of Feed.cpp confirmed general Json use and schema-3 readable-document
|
||||
comparison before signature verification. The shared/Data plans now label verification-
|
||||
before-payload-parsing as future hardening and preserve legacy parsing separately from
|
||||
StrictJson. Coverage was checked for Feed.cpp/Feed.hpp and their flagged ranges were read.
|
||||
Review A independently verified these corrections against source and returned READY for
|
||||
its original 21-document slice, with no remaining actionable findings. Its final checker
|
||||
run passed at 54/54 files, 878 local links and 300 task definitions. Review B subsequently
|
||||
completed the remaining 33-area review and the root finalized integrated records/checks.
|
||||
|
||||
## Review B corrections
|
||||
|
||||
Review B inspected the remaining 33 plans and shared interfaces, returning three P2
|
||||
planning findings. Root corrected each boundary; focused independent recheck returned
|
||||
READY with every original finding resolved and no new actionable defect.
|
||||
|
||||
1. Async's first-stop-wins wording conflicted with Storage/Update committed outcomes.
|
||||
C-03 and Async now separate stop intent, domain-result classification and single
|
||||
delivery. IO preserves late successful/failed sync evidence rather than replacing it
|
||||
with timeout. Storage and fake-adapter acceptance cases cover stop before append,
|
||||
pending sync, success after stop and failure after stop.
|
||||
2. Runtime stopped execution resources before exporter flushing. Shutdown now separates
|
||||
business work from bounded cleanup/export scopes, joins exporters before their IO and
|
||||
workers stop, and retains those resources after an expired flush/shutdown budget.
|
||||
Runtime and the NetworkedApplications plan include the timed-out in-flight-export case.
|
||||
3. Storage's first durability milestone lacked its required manifest implementation.
|
||||
S-STORAGE-03 now owns minimal CURRENT/manifest bootstrap, WAL-segment publication and
|
||||
creation/rotation crash tests; S-STORAGE-04 extends it with tables/checkpoints. The
|
||||
filesystem fault harness is required from the first durability milestone.
|
||||
|
||||
These are document corrections, not implemented C++ repairs or observed runtime failures.
|
||||
After all corrections, the root documentation checker passed again: 54/54 documents,
|
||||
75,163 words, 878 local links and 300 planned task definitions. The amended review-B task
|
||||
specification passed structural lint, and `git diff --check` passed.
|
||||
Review B independently repeated the checker and affected-document/source-scope checks,
|
||||
confirmed the unchanged baseline and empty application/build diff, and accepted the
|
||||
previously reviewed 33-plan slice. Both review agents have been closed.
|
||||
|
||||
## Complete-package root checks
|
||||
|
||||
Root ran `python3 -B /tmp/void-roadmap-check.py` after all documents existed: PASS,
|
||||
54/54 files, 74,290 words, 878 local links, 300 planned feature task definitions.
|
||||
Coverage is 26 existing public modules, 15 new subsystems, three platforms and ten shared
|
||||
documents. `git diff --check` passed. All six persisted author/review task specifications
|
||||
passed `python3 -B /home/faumaray/.codex/astra-workflow/tools/tasklint.py` (structure only).
|
||||
The scoped diff over include/, src/, tests/, CMake/build/CI files and existing ShortUrl
|
||||
documentation was empty. These results precede review B's final disposition; affected
|
||||
checks will be repeated only if review corrections require it.
|
||||
|
||||
After the last author returned DONE, root's direct whitespace/fence/final-newline audit
|
||||
covered all 65 changed/new Markdown files (roadmap, workflow/specifications and README):
|
||||
zero issues. Git again reported branch main and the unchanged baseline HEAD; the scoped
|
||||
implementation diff remained empty. No staging, commit, push or deployment occurred.
|
||||
|
||||
All 54 roadmap paths received matching-metadata coverage checks. Packet104's final source
|
||||
anchor count is 49; the additional Json/Feed flagged ranges were read directly. Matching
|
||||
metadata does not prove graph completeness: the existing verifyEnvelope source function
|
||||
was not returned by the scoped symbol query, so its implementation was inspected directly.
|
||||
|
||||
## Unrun checks and limits
|
||||
|
||||
No C++ source or build-system modification is part of this delivery. Application tests
|
||||
are not rerun solely for Markdown authoring. Sanitizers, fuzzing, benchmarks, alternative
|
||||
platforms, NEW APIs, native storage and distributed scenarios remain unrun/planned.
|
||||
Written designs and proposed commands do not establish implementation or release readiness.
|
||||
|
||||
## Wave 1 / P0 Implementation Verification (2026-11-24)
|
||||
|
||||
Branch: `feat/roadmap-p0-p1-foundations`. Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2.
|
||||
|
||||
| Task | Command & scope | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| X-BASE-01 | `/tmp/void-p0-base/tests/VoidTests --filter "Process*"` and full `/tmp/void-p0-base/tests/VoidTests` | `Process`+`ProcessStream` 13/13 passed; full `VoidTests` 1,249 passed, 3 intentional skips, 0 failed (`340acae`) |
|
||||
| X-BASE-02 | Full RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` build & `VoidTests` in `/tmp/void-p0-werror` | Exit 0 (all 691 Ninja targets clean); `VoidTests` 1,249 passed, 3 skipped, 0 failed (`e385746`) |
|
||||
| X-BASE-03 | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium -c ctest --test-dir /tmp/void-p0-closures --output-on-failure --timeout 120` | 2/2 passed: `VoidTests` + `VoidInstalledComponentConsumers` (`Binary`, `Foundation`, `Audited`, `External`, `RelocatedFoundation`, `RelocatedExternal`) (`cd6fc7e`) |
|
||||
| X-BASE-03 | Minimal (`Time;Math;Text;Binary;Functional;FunctionalCoreFormatting;Testing`), `System;Testing`, `tests/package/Embedded`, static (`BUILD_SHARED_LIBS=OFF`) | All 4 passed; `System` without `Log` installs `include/Void/Log/Log.hpp` and passes `Process*` |
|
||||
| X-BASE-04 | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium -c bash -lc 'ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-p0-asan/tests/VoidTests'` | 1,249 passed, 3 skipped, 0 failed, 0 ASan/UBSan/LSan errors (`c64fa93`) |
|
||||
| X-BASE-04 | `dev cpp-gcc -c /tmp/void-p0-tsan/tests/VoidTests` (`Async;Time;Core;Functional;Testing`, Debug, `-DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`) | Capabilities: `reflection=yes, expected=yes, sanitizers=TSan`; 389 passed, 2 skipped, 0 failed, 0 TSan races |
|
||||
| X-BASE-05 | `dev cpp-gcc -c /tmp/void-p0-bench/benchmarks/VoidFoundationBench --json /tmp/void-p0-bench/baseline.json` (RelWithDebInfo, `-DVOID_WARNINGS_AS_ERRORS=ON`, 5 warmup, 20 reps, 10k ops/rep) | Exit 0; JSON schema_version 1 validated. Key baselines: `harness_empty_loop` 0.38ns, `core_uuid_parse_hyphenated` 88.76ns, `core_uuid_to_string` 498.11ns, `data_json_parse_small_object` 295.46ns |
|
||||
|
||||
## Wave 2 / P1 Foundations Gate 1 Verification (2026-11-24)
|
||||
|
||||
Branch: `feat/roadmap-p0-p1-foundations`. Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2.
|
||||
|
||||
| Scope | Command & configuration | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| M-CORE-02..03 (`cbc9004`) | `Core` standalone + `CoreOnly` installed consumer (`tests/package/CoreOnly`) | `ctest --test-dir /tmp/void-p1-core` 2/2 passed; `Core`-only install contains no `include/Void/Math` and links cleanly |
|
||||
| Scanner fix (`284d963`) | `/tmp/void-p1-scanner-check/tests/VoidTests --filter "^(Sources\|Watch\|Json\|Pattern)\."` | 52/52 passed (`Sources` 7, `Watch` 3, `Json` 30, `Pattern` 12) |
|
||||
| M-FUNCTIONAL-02 (`7f3395c`) | `/tmp/void-p1-functional/tests/VoidTests --filter "ErrorStatus*\|Result*"` & `ctest` | 21/21 passed; `ctest` 2/2 passed |
|
||||
| M-TIME-02 (`4227348`) | `/tmp/void-p1-time/tests/VoidTests --filter "Clock*\|Stopwatch*\|Time*\|Bench*"` & `ctest` | 48/48 passed; `ctest` 2/2 passed |
|
||||
| S-MEMORY-02..04 (`4d48f2a`) | `Memory;Testing` (`-DVOID_WARNINGS_AS_ERRORS=ON`) & isolated `-DVOID_ENABLED_MODULES=Memory` consumer `/tmp/void-p1-memory-only-consumer/void_memory_only_consumer` | `VoidTests --filter "Budget*\|Arena*\|BlockPool*"` 8/8 (`Arena` 3, `BlockPool` 2, `BudgetResource` 3); `ctest` 2/2; `void_memory_only_consumer` exit 0 |
|
||||
| M-MATH-02 (`91e2beb`, `6cac781`) | Debug `Math;Testing` `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-p1-math/tests/VoidTests --filter "Numeric*"` & `ctest` | `Numeric` 35/35 passed; `ctest` 2/2 passed |
|
||||
| Full Integrated RelWithDebInfo (`6cac781`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` full build (`-DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_BENCHMARKS=ON`), `/tmp/void-p1-full/tests/VoidTests`, `ctest --test-dir /tmp/void-p1-full --output-on-failure --timeout 180` | `VoidTests`: 1,310 tests — 1,307 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (3.72s); `ctest`: 2/2 passed (`VoidTests` 3.81s + `VoidInstalledComponentConsumers` 11.95s, total 15.75s) |
|
||||
| Full Integrated ASan+UBSan (`6cac781`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug (`-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-p1-asan/tests/VoidTests` | 1,310 tests — 1,307 passed, 3 skipped, 0 failed (10.70s), 0 leaks, 0 UB |
|
||||
| Post-P1 Benchmark (`6cac781`) | `/tmp/void-p1-full/benchmarks/VoidFoundationBench --json /tmp/void-p1-full/post-p1.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.20ns, `core_uuid_parse_hyphenated` 25.26ns, `core_uuid_to_string` 16.73ns, `core_hash_fnv1a64_256b` 183.64ns, `core_hash_murmur3_256b` 68.66ns, `functional_result_ok_chain` 1.14ns, `functional_error_with_context` 59.07ns, `math_checked_add_loop` 0.47ns, `containers_spsc_ring_push_pop` 8.51ns, `containers_lru_get_put` 22.29ns, `binary_reader_u64_be` 1.32ns, `data_json_parse_small_object` 290.64ns, `data_json_serialize_small_object` 174.92ns |
|
||||
|
||||
## Wave 3 / P1 Text, Containers, Binary, Data Verification (2026-11-24)
|
||||
|
||||
Branch: `feat/roadmap-p0-p1-foundations`. Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2.
|
||||
|
||||
| Scope | Command & configuration | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| M-TEXT-02 (`883bbdc`) | `dev cpp-gcc -c` RelWithDebInfo `Text;Testing` `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-p1-text/tests/VoidTests --filter "Str*\|Bounded*"` & `ctest` | 50/50 passed (`Str` 25, `Bounded` 2, plus active dependencies); `ctest` 2/2 passed |
|
||||
| M-CONTAINERS-02..03 (`9ac76bb`) | `Containers;Testing` RelWithDebInfo `-Werror` `/tmp/void-p1-containers` & Debug TSan `/tmp/void-p1-containers-tsan` | RelWithDebInfo `Pool*\|BufferPool*\|Ring*` 38/38 & `ctest` 2/2 passed; Debug TSan `Ring*` 15/15 passed (0 races) |
|
||||
| M-BINARY-02..03 (`eacb8a4`) | `Binary;Testing` RelWithDebInfo `-Werror` `/tmp/void-p1-binary` & `ctest` | `Reader*\|Writer*\|ByteBuffer*` 7/7 passed (`Reader` 4, `Writer` 2, `ByteBuffer` 1); `ctest` 2/2 passed (including expanded `Binary` & `RelocatedBinary` consumers) |
|
||||
| M-DATA-02 (`692f5ba`) | `dev cpp-gcc -p openssl` RelWithDebInfo `Data;Update;Configuration;Testing` `-Werror` `/tmp/void-p1-data/tests/VoidTests` | Filtered `Json*\|StrictJson*\|Reflect*\|Update*\|Config*` 119/119 passed; full active suite 804 tests: 802 passed, 2 skipped, 0 failed |
|
||||
| Full Integrated RelWithDebInfo (`692f5ba`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` full build (`-DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_BENCHMARKS=ON`), `/tmp/void-w3-full/tests/VoidTests`, `ctest --test-dir /tmp/void-w3-full --output-on-failure --timeout 180` | `VoidTests`: 1,332 tests — 1,329 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (3.83s); `ctest`: 2/2 passed (`VoidTests` 3.81s + `VoidInstalledComponentConsumers` 12.38s, total 16.20s) |
|
||||
| Full Integrated ASan+UBSan (`692f5ba`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug (`-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-w3-asan/tests/VoidTests` | 1,332 tests — 1,329 passed, 3 skipped, 0 failed (10.83s), 0 leaks, 0 UB |
|
||||
| Wave 3 TSan Subset (`692f5ba`) | `dev cpp-gcc -c` Debug (`Containers;Async;Time;Testing`, `-DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `/tmp/void-w3-tsan/tests/VoidTests --filter "Ring*\|Pool*\|BufferPool*\|Clock*\|Stopwatch*"` | 67/67 passed (69.8ms), 0 TSan races (`ThreadPool` 7, `ThreadPoolBackpressure` 2, `BufferPoolTests` 8, `Pool` 13, `Ring` 15, `BlockPool` 2, `Clock` 6, `Stopwatch` 14) |
|
||||
| Post-W3 Benchmark (`692f5ba`) | `/tmp/void-w3-full/benchmarks/VoidFoundationBench --json /tmp/void-w3-full/post-w3.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.39ns, `core_uuid_parse_hyphenated` 24.94ns, `core_uuid_to_string` 16.88ns, `core_hash_fnv1a64_256b` 181.90ns, `core_hash_murmur3_256b` 68.26ns, `functional_result_ok_chain` 1.13ns, `functional_error_with_context` 58.86ns, `math_checked_add_loop` 0.47ns, `containers_spsc_ring_push_pop` 8.85ns, `containers_lru_get_put` 20.59ns, `binary_reader_u64_be` 1.31ns, `data_json_parse_small_object` 325.73ns, `data_json_serialize_small_object` 164.76ns |
|
||||
|
||||
## Wave 4A / P1 Algorithms, Unicode, Async Verification (2026-11-24)
|
||||
|
||||
Branch: `feat/roadmap-p1-wave4a` (branched from `main` at `5754a7f`). Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2.
|
||||
|
||||
| Scope | Command & configuration | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| S-ALGORITHMS-02 (`bfd6246`) | `Algorithms;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w4a-alg` (`VoidTests --filter "Graph*"` & `ctest`) | `Graph` 4/4 passed (64.2ms); `ctest` 2/2 passed (`VoidTests` 0.17s, `VoidInstalledComponentConsumers` including `AlgorithmsOnly` 2.55s) |
|
||||
| S-UNICODE-01..02 (`4369fde`) | `Unicode;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w4a-unicode` (`VoidTests --filter "Utf*"` & `ctest`) | `Utf` 4/4 passed (0.3ms); `ctest` 2/2 passed (`VoidTests` 0.11s, `VoidInstalledComponentConsumers` including `UnicodeOnly` 2.25s) |
|
||||
| M-ASYNC-02..03 (`c75056f`) | `Async;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w4a-async` & Debug TSan `/tmp/void-w4a-async-tsan` | RelWithDebInfo `OperationScope*\|Executor*\|Coro*` 28/28 (4.1ms) & `ctest` 2/2 (2.74s); Debug TSan `OperationScope*\|Executor*\|ThreadPool*` 20/20 passed (34.6ms, 0 races) |
|
||||
| Full Integrated RelWithDebInfo (`c75056f`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` full build (`-DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_BENCHMARKS=ON`), `/tmp/void-w4a-full/tests/VoidTests`, `ctest --test-dir /tmp/void-w4a-full --output-on-failure --timeout 180` | 31 active modules; `VoidTests`: 1,345 tests — 1,342 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (3.75s); `ctest`: 2/2 passed (`VoidTests` 3.77s + `VoidInstalledComponentConsumers` 14.45s, total 18.21s) |
|
||||
| Full Integrated ASan+UBSan (`c75056f`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug (`-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-w4a-asan/tests/VoidTests` | 1,345 tests — 1,342 passed, 3 skipped, 0 failed (11.00s), 0 leaks, 0 UB |
|
||||
| Post-W4A Benchmark (`c75056f`) | `/tmp/void-w4a-full/benchmarks/VoidFoundationBench --json /tmp/void-w4a-full/post-w4a.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.39ns, `core_uuid_parse_hyphenated` 25.48ns, `core_uuid_to_string` 17.09ns, `core_hash_fnv1a64_256b` 185.25ns, `core_hash_murmur3_256b` 69.37ns, `functional_result_ok_chain` 1.15ns, `functional_error_with_context` 59.77ns, `math_checked_add_loop` 0.48ns, `containers_spsc_ring_push_pop` 9.16ns, `containers_lru_get_put` 21.81ns, `binary_reader_u64_be` 1.36ns, `data_json_parse_small_object` 319.83ns, `data_json_serialize_small_object` 168.13ns |
|
||||
|
||||
## Wave 4B / P1 IO, Runtime, Testing Verification (2026-11-24)
|
||||
|
||||
Branch: `feat/roadmap-p1-wave4b` (branched from `main` at `2e5d1ef`). Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2.
|
||||
|
||||
| Scope | Command & configuration | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| S-IO-01..02 (`673bb7e`) | `IO` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w4b-io` (`VoidTests --filter "IoDriver*"`, `ctest`) & Debug TSan `/tmp/void-w4b-io-tsan` | `IoDriver` 4/4 passed (7.5ms); `ctest` 2/2 passed (`VoidTests` 1.50s, `VoidInstalledComponentConsumers` including `IOOnly` 6.08s); Debug TSan `IoDriver` 4/4 passed (12.8ms, 0 races) |
|
||||
| S-RUNTIME-01 (`1b3331e`) | `Runtime` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w4b-runtime` (`VoidTests --filter "RuntimeHost*"`, `ctest`, 11 modules) | `RuntimeHost` 3/3 passed (0.5ms); `ctest` 2/2 passed (`VoidTests` 1.54s, `VoidInstalledComponentConsumers` including `RuntimeOnly` 8.01s) |
|
||||
| M-TESTING-02..03 (`de8a981`) | `Core;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w4b-testing` (`VoidTests --filter "FrameworkHardening*\|Deterministic*\|Math*\|ContainerFixture*\|StructRepr*"`, `ctest`) | 16 tests: 14 passed, 2 intentional skips (`broken_feature`, `unquoted_skip`), 0 failed (301.1ms); `ctest` 2/2 passed (2.82s) |
|
||||
| Full Integrated RelWithDebInfo (`de8a981`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` full build (`/tmp/void-w4b-full`, `-DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_BENCHMARKS=ON`), `VoidTests`, `ctest` | 33 active modules; `VoidTests`: 1,359 tests — 1,356 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (5.08s); `ctest`: 2/2 passed (`VoidTests` 4.50s + `VoidInstalledComponentConsumers` 19.77s, total 24.27s) |
|
||||
| Full Integrated ASan+UBSan (`de8a981`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug (`/tmp/void-w4b-asan`, `-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-w4b-asan/tests/VoidTests` | 33 active modules; `VoidTests`: 1,359 tests — 1,356 passed, 3 skipped, 0 failed (14.87s), 0 leaks, 0 UB |
|
||||
| Wave 4B TSan Subset (`de8a981`) | `dev cpp-gcc -c` Debug (`IO;Async;Containers;Time;Testing`, `/tmp/void-w4b-tsan`, `-DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `/tmp/void-w4b-tsan/tests/VoidTests --filter "Io*\|OperationScope*\|Executor*\|Ring*\|Pool*\|Clock*"` | 9 active modules; 80/80 passed (60.7ms), 0 TSan data races |
|
||||
| Post-W4B Benchmark (`de8a981`, `rev=de8a981893d8`) | `VoidFoundationBench` in `/tmp/void-w4b-full` (`post-w4b.json`) | Medians: `harness_empty_loop` 0.39ns, `core_uuid_parse_hyphenated` 25.28ns, `core_uuid_to_string` 16.94ns, `core_hash_fnv1a64_256b` 184.30ns, `core_hash_murmur3_256b` 69.63ns, `functional_result_ok_chain` 1.16ns, `functional_error_with_context` 60.17ns, `math_checked_add_loop` 0.48ns, `containers_spsc_ring_push_pop` 9.06ns, `containers_lru_get_put` 21.30ns, `binary_reader_u64_be` 1.35ns, `data_json_parse_small_object` 316.78ns, `data_json_serialize_small_object` 168.16ns |
|
||||
|
||||
## Wave 5 / P2 Operations Foundations Verification (2026-11-24)
|
||||
|
||||
Branch: `feat/roadmap-p2-wave5` (branched from `main` at `1e901ce`, which was pushed to `origin/main`). Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2.
|
||||
|
||||
| Scope | Command & configuration | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| S-OBSERVABILITY-01..04 (`fe99051`) | `Observability;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w5-obs` (`VoidTests --filter "Observability*"`, `ctest`) | `Observability` 4/4 passed (12.1ms); `ctest` 2/2 passed (`VoidTests` 0.41s, `VoidInstalledComponentConsumers` including `ObservabilityHooksOnly` & `ObservabilityOnly` 6.62s, total 7.03s) |
|
||||
| M-RESILIENCE-01..04 (`18a623a`) | `Resilience;Testing` (`/tmp/void-w5-resilience`) & `ResilienceAsync;Testing` (`/tmp/void-w5-resilience-async`) RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` | `Resilience` `CircuitBreaker*\|RateLimiter*\|KeyedRateLimiter*\|ResourceMonitor*\|ResilienceHardening*` 21/21 (2.8ms) & `ctest` 2/2 (`5.99s` including `ResilienceOnly`); `ResilienceAsync` `AsyncPolicy*\|ResilienceHardening*` 6/6 (1.3ms) |
|
||||
| M-LOG-01..05 (`a74a402`) | `Log;Testing` (`/tmp/void-w5-log`, 10 modules) & `LogConfig;Testing` (`/tmp/void-w5-logconfig`, 13 modules) RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` | `Log;Testing` `VoidTests`: 726 tests — 724 passed, 2 intentional skips (`broken_feature`, `unquoted_skip`), 0 failed (799.2ms) & `ctest` 2/2 (8.09s including `LogOnly` 7.15s); `LogConfig;Testing` `LogHardening*\|FromConfig*` 12/12 (28.9ms) |
|
||||
| M-STACKTRACE-01..04 & CMake fix (`3d8dfb0`, `7b57b35`) | `Stacktrace;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` (`/tmp/void-w5-stacktrace`, 6 active modules, Boost cached) | `Stacktrace*` 4/4 passed (374.2ms); `Log` not required thanks to `VOID_ACTIVE_PUBLIC_HEADERS` mapping |
|
||||
| Full Integrated RelWithDebInfo (`7b57b35`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` full build (`/tmp/void-w5-full`, 37 modules, `-DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_BENCHMARKS=ON`), `/tmp/void-w5-full/tests/VoidTests`, `ctest --test-dir /tmp/void-w5-full --output-on-failure --timeout 180` | `VoidTests`: 1,378 tests — 1,375 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (7.49s); `ctest`: 2/2 passed (`VoidTests` 8.09s + `VoidInstalledComponentConsumers` all 16 consumers 66.12s, total 74.22s) |
|
||||
| Full Integrated ASan+UBSan (`7b57b35`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug (`/tmp/void-w5-asan`, 37 modules, `-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-w5-asan/tests/VoidTests` | Initial run hit 1 timing assertion in unrelated existing `internal_fsm_service_hot_reload_under_load` (`FsmServiceHotReload.cpp:119`, 0 leaks/UB); full re-run on same binary passed 1,378 tests — 1,375 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (50.16s), 0 ASan/LSan leaks, 0 UBSan errors |
|
||||
| Wave 5 TSan Subset (`7b57b35`) | `dev cpp-gcc -c` Debug (`Observability;ResilienceAsync;Log;IO;Async;Time;Testing`, `/tmp/void-w5-tsan`, 15 modules, `-DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `/tmp/void-w5-tsan/tests/VoidTests --filter "Observability*\|ResilienceHardening*\|AsyncPolicy*\|Log*\|AsyncLogger*\|LogScopeSnapshot*\|Io*\|OperationScope*"` | 68/68 passed (7.01s, including `AsyncLogger::async_multi_producer_no_loss` 6.53s, `Observability` 4/4, `ResilienceHardening` 4/4, `AsyncPolicy` 2/2, `Log` 12/12, `LogHardening` 4/4, `LogScopeSnapshot` 3/3, `IoDriver` 4/4, `OperationScope` 5/5), 0 TSan data races |
|
||||
| Post-W5 Benchmark (`7b57b35`, `rev=7b57b355cd75`) | `/tmp/void-w5-full/benchmarks/VoidFoundationBench --json /tmp/void-w5-full/post-w5.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.75ns, `core_uuid_parse_hyphenated` 43.49ns, `core_uuid_to_string` 32.51ns, `core_hash_fnv1a64_256b` 213.37ns, `core_hash_murmur3_256b` 92.34ns, `functional_result_ok_chain` 1.65ns, `functional_error_with_context` 94.82ns, `math_checked_add_loop` 0.86ns, `containers_spsc_ring_push_pop` 10.76ns, `containers_lru_get_put` 31.99ns, `binary_reader_u64_be` 2.24ns, `data_json_parse_small_object` 576.81ns, `data_json_serialize_small_object` 284.87ns |
|
||||
|
||||
## Wave 6A / P2 System, SystemAsync, IPC Verification (2026-11-24)
|
||||
|
||||
Branch: `feat/roadmap-p2-wave6a` (branched from `main` at `4479960`, which was pushed to `origin/main`). Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2.
|
||||
|
||||
| Scope | Command & configuration | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| M-SYSTEM-01..05 (`3f67b1e`, `fcdbc06`) | `System;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w6a-system` (`VoidTests --filter "System*"`, `ctest`) | `System*` 53/53 passed (226.6ms); `ctest` 2/2 passed (`VoidTests` 0.57s, `VoidInstalledComponentConsumers` including `SystemOnly` 3.95s) |
|
||||
| M-SYSTEM-06 (`9a3c5d8`) | `SystemAsync;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w6a-sysasync` (`VoidTests --filter "SystemAsync*"`, `ctest`) | `SystemAsync*` 2/2 passed (211.5ms); `ctest` 2/2 passed (`VoidTests` 1.15s, `VoidInstalledComponentConsumers` including `SystemAsyncOnly` 9.43s) |
|
||||
| S-IPC-01..03 (`39a48d5`) | `IPC;Testing` RelWithDebInfo `-DVOID_WARNINGS_AS_ERRORS=ON` `/tmp/void-w6a-ipc` (`VoidTests --filter "Ipc*"`, `ctest`) | `Ipc*` 3/3 passed (8.8ms); `ctest` 2/2 passed (`VoidTests` 0.49s, `VoidInstalledComponentConsumers` including `IPCOnly` 12.20s, total 12.70s) |
|
||||
| Full Integrated RelWithDebInfo (`39a48d5`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` full build (`/tmp/void-w6a-full`, 39 modules, `-DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_BENCHMARKS=ON`), `/tmp/void-w6a-full/tests/VoidTests`, `ctest --test-dir /tmp/void-w6a-full --output-on-failure --timeout 300` | `VoidTests`: 1,386 tests — 1,383 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (4.68s); `ctest`: 2/2 passed (`VoidTests` 4.58s + `VoidInstalledComponentConsumers` 31.05s across 19 consumer runs incl. `SystemOnly`, `SystemAsyncOnly`, `IPCOnly`, `RelocatedFoundation`, `RelocatedExternal`, total 35.63s) |
|
||||
| Full Integrated ASan+UBSan (`39a48d5`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug (`/tmp/void-w6a-asan`, 39 modules, `-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `/tmp/void-w6a-asan/tests/VoidTests` | 1,386 tests — 1,383 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (19.34s), 0 ASan/LSan leaks, 0 UBSan errors |
|
||||
| Wave 6A TSan Subset (`39a48d5`) | `dev cpp-gcc -c` Debug (`SystemAsync;IPC;IO;Async;Resilience;Testing`, `/tmp/void-w6a-tsan`, 14 modules, `-DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `/tmp/void-w6a-tsan/tests/VoidTests --filter "Process*\|SystemHardening*\|SystemAsync*\|Ipc*\|FileWatcher*\|IoDriver*\|OperationScope*"` | 35/35 passed (609.4ms: `OperationScope` 5, `IoDriver` 4, `Ipc` 3, `FileWatcher` 5, `Process` 10, `ProcessStream` 3, `SystemHardening` 3, `SystemAsync` 2), 0 TSan data races |
|
||||
| Post-W6A Benchmark (`39a48d5`, `rev=39a48d5c0a72`) | `/tmp/void-w6a-full/benchmarks/VoidFoundationBench --json /tmp/void-w6a-full/post-w6a.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.38ns, `core_uuid_parse_hyphenated` 24.92ns, `core_uuid_to_string` 17.45ns, `core_hash_fnv1a64_256b` 181.41ns, `core_hash_murmur3_256b` 67.93ns, `functional_result_ok_chain` 1.13ns, `functional_error_with_context` 58.77ns, `math_checked_add_loop` 0.47ns, `containers_spsc_ring_push_pop` 8.80ns, `containers_lru_get_put` 20.61ns, `binary_reader_u64_be` 1.31ns, `data_json_parse_small_object` 311.16ns, `data_json_serialize_small_object` 162.52ns |
|
||||
|
||||
## StrictJson RFC 8259 Decimal Verification (2026-11-25)
|
||||
|
||||
Branch: `main` (`acd77ee`, pushed to `origin/main`). Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2.
|
||||
|
||||
| Scope | Command & configuration | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| StrictJson decimals (`acd77ee`) | RelWithDebInfo `-Werror` Data suite & `ctest`, plus Debug ASan+UBSan `-Werror` (`/tmp/void-strictjson-asan`) | RelWithDebInfo: `49/49` (`StrictJson` 6/6), `ctest` 2/2 passed; Debug ASan+UBSan: `49/49` (7.0ms), 0 leaks, 0 UB |
|
||||
|
||||
## Wave 6B / P2 Crypto, Security, Archive, Update Verification (2026-11-25)
|
||||
|
||||
Branch: `feat/roadmap-p2-wave6b` (branched from `main` at `acd77ee`). Toolchain via `dev cpp-gcc`: GCC 16.2.0, CMake 4.4.4, Ninja 1.13.2, OpenSSL 3.5.9, libsodium 1.0.22, libarchive 3.8.10, SQLite 3.54.0.
|
||||
|
||||
| Scope | Command & configuration | Observed outcome |
|
||||
| --- | --- | --- |
|
||||
| M-CRYPTO-01..05 (`8a1c15f`, `eb42228`) | `Crypto;CryptoAsync;Testing` RelWithDebInfo `-Werror` `-p openssl` `/tmp/void-w6b-crypto` (10 modules, `VoidTests`, `ctest`) | `CryptoHardening` 3 + `CryptoAsync` 2 (+ `Crypto` 3) passed; `ctest` 2/2 passed (`7.22s`, incl. `CryptoOnly` & `CryptoAsyncOnly`) |
|
||||
| M-SECURITY-01..04 (`713d2dc`) | `Security;SecurityAsync;Testing` RelWithDebInfo `-Werror` `-p libsodium` `/tmp/void-w6b-security` (10 modules, `VoidTests`, `ctest`) | `Security*\|security_*` 14/14 passed (`720.7ms`: `SecurityTests` 8, `SecurityHardening` 4, `SecurityAsync` 2); `ctest` 2/2 passed (`8.46s`, incl. `SecurityOnly` & `SecurityAsyncOnly`) |
|
||||
| M-ARCHIVE-01..05 (`00d7478`) | `Archive;Testing` RelWithDebInfo `-Werror` `-p libarchive` `/tmp/void-w6b-archive` (7 modules, `VoidTests`, `ctest`) | `Archive*\|archive_*` 9/9 passed (`259.0ms`: `Archive` 6, `ArchiveHardening` 3); `ctest` 2/2 passed (`5.76s`, incl. `ArchiveOnly`) |
|
||||
| M-UPDATE-01..06 (`47736cb`) | `Update;Testing` RelWithDebInfo `-Werror` `-p libarchive -p openssl` `/tmp/void-w6b-update` (12 modules, `VoidTests`, `ctest`) | `Update*\|update_*\|component_feed_*\|readable_component_*\|version_store_*` 25/25 passed (`1.91s`: `Update` 22, `UpdateHardening` 3); `ctest` 2/2 passed (`10.64s`, incl. `UpdateOnly`) |
|
||||
| Full Integrated RelWithDebInfo (`47736cb`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` full build (`/tmp/void-w6b-full`, 41 modules, `-DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_BENCHMARKS=ON`), `/tmp/void-w6b-full/tests/VoidTests`, `ctest --test-dir /tmp/void-w6b-full --output-on-failure --timeout 300` | `VoidTests`: 1,406 tests — 1,403 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (`6.26s`); `ctest`: 2/2 passed (`VoidTests` 7.34s + `VoidInstalledComponentConsumers` 40.73s across 25 consumer runs incl. `CryptoOnly`, `CryptoAsyncOnly`, `SecurityOnly`, `SecurityAsyncOnly`, `ArchiveOnly`, `UpdateOnly`, `RelocatedFoundation`, `RelocatedExternal`, total `48.07s`) |
|
||||
| Full Integrated ASan+UBSan (`47736cb`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug (`/tmp/void-w6b-asan`, 41 modules, `-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-w6b-asan/tests/VoidTests` | `VoidTests`: 1,406 tests — 1,403 passed, 3 intentional skips (`plugin_load_and_query_skipped`, `broken_feature`, `unquoted_skip`), 0 failed (`21.78s`), 0 ASan/LSan leaks, 0 UBSan errors |
|
||||
| Wave 6B TSan Subset (`47736cb`) | `dev cpp-gcc -p libarchive -p openssl -p libsodium` Debug (`CryptoAsync;SecurityAsync;Update;Testing`, `/tmp/void-w6b-tsan`, 20 modules, `-DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON`), `/tmp/void-w6b-tsan/tests/VoidTests --filter "Crypto*\|crypto_*\|Security*\|security_*\|Archive*\|archive_*\|Update*\|update_*\|component_feed_*\|readable_component_*\|version_store_*"` | 56/56 passed (`4.86s`: `Archive` 6, `ArchiveHardening` 3, `Crypto` 3, `CryptoHardening` 3, `CryptoAsync` 2, `SecurityTests` 8, `SecurityHardening` 4, `SecurityAsync` 2, `Update` 22, `UpdateHardening` 3), 0 TSan data races |
|
||||
| Post-W6B Benchmark (`47736cb`, `rev=47736cb6ce2f`) | `/tmp/void-w6b-full/benchmarks/VoidFoundationBench --json /tmp/void-w6b-full/post-w6b.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.38ns, `core_uuid_parse_hyphenated` 24.52ns, `core_uuid_to_string` 16.53ns, `core_hash_fnv1a64_256b` 179.95ns, `core_hash_murmur3_256b` 67.37ns, `functional_result_ok_chain` 1.12ns, `functional_error_with_context` 58.37ns, `math_checked_add_loop` 0.47ns, `containers_spsc_ring_push_pop` 8.76ns, `containers_lru_get_put` 21.02ns, `binary_reader_u64_be` 1.31ns, `data_json_parse_small_object` 333.32ns, `data_json_serialize_small_object` 165.99ns |
|
||||
@@ -0,0 +1,26 @@
|
||||
# Archive Streaming Reader, Atomic Staged Publication, Reproducible Creation & Child Isolation
|
||||
Task ID: M-ARCHIVE-01..05
|
||||
Phase: P2 (Wave 6B)
|
||||
Status: APPROVED
|
||||
Contracts: C-02, C-03, C-04, C-05, C-06, C-07
|
||||
|
||||
## 1. Context and baseline
|
||||
`Void::Archive` preserves the existing incremental `extract(path, destination, ExtractionOptions)` API and anti-traversal/symlink-swap/size-limit tests while adding typed error reporting (`kArchiveErrorDomain = 17`), bounded streaming `Reader` (`open_reader`, `next_entry`, `read_chunk`, `skip_entry`, normal/forensic `list_entries`), atomic staged extraction and no-replace directory publication (`StagedTree`, `extract_staged`, `publish`, `cleanup_stale_staging`), reproducible tar/tar.zstd creation (`create_archive`), and hardened child-process isolated extraction (`extract_staged_isolated`, `run_isolated_worker_main`).
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Archive/module.cmake` (`INTERNAL_DEPS Functional Time System`, `EXTERNAL_DEPS LibArchive::LibArchive`).
|
||||
- `include/Void/Archive/Types.hpp`: `kArchiveErrorDomain = 17`, `ArchiveErrorCode`, `make_archive_error`, `ReadLimits` (10,000 entries, 512 MiB file, 2 GiB total, 1 GiB compressed, 8 MiB metadata, 64 KiB transfer chunk, 4 KiB path, 255B component, 64 components), `EntryInfo`, `ProgressEvent`, `PublicationOutcome`, `PublicationReceipt`, `CreationOptions`, `IsolationOptions` (128 MiB RSS, 60s timeout), `ByteSource`/`ByteSink` + span/vector/file adapters.
|
||||
- `include/Void/Archive/Archive.hpp`, `src/Archive/Archive.cpp`, `src/Archive/StagedArchive.cpp`: preserve `extract()`; add `Reader`, `list_entries` (normal + opt-in forensic), `StagedTree`, `extract_staged` (exclusive `0700` dir, `O_NOFOLLOW`, `0644`/`0755`, bottom-up dir `fsync`, completion inventory, no-follow cleanup), `publish` via Linux `renameat2(..., RENAME_NOREPLACE)` (`unsupported_capability` on `ENOSYS`/`EINVAL`, `PublicationOutcome::Unknown` on post-rename parent `fsync` failure), `cleanup_stale_staging`, reproducible `create_archive`, and `extract_staged_isolated` / `run_isolated_worker_main` via `Void::Process::spawn` (ASan-safe rlimits + parent verification of staged inventory).
|
||||
- `tests/helpers/ArchiveWorker.cpp` wired as `VoidArchiveWorker` in `tests/CMakeLists.txt`, `tests/standalone/Archive/ArchiveHardening.cpp`, `tests/package/ArchiveOnly/*`, registered in `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Edge cases
|
||||
- `skip_entry` still decodes and accounts for actual decompressed bytes against per-entry and total limits.
|
||||
- File-as-parent path conflicts (e.g. file `a` followed by `a/b`, or `a/b` followed by file `a`) and non-zero/zero invalid limits are rejected cleanly.
|
||||
- Diagnostics cap path rendering at 4 KiB and escape control characters / attacker newlines.
|
||||
- Post-rename parent `fsync` failure reports `PublicationOutcome::Unknown` without falsely claiming rollback; pre-publish failure cleans only the owned staging descriptor and preserves primary error + staging id if cleanup fails.
|
||||
- Under `__SANITIZE_ADDRESS__`, child worker avoids fatal `RLIMIT_AS` and enforces `RLIMIT_CPU`/`RLIMIT_FSIZE`/`RLIMIT_NOFILE` + `/proc/self/statm` RSS enforcement.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -p libarchive -c bash -lc 'cmake -S . -B /tmp/void-w6b-archive -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="Archive;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w6b-archive && /tmp/void-w6b-archive/tests/VoidTests --filter "Archive*|archive_*" && ctest --test-dir /tmp/void-w6b-archive --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# Async OperationState, ResumeTicket, TaskScope, and Bounded Executor Lanes
|
||||
Task ID: M-ASYNC-02, M-ASYNC-03
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-04, C-06, C-07
|
||||
|
||||
## 1. Context and baseline
|
||||
`src/Async/module.cmake` currently depends only on `LogState`, while `include/Void/Async/Executor.hpp` provides only void-returning `post()`, `ManualExecutor`, `schedule_on`, and fire-and-forget `spawn()`. Async lacks structured admission control, race-free backend completion vs cancellation settlement, completion-lane backpressure bypass, and structured `TaskScope` join/cancellation/exception ownership.
|
||||
|
||||
## 2. Deliverables
|
||||
- Updated `src/Async/module.cmake` declaring `INTERNAL_DEPS Functional Time LogState`.
|
||||
- New `include/Void/Async/Operation.hpp`: `OperationOptions`, `AdmissionError`, `AsyncErrorCode` (`kAsyncErrorDomain`), `make_async_error`, `DomainOutcomeKind`, `ResumeTicket`, and `OperationState` managing combined `std::stop_source`, atomic `backend_refs`, single-winner CAS terminal state, and post-backend-release continuation resumption outside locks.
|
||||
- Upgraded `include/Void/Async/Executor.hpp`: keeps 1.x `post`/`ManualExecutor`/`schedule_on`/`spawn` working while adding `try_post`, `post_completion` (reserved completion lane), `is_executor_thread()`, bounded `ManualExecutor` queue capacity, and cancellable clock-aware `schedule_on(executor, options, clock)`.
|
||||
- New `include/Void/Async/TaskScope.hpp`: `TaskScopeOptions`, `JoinHandle`, reserve-then-transfer `TaskScope::spawn` (preserving `Task<void>` on admission failure), `request_stop`, `co_await join()`, `join_blocking()` with `self_join` detection, `join_pumping`, and `DetachedOwner`.
|
||||
- Tests in `tests/standalone/Async/OperationScope.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `src/Async/module.cmake`
|
||||
- `include/Void/Async/Operation.hpp`
|
||||
- `include/Void/Async/Executor.hpp`
|
||||
- `include/Void/Async/TaskScope.hpp`
|
||||
- `tests/standalone/Async/OperationScope.cpp`
|
||||
|
||||
## 4. Edge cases
|
||||
- Failed `TaskScope::spawn` (full or stopped) does not consume or destroy caller's `Coro::Task<void>`.
|
||||
- Concurrent backend commit vs `std::stop_token` firing resolves to exactly one terminal outcome, releases backend references before resuming continuation outside locks, and supports synchronous completion without double-resume.
|
||||
- Reserved `post_completion` succeeds even when normal submission queue capacity is saturated.
|
||||
- `join_blocking()` called from the associated executor thread detects `self_join` rather than deadlocking.
|
||||
- Concurrent cancellation/completion/join stress passes cleanly under Debug TSan and ASan/UBSan.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `OperationScope*`, `Executor*`, `Coro*`, and `ThreadPool*` tests pass under RelWithDebInfo `-Werror`, ASan+UBSan, and Debug TSan (`-DVOID_ENABLE_TSAN=ON`).
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w4a-async -G Ninja -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w4a-async && /tmp/void-w4a-async/tests/VoidTests --filter "OperationScope*|Executor*|Coro*" && ctest --test-dir /tmp/void-w4a-async --output-on-failure --timeout 60'
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w4a-async-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w4a-async-tsan && /tmp/void-w4a-async-tsan/tests/VoidTests --filter "OperationScope*|Executor*|ThreadPool*"'
|
||||
```
|
||||
@@ -0,0 +1,35 @@
|
||||
# Binary Writer, Owning ByteBuffer, DecodeBudget, and Endian Codecs
|
||||
Task ID: M-BINARY-02, M-BINARY-03
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-04, C-07
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Binary/Reader.hpp` provides non-owning bounds-checked reading with native-endian defaults, while Binary lacks `Writer`, `ByteBuffer`, cumulative decode budgets, transaction/rollback helpers, strict bool/IEEE float codecs, and `kBinaryErrorDomain` codes.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Binary/module.cmake` updated to `INTERNAL_DEPS Functional Memory`; `tests/package/InstalledComponents.cmake` updated to pass `Memory Core` for `Binary`/`Foundation` component checks.
|
||||
- New `include/Void/Binary/Budget.hpp`: `BinaryErrorCode`, `make_error`, `DecodeLimits`, `DecodeBudget` (overflow-safe cumulative field bytes and RAII `DepthGuard`).
|
||||
- Extended `include/Void/Binary/Reader.hpp`: `kBinaryErrorDomain` codes, pre-consume endian check, `readLittle`/`readBig`, strict `readBool`, explicit `readF32`/`readF64` (IEEE binary32/64, no default endian), `checkpoint`/`rollback`/`Transaction`, `readBytesChecked`/`subreaderChecked`.
|
||||
- New `include/Void/Binary/Writer.hpp`: non-owning mutable `Writer` with pre-write capacity checks, overlapping `memmove`-safe `writeBytes`, explicit-endian `write`/`writeLittle`/`writeBig`/`writeBool`/`writeF32`/`writeF64`/`writeString`, and `checkpoint`/`rollbackPosition`.
|
||||
- New `include/Void/Binary/ByteBuffer.hpp`: PMR-backed bounded `ByteBuffer` (`max_bytes`, `0` ceiling for empty-only, self-aliasing `append`, `std::bad_alloc` -> `allocation_failed`, preserves committed bytes on failure) and zero-copy `FrozenBytes` via `freeze()`.
|
||||
- Tests in `tests/standalone/Binary/{Reader,Writer,ByteBuffer}.cpp` and expanded `tests/package/Binary/main.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `src/Binary/module.cmake`, `tests/package/InstalledComponents.cmake`, `tests/package/Binary/main.cpp`
|
||||
- `include/Void/Binary/{Budget,Reader,Writer,ByteBuffer}.hpp`
|
||||
- `tests/standalone/Binary/{Reader,Writer,ByteBuffer}.cpp`
|
||||
|
||||
## 4. Edge cases
|
||||
- Truncated or unsupported-endian operations leave cursor position and destination buffer untouched.
|
||||
- `readBool` accepts only `0x00`/`0x01` without consuming invalid bytes; IEEE float width/IEC-559 checked via `static_assert`.
|
||||
- Shared cumulative `DecodeBudget` enforces total bytes and depth across nested `subreaderChecked`.
|
||||
- `ByteBuffer` with `BudgetResource` preserves previously written data on ceiling or OOM failure; `freeze()` preserves underlying pointer with zero copy.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `Reader*`, `Writer*`, `ByteBuffer*`, and `VoidInstalledComponentConsumers` pass under `-DVOID_WARNINGS_AS_ERRORS=ON`.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-p1-binary -G Ninja -DVOID_ENABLED_MODULES="Binary;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-p1-binary && /tmp/void-p1-binary/tests/VoidTests --filter "Reader*|Writer*|ByteBuffer*" && ctest --test-dir /tmp/void-p1-binary --output-on-failure --timeout 60'
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
# Containers Pool Lease Lifetimes, Budgets, and Non-Spinning Rings
|
||||
Task ID: M-CONTAINERS-02, M-CONTAINERS-03
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Containers/Pool.hpp` (`ObjectPool`, `FixedPool`) and `BufferPool.hpp` currently hold raw pool pointers in returned leases/deleters, leak slots on throwing construction, allocate heap nodes on buffer recycle, and lack admission/byte ceilings. `include/Void/Containers/Ring.hpp` currently spins indefinitely in `MpscRing::pop()` while waiting for `ready_[tail]` and lacks destruction of queued items on ring drop and explicit `close()`/`try_pop()` polling states.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Containers/module.cmake` declaring `INTERNAL_DEPS Core Memory`.
|
||||
- Upgraded `include/Void/Containers/Pool.hpp`: stationary `std::shared_ptr<State>`, `std::pmr::memory_resource*` slab allocation, intrusive zero-alloc `noexcept` `Slot` recycling, throwing-ctor rollback, `ObjectPoolLimits`, `PoolError`, `try_acquire`, `live()`, `allocated_bytes()`, and exception-safe `FixedPool::try_acquire`.
|
||||
- Upgraded `include/Void/Containers/BufferPool.hpp`: stationary `std::shared_ptr<State>`, O(1) power-of-two intrusive buckets (`buckets[65]`), checked `size_class` overflow, `Limits`, `BufferPoolError`, `try_acquire`, extended `Stats`, safe pool move/destruction while leases outlive owner.
|
||||
- Upgraded `include/Void/Containers/Ring.hpp`: `PushStatus`, `PopStatus`, `PopResult<T>`, Vyukov per-slot sequence `MpscRing` non-spinning `try_pop()`/`close()`, destructor cleanup in `~SpscRing()`/`~MpscRing()`, keeping 1.x `push`/`pop`/`empty`/`full`/`capacity`.
|
||||
- Expanded tests in `tests/standalone/Containers/{Pool,BufferPool,Ring}.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `src/Containers/module.cmake`
|
||||
- `include/Void/Containers/Pool.hpp`
|
||||
- `include/Void/Containers/BufferPool.hpp`
|
||||
- `include/Void/Containers/Ring.hpp`
|
||||
- `tests/standalone/Containers/{Pool,BufferPool,Ring}.cpp`
|
||||
|
||||
## 4. Edge cases
|
||||
- Owner moved/destroyed while leases/buffers are still live (`~Buffer`/`~Ptr` frees directly via `State` and upstream resource with zero UAF and zero recycle heap allocations).
|
||||
- `std::construct_at` throwing rolls back slot/budget accounting.
|
||||
- Delayed MPSC producer paused inside move construction causes consumer `try_pop()` to return `PopStatus::pending` without blocking/spinning, then `PopStatus::ok` once producer completes.
|
||||
- `> 4 * N` ring wraparound, `close()`, and `~SpscRing()`/`~MpscRing()` item destruction verified under TSan and ASan/UBSan.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `Pool*`, `BufferPool*`, and `Ring*` pass under `-DVOID_WARNINGS_AS_ERRORS=ON` and under Debug TSan (`-DVOID_ENABLE_TSAN=ON`).
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-p1-containers -G Ninja -DVOID_ENABLED_MODULES="Containers;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-p1-containers && /tmp/void-p1-containers/tests/VoidTests --filter "Pool*|BufferPool*|Ring*" && ctest --test-dir /tmp/void-p1-containers --output-on-failure --timeout 60'
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-p1-containers-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Containers;Testing" -DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-p1-containers-tsan && /tmp/void-p1-containers-tsan/tests/VoidTests --filter "Ring*"'
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
# Core Standalone UUID, Checked Bits, and Portable Hash
|
||||
Task IDs: M-CORE-02, M-CORE-03
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Core/Uuid.hpp` currently includes `<Void/Math/Random.hpp>` (an undeclared dependency leak violating C-01), allocates temporary `std::string` objects in `parse()` and `v5_lite()`, and marks `v4()` unconditionally `noexcept`. `include/Void/Core/Bits.hpp` lacks checked boundary variants, and `include/Void/Core/Hash.hpp` uses `__builtin_memcpy` in `murmur3_32`.
|
||||
|
||||
## 2. Deliverables
|
||||
- Portable incremental/constexpr extensions in `include/Void/Core/Hash.hpp`.
|
||||
- Zero-Math, zero-allocation `Uuid` APIs in `include/Void/Core/Uuid.hpp`.
|
||||
- `include/Void/Core/CheckedBits.hpp` (`checked_extract`, `checked_deposit`, `checked_align_up`, `checked_align_down`).
|
||||
- Expanded unit tests in `tests/standalone/Core/{Uuid,Bits,Hash}.cpp` and isolated installed consumer `tests/package/CoreOnly`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Core/Hash.hpp`: `fnv1a64_offset_basis`, `fnv1a64_update`, `crc32_initial`, `crc32_update`, `crc32_finalize`; endian-portable `constexpr` `murmur3_32`.
|
||||
- `include/Void/Core/Uuid.hpp`: remove `<Void/Math/Random.hpp>` and `<format>`; add `GenerateError`, `v4(G&)`, `try_v4() noexcept`, throwing `v4()`, `constexpr format_chars`, `constexpr` zero-alloc `parse`, zero-alloc byte-identical `v5_lite`.
|
||||
- `include/Void/Core/CheckedBits.hpp`: `BitError { invalid_range, invalid_alignment, overflow }`, `checked_extract`, `checked_deposit`, `checked_align_up`, `checked_align_down`.
|
||||
- `tests/package/CoreOnly/{CMakeLists.txt,main.cpp}`, `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 4. Edge cases
|
||||
- `checked_extract`/`checked_deposit`: `offset = width`, `count = 0`, `count = width`, `offset + count` integer overflow.
|
||||
- `checked_align_up`: `alignment = 0`, non-power-of-two, `value = MAX` overflow.
|
||||
- `Uuid::v5_lite`: golden byte-for-byte equivalence with 1.x `ns.bytes + name` hash output.
|
||||
- Throwing custom URBG propagates out of `v4(G&)`; `try_v4()` converts `random_device` failure without returning nil.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `-DVOID_ENABLED_MODULES=Core -DVOID_ENABLE_TESTING=OFF` installs and runs `CoreOnly` with all external packages disabled and no `Math` dependency.
|
||||
- Core tests pass with `-DVOID_WARNINGS_AS_ERRORS=ON` and ASan/UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-core -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Core;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-core --parallel 4
|
||||
dev cpp-gcc -c /tmp/void-p1-core/tests/VoidTests --filter "Uuid*|Bits*|Hash*"
|
||||
```
|
||||
@@ -0,0 +1,26 @@
|
||||
# Crypto Hardening, Signing, MAC/KDF & Optional Async Hash Adapter
|
||||
Task ID: M-CRYPTO-01..05
|
||||
Phase: P2 (Wave 6B)
|
||||
Status: APPROVED
|
||||
Contracts: C-02, C-03, C-07, C-13
|
||||
|
||||
## 1. Context and baseline
|
||||
`Void::Crypto` preserves all 1.x APIs (`Hasher`, `Digest`, `HashAlgorithm`, `hash`, `hashFile`, `sha1`/`sha256`/`sha512`, `sha*File`, `verifyEd25519` exact-byte false-vs-error semantics) while hardening `Hasher` state poisoning (`Ready -> Updating -> Finalized | Failed`), adding per-context OpenSSL 3 `ProviderOptions` (no process-wide provider mutation), typed Ed25519 wrappers (`Ed25519PublicKey`, `Ed25519Signature`, `Ed25519Seed`, move-only `Ed25519PrivateKey`), `sign_ed25519`, `hmac_sha256`/`hmac_sha256_into`, `hkdf_sha256`, `constant_time_equal`, backend fault injection, and a separate optional `CryptoAsync` module (`hash_stream`, `AsyncFileHasher`) so `Crypto` remains runtime-free.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Crypto/module.cmake` (`INTERNAL_DEPS Functional`, `EXTERNAL_DEPS OpenSSL::Crypto`, `EXCLUDE_HEADERS Void/Crypto/AsyncHash.hpp`) & `src/CryptoAsync/module.cmake` (`INTERNAL_DEPS Crypto IO Async Time Functional`, `EXTRA_HEADERS Void/Crypto/AsyncHash.hpp`).
|
||||
- `include/Void/Crypto/Types.hpp`: `kCryptoErrorDomain = 18`, `CryptoErrorCode`, `make_crypto_error`, `HasherState`, `ProviderOptions`, `CryptoLimits` (`kMaxOneShotMessageBytes = 16 MiB`, `kMaxHkdfOutputBytes = 4 KiB`, `kStreamChunkBytes = 64 KiB`, `kDefaultMaxConcurrentFileHashes = 8`, `kDefaultMaxWaitingFileHashes = 32`, `kDefaultAsyncBufferBudgetBytes = 8 MiB`), `Ed25519PublicKey`, `Ed25519Signature`, `Ed25519Seed` (with explicit wipe).
|
||||
- `include/Void/Crypto/Crypto.hpp` & `src/Crypto/Crypto.cpp`: OpenSSL 3 non-deprecated EVP APIs (`EVP_MD_fetch`, `EVP_MAC_fetch`, `EVP_KDF_fetch`, `EVP_PKEY_new_raw_*_ex`, `EVP_DigestSignInit_ex`, `EVP_DigestVerifyInit_ex`, `CRYPTO_memcmp`, `OPENSSL_cleanse`), poisoned `Hasher` + `state()`, `Ed25519PrivateKey` (`generate`, `from_raw_seed`, `public_key`, `export_raw_seed`), `sign_ed25519`, typed `verify_ed25519`, `hmac_sha256`, `hmac_sha256_into`, `hkdf_sha256` (4 KiB cap, overlap rejection, wipe-on-error), `constant_time_equal`, and thread-local/scoped backend fault hook.
|
||||
- `include/Void/Crypto/AsyncHash.hpp` & `src/CryptoAsync/AsyncHash.cpp`: `hash_stream` (64 KiB `BufferLease` chunks, stop/deadline checks between chunks, clean-EOF-only finalize) and `AsyncFileHasher` (8 concurrent / 32 waiters / 8 MiB buffer budget, `close_and_join`).
|
||||
- `tests/standalone/Crypto/CryptoHardening.cpp`, `tests/standalone/CryptoAsync/CryptoAsync.cpp`, `tests/package/{CryptoOnly,CryptoAsyncOnly}/*`, registered in `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Edge cases
|
||||
- Invalid key/signature sizes return `invalid_argument` before touching OpenSSL; well-formed invalid Ed25519 signatures return `true`/`false` (not error).
|
||||
- One-shot `sign_ed25519`/`verify_ed25519` enforce `16 MiB` limit; `hkdf_sha256` rejects zero/oversized (`> 4 KiB`) output and overlapping input/salt/context/output spans, wiping output on failure.
|
||||
- Backend error during `Hasher::update`/`finalize` transitions state to `Failed`, rejecting further `update`/`finalize` calls.
|
||||
- `hash_stream` never returns a digest on partial read + error or stop/EOF cancellation race; `AsyncFileHasher::close_and_join` stops admission and drains in-flight work before returning.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -p openssl -c bash -lc 'cmake -S . -B /tmp/void-w6b-crypto -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="Crypto;CryptoAsync;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w6b-crypto && /tmp/void-w6b-crypto/tests/VoidTests --filter "Crypto*|crypto_*" && ctest --test-dir /tmp/void-w6b-crypto --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
# Data Exact 64-Bit Signed/Unsigned JSON Numbers and Checked Conversion
|
||||
Task ID: M-DATA-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-05, C-07
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Data/Json.hpp` currently stores all numbers as `double`, silently rounding integers above `2^53` through parse, DOM construction, equality, serialization, SAX events, and `Reflect.hpp`. StrictJson (`Void::Json::Strict::Value`) is already signed `int64_t` and must remain completely unchanged (C-07).
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Data/module.cmake` updated to `INTERNAL_DEPS Core Math Time`.
|
||||
- Extended `include/Void/Data/Json.hpp`: `NumberKind`, `ConversionError`, `int64_t`/`uint64_t`/`double` variant alternatives, unambiguous integral/float constructors, `is_int`/`is_uint`/`is_double`/`is_integer`/`number_kind`/`as_uint`/`get_int`/`get_uint`, `number_as<T>` delegating to `Void::Numeric::checked_cast`, exact cross-type `operator==`, strict RFC 8259 numeric grammar parsing (256-byte limit, `-0` -> integer `0`, `-0.0` preserved as negative double), optional `SaxHandler::{on_int,on_uint}` retaining `on_number` compatibility, exact `std::to_chars` serialization + `try_serialize`.
|
||||
- Updated `include/Void/Data/Reflect.hpp` (exact integer `leaf_to_json`, `number_as<T>` in `leaf_from_json` and versioned envelopes) and `include/Void/Configuration/Config.hpp` (exact integer stringification).
|
||||
- Expanded tests in `tests/standalone/Data/{Json,Reflect}.cpp`; `StrictJson.hpp` and `tests/standalone/Data/StrictJson.cpp` untouched.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `src/Data/module.cmake`
|
||||
- `include/Void/Data/Json.hpp`
|
||||
- `include/Void/Data/Reflect.hpp`
|
||||
- `include/Void/Configuration/Config.hpp`
|
||||
- `tests/standalone/Data/{Json,Reflect}.cpp`
|
||||
|
||||
## 4. Edge cases
|
||||
- `INT64_MIN`, `INT64_MAX`, `UINT64_MAX`, and `2^53 ± 1` survive parse, serialize, equality, and reflection round trips without silent rounding; integers `< INT64_MIN` or `> UINT64_MAX` fail parsing.
|
||||
- `Value{UINT64_MAX} != Value{static_cast<double>(UINT64_MAX)}` and `Value{(std::uint64_t{1} << 53) + 1} != Value{static_cast<double>(1ULL << 53)}`.
|
||||
- `number_as<double>` rejects `2^53 + 1` with `Rounding::exact`, succeeds with explicit `Rounding::nearest_even`; `try_serialize` rejects `NaN`/`Inf` with `Error::NonFinite`.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `Data;Update;Configuration;Testing` suites (`Json*|StrictJson*|Reflect*|Update*|Config*`) pass under `-DVOID_WARNINGS_AS_ERRORS=ON` without modifying `StrictJson`.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -p openssl -c bash -lc 'cmake -S . -B /tmp/void-p1-data -G Ninja -DVOID_ENABLED_MODULES="Data;Update;Configuration;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-p1-data && /tmp/void-p1-data/tests/VoidTests --filter "Json*|StrictJson*|Reflect*|Update*|Config*"'
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
# Functional Compact Status, Bounded Contexts, and Error Adapters
|
||||
Task ID: M-FUNCTIONAL-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-05 (G-ERROR)
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Functional/Error.hpp` stores free-form message strings and unbounded `shared_ptr<const Error>` chains with recursive destruction and no machine-readable classification.
|
||||
|
||||
## 2. Deliverables
|
||||
- `ErrorKind`, `ErrorCode`, `Status`, reserved domain constants, bounded message/frame/format limits, and iterative `~Error()` in `include/Void/Functional/Error.hpp`.
|
||||
- `fail(Status)` and `fail(ErrorKind, ...)` factories in `include/Void/Functional/Result.hpp`.
|
||||
- `include/Void/Functional/Adapters.hpp` (`adapt`, `try_invoke`, `from_errno`).
|
||||
- `tests/standalone/Functional/ErrorStatus.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Functional/Error.hpp`:
|
||||
- `ErrorKind`: `invalid_argument`, `not_found`, `conflict`, `cancelled`, `timeout`, `overloaded`, `unsupported`, `io`, `corrupt`, `exhausted`, `internal`.
|
||||
- `Status { ErrorKind kind; ErrorCode code; }` and `explicit Error(Status) noexcept` (zero heap allocation).
|
||||
- Limits: `kDefaultMaxErrorFrames = 16`, `kDefaultMaxErrorMessageBytes = 1024`, `kDefaultMaxFormattedErrorBytes = 16 * 1024`.
|
||||
- `with_context()` preserves root `Status` and `std::error_code`, pins the root cause at the tail when capping > 16 frames, and sets `truncated() == true`.
|
||||
- `include/Void/Functional/Result.hpp`: typed `fail(...)` overloads.
|
||||
- `include/Void/Functional/Adapters.hpp`: `adapt`, `try_invoke`, `from_errno`.
|
||||
|
||||
## 4. Edge cases
|
||||
- `Error(Status)` makes zero heap allocations.
|
||||
- `try_invoke` must ALWAYS rethrow `std::bad_alloc` and any exception where `map_exception` returns `std::nullopt`.
|
||||
- `adapt` handles `void`, move-only values, and never invokes `map_error` on success.
|
||||
- 20-layer context chains preserve `ErrorKind`, `ErrorCode`, `system_code`, and root cause message.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- Existing 1.x `Result*` tests pass unchanged; `ErrorStatus` suite passes under `-Werror` and ASan/UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-functional -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Functional;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-functional --parallel 4
|
||||
dev cpp-gcc -c /tmp/void-p1-functional/tests/VoidTests --filter "ErrorStatus*|Result*"
|
||||
```
|
||||
@@ -0,0 +1,28 @@
|
||||
# Log Hardening, Bounded Delivery, File Sync, and LogConfig Separation
|
||||
Task ID: M-LOG-01..05
|
||||
Phase: P2
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-03, C-04, C-05, C-11
|
||||
|
||||
## 1. Context and baseline
|
||||
`Void::Log` (`Log.hpp` + `LogState/State.cpp`) holds `Sink` behind `State::mutex` during emission, and `Void::Logging::Logger` (`src/Log/Logger.cpp`) uses an unbounded batch drain without byte budgeting, contiguous ticket completion, exception quarantine, or file durability/reopen controls, while `Log` links `Configuration` via `FromConfig.hpp`.
|
||||
|
||||
## 2. Deliverables
|
||||
- Split `LogConfig` (`src/LogConfig/module.cmake`, `FromConfig.hpp`/`src/LogConfig/FromConfig.cpp`) out of `Log` (`src/Log/module.cmake`: `INTERNAL_DEPS Async Core Data Functional Memory Time LogState`, `OPTIONAL_DEPS Stacktrace`, `EXCLUDE_HEADERS Void/Log/Log.hpp Void/Log/FromConfig.hpp`).
|
||||
- `include/Void/Log/Log.hpp` & `src/LogState/State.cpp`: immutable `SinkRegistration`, `register_sink`, `detach_and_drain` (`DrainResult` with `would_deadlock`), outer-of-lock callback invocation & owner destruction, reentrancy guard (depth <= 8) + emergency hook.
|
||||
- `include/Void/Log/Entry.hpp`: `bool truncated{false};`.
|
||||
- `include/Void/Log/Logger.hpp` & `src/Log/Logger.cpp`: `LogErrorCode`, `make_log_error` (`kLogErrorDomain = 12`), `DeliveryLimits`, `FailurePolicy`, `LoggerOptions`, `SubmitState`, `Ticket`, `SubmitReceipt`, `FlushDurability`, `FlushOptions`, `CloseOptions`, `FlushReport`, bounded deque with queued+in-flight entry and byte accounting, contiguous ticket watermark, `try_submit`, `flush_through`, `close`, quarantine & reset, admission-barrier `set_mode`, `sync_files()`.
|
||||
- `include/Void/Log/Sinks.hpp`: `CallbackLogger(Callback, LoggerOptions)`, `MultiLogger::try_add` with max 8 children and cycle check.
|
||||
- `include/Void/Log/Formatter.hpp` & `src/Log/Formatter.cpp`: field redaction in `FieldFilter`, `LogfmtFormatter` control-char escaping, `JsonLinesFormatter` int64 line numbers, `format_bounded`.
|
||||
- `FileLogger` / `RotatingFileLogger` / `RollingFile`: explicit `create_directories`, `RotatingFileOptions::roadmap_defaults()`, stream write-error surfacing, `reopen()`, POSIX `::fsync` in `sync_files()`.
|
||||
- `src/LogConfig/FromConfig.cpp` + moved `tests/standalone/LogConfig/FromConfig.cpp`: strict config value validation.
|
||||
- `tests/standalone/Log/LogHardening.cpp` and `tests/package/LogOnly/{CMakeLists.txt,main.cpp}` registered in `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Edge cases
|
||||
- Legacy 3-argument `Logger` constructor preserves compatibility for existing `LogScopeSnapshot` immediate recursion and `AsyncLogger` 400k stress test (`owned_bytes >= max(8 MiB, entries * 1024)`, `suppress_reentrancy = false`).
|
||||
- `DropOldest` never evicts already-dispatched in-flight batch entries; `Block` rejects self-blocking on worker (`would_deadlock`).
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w5-log -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="Log;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w5-log && /tmp/void-w5-log/tests/VoidTests && ctest --test-dir /tmp/void-w5-log --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,35 @@
|
||||
# Math Span-Safe Parsing, Checked Cast, and Portable Overflow
|
||||
Task ID: M-MATH-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-05, C-07
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Math/Numeric.hpp` currently passes `string_view::data()` to `std::strtol`/`std::strtod` (unsafe on non-NUL-terminated substrings), uses `long long`-based `in_range`/`narrow_cast` (broken for unsigned 64-bit / floating conversions), and lacks `checked_cast`, `checked_mul_add`, and portable non-builtin overflow arithmetic.
|
||||
|
||||
## 2. Deliverables
|
||||
- Extended `include/Void/Math/Numeric.hpp`: `Error::Inexact`, `Error::NonFinite`, `Rounding`, `kMaxNumericTokenBytes = 256`, guarded `__builtin_*_overflow` + portable `constexpr` fallback, `checked_mul_add`, `checked_cast`, `parse_integer`, `parse_real`, and span-safe `parse_int`/`parse_double` adapters.
|
||||
- Comprehensive boundary tests in `tests/standalone/Math/Numeric.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Math/Numeric.hpp`:
|
||||
- `checked_cast<To, From>(value, Rounding mode = Rounding::exact) noexcept -> std::expected<To, Error>` across all non-`bool` arithmetic pairs.
|
||||
- `parse_integer<T>(std::string_view, int base = 10) noexcept -> std::expected<T, Error>`.
|
||||
- `parse_real<T>(std::string_view) noexcept -> std::expected<T, Error>`.
|
||||
- `checked_mul_add<T>(T a, T b, T c) noexcept -> std::expected<T, Error>`.
|
||||
|
||||
## 4. Edge cases
|
||||
- Non-NUL-terminated substrings adjacent to digits (`"429"` sliced to `"42"` must parse `42`, never `429`).
|
||||
- `parse_integer`/`parse_real` reject empty strings, `> 256` bytes, leading whitespace, leading `'+'`, trailing characters, and `"nan"`/`"inf"`.
|
||||
- Float->int checks exact exclusive `2^63` (`9223372036854775808.0`) / `2^64` (`18446744073709551616.0`) boundaries, and `nearest_even` implements deterministic ties-to-even independent of `FE_ROUND`.
|
||||
- Int->float exactness checks significant bits without UB when negating `INT64_MIN`; preserves `-0.0` sign on float narrowing.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- Existing `Numeric` tests plus all boundary tests pass under `-Werror` and ASan/UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-math -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Math;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-math --parallel 4
|
||||
dev cpp-gcc -c /tmp/void-p1-math/tests/VoidTests --filter "Numeric*"
|
||||
```
|
||||
@@ -0,0 +1,28 @@
|
||||
# Resilience Hardening, Permits, Bounded Keyed Cleanup, and Async Policy
|
||||
Task ID: M-RESILIENCE-01..04
|
||||
Phase: P2
|
||||
Status: APPROVED
|
||||
Contracts: C-02, C-03, C-04, C-05, C-11, C-13
|
||||
|
||||
## 1. Context and baseline
|
||||
`Void::Resilience` currently provides `TokenBucket`, `KeyedRateLimiter`, `CircuitBreaker`, and `ResourceMonitor` without config/input validation, overflow-safe `ResourceMonitor` subtraction, synchronized callback setters, single-probe HalfOpen leases, generation binding, bounded keyed cleanup cursors, or optional `Async` bulkhead/retry composition.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Resilience/module.cmake` (`INTERNAL_DEPS Functional Time ObservabilityHooks`, `EXCLUDE_HEADERS Void/Resilience/AsyncPolicy.hpp`)
|
||||
- `src/ResilienceAsync/module.cmake` (`INTERNAL_DEPS Resilience Async Functional Time ObservabilityHooks`, `EXTRA_HEADERS Void/Resilience/AsyncPolicy.hpp`)
|
||||
- `include/Void/Resilience/Types.hpp`: `ResilienceErrorCode`, `make_resilience_error` (`kResilienceErrorDomain = 15`), `Outcome`, `Admission`, validated `BucketConfig`, `KeyedBucketConfig`, `BreakerConfig`, `MonitorConfig`
|
||||
- Upgrades in `RateLimiter.hpp`, `KeyedRateLimiter.hpp`, `CircuitBreaker.hpp`, `ResourceMonitor.hpp`, `Resilience.hpp` (`TokenBucket::create`/`try_acquire_checked`/`try_acquire_all`, `BoundedKeyedRateLimiter`, `Breaker`/`BreakerPermit`, overflow-safe `ResourceMonitor`/`ResourcePermit`)
|
||||
- `include/Void/Resilience/AsyncPolicy.hpp`: `BulkheadConfig`, `Bulkhead`, `BulkheadPermit`, `ResilientRetryConfig` (using `Void::Retry::ExponentialBackoff` + `JitterMode::Full`), `execute_resilient`
|
||||
- `tests/standalone/Resilience/ResilienceHardening.cpp`, `tests/standalone/ResilienceAsync/AsyncPolicy.cpp`
|
||||
- `tests/package/ResilienceOnly/{CMakeLists.txt,main.cpp}` registered in `tests/package/InstalledComponents.cmake`
|
||||
|
||||
## 3. Edge cases
|
||||
- Clock regression never moves `last_` backwards or adds tokens; NaN/Inf/negative/oversize costs consume nothing.
|
||||
- `BreakerPermit` enforces single (or `half_open_max_probes`) concurrent HalfOpen probe, rejects stale-generation completions from closing newer Open state, and releases slot neutrally on abandonment.
|
||||
- `ResourceMonitor` rejects overflow (`amount > limit - usage`), over-release (`release_checked`), and isolates observer callback exceptions outside locks.
|
||||
- `execute_resilient` honors composition order, shares total deadline across retries, and never retries non-replay-safe operations.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w5-resilience -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="Resilience;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w5-resilience && /tmp/void-w5-resilience/tests/VoidTests --filter "CircuitBreaker*|RateLimiter*|KeyedRateLimiter*|ResourceMonitor*|ResilienceHardening*" && ctest --test-dir /tmp/void-w5-resilience --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,29 @@
|
||||
# Security Hardening, SecureBuffer, Versioned Envelopes, Authorization & Authenticator
|
||||
Task ID: M-SECURITY-01..04
|
||||
Phase: P2 (Wave 6B)
|
||||
Status: APPROVED
|
||||
Contracts: C-02, C-03, C-04, C-05, C-07, C-09, C-13
|
||||
|
||||
## 1. Context and baseline
|
||||
`Void::Security` preserves all 1.x APIs (`generateToken`, `hashToken`, `verifyToken`, `hashPassword`, `verifyPassword`, `generateSecretKey`, `sealSecret`, `openSecret`) and the exact legacy secret envelope format (`24B nonce || secretbox_easy(16B MAC + ciphertext)`), while adding `SecureBuffer`, input/cost validation (`parse_argon2id_cost`, `verify_password_budgeted`), versioned `VSEC` v1 AEAD envelopes + `SecretKeyRing` rotation, typed default-deny `Authorization`, and a separate `SecurityAsync` module (`Authenticator`, `AccountSessionPort`, `InMemoryAccountSessionStore`, `PasswordJobBudget`, `AuditSink`) so primitive `Security` remains free of Async/Resilience/Storage dependencies.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Security/module.cmake` (`INTERNAL_DEPS Functional Time`, `EXTERNAL_DEPS Sodium::Sodium`, `EXCLUDE_HEADERS Void/Security/Authenticator.hpp`) & `src/SecurityAsync/module.cmake` (`INTERNAL_DEPS Security Async Time Resilience Functional`, `EXTRA_HEADERS Void/Security/Authenticator.hpp`).
|
||||
- `include/Void/Security/Types.hpp`: `kSecurityErrorDomain = 19`, `SecurityErrorCode`, `make_security_error`, `SecurityLimits` (1 KiB password/hash, 512 B token, 16 MiB plaintext, 64 roles, 4096 rules, 16 predicate depth), `PasswordVerifyBudget`, `Argon2idCost`.
|
||||
- `include/Void/Security/SecureBuffer.hpp` & `src/Security/SecureBuffer.cpp`: move-only `SecureBuffer` with `LockPolicy::{StandardWiped, LockedOptional, LockedRequired}` (fail-closed if locked allocation fails), `sodium_memzero` wipe on release/move, optional fault hook.
|
||||
- `include/Void/Security/Security.hpp` & `src/Security/Security.cpp`: preserve 1.x surface + enforce input caps, `parse_argon2id_cost`, `verify_password_budgeted` rejecting excessive `m`/`t` before Argon2id allocation, backend init/randomness fault seam.
|
||||
- `include/Void/Security/Envelope.hpp` & `src/Security/Envelope.cpp`: versioned `VSEC` v1 `crypto_aead_xchacha20poly1305_ietf` envelope authenticating header + `key_id` + `aad`, `SecretKeyRing` (active-key writes, multi-key reads, checked retirement), zero silent legacy fallback.
|
||||
- `include/Void/Security/Authorization.hpp` & `src/Security/Authorization.cpp`: `Principal` (<=64 roles), typed `Predicate` (depth <=16), `PolicySnapshot` (<=4096 rules, default-deny, deny-overrides-allow, `authorize`).
|
||||
- `include/Void/Security/Authenticator.hpp` & `src/SecurityAsync/Authenticator.cpp`: `AccountSessionPort`, `InMemoryAccountSessionStore`, `PasswordJobBudget` (512 MiB / 2 active / 32 waiters), `SessionPolicy` (10,000 total / 16 per subject / 1h TTL / 60s civil-clock rollback check / 256 cleanup batch), mandatory `AuditSink`, `Authenticator` (dummy-hash timing-work parity, credential-version CAS, non-interruptible drain-on-stop, zero positive session cache, `close_and_join`).
|
||||
- `tests/standalone/Security/SecurityHardening.cpp`, `tests/standalone/SecurityAsync/SecurityAsync.cpp`, `tests/package/{SecurityOnly,SecurityAsyncOnly}/*`, registered in `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Edge cases
|
||||
- Legacy `sealSecret`/`openSecret` bytes remain bit-for-bit compatible; `Envelope` never guesses legacy decoding after AEAD failure.
|
||||
- Unknown account and wrong password execute comparable Argon2id work via a precomputed dummy hash and return identical public denial while recording distinct internal audit reasons.
|
||||
- Cancelling during password verification returns cancelled, retains budget/buffers until the Argon2id job completes, discards output, and never writes a session.
|
||||
- Civil-clock rollback exceeding configured tolerance (default 60s) fails session admission until reconciled.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -p libsodium -c bash -lc 'cmake -S . -B /tmp/void-w6b-security -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="Security;SecurityAsync;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w6b-security && /tmp/void-w6b-security/tests/VoidTests --filter "Security*|security_*" && ctest --test-dir /tmp/void-w6b-security --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,27 @@
|
||||
# Stacktrace Split Capture/Resolve, Bounded Cache, Safe Snippets, and Crash Marker
|
||||
Task ID: M-STACKTRACE-01..04
|
||||
Phase: P2
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-03, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
`Void::Stacktrace` currently couples raw capture with demangling, source snippet file reads, and `Void::Log` diagnostics, has no explicit `Capabilities` query or async-signal-safe fatal marker helper, and has no standalone test directory under `tests/standalone/Stacktrace/`.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Stacktrace/module.cmake`: add `Time` (`INTERNAL_DEPS Functional Time LogState`)
|
||||
- `include/Void/Stacktrace/Stacktrace.hpp` & `src/Stacktrace/Stacktrace.cpp`:
|
||||
- Legacy `StackFrame`, `capture_stacktrace`, `read_source_snippet`, `format_stacktrace`, `print_stacktrace` preserved.
|
||||
- `kStacktraceErrorDomain = 13` `StacktraceErrorCode` + `make_stacktrace_error`.
|
||||
- `Capabilities` (`raw_capture`, `symbols`, `line_info`, `async_signal_safe = false`, `backend_name`) + `capabilities() noexcept`.
|
||||
- `CaptureOptions`, owned `RawFrame` (`address`, `module_offset`, `module_path`, `module_id`), `RawTrace`, `capture()` (validates `1 <= max_frames <= 256`, zero source IO, zero `Void::Log` calls).
|
||||
- `FrameResolveStatus`, `ResolvedFrame`, `ResolvedTrace`, `ResolveOptions`, `Resolver` (bounded `1024` entries / `4 MiB` cache keyed by `(module_id, module_offset)`, `invalidate_module`, `clear_cache`), `read_source_snippet_checked` (allowed roots, symlink-escape rejection, overflow-safe line math, byte limits), `format_resolved_trace`, `write_fatal_signal_marker(int fd, int sig) noexcept`.
|
||||
- `tests/standalone/Stacktrace/Stacktrace.cpp`
|
||||
|
||||
## 3. Edge cases
|
||||
- Pre-cancelled `stop_token` and expired `ManualClock` deadline return `incomplete == true` while preserving captured raw frames.
|
||||
- Path traversal (`..`) and symlinks escaping `allowed_source_roots` fail with `unsafe_path`; `INT_MAX` line arithmetic never overflows.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w5-stacktrace -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="Stacktrace;Testing" -DVOID_WARNINGS_AS_ERRORS=ON -DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src && cmake --build /tmp/void-w5-stacktrace && /tmp/void-w5-stacktrace/tests/VoidTests --filter "Stacktrace*"'
|
||||
```
|
||||
@@ -0,0 +1,27 @@
|
||||
# System Process, Shared Watcher, Durable Filesystem & Temp Factories
|
||||
Task ID: M-SYSTEM-01..05
|
||||
Phase: P2 (Wave 6A)
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-03, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
`Void::System` preserves 1.x APIs (`Void::Process::{run,run_streaming,shell,reexec}`, `Void::FileSystem::{FileWatcher,Path,Query,TempFile,TempDir}`, `Void::SystemInfo::CpuSampler`) while fixing legacy bugs (zero-timeout 30s cutoff, full-duplex pipe deadlock, unescalated `SIGTERM` wait hangs, `SIGPIPE` on pipes, TOCTOU temp creation, unsafe `atomic_write`) and adding `System` (`Types`, `OwnedFd`, `Child`, `spawn`, `communicate_blocking`, `replace_file`, bounded `read_file`/`list_directory`, valid `CpuSampler::sample`) plus `Void::SystemAsync` (`ProcessManager`, async `communicate`/`wait`, shared `WatcherService`, `WatchSubscription`).
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/System/module.cmake` (`INTERNAL_DEPS Functional Time LogState`, `EXCLUDE_HEADERS Void/System/AsyncProcess.hpp Void/System/AsyncWatcher.hpp`) & `src/SystemAsync/module.cmake` (`INTERNAL_DEPS System Async IO Time Functional LogState`).
|
||||
- `include/Void/System/Types.hpp`: `kSystemErrorDomain = 10`, `SystemErrorCode`, `make_system_error`, move-only `OwnedFd`.
|
||||
- `include/Void/System/Process.hpp` & `src/System/Process.cpp`: legacy compatibility fixes + `SpawnOptions`, `EnvironmentPolicy`, `CaptureLimits`, `OverflowPolicy`, `kMaxSpawnInputBytes = 256 KiB`, move-only `Child`, `spawn`, `communicate_blocking`, `reexec(..., close_extra_fds)`.
|
||||
- `include/Void/System/{Path,Query,TempFile,TempDir,Metrics}.hpp`: `read_file_bounded`, `list_directory_bounded`, `replace_file` with `ReplaceDurability`/`ReplacePhase`/`ReplaceFaultHook`, atomic `0600`/`0700` `TempFile`/`TempDir` verified by `(dev, ino)` before removal, `CpuSample`.
|
||||
- `include/Void/System/{AsyncProcess,AsyncWatcher}.hpp` & `src/SystemAsync/{AsyncProcess,AsyncWatcher}.cpp`: `ProcessManager`, async `communicate`/`wait`/`close_and_join`, shared `WatcherService`, `WatchSubscription`.
|
||||
- `tests/helpers/ProcessHelper.cpp`, `tests/standalone/System/{ProcessStream,SystemHardening}.cpp`, `tests/standalone/SystemAsync/SystemAsync.cpp`, `tests/package/{SystemOnly,SystemAsyncOnly}/*`.
|
||||
|
||||
## 3. Edge cases
|
||||
- Between `fork()` and `exec*()`, strictly async-signal-safe operations only; `exec_failed` preserves `errno` via `CLOEXEC` error pipe and never collides with child exit `127`.
|
||||
- `replace_file` cleans only owned temp files before rename and reports `visible_on_disk = true, durability_unknown = true` if post-rename directory `fsync` fails.
|
||||
- `WatcherService::close_and_join()` drains admitted callbacks and rejects self-join.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w6a-system -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="System;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w6a-system && /tmp/void-w6a-system/tests/VoidTests --filter "Process*|SystemHardening*|Path*|Query*|TempDir*|TempFile*|Metrics*|FileWatcher*|SignalWatcher*" && ctest --test-dir /tmp/void-w6a-system --output-on-failure --timeout 120'
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w6a-sysasync -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="SystemAsync;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w6a-sysasync && /tmp/void-w6a-sysasync/tests/VoidTests --filter "SystemAsync*" && ctest --test-dir /tmp/void-w6a-sysasync --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# Testing Per-Run Reporters, Subprocess Isolation, and Deterministic Harness
|
||||
Task ID: M-TESTING-02, M-TESTING-03
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-04, C-16
|
||||
|
||||
## 1. Context and baseline
|
||||
`Testing` (`Runner.cpp`, `Assert.cpp`, `Config.hpp`, `JUnitReporter.cpp`) currently uses a process-global static `std::ofstream` for JUnit reporting, silently turns malformed regex or empty explicit filter selections into passing 0-test runs, retains unbounded per-test assertions, and lacks owned `FailureCapture`, isolated subprocess test execution, versioned deterministic property shrinking, and clock/order-controlled `DeterministicRun`.
|
||||
|
||||
## 2. Deliverables
|
||||
- Updated `include/Void/Testing/{Config,Assert,Runner}.hpp` and `src/Testing/{Assert,Runner}.cpp`:
|
||||
- Per-run owned JUnit stream checking open/write health cleanly.
|
||||
- Strict CLI/config validation (invalid regex, unknown reporter, unopenable output path, empty selection without `--allow-empty` fail with exit code 2).
|
||||
- Bounded per-test assertion retention (`1000` assertions / `1 MiB` diagnostics) and stray-assertion counter.
|
||||
- Single-teardown fixture lifecycle recording teardown errors in `cleanup_error` without masking primary test failure.
|
||||
- `--selftest-child <abort|hang|flood>` fixtures inside `Runner::main`.
|
||||
- New `include/Void/Testing/Capture.hpp` (`FailureCapture`) and `include/Void/Testing/{Subprocess.hpp}` + `src/Testing/Subprocess.cpp` (`current_executable_path`, `run_isolated_subprocess`, `ProcessTestOptions`, `ProcessOutcome`, `ProcessTestResult`).
|
||||
- New `include/Void/Testing/Deterministic.hpp` (`ReplayToken`, version-1 rejection-mapped `DeterministicRng`, `check_property` with shrinking & budget-exhaustion `inconclusive`, and `DeterministicRun` schedule/clock/timer harness).
|
||||
- Tests in `tests/standalone/Testing/{FrameworkHardening,Deterministic}.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Testing/{Config,Assert,Runner,Capture,Subprocess,Deterministic}.hpp`
|
||||
- `src/Testing/{Assert,Runner,Subprocess}.cpp`
|
||||
- `tests/standalone/Testing/{FrameworkHardening,Deterministic}.cpp`
|
||||
|
||||
## 4. Edge cases
|
||||
- Child process `flood` saturating stdout and stderr concurrently drains via non-blocking `poll` with bounded truncation without pipe deadlock.
|
||||
- Child process `hang` beyond `ProcessTestOptions::timeout` terminates via `SIGKILL` and reports `ProcessOutcome::timed_out`.
|
||||
- Child process `abort` reports `ProcessOutcome::crashed` (`SIGABRT`) safely even under ASan/UBSan.
|
||||
- Property shrinking preserves counterexample failure category and reports `inconclusive` on step, time, or discard exhaustion.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `FrameworkHardening*|Deterministic*|Math*|ContainerFixture*|StructRepr*` and full 1,345+ `VoidTests` pass under RelWithDebInfo `-Werror` and ASan+UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w4b-testing -G Ninja -DVOID_ENABLED_MODULES="Core;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w4b-testing && /tmp/void-w4b-testing/tests/VoidTests --filter "FrameworkHardening*|Deterministic*|Math*|ContainerFixture*|StructRepr*" && ctest --test-dir /tmp/void-w4b-testing --output-on-failure --timeout 60'
|
||||
```
|
||||
@@ -0,0 +1,29 @@
|
||||
# Text ASCII Helpers, View Splitting, and Bounded Growth
|
||||
Task ID: M-TEXT-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-05, C-13
|
||||
|
||||
## 1. Context and baseline
|
||||
`src/Text/module.cmake` declares zero dependencies. `include/Void/Text/Str.hpp` currently uses `std::isspace`/`std::tolower`/`std::toupper`/`std::isalpha`/`std::isdigit`/`std::isalnum` without an explicit locale-free ASCII byte contract (`0..127` classified, bytes `>= 128` preserved unchanged) and lacks overflow/output-bounded splitting, replacing, repeating, and joining utilities.
|
||||
|
||||
## 2. Deliverables
|
||||
- Extended `include/Void/Text/Str.hpp` adding `constexpr noexcept` ASCII-only classifiers, `trim_*_ascii`, `to_lower_ascii`/`to_upper_ascii`, and `iequals_ascii`.
|
||||
- New `include/Void/Text/Bounded.hpp` defining `Void::Text::{TextLimits, TextError, EmptyParts, split_views, replace_bounded, repeat_bounded, join_bounded}` and re-exporting ASCII helpers.
|
||||
- Tests in `tests/standalone/Text/Str.cpp` and `tests/standalone/Text/Bounded.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Text/Str.hpp`: keep all 1.x `Void::Str` signatures intact; add `is_ascii_*`, `to_*_ascii_char`, `trim_{left,right,}_ascii`, `to_{lower,upper}_ascii`, `is_{alpha,digit,alnum}_ascii`, `iequals_ascii`.
|
||||
- `include/Void/Text/Bounded.hpp`: `TextLimits` (`max_input=16MiB`, `max_output=16MiB`, `max_parts=65536`), `TextError`, `split_views`, `replace_bounded`, `repeat_bounded`, `join_bounded`.
|
||||
|
||||
## 4. Edge cases
|
||||
- High bytes `0x80..0xFF` and multi-byte UTF-8 sequences preserved untouched by ASCII trim/case helpers; embedded NUL bytes preserved.
|
||||
- Empty delimiter/needle rejected with `TextError::Code::invalid_rule`; oversized input/parts/output rejected BEFORE allocating; `SIZE_MAX` count*size multiplication rejected with `TextError::Code::overflow`; shrinking `replace_bounded` verified cleanly.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `Str*` and `Bounded*` tests plus full `Text;Testing` suite pass under `-DVOID_WARNINGS_AS_ERRORS=ON` without Unicode linkage.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-p1-text -G Ninja -DVOID_ENABLED_MODULES="Text;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-p1-text && /tmp/void-p1-text/tests/VoidTests --filter "Str*|Bounded*" && ctest --test-dir /tmp/void-p1-text --output-on-failure --timeout 60'
|
||||
```
|
||||
@@ -0,0 +1,32 @@
|
||||
# Time Injected Clocks and Bounded Stopwatch
|
||||
Task ID: M-TIME-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Time/Stopwatch.hpp` hardcodes `std::chrono::steady_clock::now()`, grows `laps_` without bound, and lacks `resume()`. No injectable `MonotonicClock` / `CivilClock` / `ManualClock` interface exists yet for deterministic testing or Async deadlines.
|
||||
|
||||
## 2. Deliverables
|
||||
- `include/Void/Time/Clock.hpp` (`MonotonicClock`, `CivilClock`, `SystemMonotonicClock`, `SystemCivilClock`, `ManualClock`, `ManualCivilClock`, `remaining_until`).
|
||||
- Updated clock-injectable, bounded `Stopwatch` (`resume`, single-sample `split`, `try_lap` capped at 4,096) and `ScopedTimer` clock overload in `include/Void/Time/Stopwatch.hpp`.
|
||||
- `tests/standalone/Time/Clock.cpp` and deterministic tests in `tests/standalone/Time/Stopwatch.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Time/Clock.hpp`: atomic nanosecond storage in `ManualClock`/`ManualCivilClock`, checked `advance` (`negative_step`, `overflow`), monotonic `set` in `ManualClock`, `remaining_until(clock, deadline)`.
|
||||
- `include/Void/Time/Stopwatch.hpp`: `StopwatchError { not_running, lap_limit_reached }`, `kDefaultMaxLaps = 4096`, borrowed `MonotonicClock` constructors, `resume()`, `try_lap()`, single-sample `split()`, legacy `lap()` compatibility.
|
||||
|
||||
## 4. Edge cases
|
||||
- `ManualClock::advance` with negative duration or `INT64_MAX` overflow leaves time unchanged and returns `ClockError`.
|
||||
- `Stopwatch::start() -> stop() -> advance(clock) -> resume()` preserves prior elapsed & laps without counting stopped idle time.
|
||||
- `try_lap()` at `max_laps_` returns `lap_limit_reached` without growing `laps_`.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- Existing sleep-based `Time`/`Stopwatch` tests pass; deterministic `ManualClock` tests run with zero sleeps under `-Werror`.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-time -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Time;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-time --parallel 4
|
||||
dev cpp-gcc -c /tmp/void-p1-time/tests/VoidTests --filter "Clock*|Stopwatch*|Time*"
|
||||
```
|
||||
@@ -0,0 +1,28 @@
|
||||
# Update Verify-Before-Parse, Replay Floor, Trust Store, Pinned Pruning & Recoverable Install Coordinator
|
||||
Task ID: M-UPDATE-01..06
|
||||
Phase: P2 (Wave 6B)
|
||||
Status: APPROVED
|
||||
Contracts: C-02, C-03, C-04, C-05, C-06, C-07, C-09, C-10
|
||||
|
||||
## 1. Context and baseline
|
||||
`Void::Update` preserves existing feed/component verification, readable envelopes, greatest-compatible-version selection, and `VersionStore` durable activation/commit/rollback/reconcile/external-health semantics while fixing the schema-3 verify-before-payload-parse bug in `src/Update/Feed.cpp`, introducing explicit `SchemaParsePolicy` (`LegacyGeneralJson` vs `StrictJsonProfile`), non-forgeable `VerifiedSelection`, durable monotonic `ReplayFloorStore`, explicit `TrustStore` rotation/revocation, pin-aware bounded `VersionStore::pruneWithPins`, checksummed `OperationJournal`, and `InstallCoordinator` integrating `Archive`'s staged atomic publication and `VersionStore`'s single commit boundary.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Update/module.cmake` (`INTERNAL_DEPS Archive Crypto Data Functional System Text Time`).
|
||||
- `include/Void/Update/Types.hpp`: `kUpdateErrorDomain = 20`, `UpdateErrorCode`, `make_update_error`, `SchemaParsePolicy`, `InstallState`, `ActivationMode`, `ReleaseIdentity`, `InstallReceipt`, `InstallOptions` (1 active, 8 queued, 2 concurrent downloads, 512 MiB artifact, 2 GiB staging quota, 32 components, 256 edges, 10m deadline, 30s readiness, 1s probe interval, 3 consecutive healthy, 2 retained previous, 16 prune batch).
|
||||
- `include/Void/Update/Feed.hpp` & `src/Update/Feed.cpp`: move `Crypto::verifyEd25519` strictly BEFORE payload JSON parsing/comparison in schema-3 `verifyEnvelope`, support `SchemaParsePolicy::StrictJsonProfile` (integer-only strict JSON via `Void::Json::Strict::ParseOptions{.allowDecimals = false}`), add non-forgeable `VerifiedSelection` + `verify_and_select_release` / `verify_and_select_component_set`.
|
||||
- `include/Void/Update/VersionStore.hpp` & `src/Update/VersionStore.cpp`: add `PruneReport` and `pruneWithPins(retainedPreviousVersions, pinnedVersions, batchLimit = 16)`.
|
||||
- `include/Void/Update/Install.hpp` & `src/Update/Install.cpp` (included from `Update.hpp`): `ReplayFloorStore` (atomic via `Void::FileSystem::replace_file`, monotonic across restarts/key rotations/clock rollback), `TrustStore` (bootstrap, authenticated rotation, revocation), `ArtifactTransport` + `LocalFileArtifactTransport`, `LifecycleHooks`, checksummed `OperationJournal` (`RecoveryRequired` on unknown/corrupt), and `InstallCoordinator` (`install`, idempotent `reconcile`, `retry_cleanup`, `shutdown`).
|
||||
- `tests/standalone/Update/UpdateHardening.cpp`, `tests/package/UpdateOnly/*`, registered in `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Edge cases
|
||||
- Invalid signature over malformed JSON payload in schema-3 envelopes fails at signature verification without ever invoking payload JSON parsing.
|
||||
- Replay floor never decreases on restart, key rotation, or civil-clock rollback.
|
||||
- Post-commit cleanup/prune failures transition receipt to `CleanupPending` with retryable diagnostics and NEVER trigger rollback; calling `rollback` after durable healthy marker preserves the committed candidate.
|
||||
- Unknown/corrupt operation journal entries halt automation with `RecoveryRequired` without discarding evidence.
|
||||
- Pinned versions cannot be pruned; prune reports skipped-pin pressure rather than breaking live pins.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -p libarchive -p openssl -c bash -lc 'cmake -S . -B /tmp/void-w6b-update -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="Update;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w6b-update && /tmp/void-w6b-update/tests/VoidTests --filter "Update*|update_*|component_feed_*|readable_component_*|version_store_*" && ctest --test-dir /tmp/void-w6b-update --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# Algorithms Indexed Graph Views, Work Budgets, and Iterative Traversals/Topology
|
||||
Task ID: S-ALGORITHMS-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-05, C-07
|
||||
|
||||
## 1. Context and baseline
|
||||
VoidLibrary currently has no `Algorithms` module (`src/Algorithms/module.cmake`, `include/Void/Algorithms/`). Graph algorithms are needed as a standalone header-only module with strict dependency discipline (`INTERNAL_DEPS Core Math`), zero unbounded recursion, pre-checked scratch memory budgets, overflow-safe sizing via `Void::Numeric`, and safe cancellation / concurrent graph mutation detection.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Algorithms/module.cmake` declaring `INTERNAL_DEPS Core Math`.
|
||||
- New `include/Void/Algorithms/Graph.hpp` defining `Void::Algorithms::{WorkLimits, AlgorithmError, Topology, TraversalResult, ShortestPathResult, IndexedGraphView, HasVersionStamp, AdjacencyView}` and iterative `bfs`, `dfs`, `shortest_path_unweighted`, and `topological_order`.
|
||||
- Comprehensive unit and edge-case tests in `tests/standalone/Algorithms/Graph.cpp`.
|
||||
- Package consumer `tests/package/AlgorithmsOnly/{CMakeLists.txt,main.cpp}` registered in `tests/package/InstalledComponents.cmake` (`Algorithms Math Core`).
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `src/Algorithms/module.cmake`
|
||||
- `include/Void/Algorithms/Graph.hpp`
|
||||
- `tests/standalone/Algorithms/Graph.cpp`
|
||||
- `tests/package/AlgorithmsOnly/CMakeLists.txt`
|
||||
- `tests/package/AlgorithmsOnly/main.cpp`
|
||||
- `tests/package/InstalledComponents.cmake`
|
||||
|
||||
## 4. Edge cases
|
||||
- Out-of-range source/target vertex IDs or `vertex_count()` exceeding `WorkLimits` rejected before scratch allocations.
|
||||
- Overflowing edge/vertex scratch budget calculations rejected using `Void::Numeric::checked_mul`/`checked_add`.
|
||||
- Out-of-range neighbor IDs in adjacency lists diagnosed cleanly without out-of-bounds vector access.
|
||||
- Deep graphs (`> 100k` vertices / chains) execute strictly iteratively with no stack overflow.
|
||||
- `topological_order` uses Kahn's algorithm and, on cycle detection, runs iterative 3-color DFS to extract a deterministic cycle witness `[u0, ..., uk, u0]`.
|
||||
- Periodic `std::stop_token` and `HasVersionStamp::version()` checks abort mid-traversal with `cancelled` / `concurrent_modification`.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `Graph*` tests and `VoidInstalledComponentConsumers` (`AlgorithmsOnly`) pass under `-DVOID_WARNINGS_AS_ERRORS=ON` and ASan/UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w4a-alg -G Ninja -DVOID_ENABLED_MODULES="Algorithms;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w4a-alg && /tmp/void-w4a-alg/tests/VoidTests --filter "Graph*" && ctest --test-dir /tmp/void-w4a-alg --output-on-failure --timeout 60'
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
# IO Portable Driver, BufferLease, Mock Backend, and Linux Epoll Driver
|
||||
Task ID: S-IO-01, S-IO-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-03, C-04, C-06
|
||||
|
||||
## 1. Context and baseline
|
||||
VoidLibrary currently has no `IO` module (`src/IO/`, `include/Void/IO/`). Now that `Async` (`M-ASYNC-02`, `M-ASYNC-03`) and `Time` (`M-TIME-02`) are in place, `IO` can expose a dependency-minimal native descriptor/stream layer (`INTERNAL_DEPS Core Functional Time Memory Async`) with zero dependency on `Net`, `Runtime`, `System`, or `Log`.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/IO/module.cmake` (`INTERNAL_DEPS Core Functional Time Memory Async`).
|
||||
- `include/Void/IO/Types.hpp`: `IoErrorCode` (`kIoErrorDomain = 8`), `make_io_error`, `Transfer`, `ComposedTransferError`, `IoLimits`, `BackendPreference`, `BackendOptions`, `DescriptorId`, `DriverTelemetry`, and PMR/quota-tracked `BufferLease`.
|
||||
- `include/Void/IO/Driver.hpp`, `include/Void/IO/Stream.hpp`, `src/IO/EpollDriver.cpp`:
|
||||
- `Driver` (`create`, `allocate_buffer`, `create_mock_stream`, `mock_controller`, `adopt_fd`, `create_socket_pair`, `poll_once`, `wake`, `request_stop`, `shutdown_and_join`, `telemetry`, `active_backend`).
|
||||
- `ByteStream` (`read_some`, `write_some`, `read_some_owned`, `write_some_owned`, `close_and_join`) plus composed `read_exact` / `write_all`.
|
||||
- Portable `MockBackend` for deterministic concurrency/stop-race verification and Linux level-triggered `EpollBackend` (no `EPOLLET`, `eventfd` wakeups, `(slot, generation)` tokens).
|
||||
- `tests/standalone/IO/IoDriver.cpp` and installed package consumer `tests/package/IOOnly/{CMakeLists.txt,main.cpp}` registered in `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `src/IO/module.cmake`, `src/IO/EpollDriver.cpp`
|
||||
- `include/Void/IO/{Types,Driver,Stream}.hpp`
|
||||
- `tests/standalone/IO/IoDriver.cpp`
|
||||
- `tests/package/IOOnly/{CMakeLists.txt,main.cpp}`, `tests/package/InstalledComponents.cmake`
|
||||
|
||||
## 4. Edge cases
|
||||
- Zero-length `read_some`/`write_some` succeeds immediately (`Transfer{0, false}`) without probing EOF.
|
||||
- Same-direction overlapping operation on a stream rejects with `IoErrorCode::busy`; simultaneous `read_some` + `write_some` succeeds.
|
||||
- Pre-stopped options or expired injected `MonotonicClock` deadline rejected before backend submission; active ops never resume continuations while backend holds `backend_refs` or borrowed buffers.
|
||||
- Linux epoll level-triggered handling handles `EAGAIN`/`EINTR`/short transfers, drains buffered data before `EOF`/`HUP`, ignores stale `(slot, generation)` events after fd reuse, and keeps `EPOLLOUT` disabled when no write is pending.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `Io*` tests and `VoidInstalledComponentConsumers` (`IOOnly`) pass under `-DVOID_WARNINGS_AS_ERRORS=ON`, ASan+UBSan, and Debug TSan (`-DVOID_ENABLE_TSAN=ON`).
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w4b-io -G Ninja -DVOID_ENABLED_MODULES="IO;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w4b-io && /tmp/void-w4b-io/tests/VoidTests --filter "Io*" && ctest --test-dir /tmp/void-w4b-io --output-on-failure --timeout 60'
|
||||
```
|
||||
@@ -0,0 +1,27 @@
|
||||
# IPC Wire Codec, Quota Reservations, Local UDS/Pipe Transport, and Session
|
||||
Task ID: S-IPC-01..03
|
||||
Phase: P2 (Wave 6A)
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-03, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
New subsystem `Void::IPC` (`src/IPC/module.cmake`, `INTERNAL_DEPS Core Functional Memory Time Binary Async IO Resilience`) providing V1 `VDIP` 24-byte big-endian framed RPC/messaging over pathname `AF_UNIX` `SOCK_STREAM` and supervised child pipe pairs (`adopt_pipe_pair`).
|
||||
|
||||
## 2. Deliverables
|
||||
- `include/Void/Functional/Error.hpp`: reserve `kIpcErrorDomain = 16` (plus remaining P2 domains `17..21`).
|
||||
- `include/Void/IPC/{Types,Codec,Transport,Session,IPC}.hpp` & `src/IPC/{Codec,Transport,Session}.cpp`:
|
||||
- `IpcErrorCode`, `IpcLimits`, `EffectStatus`, `CallFailure`, `PeerCredentials`, `PeerPolicy`, `HelloInfo`.
|
||||
- V1 24B `VDIP` codec + `BufferQuota`/`QuotaPermit` + incremental `FrameDecoder` validating magic/version/flags/stream/request ID/limits and reserving global (`64 MiB`) + per-session quotas before payload allocation.
|
||||
- `LocalListener` (0700 owned parent dir, `sun_path < 108`, startup `flock` + failed `connect` stale cleanup, `SOCK_NONBLOCK|SOCK_CLOEXEC`, `fchmod(0600)` before `bind()`, `SO_PEERCRED`), `connect_local`, `adopt_pipe_pair` (`PeerCredentials::available == false`).
|
||||
- Full-duplex `Session` (`handshake`, `start`, `request`, `send_one_way`, `send_goaway`, `close_and_join` rejecting `self_join`), monotonic request IDs, `TokenBucket` per-peer rate limit, reserved control lane (`8 KiB`/`16` frames), `256` late-response tombstones, advisory `cancel`, single terminal completion, zero auto-replay.
|
||||
- `tests/standalone/IPC/Ipc.cpp` & `tests/package/IPCOnly/*`.
|
||||
|
||||
## 3. Edge cases
|
||||
- Oversize/corrupt headers fail before any payload allocation or quota charge.
|
||||
- Saturated data lane still delivers reserved control-lane `cancel`/`overloaded`/`rate_limited` replies without deadlock.
|
||||
- Peer disconnect faults active requests once with `transport_lost` and `EffectStatus::unknown`.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w6a-ipc -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="IPC;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w6a-ipc && /tmp/void-w6a-ipc/tests/VoidTests --filter "Ipc*" && ctest --test-dir /tmp/void-w6a-ipc --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,36 @@
|
||||
# NEW Memory Subsystem Core Allocators and Resources
|
||||
Task IDs: S-MEMORY-02, S-MEMORY-03, S-MEMORY-04
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
No `src/Memory` module or `include/Void/Memory` headers exist yet. Containers and future IO/Storage modules need bounded PMR budget tracking, bump arenas with checkpoints/typed destructor scopes, and fixed-size block pools.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Memory/module.cmake` (`INTERFACE`, depending only on `Core`).
|
||||
- `include/Void/Memory/{Resource.hpp,BudgetResource.hpp,Arena.hpp,BlockPool.hpp}`.
|
||||
- `tests/standalone/Memory/{BudgetResource.cpp,Arena.cpp,BlockPool.cpp}`.
|
||||
- `tests/package/MemoryOnly/{CMakeLists.txt,main.cpp}` wired into `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `Resource.hpp`: `AllocationError`, `UnlimitedTag`/`unlimited`, `ResourceStats`, `is_valid_alignment`.
|
||||
- `BudgetResource.hpp`: atomic CAS `std::pmr::memory_resource` with reservation rollback on upstream `std::bad_alloc`, overflow detection, zero-limit positive rejection.
|
||||
- `Arena.hpp`: fixed, growing, and initial+growing modes (`64 KiB` slab, `1 MiB` geometric cap, `16 MiB` default max), address-aligned bump allocation (explicit 1-byte reservation for 0-byte calls), `Checkpoint`/`rewind`/`reset` with generation checks, `TypedScope` (reverse dtor order, exception-safe `emplace`, 4,096 default registrations), `ArenaResource`.
|
||||
- `BlockPool.hpp`: per-slab intrusive free lists (zero allocations on `deallocate`, safe `trim_idle` of completely idle slabs, default 4,096 blocks / 16 MiB cap) and `SynchronizedBlockPool`.
|
||||
|
||||
## 4. Edge cases
|
||||
- Over-aligned (`alignas(64)`) allocation inside a misaligned/stack fixed buffer aligns the actual pointer address rather than only the offset.
|
||||
- Stale checkpoint after `reset()` returns `invalid_checkpoint`; `reset()`/`rewind()` while a `TypedScope` is live returns `live_allocations`.
|
||||
- `BlockPool::trim_idle()` never touches slabs with live blocks and maintains intact per-slab free lists.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- Standalone `-DVOID_ENABLED_MODULES=Memory -DVOID_ENABLE_TESTING=OFF` installs and runs `MemoryOnly` with zero external packages.
|
||||
- All Memory tests pass under ASan/UBSan and `-Werror`.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-memory -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Memory;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-memory --parallel 4
|
||||
dev cpp-gcc -c ctest --test-dir /tmp/void-p1-memory --output-on-failure --timeout 60
|
||||
```
|
||||
@@ -0,0 +1,31 @@
|
||||
# Observability Hooks, Context, Metrics, and Tracing
|
||||
Task ID: S-OBSERVABILITY-01..04
|
||||
Phase: P2
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-03, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
`ObservabilityHooks` and `Observability` do not yet exist in `src/` or `include/Void/Observability/`. Higher modules need zero-dependency instrumentation hooks, `HookLease` drain lifetimes, immutable `ContextSnapshot` propagation, bounded producer-sharded metrics, head-sampled bounded tracing, and a deterministic text snapshot exporter with zero dependency on `Async`, `IO`, `Runtime`, `Log`, `Net`, `Configuration`, or `System`.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/ObservabilityHooks/module.cmake` (header-only `Void/Observability/Hooks.hpp`, zero deps)
|
||||
- `src/Observability/module.cmake` (`INTERNAL_DEPS ObservabilityHooks Core Functional Time Memory`, `EXCLUDE_HEADERS Void/Observability/Hooks.hpp`)
|
||||
- `include/Void/Observability/Hooks.hpp`: `MetricKind`, `AttributeView`, `MetricPoint`, `DiagnosticEvent`, `ObservationHooks`, `kNullObservationHooks`, `DrainStatus`, `HookRegistrationId`, `HookLease`, `HookSlot`
|
||||
- `include/Void/Observability/Context.hpp`: `ObservabilityErrorCode`, `make_observability_error` (`kObservabilityErrorDomain = 14`), `TraceId`, `SpanId`, `TraceContext`, `ContextLimits`, `ContextSnapshot`, `ScopedContext`
|
||||
- `include/Void/Observability/AsyncContext.hpp`: `bind_context`, `ContextAwaitable` (no `#include <Void/Async/...>`)
|
||||
- `include/Void/Observability/Metrics.hpp` & `src/Observability/Metrics.cpp`: `MetricsLimits`, `InstrumentSpec`, `InstrumentHandle`, `HistogramSnapshot`, `SeriesSnapshot`, `MetricsSnapshot`, `MetricRegistry`
|
||||
- `include/Void/Observability/Tracing.hpp` & `src/Observability/Tracing.cpp`: `TracingLimits`, `SpanStatus`, `SpanSpec`, `SpanEvent`, `CompletedSpan`, `ExportBatch`, `ExportReport`, `ExportOptions`, `Span`, `SpanExporter`, `CallbackSpanExporter`, `TextSnapshotExporter`, `Tracer`
|
||||
- `include/Void/Observability/Observability.hpp`
|
||||
- `tests/standalone/Observability/Observability.cpp`
|
||||
- `tests/package/ObservabilityHooksOnly/{CMakeLists.txt,main.cpp}` & `tests/package/ObservabilityOnly/{CMakeLists.txt,main.cpp}` registered in `tests/package/InstalledComponents.cmake`
|
||||
|
||||
## 3. Edge cases
|
||||
- Null hooks allocate zero memory and initialize no backend.
|
||||
- `HookSlot::detach_and_drain` detects self-drain from within an active callback (`would_deadlock`) and destroys owners strictly outside the lock.
|
||||
- Exiting producer threads retain their metric shards via `std::shared_ptr<Shard>` in `MetricRegistry` while `thread_local` caches hold `std::weak_ptr<Shard>`, preventing leaks when `MetricRegistry` is destroyed.
|
||||
- Cardinality overflow routes to `__overflow__` and increments overflow counters; exporting respects span/byte caps, retry limits, and deadline/stop without spawning hidden background threads.
|
||||
|
||||
## 4. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w5-obs -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLED_MODULES="Observability;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w5-obs && /tmp/void-w5-obs/tests/VoidTests --filter "Observability*" && ctest --test-dir /tmp/void-w5-obs --output-on-failure --timeout 120'
|
||||
```
|
||||
@@ -0,0 +1,35 @@
|
||||
# Runtime Inert Host, Validated Limits, EmbeddedResources, and ResourceGraph
|
||||
Task ID: S-RUNTIME-01
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-04, C-05, C-09
|
||||
|
||||
## 1. Context and baseline
|
||||
VoidLibrary currently has no `Runtime` module (`src/Runtime/`, `include/Void/Runtime/`). P1 establishes the inert managed composition contracts on top of `Core`, `Functional`, `Time`, `Memory`, `Algorithms`, `Async`, and `IO` without implicitly starting worker threads or depending on `System`, `Net`, `Service`, or `Log`.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Runtime/module.cmake` (`INTERNAL_DEPS Core Functional Time Memory Algorithms Async IO`).
|
||||
- `include/Void/Runtime/Options.hpp`: `kRuntimeErrorDomain = 11`, `RuntimeLimits`, `ShutdownPolicy`, `Options`, `validate_options`.
|
||||
- `include/Void/Runtime/ResourceGraph.hpp`: `ResourceOwnership`, `ResourceKind`, `ResourceNode`, `LifecyclePlan`, and `ResourceGraph` (`add_node`, `add_dependency`, `validate_and_plan` via `Void::Algorithms::topological_order`).
|
||||
- `include/Void/Runtime/Host.hpp`: `HostState`, `EmbeddedResources`, `ShutdownReport`, inert `Host` (`create`, `create_embedded`), and `HostBuilder`.
|
||||
- `tests/standalone/Runtime/RuntimeHost.cpp` and installed consumer `tests/package/RuntimeOnly/{CMakeLists.txt,main.cpp}` registered in `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `src/Runtime/module.cmake`
|
||||
- `include/Void/Runtime/{Options,ResourceGraph,Host}.hpp`
|
||||
- `tests/standalone/Runtime/RuntimeHost.cpp`
|
||||
- `tests/package/RuntimeOnly/{CMakeLists.txt,main.cpp}`, `tests/package/InstalledComponents.cmake`
|
||||
|
||||
## 4. Edge cases
|
||||
- `Host::create()` starts zero worker threads and opens zero OS descriptors (`HostState::constructed`).
|
||||
- Zero worker counts in non-embedded mode, zero limits, `drain_grace > total_timeout`, and submodule `IO::BackendOptions::limits` exceeding global `RuntimeLimits` reject before construction.
|
||||
- `EmbeddedResources::validate()` rejects null required ports (`executor`, `io`, `clock`).
|
||||
- `ResourceGraph::validate_and_plan()` catches duplicate node IDs, missing required dependencies, and dependency cycles (preserving cycle witness) while producing deterministic startup order and exact reverse shutdown order.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `Runtime*` tests and `VoidInstalledComponentConsumers` (`RuntimeOnly`) pass under `-DVOID_WARNINGS_AS_ERRORS=ON` and ASan+UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w4b-runtime -G Ninja -DVOID_ENABLED_MODULES="Runtime;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w4b-runtime && /tmp/void-w4b-runtime/tests/VoidTests --filter "Runtime*" && ctest --test-dir /tmp/void-w4b-runtime --output-on-failure --timeout 60'
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# Unicode 17.0.0 Manifest and Strict/Repair/Streaming UTF Codecs
|
||||
Task ID: S-UNICODE-01, S-UNICODE-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-05, C-07
|
||||
|
||||
## 1. Context and baseline
|
||||
VoidLibrary currently has no `Unicode` module (`src/Unicode/`). `Text` handles locale-free ASCII-only operations (`M-TEXT-02`), while UTF-8/UTF-16/UTF-32 validation, transcoding, one-unit repair, and streaming decoding must live in a dedicated `Unicode` module pinning Unicode `17.0.0` metadata and keeping `Text` independent of Unicode data.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Unicode/module.cmake` declaring `INTERNAL_DEPS Core Text`.
|
||||
- `src/Unicode/MANIFEST.md` pinning Unicode `17.0.0`, official UCD source URL, and Unicode license notice.
|
||||
- New `include/Void/Unicode/Utf.hpp` defining `Void::Unicode::{data_version, is_scalar_value, UtfPolicy, UtfErrorKind, UtfError, Scalar, UtfLimits, TranscodeCounts}`, strict & `replace_one_unit` validation/transcoding functions for UTF-8/UTF-16/UTF-32 (owning and into-`std::span`), and stateful `Utf8StreamDecoder` / `Utf16StreamDecoder`.
|
||||
- Tests in `tests/standalone/Unicode/Utf.cpp`.
|
||||
- Package consumer `tests/package/UnicodeOnly/{CMakeLists.txt,main.cpp}` registered in `tests/package/InstalledComponents.cmake` (`Unicode Text Core`).
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `src/Unicode/module.cmake`
|
||||
- `src/Unicode/MANIFEST.md`
|
||||
- `include/Void/Unicode/Utf.hpp`
|
||||
- `tests/standalone/Unicode/Utf.cpp`
|
||||
- `tests/package/UnicodeOnly/CMakeLists.txt`
|
||||
- `tests/package/UnicodeOnly/main.cpp`
|
||||
- `tests/package/InstalledComponents.cmake`
|
||||
|
||||
## 4. Edge cases
|
||||
- Rejects overlong UTF-8 sequences, UTF-16 surrogates (`U+D800..U+DFFF`) in UTF-8/UTF-32, unpaired surrogates in UTF-16, code points `> U+10FFFF`, and truncated sequences under `UtfPolicy::reject`.
|
||||
- One-unit repair (`replace_one_unit`) emits `U+FFFD` per ill-formed unit and advances cleanly by one code unit without skipping subsequent valid units; streaming chunk boundaries match one-shot behavior identically.
|
||||
- Pre-reserve limit checks against `UtfLimits` reject oversized inputs/outputs before large allocations; periodic `std::stop_token` checks abort long transcodes cleanly.
|
||||
- Streaming `Utf8StreamDecoder` / `Utf16StreamDecoder` split sequences across arbitrary 1-byte/1-unit boundaries and flush trailing incomplete sequences cleanly at EOF.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `Utf*` tests and `VoidInstalledComponentConsumers` (`UnicodeOnly`) pass under `-DVOID_WARNINGS_AS_ERRORS=ON` and ASan/UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w4a-unicode -G Ninja -DVOID_ENABLED_MODULES="Unicode;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w4a-unicode && /tmp/void-w4a-unicode/tests/VoidTests --filter "Utf*" && ctest --test-dir /tmp/void-w4a-unicode --output-on-failure --timeout 60'
|
||||
```
|
||||
@@ -0,0 +1,62 @@
|
||||
# Foundation and data plans
|
||||
Task ID: T-DOC-101
|
||||
Role: sol_implementer
|
||||
Status: APPROVED
|
||||
|
||||
## 1. Context and baseline
|
||||
Repository/cwd /home/faumaray/Projects/VoidLibrary, main at f1f9ba375b22abf1adcc7c550ec21ac20895c0a4. Tracked tree was clean; unrelated protected untracked .env, WG.conf, keys and .serena untouched. Parent now authors docs/roadmap and docs/agent-workflow in the shared checkout. User approved a detailed planning package with "Implement the plan"; the approved plan explicitly says feature implementation follows separately. Prior astra_planner architecture investigation and fresh astra_reviewer preflight READY completed. You implement documentation only. Requirements R-001 through R-016 in docs/roadmap/REQUIREMENTS.md are authoritative. Role configured Sol/XHigh; no alternate model selection.
|
||||
|
||||
## 2. Objective and deliverables
|
||||
Author all 11 exclusive Markdown files listed below as substantial, individually actionable plans grounded in existing source. Module plans cover existing capabilities and expansion; subsystem/platform plans clearly mark NEW designs. Deliver actual documents, not summaries or placeholders. Each includes source baseline, concrete capability backlog, proposed APIs/types/examples, dataflow/algorithms/ownership/failure behavior, backend rationale, performance/resource limits, ordered implementation tasks, validation and migration. Specific content emphasis: Deepen small utility and data capabilities without layering cycles. Core UUID cannot require broad Math. Functional owns errors/adapters, Time clocks, Memory allocators; Data general parsing must not broaden StrictJson signed-document semantics. New Unicode uses pinned data and explicit UTF error policy; Text dependency stays one-way. Define concrete native structures, numeric representation/checked conversions, binary writer and codec boundaries; specialized containers/algorithms justified by workloads, not wholesale reimplementation of std. Time benchmark changes distinguish measurement overhead. Propose coherent NEW API examples, bounds, migration, and meaningful tasks for every area.
|
||||
|
||||
## 3. Scope and non-goals
|
||||
Only planning documents are implemented. No C++ changes, CMake/CI changes, new runnable applications, dependency installation, benchmark execution, Git commits/pushes, publishing or configuration edits. No edits to another worker's files. Do not reopen the user interview, narrow the approved breadth, or implement features while documenting them. Existing docs/short-url.md remains intact. Do not change shared contracts unilaterally.
|
||||
|
||||
## 4. Files to inspect
|
||||
First read docs/roadmap/REQUIREMENTS.md, docs/roadmap/ARCHITECTURE.md, docs/agent-workflow/DECISIONS.md and /home/faumaray/.codex/skills/code-intelligence/SKILL.md. Inspect exact relevant headers under include/Void/{Core,Functional,Containers,Math,Text,Time,Binary,Data}, sources/module.cmake under src/{Core,Functional,Containers,Math,Text,Time,Binary,Data}, and tests/standalone/{Core,Functional,Containers,Math,Text,Time,Binary,Data}. These are real directories, not permission to traverse secrets. Adjacent explicitly identified shared source files are readable when necessary. CMakeLists.txt, cmake/Module.cmake and tests/CMakeLists.txt define current targets/tests; inspect only as needed, root owns cross-cutting analysis. New subsystems have no current source directory: label proposed paths NEW. Use scoped file inventory before citing any specific file not listed here.
|
||||
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: docs/roadmap/modules/Core.md; docs/roadmap/modules/Functional.md; docs/roadmap/modules/Containers.md; docs/roadmap/modules/Math.md; docs/roadmap/modules/Text.md; docs/roadmap/modules/Time.md; docs/roadmap/modules/Binary.md; docs/roadmap/modules/Data.md; docs/roadmap/subsystems/Memory.md; docs/roadmap/subsystems/Algorithms.md; docs/roadmap/subsystems/Unicode.md
|
||||
You are not alone in the codebase. All other files are non-owned, including shared roadmap root documents, workflow/task records, existing project docs and application/build/test files. Shared checkout is intentional; do not switch branches, reset, stash, clean, stage or commit. Edit only assigned Markdown files directly with apply_patch; create their parent directories if needed. Do not revert others' work. Root owns shared contracts and master integration. Return any conflict with exact evidence and proposed change to root.
|
||||
|
||||
## 6. Implementation or investigation approach
|
||||
1. Read shared contracts C-01..C-14 and preserve them. Root-owned decisions already select overall scope, boundaries and algorithms; fill bounded details for your assigned areas coherently.
|
||||
2. Confirm repo and codememory project home-faumaray-Projects-VoidLibrary identity/freshness with index_status. Query only scoped include/src/tests paths. Graph may contain protected data, so no whole-repo text/graph browsing. Use search_graph then trace_path/get_code_snippet for structure; inspect source for important claims. Call check_index_coverage for EVERY relied-on source file and directly read flagged missing ranges. If graph unavailable, use scoped source fallback and disclose. Serena manual must be read if used; project is already active VoidLibrary, do not change activation.
|
||||
3. For each document, ground existing features/tests and gaps before designing NEW additions. Cite portable relative source links from the file location, not absolute workstation paths. Keep source facts separate from design recommendations.
|
||||
4. Use sections tailored to the area but cover all deliverables. Each task gets a unique ID M-<MODULE>-NN, S-<SUBSYSTEM>-NN, or P-<PLATFORM>-NN, explicit dependencies, intended implementation scope, acceptance and role recommendation. Use phase P0 baseline, P1 foundations, P2 module completion, P3 initial platforms/optimization, P4 distributed. All feature tasks are PLANNED.
|
||||
5. Draft concrete representative NEW API/type shapes; preserve existing namespace facts and distinguish illustrative NEW code from compiling examples. Shared types are referenced to their owner, not independently redefined. Choose bounded sensible defaults and explain tradeoffs. Avoid unspecified "consider X or Y" where it changes implementation; select a design or explicitly stage alternatives behind a later named capability gate.
|
||||
6. Native-vs-external choices are per module. Retain current security primitives as initial implementations. Cite primary sources already supplied below; if new consequential library facts require research, use context7 skill resolving library id first, then official docs/web only, never submit private source.
|
||||
7. Cross-link shared architecture/performance/validation/migration and relevant area documents. Other workers may still be creating them; expected names in master contract below are valid planned links. Do not repeatedly check unfinished peers.
|
||||
8. Validate your own documents for ownership, meaningful content, source/path accuracy, unique IDs and no unresolved placeholders. Tell root any shared decision that needs reconciliation. Do not pad every file with repeated common text.
|
||||
|
||||
## 7. Interfaces and data contracts
|
||||
Authoritative shared contracts: architecture C-01 foundation layers; C-02 Result/expected errors; C-03 std::stop_token+steady deadline and one completion; C-04 embedded/managed composition; C-05 bounds; C-06 IO/Net; C-07 general vs strict signed data; C-08 native Storage separate from SQLite; C-09 owning Service/Plugin/C ABI; C-10 FSM/Scheduler/Update commit; C-11 Log/Observability; C-12 distributed ownership/consistency; C-13 naming/migration; C-14 platforms.
|
||||
Existing names must be source-verified. NEW API illustrations do not claim existence. Detailed task IDs use area names uppercased (e.g. M-ASYNC-01, S-IO-01, P-RELOADABLE-01). Relative references to peers: ../modules/<Name>.md, ../subsystems/<Name>.md or ../platforms/<Name>.md; shared files ../ARCHITECTURE.md, ../REQUIREMENTS.md, ../DEPENDENCIES.md, ../DELIVERY.md, ../PERFORMANCE.md, ../VALIDATION.md, ../MIGRATION.md, ../BUILD-AND-DISTRIBUTION.md, ../DOCUMENTATION.md.
|
||||
|
||||
## 8. Dependencies and integration
|
||||
Parent creates shared root documents and workflow records concurrently. Four worker packages have disjoint ownership. Existing modules planned: Core Functional Containers Math Text Data Async Time Log System Configuration Stacktrace Plugin Service Fsm Testing TestingMock Binary Archive Crypto Security Sqlite Resilience Update ShortUrl Net. NEW subsystems: Memory Algorithms Unicode IO Runtime Scheduler Storage IPC RPC Messaging Observability Discovery Coordination Replication DistributedStorage. Platforms: NetworkedApplications ReloadableApplications DistributedApplications. Only your listed paths are writable. Parent checks integration and commissions fresh adversarial review of actual docs. No dependency on other worker completion before drafting against ARCHITECTURE.md.
|
||||
|
||||
## 9. Edge cases security and performance
|
||||
Never read .env, .env.*, WG.conf, keys or descendants; ~/.config/agent-integrations, ~/.ssh, ~/.gnupg, ~/.opencodex, /run/agenix.d, nixos-config/jev_token. No broad indexing/reindexing and no private source in public queries. No credentials or other repository information in documents.
|
||||
Specify concrete failure paths, resource accounting, cancellation/shutdown and compatibility relevant to each area. No fabricated performance results, compiler support, test passes or production readiness. Performance profiles measure p50/p95/p99, throughput, allocations, peak RSS/CPU and build cost; avoid arbitrary universal speedup claims. Cryptographic/TLS recommendations based on OpenSSL 3.5 guide; new storage durability methodology on SQLite atomiccommit; Raft paper for consensus. Primary URLs: https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/ ; https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior ; https://sqlite.org/wal.html ; https://raft.github.io/raft.pdf ; https://man7.org/linux/man-pages/man7/epoll.7.html . Cite near claims.
|
||||
|
||||
## 10. Acceptance criteria
|
||||
1. All owned documents exist and contain distinct, substantial implementation guidance; no empty boilerplate or arbitrary word-count padding.
|
||||
2. Source links and existing behavior are checked; NEW contracts clearly labeled; source coverage limitations reported.
|
||||
3. Each plan has concrete APIs/dataflow, native/backend decision, ownership/failure/resource limits, task DAG/dependencies, test scenarios and compatibility/rollback.
|
||||
4. Shared C-01..C-14 contracts are respected and cross-links use agreed names.
|
||||
5. Commands distinguish CURRENT available checks from PROPOSED checks with prerequisites; future reference apps are specified only.
|
||||
6. No unowned modifications, implementation changes, unsupported measured claims or unresolved high-impact alternatives.
|
||||
|
||||
## 11. Verification commands and evidence
|
||||
Cwd /home/faumaray/Projects/VoidLibrary. Observed current baseline commands: cmake -S . -B /tmp/voidlibrary-discovery-f1f9ba3 -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=OFF -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src ; cmake --build /tmp/voidlibrary-discovery-f1f9ba3 --parallel 4 ; ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60. Do not rerun builds/tests for this documentation task. Normal build passed; VoidTests 1245 passed/2 failed/3 skipped out of1250; failures hard-code absent /bin/echo and /bin/cat; installed component consumers passed. Werror failed in cached Boost1.84 headers. No sanitizer/benchmark/cross-platform checks ran. Actual test runner --filter syntax exists but verify names before showing existing filtered commands. Generic future build paths must be labeled templates/proposed.
|
||||
Run documentation checks via scoped rg, file inventory and git diff --check -- <owned paths> (new files require direct content inspection too). Root will run full coverage/link/ID validation. Do not add a validation script or tests outside ownership.
|
||||
|
||||
## 12. Constraints and stop conditions
|
||||
No child agents or independent user questions. Stop on ownership collision, a required protected read, unavailable configured role, or a contradiction requiring shared contract change; report to parent with a bounded resolution. Missing graph coverage alone permits scoped direct reads. Do not treat an absent NEW file as a blocker. No commits/pushes or application edits. Finish all owned documents before returning unless a genuine blocker exists.
|
||||
|
||||
## 13. Authorization and decisions
|
||||
User approved this exact planning-package scope on 2026-11-24. Prior architectural planner and fresh preflight reviewer complete; current handoff specifies exclusive documentation ownership. Parent reviewed technical content and will lint full specification before dispatch. Default choices within ARCHITECTURE.md are authorized planning decisions. No permission to implement features is inferred.
|
||||
|
||||
## 14. Return format
|
||||
Return task ID; DONE/BLOCKED/PARTIAL; files changed; concise content/decision highlights; source and graph coverage limitations; exact documentation checks and outcomes; unrun checks; cross-file integration issues. Do not paste full documents or spawn children.
|
||||
@@ -0,0 +1,62 @@
|
||||
# Runtime, systems and reloadable platform plans
|
||||
Task ID: T-DOC-102
|
||||
Role: sol_implementer
|
||||
Status: APPROVED
|
||||
|
||||
## 1. Context and baseline
|
||||
Repository/cwd /home/faumaray/Projects/VoidLibrary, main at f1f9ba375b22abf1adcc7c550ec21ac20895c0a4. Tracked tree was clean; unrelated protected untracked .env, WG.conf, keys and .serena untouched. Parent now authors docs/roadmap and docs/agent-workflow in the shared checkout. User approved a detailed planning package with "Implement the plan"; the approved plan explicitly says feature implementation follows separately. Prior astra_planner architecture investigation and fresh astra_reviewer preflight READY completed. You implement documentation only. Requirements R-001 through R-016 in docs/roadmap/REQUIREMENTS.md are authoritative. Role configured Sol/XHigh; no alternate model selection.
|
||||
|
||||
## 2. Objective and deliverables
|
||||
Author all 11 exclusive Markdown files listed below as substantial, individually actionable plans grounded in existing source. Module plans cover existing capabilities and expansion; subsystem/platform plans clearly mark NEW designs. Deliver actual documents, not summaries or placeholders. Each includes source baseline, concrete capability backlog, proposed APIs/types/examples, dataflow/algorithms/ownership/failure behavior, backend rationale, performance/resource limits, ordered implementation tasks, validation and migration. Specific content emphasis: Freeze NEW Async operation options around std::stop_token plus optional steady deadline and reference Time's injectable clock; no separate context types per consumer. Resolve coroutine/frame ownership, cancellation/completion races and safe shutdown. IO uses level-triggered epoll sockets + bounded file workers initially, future optional io_uring. Managed Runtime depends on Async/IO, not vice versa. Service owning handles survive replacement and callbacks run outside registry locks. Plugin C ABI separate from existing C++ descriptors, with explicit generation and async-operation pins, quiescence/readiness and rollback. Fsm checkpoints state boundaries, cancels/joins race losers, consistent fault termination. Scheduler persistent job at-least-once semantics and occurrence IDs; IPC explicit framing and quotas. Configuration validation/reload must be transactional. Platform spec describes future runnable host, never implements it.
|
||||
|
||||
## 3. Scope and non-goals
|
||||
Only planning documents are implemented. No C++ changes, CMake/CI changes, new runnable applications, dependency installation, benchmark execution, Git commits/pushes, publishing or configuration edits. No edits to another worker's files. Do not reopen the user interview, narrow the approved breadth, or implement features while documenting them. Existing docs/short-url.md remains intact. Do not change shared contracts unilaterally.
|
||||
|
||||
## 4. Files to inspect
|
||||
First read docs/roadmap/REQUIREMENTS.md, docs/roadmap/ARCHITECTURE.md, docs/agent-workflow/DECISIONS.md and /home/faumaray/.codex/skills/code-intelligence/SKILL.md. Inspect exact relevant headers under include/Void/{Async,System,Configuration,Service,Fsm,Plugin}, sources/module.cmake under src/{Async,System,Configuration,Service,Fsm,Plugin}, and tests/standalone/{Async,System,Configuration,Service,Fsm,Plugin}. These are real directories, not permission to traverse secrets. Adjacent explicitly identified shared source files are readable when necessary. CMakeLists.txt, cmake/Module.cmake and tests/CMakeLists.txt define current targets/tests; inspect only as needed, root owns cross-cutting analysis. New subsystems have no current source directory: label proposed paths NEW. Use scoped file inventory before citing any specific file not listed here.
|
||||
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: docs/roadmap/modules/Async.md; docs/roadmap/modules/System.md; docs/roadmap/modules/Configuration.md; docs/roadmap/modules/Service.md; docs/roadmap/modules/Fsm.md; docs/roadmap/modules/Plugin.md; docs/roadmap/subsystems/IO.md; docs/roadmap/subsystems/Runtime.md; docs/roadmap/subsystems/Scheduler.md; docs/roadmap/subsystems/IPC.md; docs/roadmap/platforms/ReloadableApplications.md
|
||||
You are not alone in the codebase. All other files are non-owned, including shared roadmap root documents, workflow/task records, existing project docs and application/build/test files. Shared checkout is intentional; do not switch branches, reset, stash, clean, stage or commit. Edit only assigned Markdown files directly with apply_patch; create their parent directories if needed. Do not revert others' work. Root owns shared contracts and master integration. Return any conflict with exact evidence and proposed change to root.
|
||||
|
||||
## 6. Implementation or investigation approach
|
||||
1. Read shared contracts C-01..C-14 and preserve them. Root-owned decisions already select overall scope, boundaries and algorithms; fill bounded details for your assigned areas coherently.
|
||||
2. Confirm repo and codememory project home-faumaray-Projects-VoidLibrary identity/freshness with index_status. Query only scoped include/src/tests paths. Graph may contain protected data, so no whole-repo text/graph browsing. Use search_graph then trace_path/get_code_snippet for structure; inspect source for important claims. Call check_index_coverage for EVERY relied-on source file and directly read flagged missing ranges. If graph unavailable, use scoped source fallback and disclose. Serena manual must be read if used; project is already active VoidLibrary, do not change activation.
|
||||
3. For each document, ground existing features/tests and gaps before designing NEW additions. Cite portable relative source links from the file location, not absolute workstation paths. Keep source facts separate from design recommendations.
|
||||
4. Use sections tailored to the area but cover all deliverables. Each task gets a unique ID M-<MODULE>-NN, S-<SUBSYSTEM>-NN, or P-<PLATFORM>-NN, explicit dependencies, intended implementation scope, acceptance and role recommendation. Use phase P0 baseline, P1 foundations, P2 module completion, P3 initial platforms/optimization, P4 distributed. All feature tasks are PLANNED.
|
||||
5. Draft concrete representative NEW API/type shapes; preserve existing namespace facts and distinguish illustrative NEW code from compiling examples. Shared types are referenced to their owner, not independently redefined. Choose bounded sensible defaults and explain tradeoffs. Avoid unspecified "consider X or Y" where it changes implementation; select a design or explicitly stage alternatives behind a later named capability gate.
|
||||
6. Native-vs-external choices are per module. Retain current security primitives as initial implementations. Cite primary sources already supplied below; if new consequential library facts require research, use context7 skill resolving library id first, then official docs/web only, never submit private source.
|
||||
7. Cross-link shared architecture/performance/validation/migration and relevant area documents. Other workers may still be creating them; expected names in master contract below are valid planned links. Do not repeatedly check unfinished peers.
|
||||
8. Validate your own documents for ownership, meaningful content, source/path accuracy, unique IDs and no unresolved placeholders. Tell root any shared decision that needs reconciliation. Do not pad every file with repeated common text.
|
||||
|
||||
## 7. Interfaces and data contracts
|
||||
Authoritative shared contracts: architecture C-01 foundation layers; C-02 Result/expected errors; C-03 std::stop_token+steady deadline and one completion; C-04 embedded/managed composition; C-05 bounds; C-06 IO/Net; C-07 general vs strict signed data; C-08 native Storage separate from SQLite; C-09 owning Service/Plugin/C ABI; C-10 FSM/Scheduler/Update commit; C-11 Log/Observability; C-12 distributed ownership/consistency; C-13 naming/migration; C-14 platforms.
|
||||
Existing names must be source-verified. NEW API illustrations do not claim existence. Detailed task IDs use area names uppercased (e.g. M-ASYNC-01, S-IO-01, P-RELOADABLE-01). Relative references to peers: ../modules/<Name>.md, ../subsystems/<Name>.md or ../platforms/<Name>.md; shared files ../ARCHITECTURE.md, ../REQUIREMENTS.md, ../DEPENDENCIES.md, ../DELIVERY.md, ../PERFORMANCE.md, ../VALIDATION.md, ../MIGRATION.md, ../BUILD-AND-DISTRIBUTION.md, ../DOCUMENTATION.md.
|
||||
|
||||
## 8. Dependencies and integration
|
||||
Parent creates shared root documents and workflow records concurrently. Four worker packages have disjoint ownership. Existing modules planned: Core Functional Containers Math Text Data Async Time Log System Configuration Stacktrace Plugin Service Fsm Testing TestingMock Binary Archive Crypto Security Sqlite Resilience Update ShortUrl Net. NEW subsystems: Memory Algorithms Unicode IO Runtime Scheduler Storage IPC RPC Messaging Observability Discovery Coordination Replication DistributedStorage. Platforms: NetworkedApplications ReloadableApplications DistributedApplications. Only your listed paths are writable. Parent checks integration and commissions fresh adversarial review of actual docs. No dependency on other worker completion before drafting against ARCHITECTURE.md.
|
||||
|
||||
## 9. Edge cases security and performance
|
||||
Never read .env, .env.*, WG.conf, keys or descendants; ~/.config/agent-integrations, ~/.ssh, ~/.gnupg, ~/.opencodex, /run/agenix.d, nixos-config/jev_token. No broad indexing/reindexing and no private source in public queries. No credentials or other repository information in documents.
|
||||
Specify concrete failure paths, resource accounting, cancellation/shutdown and compatibility relevant to each area. No fabricated performance results, compiler support, test passes or production readiness. Performance profiles measure p50/p95/p99, throughput, allocations, peak RSS/CPU and build cost; avoid arbitrary universal speedup claims. Cryptographic/TLS recommendations based on OpenSSL 3.5 guide; new storage durability methodology on SQLite atomiccommit; Raft paper for consensus. Primary URLs: https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/ ; https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior ; https://sqlite.org/wal.html ; https://raft.github.io/raft.pdf ; https://man7.org/linux/man-pages/man7/epoll.7.html . Cite near claims.
|
||||
|
||||
## 10. Acceptance criteria
|
||||
1. All owned documents exist and contain distinct, substantial implementation guidance; no empty boilerplate or arbitrary word-count padding.
|
||||
2. Source links and existing behavior are checked; NEW contracts clearly labeled; source coverage limitations reported.
|
||||
3. Each plan has concrete APIs/dataflow, native/backend decision, ownership/failure/resource limits, task DAG/dependencies, test scenarios and compatibility/rollback.
|
||||
4. Shared C-01..C-14 contracts are respected and cross-links use agreed names.
|
||||
5. Commands distinguish CURRENT available checks from PROPOSED checks with prerequisites; future reference apps are specified only.
|
||||
6. No unowned modifications, implementation changes, unsupported measured claims or unresolved high-impact alternatives.
|
||||
|
||||
## 11. Verification commands and evidence
|
||||
Cwd /home/faumaray/Projects/VoidLibrary. Observed current baseline commands: cmake -S . -B /tmp/voidlibrary-discovery-f1f9ba3 -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=OFF -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src ; cmake --build /tmp/voidlibrary-discovery-f1f9ba3 --parallel 4 ; ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60. Do not rerun builds/tests for this documentation task. Normal build passed; VoidTests 1245 passed/2 failed/3 skipped out of1250; failures hard-code absent /bin/echo and /bin/cat; installed component consumers passed. Werror failed in cached Boost1.84 headers. No sanitizer/benchmark/cross-platform checks ran. Actual test runner --filter syntax exists but verify names before showing existing filtered commands. Generic future build paths must be labeled templates/proposed.
|
||||
Run documentation checks via scoped rg, file inventory and git diff --check -- <owned paths> (new files require direct content inspection too). Root will run full coverage/link/ID validation. Do not add a validation script or tests outside ownership.
|
||||
|
||||
## 12. Constraints and stop conditions
|
||||
No child agents or independent user questions. Stop on ownership collision, a required protected read, unavailable configured role, or a contradiction requiring shared contract change; report to parent with a bounded resolution. Missing graph coverage alone permits scoped direct reads. Do not treat an absent NEW file as a blocker. No commits/pushes or application edits. Finish all owned documents before returning unless a genuine blocker exists.
|
||||
|
||||
## 13. Authorization and decisions
|
||||
User approved this exact planning-package scope on 2026-11-24. Prior architectural planner and fresh preflight reviewer complete; current handoff specifies exclusive documentation ownership. Parent reviewed technical content and will lint full specification before dispatch. Default choices within ARCHITECTURE.md are authorized planning decisions. No permission to implement features is inferred.
|
||||
|
||||
## 14. Return format
|
||||
Return task ID; DONE/BLOCKED/PARTIAL; files changed; concise content/decision highlights; source and graph coverage limitations; exact documentation checks and outcomes; unrun checks; cross-file integration issues. Do not paste full documents or spawn children.
|
||||
@@ -0,0 +1,62 @@
|
||||
# Networking, security and distributed plans
|
||||
Task ID: T-DOC-103
|
||||
Role: sol_implementer
|
||||
Status: APPROVED
|
||||
|
||||
## 1. Context and baseline
|
||||
Repository/cwd /home/faumaray/Projects/VoidLibrary, main at f1f9ba375b22abf1adcc7c550ec21ac20895c0a4. Tracked tree was clean; unrelated protected untracked .env, WG.conf, keys and .serena untouched. Parent now authors docs/roadmap and docs/agent-workflow in the shared checkout. User approved a detailed planning package with "Implement the plan"; the approved plan explicitly says feature implementation follows separately. Prior astra_planner architecture investigation and fresh astra_reviewer preflight READY completed. You implement documentation only. Requirements R-001 through R-016 in docs/roadmap/REQUIREMENTS.md are authoritative. Role configured Sol/XHigh; no alternate model selection.
|
||||
|
||||
## 2. Objective and deliverables
|
||||
Author all 12 exclusive Markdown files listed below as substantial, individually actionable plans grounded in existing source. Module plans cover existing capabilities and expansion; subsystem/platform plans clearly mark NEW designs. Deliver actual documents, not summaries or placeholders. Each includes source baseline, concrete capability backlog, proposed APIs/types/examples, dataflow/algorithms/ownership/failure behavior, backend rationale, performance/resource limits, ordered implementation tasks, validation and migration. Specific content emphasis: Net: actual server transports, secure peer+hostname defaults, total deadlines, redirects, HTTP/WebSocket conformance, persistent connections, streaming and cancellation; native preference with existing Boost migration adapter. Crypto/OpenSSL and Security/libsodium remain initial cryptographic backends; distinguish cryptographic primitives from authentication/policy workflows. Preserve frozen ShortUrl V1; existing service contract is not a shipped provider. Coordination is pure deterministic protocol with ports; Replication owns RPC/storage adapters to avoid cycles. Discovery static/local initial; consensus-backed discovery an upper adapter. Fixed-membership Raft first, quorum-consistent reads, durable replies, application+applied-index+dedup atomic state. Messaging explicit at-least-once, no blanket exactly-once. DistributedStorage sequences single-group correctness before sharding/rebalance and disclaims unimplemented cross-shard transactions. Complete concrete failure matrices and algorithmic/operational decisions, not aspirational bullet lists.
|
||||
|
||||
## 3. Scope and non-goals
|
||||
Only planning documents are implemented. No C++ changes, CMake/CI changes, new runnable applications, dependency installation, benchmark execution, Git commits/pushes, publishing or configuration edits. No edits to another worker's files. Do not reopen the user interview, narrow the approved breadth, or implement features while documenting them. Existing docs/short-url.md remains intact. Do not change shared contracts unilaterally.
|
||||
|
||||
## 4. Files to inspect
|
||||
First read docs/roadmap/REQUIREMENTS.md, docs/roadmap/ARCHITECTURE.md, docs/agent-workflow/DECISIONS.md and /home/faumaray/.codex/skills/code-intelligence/SKILL.md. Inspect exact relevant headers under include/Void/{Net,Resilience,Crypto,Security,ShortUrl}, sources/module.cmake under src/{Net,Resilience,Crypto,Security,ShortUrl}, and tests/standalone/{Net,Resilience,Crypto,Security,ShortUrl}. These are real directories, not permission to traverse secrets. Adjacent explicitly identified shared source files are readable when necessary. CMakeLists.txt, cmake/Module.cmake and tests/CMakeLists.txt define current targets/tests; inspect only as needed, root owns cross-cutting analysis. New subsystems have no current source directory: label proposed paths NEW. Use scoped file inventory before citing any specific file not listed here.
|
||||
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: docs/roadmap/modules/Net.md; docs/roadmap/modules/Resilience.md; docs/roadmap/modules/Crypto.md; docs/roadmap/modules/Security.md; docs/roadmap/modules/ShortUrl.md; docs/roadmap/subsystems/RPC.md; docs/roadmap/subsystems/Messaging.md; docs/roadmap/subsystems/Discovery.md; docs/roadmap/subsystems/Coordination.md; docs/roadmap/subsystems/Replication.md; docs/roadmap/subsystems/DistributedStorage.md; docs/roadmap/platforms/DistributedApplications.md
|
||||
You are not alone in the codebase. All other files are non-owned, including shared roadmap root documents, workflow/task records, existing project docs and application/build/test files. Shared checkout is intentional; do not switch branches, reset, stash, clean, stage or commit. Edit only assigned Markdown files directly with apply_patch; create their parent directories if needed. Do not revert others' work. Root owns shared contracts and master integration. Return any conflict with exact evidence and proposed change to root.
|
||||
|
||||
## 6. Implementation or investigation approach
|
||||
1. Read shared contracts C-01..C-14 and preserve them. Root-owned decisions already select overall scope, boundaries and algorithms; fill bounded details for your assigned areas coherently.
|
||||
2. Confirm repo and codememory project home-faumaray-Projects-VoidLibrary identity/freshness with index_status. Query only scoped include/src/tests paths. Graph may contain protected data, so no whole-repo text/graph browsing. Use search_graph then trace_path/get_code_snippet for structure; inspect source for important claims. Call check_index_coverage for EVERY relied-on source file and directly read flagged missing ranges. If graph unavailable, use scoped source fallback and disclose. Serena manual must be read if used; project is already active VoidLibrary, do not change activation.
|
||||
3. For each document, ground existing features/tests and gaps before designing NEW additions. Cite portable relative source links from the file location, not absolute workstation paths. Keep source facts separate from design recommendations.
|
||||
4. Use sections tailored to the area but cover all deliverables. Each task gets a unique ID M-<MODULE>-NN, S-<SUBSYSTEM>-NN, or P-<PLATFORM>-NN, explicit dependencies, intended implementation scope, acceptance and role recommendation. Use phase P0 baseline, P1 foundations, P2 module completion, P3 initial platforms/optimization, P4 distributed. All feature tasks are PLANNED.
|
||||
5. Draft concrete representative NEW API/type shapes; preserve existing namespace facts and distinguish illustrative NEW code from compiling examples. Shared types are referenced to their owner, not independently redefined. Choose bounded sensible defaults and explain tradeoffs. Avoid unspecified "consider X or Y" where it changes implementation; select a design or explicitly stage alternatives behind a later named capability gate.
|
||||
6. Native-vs-external choices are per module. Retain current security primitives as initial implementations. Cite primary sources already supplied below; if new consequential library facts require research, use context7 skill resolving library id first, then official docs/web only, never submit private source.
|
||||
7. Cross-link shared architecture/performance/validation/migration and relevant area documents. Other workers may still be creating them; expected names in master contract below are valid planned links. Do not repeatedly check unfinished peers.
|
||||
8. Validate your own documents for ownership, meaningful content, source/path accuracy, unique IDs and no unresolved placeholders. Tell root any shared decision that needs reconciliation. Do not pad every file with repeated common text.
|
||||
|
||||
## 7. Interfaces and data contracts
|
||||
Authoritative shared contracts: architecture C-01 foundation layers; C-02 Result/expected errors; C-03 std::stop_token+steady deadline and one completion; C-04 embedded/managed composition; C-05 bounds; C-06 IO/Net; C-07 general vs strict signed data; C-08 native Storage separate from SQLite; C-09 owning Service/Plugin/C ABI; C-10 FSM/Scheduler/Update commit; C-11 Log/Observability; C-12 distributed ownership/consistency; C-13 naming/migration; C-14 platforms.
|
||||
Existing names must be source-verified. NEW API illustrations do not claim existence. Detailed task IDs use area names uppercased (e.g. M-ASYNC-01, S-IO-01, P-RELOADABLE-01). Relative references to peers: ../modules/<Name>.md, ../subsystems/<Name>.md or ../platforms/<Name>.md; shared files ../ARCHITECTURE.md, ../REQUIREMENTS.md, ../DEPENDENCIES.md, ../DELIVERY.md, ../PERFORMANCE.md, ../VALIDATION.md, ../MIGRATION.md, ../BUILD-AND-DISTRIBUTION.md, ../DOCUMENTATION.md.
|
||||
|
||||
## 8. Dependencies and integration
|
||||
Parent creates shared root documents and workflow records concurrently. Four worker packages have disjoint ownership. Existing modules planned: Core Functional Containers Math Text Data Async Time Log System Configuration Stacktrace Plugin Service Fsm Testing TestingMock Binary Archive Crypto Security Sqlite Resilience Update ShortUrl Net. NEW subsystems: Memory Algorithms Unicode IO Runtime Scheduler Storage IPC RPC Messaging Observability Discovery Coordination Replication DistributedStorage. Platforms: NetworkedApplications ReloadableApplications DistributedApplications. Only your listed paths are writable. Parent checks integration and commissions fresh adversarial review of actual docs. No dependency on other worker completion before drafting against ARCHITECTURE.md.
|
||||
|
||||
## 9. Edge cases security and performance
|
||||
Never read .env, .env.*, WG.conf, keys or descendants; ~/.config/agent-integrations, ~/.ssh, ~/.gnupg, ~/.opencodex, /run/agenix.d, nixos-config/jev_token. No broad indexing/reindexing and no private source in public queries. No credentials or other repository information in documents.
|
||||
Specify concrete failure paths, resource accounting, cancellation/shutdown and compatibility relevant to each area. No fabricated performance results, compiler support, test passes or production readiness. Performance profiles measure p50/p95/p99, throughput, allocations, peak RSS/CPU and build cost; avoid arbitrary universal speedup claims. Cryptographic/TLS recommendations based on OpenSSL 3.5 guide; new storage durability methodology on SQLite atomiccommit; Raft paper for consensus. Primary URLs: https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/ ; https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior ; https://sqlite.org/wal.html ; https://raft.github.io/raft.pdf ; https://man7.org/linux/man-pages/man7/epoll.7.html . Cite near claims.
|
||||
|
||||
## 10. Acceptance criteria
|
||||
1. All owned documents exist and contain distinct, substantial implementation guidance; no empty boilerplate or arbitrary word-count padding.
|
||||
2. Source links and existing behavior are checked; NEW contracts clearly labeled; source coverage limitations reported.
|
||||
3. Each plan has concrete APIs/dataflow, native/backend decision, ownership/failure/resource limits, task DAG/dependencies, test scenarios and compatibility/rollback.
|
||||
4. Shared C-01..C-14 contracts are respected and cross-links use agreed names.
|
||||
5. Commands distinguish CURRENT available checks from PROPOSED checks with prerequisites; future reference apps are specified only.
|
||||
6. No unowned modifications, implementation changes, unsupported measured claims or unresolved high-impact alternatives.
|
||||
|
||||
## 11. Verification commands and evidence
|
||||
Cwd /home/faumaray/Projects/VoidLibrary. Observed current baseline commands: cmake -S . -B /tmp/voidlibrary-discovery-f1f9ba3 -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=OFF -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src ; cmake --build /tmp/voidlibrary-discovery-f1f9ba3 --parallel 4 ; ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60. Do not rerun builds/tests for this documentation task. Normal build passed; VoidTests 1245 passed/2 failed/3 skipped out of1250; failures hard-code absent /bin/echo and /bin/cat; installed component consumers passed. Werror failed in cached Boost1.84 headers. No sanitizer/benchmark/cross-platform checks ran. Actual test runner --filter syntax exists but verify names before showing existing filtered commands. Generic future build paths must be labeled templates/proposed.
|
||||
Run documentation checks via scoped rg, file inventory and git diff --check -- <owned paths> (new files require direct content inspection too). Root will run full coverage/link/ID validation. Do not add a validation script or tests outside ownership.
|
||||
|
||||
## 12. Constraints and stop conditions
|
||||
No child agents or independent user questions. Stop on ownership collision, a required protected read, unavailable configured role, or a contradiction requiring shared contract change; report to parent with a bounded resolution. Missing graph coverage alone permits scoped direct reads. Do not treat an absent NEW file as a blocker. No commits/pushes or application edits. Finish all owned documents before returning unless a genuine blocker exists.
|
||||
|
||||
## 13. Authorization and decisions
|
||||
User approved this exact planning-package scope on 2026-11-24. Prior architectural planner and fresh preflight reviewer complete; current handoff specifies exclusive documentation ownership. Parent reviewed technical content and will lint full specification before dispatch. Default choices within ARCHITECTURE.md are authorized planning decisions. No permission to implement features is inferred.
|
||||
|
||||
## 14. Return format
|
||||
Return task ID; DONE/BLOCKED/PARTIAL; files changed; concise content/decision highlights; source and graph coverage limitations; exact documentation checks and outcomes; unrun checks; cross-file integration issues. Do not paste full documents or spawn children.
|
||||
@@ -0,0 +1,62 @@
|
||||
# Storage, operations, quality and networked platform plans
|
||||
Task ID: T-DOC-104
|
||||
Role: astra_implementer
|
||||
Status: APPROVED
|
||||
|
||||
## 1. Context and baseline
|
||||
Repository/cwd /home/faumaray/Projects/VoidLibrary, main at f1f9ba375b22abf1adcc7c550ec21ac20895c0a4. Tracked tree was clean; unrelated protected untracked .env, WG.conf, keys and .serena untouched. Parent now authors docs/roadmap and docs/agent-workflow in the shared checkout. User approved a detailed planning package with "Implement the plan"; the approved plan explicitly says feature implementation follows separately. Prior astra_planner architecture investigation and fresh astra_reviewer preflight READY completed. You implement documentation only. Requirements R-001 through R-016 in docs/roadmap/REQUIREMENTS.md are authoritative. Role configured Astra/XHigh; user explicitly approved this fallback after the Sol model reported capacity exhaustion. No further model substitution.
|
||||
|
||||
## 2. Objective and deliverables
|
||||
Author all 10 exclusive Markdown files listed below as substantial, individually actionable plans grounded in existing source. Module plans cover existing capabilities and expansion; subsystem/platform plans clearly mark NEW designs. Deliver actual documents, not summaries or placeholders. Each includes source baseline, concrete capability backlog, proposed APIs/types/examples, dataflow/algorithms/ownership/failure behavior, backend rationale, performance/resource limits, ordered implementation tasks, validation and migration. Specific content emphasis: Storage is original native WAL + ordered memory index + immutable sorted checkpoint/table files, single serialized writer, atomic batches/preconditions, stable snapshots, ordered scans, bounded compaction, explicit fsync/manifest/unknown-outcome contracts and format evolution. SQLite is a separate first-class C API integration, not reimplemented SQL/file format. Specify WAL records/commit boundaries sufficiently to guide implementation with checksums/versioning/torn-write and corruption recovery, compaction crash ordering and snapshot retention. Log handles process-wide LogState, reentrant callbacks, bounded total in-flight memory, saturation/flush/failure. Observability hook-only lower dependencies, bounded cardinality and traces, context lifetimes. Testing/Mock add deterministic/property/fuzz capabilities with own framework regression checks, do not count intentional skip demos as broken feature work. Archive preserves anti-traversal limits and atomic workflows. Update exact signed bytes, strict profile and existing durable healthy commit point stay protected. Platform specifies future reference service workflows and operations using shared contracts.
|
||||
|
||||
## 3. Scope and non-goals
|
||||
Only planning documents are implemented. No C++ changes, CMake/CI changes, new runnable applications, dependency installation, benchmark execution, Git commits/pushes, publishing or configuration edits. No edits to another worker's files. Do not reopen the user interview, narrow the approved breadth, or implement features while documenting them. Existing docs/short-url.md remains intact. Do not change shared contracts unilaterally.
|
||||
|
||||
## 4. Files to inspect
|
||||
First read docs/roadmap/REQUIREMENTS.md, docs/roadmap/ARCHITECTURE.md, docs/agent-workflow/DECISIONS.md and /home/faumaray/.codex/skills/code-intelligence/SKILL.md. Inspect exact relevant headers under include/Void/{Log,Stacktrace,Testing,TestingMock,Archive,Update,Sqlite}, sources/module.cmake under src/{Log,Stacktrace,Testing,TestingMock,Archive,Update,Sqlite}, and tests/standalone/{Log,Stacktrace,Testing,TestingMock,Archive,Update,Sqlite}. These are real directories, not permission to traverse secrets. Adjacent explicitly identified shared source files are readable when necessary. CMakeLists.txt, cmake/Module.cmake and tests/CMakeLists.txt define current targets/tests; inspect only as needed, root owns cross-cutting analysis. New subsystems have no current source directory: label proposed paths NEW. Use scoped file inventory before citing any specific file not listed here.
|
||||
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: docs/roadmap/modules/Log.md; docs/roadmap/modules/Stacktrace.md; docs/roadmap/modules/Testing.md; docs/roadmap/modules/TestingMock.md; docs/roadmap/modules/Archive.md; docs/roadmap/modules/Update.md; docs/roadmap/modules/Sqlite.md; docs/roadmap/subsystems/Storage.md; docs/roadmap/subsystems/Observability.md; docs/roadmap/platforms/NetworkedApplications.md
|
||||
You are not alone in the codebase. All other files are non-owned, including shared roadmap root documents, workflow/task records, existing project docs and application/build/test files. Shared checkout is intentional; do not switch branches, reset, stash, clean, stage or commit. Edit only assigned Markdown files directly with apply_patch; create their parent directories if needed. Do not revert others' work. Root owns shared contracts and master integration. Return any conflict with exact evidence and proposed change to root.
|
||||
|
||||
## 6. Implementation or investigation approach
|
||||
1. Read shared contracts C-01..C-14 and preserve them. Root-owned decisions already select overall scope, boundaries and algorithms; fill bounded details for your assigned areas coherently.
|
||||
2. Confirm repo and codememory project home-faumaray-Projects-VoidLibrary identity/freshness with index_status. Query only scoped include/src/tests paths. Graph may contain protected data, so no whole-repo text/graph browsing. Use search_graph then trace_path/get_code_snippet for structure; inspect source for important claims. Call check_index_coverage for EVERY relied-on source file and directly read flagged missing ranges. If graph unavailable, use scoped source fallback and disclose. Serena manual must be read if used; project is already active VoidLibrary, do not change activation.
|
||||
3. For each document, ground existing features/tests and gaps before designing NEW additions. Cite portable relative source links from the file location, not absolute workstation paths. Keep source facts separate from design recommendations.
|
||||
4. Use sections tailored to the area but cover all deliverables. Each task gets a unique ID M-<MODULE>-NN, S-<SUBSYSTEM>-NN, or P-<PLATFORM>-NN, explicit dependencies, intended implementation scope, acceptance and role recommendation. Use phase P0 baseline, P1 foundations, P2 module completion, P3 initial platforms/optimization, P4 distributed. All feature tasks are PLANNED.
|
||||
5. Draft concrete representative NEW API/type shapes; preserve existing namespace facts and distinguish illustrative NEW code from compiling examples. Shared types are referenced to their owner, not independently redefined. Choose bounded sensible defaults and explain tradeoffs. Avoid unspecified "consider X or Y" where it changes implementation; select a design or explicitly stage alternatives behind a later named capability gate.
|
||||
6. Native-vs-external choices are per module. Retain current security primitives as initial implementations. Cite primary sources already supplied below; if new consequential library facts require research, use context7 skill resolving library id first, then official docs/web only, never submit private source.
|
||||
7. Cross-link shared architecture/performance/validation/migration and relevant area documents. Other workers may still be creating them; expected names in master contract below are valid planned links. Do not repeatedly check unfinished peers.
|
||||
8. Validate your own documents for ownership, meaningful content, source/path accuracy, unique IDs and no unresolved placeholders. Tell root any shared decision that needs reconciliation. Do not pad every file with repeated common text.
|
||||
|
||||
## 7. Interfaces and data contracts
|
||||
Authoritative shared contracts: architecture C-01 foundation layers; C-02 Result/expected errors; C-03 std::stop_token+steady deadline and one completion; C-04 embedded/managed composition; C-05 bounds; C-06 IO/Net; C-07 general vs strict signed data; C-08 native Storage separate from SQLite; C-09 owning Service/Plugin/C ABI; C-10 FSM/Scheduler/Update commit; C-11 Log/Observability; C-12 distributed ownership/consistency; C-13 naming/migration; C-14 platforms.
|
||||
Existing names must be source-verified. NEW API illustrations do not claim existence. Detailed task IDs use area names uppercased (e.g. M-ASYNC-01, S-IO-01, P-RELOADABLE-01). Relative references to peers: ../modules/<Name>.md, ../subsystems/<Name>.md or ../platforms/<Name>.md; shared files ../ARCHITECTURE.md, ../REQUIREMENTS.md, ../DEPENDENCIES.md, ../DELIVERY.md, ../PERFORMANCE.md, ../VALIDATION.md, ../MIGRATION.md, ../BUILD-AND-DISTRIBUTION.md, ../DOCUMENTATION.md.
|
||||
|
||||
## 8. Dependencies and integration
|
||||
Parent creates shared root documents and workflow records concurrently. Four worker packages have disjoint ownership. Existing modules planned: Core Functional Containers Math Text Data Async Time Log System Configuration Stacktrace Plugin Service Fsm Testing TestingMock Binary Archive Crypto Security Sqlite Resilience Update ShortUrl Net. NEW subsystems: Memory Algorithms Unicode IO Runtime Scheduler Storage IPC RPC Messaging Observability Discovery Coordination Replication DistributedStorage. Platforms: NetworkedApplications ReloadableApplications DistributedApplications. Only your listed paths are writable. Parent checks integration and commissions fresh adversarial review of actual docs. No dependency on other worker completion before drafting against ARCHITECTURE.md.
|
||||
|
||||
## 9. Edge cases security and performance
|
||||
Never read .env, .env.*, WG.conf, keys or descendants; ~/.config/agent-integrations, ~/.ssh, ~/.gnupg, ~/.opencodex, /run/agenix.d, nixos-config/jev_token. No broad indexing/reindexing and no private source in public queries. No credentials or other repository information in documents.
|
||||
Specify concrete failure paths, resource accounting, cancellation/shutdown and compatibility relevant to each area. No fabricated performance results, compiler support, test passes or production readiness. Performance profiles measure p50/p95/p99, throughput, allocations, peak RSS/CPU and build cost; avoid arbitrary universal speedup claims. Cryptographic/TLS recommendations based on OpenSSL 3.5 guide; new storage durability methodology on SQLite atomiccommit; Raft paper for consensus. Primary URLs: https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/ ; https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior ; https://sqlite.org/wal.html ; https://raft.github.io/raft.pdf ; https://man7.org/linux/man-pages/man7/epoll.7.html . Cite near claims.
|
||||
|
||||
## 10. Acceptance criteria
|
||||
1. All owned documents exist and contain distinct, substantial implementation guidance; no empty boilerplate or arbitrary word-count padding.
|
||||
2. Source links and existing behavior are checked; NEW contracts clearly labeled; source coverage limitations reported.
|
||||
3. Each plan has concrete APIs/dataflow, native/backend decision, ownership/failure/resource limits, task DAG/dependencies, test scenarios and compatibility/rollback.
|
||||
4. Shared C-01..C-14 contracts are respected and cross-links use agreed names.
|
||||
5. Commands distinguish CURRENT available checks from PROPOSED checks with prerequisites; future reference apps are specified only.
|
||||
6. No unowned modifications, implementation changes, unsupported measured claims or unresolved high-impact alternatives.
|
||||
|
||||
## 11. Verification commands and evidence
|
||||
Cwd /home/faumaray/Projects/VoidLibrary. Observed current baseline commands: cmake -S . -B /tmp/voidlibrary-discovery-f1f9ba3 -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=OFF -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src ; cmake --build /tmp/voidlibrary-discovery-f1f9ba3 --parallel 4 ; ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60. Do not rerun builds/tests for this documentation task. Normal build passed; VoidTests 1245 passed/2 failed/3 skipped out of1250; failures hard-code absent /bin/echo and /bin/cat; installed component consumers passed. Werror failed in cached Boost1.84 headers. No sanitizer/benchmark/cross-platform checks ran. Actual test runner --filter syntax exists but verify names before showing existing filtered commands. Generic future build paths must be labeled templates/proposed.
|
||||
Run documentation checks via scoped rg, file inventory and git diff --check -- <owned paths> (new files require direct content inspection too). Root will run full coverage/link/ID validation. Do not add a validation script or tests outside ownership.
|
||||
|
||||
## 12. Constraints and stop conditions
|
||||
No child agents or independent user questions. Stop on ownership collision, a required protected read, unavailable configured role, or a contradiction requiring shared contract change; report to parent with a bounded resolution. Missing graph coverage alone permits scoped direct reads. Do not treat an absent NEW file as a blocker. No commits/pushes or application edits. Finish all owned documents before returning unless a genuine blocker exists.
|
||||
|
||||
## 13. Authorization and decisions
|
||||
User approved this exact planning-package scope on 2026-11-24 and explicitly approved the configured astra_implementer/XHigh fallback for this unchanged assignment after Sol capacity failure. Prior architectural planner and fresh preflight reviewer complete; current handoff specifies exclusive documentation ownership. Parent reviewed technical content and will lint full specification before dispatch. Default choices within ARCHITECTURE.md are authorized planning decisions. No permission to implement features is inferred.
|
||||
|
||||
## 14. Return format
|
||||
Return task ID; DONE/BLOCKED/PARTIAL; files changed; concise content/decision highlights; source and graph coverage limitations; exact documentation checks and outcomes; unrun checks; cross-file integration issues. Do not paste full documents or spawn children.
|
||||
@@ -0,0 +1,64 @@
|
||||
# Independent review of shared and foundation planning documents
|
||||
Task ID: T-DOC-REVIEW-A
|
||||
Role: astra_reviewer
|
||||
Status: READY
|
||||
## Additional baseline-wording integration recheck
|
||||
Root verified src/Update/Feed.cpp lines631–704 and its Json.hpp include: schema3 parses the decoded signed payload for readable-document equality before Crypto::verifyEd25519. verifyFeedEnvelope does parse feed schema after verifyEnvelope, but the earlier shared/Data wording could imply all payload parsing already waits for verification. Root corrected ARCHITECTURE C-07 and modules/Data.md to distinguish current general-Json parsing from separate StrictJson, preserve both compatibility profiles, and label verify-before-payload-parse as planned Update hardening. Include these exact changed paragraphs in your focused recheck; Update.md contains the detailed contract and review B covers it. Root checked Feed.cpp/Feed.hpp graph coverage and directly read all flagged ranges; Feed.cpp's verifyEnvelope is absent from the best-effort graph despite source presence. No new write scope or assignment expansion.
|
||||
## 1. Context and baseline
|
||||
Repository/cwd /home/faumaray/Projects/VoidLibrary, main HEAD f1f9ba375b22abf1adcc7c550ec21ac20895c0a4. User approved authoring the expansion planning package, not C++ feature implementation. Prior roadmap preflight READY; this is fresh review of actual authored docs. README has a navigation addition; new docs are untracked, so git diff alone cannot show them. Existing unrelated protected untracked files remain untouched. Root and other workers share checkout; review scope below is authored/stable except root verification/state records being finalized.
|
||||
## 2. Objective and deliverables
|
||||
Read and adversarially review the 21 actual roadmap files in section 4 plus relevant workflow evidence. Return READY/CHANGES_REQUIRED/INSUFFICIENT_EVIDENCE with severity-ranked concrete defects, cross-plan contradictions, unsupported source claims and minimum corrections. Validate R-001..R-016 and C-01..C-14 against the written package, not worker summaries. This is documentation correctness, not proof that proposed algorithms are implemented.
|
||||
## 3. Scope and non-goals
|
||||
Shared architecture/requirements/delivery/quality/migration and all foundation/data plans. Another fresh reviewer will cover runtime/storage/network/distributed plans after remaining authors finish. You may read those adjacent docs to check a shared boundary if present, but do not duplicate a broad review of that slice. No files may be changed, no code builds/tests, no user questions or children.
|
||||
## 4. Files to inspect
|
||||
Primary authored files:
|
||||
- docs/roadmap/README.md
|
||||
- docs/roadmap/REQUIREMENTS.md
|
||||
- docs/roadmap/ARCHITECTURE.md
|
||||
- docs/roadmap/DEPENDENCIES.md
|
||||
- docs/roadmap/DELIVERY.md
|
||||
- docs/roadmap/PERFORMANCE.md
|
||||
- docs/roadmap/VALIDATION.md
|
||||
- docs/roadmap/MIGRATION.md
|
||||
- docs/roadmap/BUILD-AND-DISTRIBUTION.md
|
||||
- docs/roadmap/DOCUMENTATION.md
|
||||
- docs/roadmap/modules/Core.md
|
||||
- docs/roadmap/modules/Functional.md
|
||||
- docs/roadmap/modules/Containers.md
|
||||
- docs/roadmap/modules/Math.md
|
||||
- docs/roadmap/modules/Text.md
|
||||
- docs/roadmap/modules/Time.md
|
||||
- docs/roadmap/modules/Binary.md
|
||||
- docs/roadmap/modules/Data.md
|
||||
- docs/roadmap/subsystems/Memory.md
|
||||
- docs/roadmap/subsystems/Algorithms.md
|
||||
- docs/roadmap/subsystems/Unicode.md
|
||||
Also README.md navigation diff; docs/agent-workflow/DECISIONS.md, STATE.md, TASKS.md and VERIFICATION.md for authorization/evidence. Optional actual source is limited to explicitly linked include/Void/<Module>, src/<Module>, tests/standalone/<Module>, CMakeLists.txt/cmake files needed to verify a consequential claim. Source baseline read in prior discovery; no exhaustive rediscovery.
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: none
|
||||
All files non-owned. Shared checkout: no edits, branch switches, installs, reindexing, activation changes, or remote mutations. Root alone integrates corrections. Use actual file contents for new docs. Remaining storage/runtime authors have disjoint area files and cannot change your primary files.
|
||||
## 6. Implementation or investigation approach
|
||||
Read requirements and architecture, then authored area contracts/tasks. Verify API ownership, dependency direction, standard-library-only foundation, native/backend rationale, precise integer/codec semantics, strict signed-data preservation, allocator/borrow lifetime, bounds, migration, task readiness and useful acceptance checks. Check the plans are substantive and decisions are concrete rather than placeholder choices. Check CURRENT vs PROPOSED commands and evidence, including known baseline failures. Run the temporary read-only checker if useful; it may still report missing peer files while those are authored. Do not flag those known pending files as completed-package defects prematurely. Manually inspect semantic issues independent of checker.
|
||||
For source/graph navigation read code-intelligence skill, verify project home-faumaray-Projects-VoidLibrary root/freshness, scope queries to actual linked paths, call check_index_coverage for every relied-on file and read flagged ranges. Graph is best effort. No broad repository query, no secret reads. Do not defer ordinary factual investigation to the user.
|
||||
## 7. Interfaces and data contracts
|
||||
Shared contracts C-01..C-14 are authoritative. Current modules' namespaces differ from targets; NEW examples must be marked. Functional owns errors; Time clocks; Async std::stop_token+steady deadline; Binary encoding primitives; Data value codec; Storage checksums/recovery; Memory allocators. Preserving StrictJson is required. Native proposals need no runtime benchmark success claim. Review source/ABI/wire/disk evolution separately.
|
||||
## 8. Dependencies and integration
|
||||
Author T-DOC-101 complete with 11 plans/70 task definitions; root 10 shared documents authored. T-DOC-102/104 may still finish. Other review covers their integration and T-DOC-103. Root reconciles findings, repairs documents and requests recheck for changed risk areas. No reviewer approval authorizes feature implementation/publication.
|
||||
## 9. Edge cases security and performance
|
||||
No .env, .env.*, WG.conf, keys or descendants; ~/.config/agent-integrations, ~/.ssh, ~/.gnupg, ~/.opencodex, /run/agenix.d or nixos-config/jev_token. No private source in public queries. Look for invalid byte/allocator lifetime, integer overflow, format ambiguity, silent loss, unsupported claims and cyclic dependency contracts. Performance targets must distinguish proposed budgets from measured evidence.
|
||||
## 10. Acceptance criteria
|
||||
1. All 21 primary files inspected sufficiently for a defensible verdict.
|
||||
2. Findings include severity, exact file/section, triggering scenario, impact, evidence and minimal correction.
|
||||
3. Important contracts are coherent and planned work is not described as implemented.
|
||||
4. Verify source evidence for consequential disputed claims; do not invent findings from incomplete graph.
|
||||
5. Files changed none; disclose unrun checks and coverage limitations.
|
||||
## 11. Verification commands and evidence
|
||||
Cwd repo root. Allowed git status --short, git diff --stat, git diff --check, scoped rg/sed, python3 -B /tmp/void-roadmap-check.py (read-only documentation inventory/links/IDs; partial peer presence may fail). Existing full normal build passed before authorship; VoidTests 1245 passed/2 failed/3 skipped and installed consumers passed; Werror Boost1.84 warnings failed. No tests have passed for NEW features. Do not rerun application tests for Markdown. Root will perform final complete-package link checks.
|
||||
## 12. Constraints and stop conditions
|
||||
Do not edit, run app tests, spawn or talk to user. Stop on protected access or wrong project. Return focused evidence gaps instead of broad unsupported claims. Treat in-progress workflow records as provisional; identify what must be updated before final completion. Prioritize actionable P0-P2; record P3 without derailing.
|
||||
## 13. Authorization and decisions
|
||||
User approved plan-file authoring. This configured astra_reviewer/XHigh task provides independent technical review. Prior authors had no review authority. Root persists and structurally lints this assignment before dispatch; model runtime identity remains configured, not independently attested.
|
||||
## 14. Return format
|
||||
Task ID; verdict; summary; severity-ranked findings with exact locations/corrections; files inspected; checks and outcomes; coverage caveats; files changed (none); tests not run. Keep report focused, not a restatement of all plans.
|
||||
## Recheck scope after first correction
|
||||
Review A found P2 at DEPENDENCIES.md: Algorithms→Containers conflicted with the detailed Containers→Algorithms design, with Math's container prerequisite adding a possible cycle. Root has corrected docs/roadmap/DEPENDENCIES.md, ARCHITECTURE.md C-01, modules/Math.md and subsystems/Algorithms.md. Re-read those files and unchanged modules/Containers.md/Text.md where needed. Verify Math scalar arithmetic → Algorithms → Containers/Text adapters, explicit M-MATH-02 prerequisite, standard-library scratch storage, and no reverse imports. No write ownership or broader assignment change. Root git diff --check passed; task specification lint passed. Return whether the original finding is resolved and a final verdict for your original 21-file slice; do not repeat the broad review without a new concern. Root will finalize workflow records after both review slices and complete-package checks.
|
||||
@@ -0,0 +1,101 @@
|
||||
# Independent integrated review of runtime, storage and platform plans
|
||||
Task ID: T-DOC-REVIEW-B
|
||||
Role: astra_reviewer
|
||||
Status: READY
|
||||
|
||||
## 1. Context and baseline
|
||||
Repository/cwd /home/faumaray/Projects/VoidLibrary; main HEAD f1f9ba375b22abf1adcc7c550ec21ac20895c0a4. User approved the multi-file expansion planning package, not C++ features. Original request is generic library from small stdlib-only foundations through complete modules and optional platforms. Existing source/test baseline was inspected and ordinary full build passed before document authoring. New roadmap docs are untracked, so inspect their actual contents; git diff alone does not show them. T-DOC-102 and 103 authors finished their 23 files. T-DOC-104 is finishing its last three files (Update, Observability, NetworkedApplications); read 102/103 and completed 104 documents first. Root will confirm the last packet is stable before your final verdict. All agents share this checkout.
|
||||
|
||||
## 2. Objective and deliverables
|
||||
Fresh adversarial review of the actual 33 area plans listed below and their integrated contracts with shared roadmap documents. Return READY/CHANGES_REQUIRED/INSUFFICIENT_EVIDENCE with concrete severity-ranked defects and minimum corrections. Detect cross-file ownership, lifetime, durability, security, dependency and task-order contradictions. This review judges actionable planning quality, not whether proposed APIs have been implemented.
|
||||
|
||||
## 3. Scope and non-goals
|
||||
Primary runtime/system/network/security/storage/operations/quality plans and all three platforms. The other fresh reviewer owns the 11 foundation plans and 10 shared documents but your cross-component findings may touch shared contracts. Read adjacent foundation docs only where a boundary requires it. No application edits, test builds, broad rediscovery, internet publication, questions to user, or additional agents.
|
||||
|
||||
## 4. Files to inspect
|
||||
Primary area files:
|
||||
- docs/roadmap/modules/Async.md
|
||||
- docs/roadmap/modules/System.md
|
||||
- docs/roadmap/modules/Configuration.md
|
||||
- docs/roadmap/modules/Service.md
|
||||
- docs/roadmap/modules/Fsm.md
|
||||
- docs/roadmap/modules/Plugin.md
|
||||
- docs/roadmap/subsystems/IO.md
|
||||
- docs/roadmap/subsystems/Runtime.md
|
||||
- docs/roadmap/subsystems/Scheduler.md
|
||||
- docs/roadmap/subsystems/IPC.md
|
||||
- docs/roadmap/platforms/ReloadableApplications.md
|
||||
- docs/roadmap/modules/Net.md
|
||||
- docs/roadmap/modules/Resilience.md
|
||||
- docs/roadmap/modules/Crypto.md
|
||||
- docs/roadmap/modules/Security.md
|
||||
- docs/roadmap/modules/ShortUrl.md
|
||||
- docs/roadmap/subsystems/RPC.md
|
||||
- docs/roadmap/subsystems/Messaging.md
|
||||
- docs/roadmap/subsystems/Discovery.md
|
||||
- docs/roadmap/subsystems/Coordination.md
|
||||
- docs/roadmap/subsystems/Replication.md
|
||||
- docs/roadmap/subsystems/DistributedStorage.md
|
||||
- docs/roadmap/platforms/DistributedApplications.md
|
||||
- docs/roadmap/modules/Log.md
|
||||
- docs/roadmap/modules/Stacktrace.md
|
||||
- docs/roadmap/modules/Testing.md
|
||||
- docs/roadmap/modules/TestingMock.md
|
||||
- docs/roadmap/modules/Archive.md
|
||||
- docs/roadmap/modules/Update.md
|
||||
- docs/roadmap/modules/Sqlite.md
|
||||
- docs/roadmap/subsystems/Storage.md
|
||||
- docs/roadmap/subsystems/Observability.md
|
||||
- docs/roadmap/platforms/NetworkedApplications.md
|
||||
Read shared docs/roadmap/{REQUIREMENTS,ARCHITECTURE,DEPENDENCIES,DELIVERY,PERFORMANCE,VALIDATION,MIGRATION,BUILD-AND-DISTRIBUTION,DOCUMENTATION,README}.md as needed to evaluate these interfaces and coverage. Read docs/agent-workflow/{DECISIONS,VERIFICATION,STATE,TASKS}.md and T-DOC-102/103/104 task specs for original scope and evidence. Optional actual source is limited to linked include/Void/<Module>, src/<Module>, tests/standalone/<Module>, existing docs/short-url.md and build/CI declarations needed to verify a consequential claim. Read exact source, not summaries, when disputing a baseline fact.
|
||||
|
||||
## 5. Write ownership and coordination
|
||||
Write scope: none
|
||||
Every file is non-owned. No edits, branch changes, installations, reindexing, active-project changes, Git mutations or remote side effects. Root integrates fixes. T-DOC-104 exclusively owns the remaining three area files while completing them; avoid those until they exist and root confirms completion. T-DOC-102/103 and seven completed 104 files are stable except targeted corrections coordinated by root. No private worktree is assumed.
|
||||
|
||||
## 6. Implementation or investigation approach
|
||||
Read contract IDs and requirements, then the actual area plans. Review coherent NEW API semantics, concrete resource/algorithm choices, task prerequisites, failure behavior and useful acceptance evidence. Focus on cross-boundary races and crash consistency:
|
||||
- Async terminal arbitration versus Storage/SQLite durable commit outcomes: cancellation is not proof of rollback; durable outcomes must remain inspectable.
|
||||
- TaskScope/Runtime join ownership on executor threads, deadlines with still-running work, IO late completions/buffers, cancellation/resume ticket single completion.
|
||||
- Service handles, Plugin generation pins across async/callback/destructor activity, C ABI ownership, and ReloadableApplications single-generation publication plus read-only health window until Update's durable healthy commit.
|
||||
- Storage single-writer visibility, bounded versions/snapshots/compaction, WAL/footer/CRC32C framing, CURRENT manifest authority, crash tails versus corruption, unknown commit outcomes; Binary owns encoders, Storage owns framing/checksum helper and tests.
|
||||
- Raft persist-before-reply, stable identifiers and membership, atomic application/dedup/applied position, quorum read barriers, recovery/snapshot installation, durable discovery and at-least-once messaging.
|
||||
- TLS verification/deadlines/redirects, RPC authentication/framing, retry/idempotency and bounded admission; platform budget composition.
|
||||
- Log/Stacktrace/Observability dependency direction and callbacks outside locks; signal handling claims; TestingMock ownership/reentrancy and SQLite transaction lifetime.
|
||||
Check CURRENT vs NEW/PROPOSED distinctions, unrun verification honesty, native-vs-adapter rationale, migration stages and source compatibility. Do not flag expected last author files as defects before completion. Do not demand implementation tests for documentation.
|
||||
For source navigation use the code-intelligence skill at /home/faumaray/.codex/skills/code-intelligence/SKILL.md. Serena already active VoidLibrary; read initial instructions if not inherited, do not change the active project. Codememory project home-faumaray-Projects-VoidLibrary root/freshness verified by root; still verify identity before querying and call check_index_coverage for every relied-on path, reading flagged source ranges. Graph remains best effort. Public documentation queries must never include private source.
|
||||
|
||||
## 7. Interfaces and data contracts
|
||||
Shared C-01..C-14 govern. C-03 OperationOptions contains std::stop_token and optional steady-clock deadline; C-04 Time owns injected monotonic clock, Async execution, Memory allocation, Runtime composition. No hidden foundation workers. C-08 original native KV is distinct from SQLite; WAL/manifest atomic recovery and unknown outcomes required. C-09 same-toolchain plugins are separate from versioned opaque C ABI; no STL/exception crossing. C-10 checkpoint application state, never serialized C++ coroutine frames. C-12 pure Coordination state machine with higher Replication adapters and application/dedup/applied position atomicity; no global exactly-once guarantee. Root already corrected Replication recovery to follow Storage's durable CURRENT/generation pointer rather than the largest complete manifest. Root directed Storage's CRC32C ownership correction; verify actual final text. Examples are explicitly NEW and may be illustrative rather than compiling.
|
||||
|
||||
## 8. Dependencies and integration
|
||||
Author packet 102: 11 plans /59 tasks. Packet 103: 12 plans /73 tasks. Packet 104: 10 plans, completion message pending at dispatch. Root shared ten docs authored; review A found and is rechecking one P2 foundation graph contradiction already corrected. Read 102/103 while final 104 files finish, then review the complete 104 packet and integrated cross-file contracts before final verdict. Root will send the stable-file confirmation. Root resolves findings and requests recheck for changed risk areas. Review is technical acceptance of plans, not authorization to implement features, push or deploy.
|
||||
|
||||
## 9. Edge cases security and performance
|
||||
Never read repo .env, .env.*, WG.conf, keys or descendants; ~/.config/agent-integrations, ~/.ssh, ~/.gnupg, ~/.opencodex, /run/agenix.d or nixos-config/jev_token. No broad graph search that may return excluded content. Watch finite counts AND bytes (including inflight/batches), borrow lifetime, reentrant teardown, post-timeout work, format endian/length/CRC ambiguity, partial writes, stale snapshots, retry duplication and resource retention. Distinguish selected design defaults from measured benchmarks; no performance victory claimed without evidence. Native engine/protocol plans need falsifiable safety gates before broad platform claims.
|
||||
|
||||
## 10. Acceptance criteria
|
||||
1. All 33 primary plans read sufficiently for a defensible integrated verdict; do not finalize before remaining packet completion.
|
||||
2. Relevant shared contracts and all three platform compositions assessed.
|
||||
3. Every actionable finding has severity, exact file/section, triggering scenario, impact, evidence and minimum correction.
|
||||
4. Important source claims checked against actual source, with graph coverage caveats, where needed.
|
||||
5. No unrelated edits or unsupported execution/model claims. Return files changed: none.
|
||||
6. Distinguish substantive defects from optional future enhancements and unrun implementation tests.
|
||||
|
||||
## 11. Verification commands and evidence
|
||||
Cwd repo root. Read-only commands: git status --short; git diff --check; git diff -- README.md; scoped rg/sed; python3 -B /tmp/void-roadmap-check.py. The temporary checker validates 54-file inventory, relative files/anchors, required content signals, unique feature task IDs/references and a heuristic explicit prerequisite DAG; named-gate semantics still need review. At 51/54 only absent last three files/links failed. Root also checks all new Markdown whitespace/fences because tracked diff misses untracked docs. Baseline: ordinary build exit0; CTest exit8, VoidTests1245 passed/2 failed/3 skipped, absent /bin/echo and /bin/cat implicated, installed consumers passed. Werror failed in pinned Boost1.84 GCC16/C++26 warnings. No new-feature tests run; do not rerun C++ tests for these plans.
|
||||
|
||||
## 12. Constraints and stop conditions
|
||||
Read-only role; no child agents or user questions. Stop on wrong repository/protected access. Prioritize actionable P0-P2, report P3 briefly. If a consequential fact is unverifiable, state the gap rather than assuming a defect. Workflow status/evidence are being finalized; identify final-record updates needed rather than claiming provisional status is a completed-package contradiction. Do not inspect unfinished last three files repeatedly; use the stable files first and root's completion notice.
|
||||
|
||||
## 13. Authorization and decisions
|
||||
User approved authoring these expanded plans, plus explicit configured astra_implementer/XHigh fallback for packet104 after Sol capacity exhaustion. This separate configured astra_reviewer/XHigh did not author these changes. Task spec persisted and structurally linted before dispatch; root owns semantic acceptance. Tool metadata shows configured role/effort, not an independent proof of runtime model identity. No external publishing authorization.
|
||||
|
||||
## 14. Return format
|
||||
Task ID; verdict; brief summary; severity-ranked concrete findings with exact locations, trigger, impact, evidence and minimum fix; primary files inspected and cross-contract coverage; commands/results and source coverage limits; files changed none; tests not run. Do not restate all plans. If only final-author completion is pending, report interim findings while retaining the task, then finalize on the stable package.
|
||||
## Focused recheck after three P2 corrections
|
||||
All 54 documents and all author packets are now complete/stable. Your original three findings have been corrected by root; review only the changed boundaries and directly affected contracts, not a new broad audit. Changed roadmap files: ARCHITECTURE.md C-03; modules/Async.md ownership/backlog/validation; subsystems/IO.md backend/completion/backlog/validation; subsystems/Storage.md cancellation, P1 bootstrap, S-STORAGE-03/04 and fault-validation gate; subsystems/Runtime.md shutdown order/backlog/validation; platforms/NetworkedApplications.md shutdown timeout paragraph. Root updated workflow evidence separately.
|
||||
Correction 1: stop/expiry is intent, not generic domain-result selection; Async delivers one domain result after backend access ends. Side-effect-free abort is distinct from known commitment and Unknown effects. IO had the same first-stop-wins wording, so its sync completion now preserves success/native failure after stop, enabling Storage/Update outcomes. Fake-adapter and IO/Storage scenarios cover stop before append/execution, during sync, successful sync after stop, failed sync after stop; no duplicate completion or premature cleanup. Check consistency with Configuration/Update without modifying them.
|
||||
Correction 2: Runtime stops/drains business producers/scopes while keeping a separate bounded cleanup/export scope and IO/CPU/file workers alive. Exporters flush/close/join before resource teardown; timeout yields shutdown_incomplete with owners retained and later join allowed. NetworkedApplications explicitly agrees. Check an in-flight exporter whose flush and total deadlines expire, then backend releases, against Observability's existing contract.
|
||||
Correction 3: S-STORAGE-03 now implements minimal CURRENT/manifest and WAL registration before acknowledgements, with initial-create/rotation crash tests and the fault harness. S-STORAGE-04 extends the same publication protocol for tables/checkpoints. No valid CURRENT means incomplete initialization, not adoption of an orphan; no earlier acknowledged batch is possible. Verify phase/task/format ordering is coherent and no new backward dependency.
|
||||
No write ownership or model/role change. Root checker after first correction set passed 54/54, 878 links, 300 feature task IDs; IO follow-through will receive the same checker before recheck dispatch. git diff --check passed. Return resolved/unresolved for each original finding, any new actionable defect in changed boundaries, and final verdict for the assigned slice. Original command/security/return constraints still apply.
|
||||
@@ -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*"
|
||||
```
|
||||
@@ -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
|
||||
```
|
||||
@@ -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`.
|
||||
@@ -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
|
||||
```
|
||||
@@ -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
|
||||
```
|
||||
@@ -0,0 +1,288 @@
|
||||
# Architecture and shared contracts
|
||||
|
||||
Status: target design for planning; NEW contracts below are not existing library APIs.
|
||||
Source baseline: `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
|
||||
## Existing architecture
|
||||
|
||||
[CMakeLists.txt](../../CMakeLists.txt) discovers module declarations and supports
|
||||
`VOID_ENABLED_MODULES` with transitive internal dependencies. Public CMake targets use
|
||||
`Void::<Module>`. The repository has 26 public feature modules and the supporting
|
||||
LogState target. Existing namespaces do not always match CMake module names; migration
|
||||
must preserve or explicitly adapt those differences.
|
||||
|
||||
Current integrations already include coroutine tasks, a manual executor, a future-based
|
||||
thread pool, reflection serialization, scoped service registries, pinned plugin
|
||||
generations, signed update verification, and durable version activation. Their existence
|
||||
does not establish a unified execution or lifetime contract. Individual plans record
|
||||
their inspected source and exact compatibility obligations.
|
||||
|
||||
## C-01 — Layering and package independence
|
||||
|
||||
The target dependency direction is foundations → execution/I/O and system facilities →
|
||||
complete functional modules → platform compositions. This is a target, not a claim that
|
||||
today's declarations already satisfy it.
|
||||
|
||||
Foundation: Core, Functional, Memory, Containers, Algorithms, Math, Text, Unicode, Time,
|
||||
Binary, and Data. These may depend on lower foundation components and the standard
|
||||
library; none requires Runtime, Net, a database, crypto, a logging backend, or a worker
|
||||
thread. Unicode data tables are versioned build inputs, not a runtime external engine.
|
||||
|
||||
Core cannot import Math merely to implement UUID generation in the target graph. Keep
|
||||
UUID representation in Core; use standard entropy/injected generation without importing
|
||||
the broader Math module. Functional formatting bridges must not produce a Core↔Functional
|
||||
cycle. Unicode integration into Text is optional; Unicode may reuse byte/text primitives
|
||||
without Text depending back on Unicode.
|
||||
|
||||
Math's scalar checked arithmetic uses standard-library storage and imports neither
|
||||
Containers nor Algorithms. Algorithms may use that narrow numeric interface and standard
|
||||
scratch containers; Containers/Text provide adapters above Algorithms. Algorithms never
|
||||
imports Containers or Text. Allocator-aware Containers build on Memory, not vice versa.
|
||||
|
||||
Public headers compile independently with their declared dependencies. Build selection,
|
||||
installed component selection, static linkage, and shared linkage all receive consumer
|
||||
checks. Optional capabilities live in adapters or higher-level modules. A merged
|
||||
kitchen-sink test executable is insufficient evidence of independence.
|
||||
|
||||
## C-02 — Errors and compatibility
|
||||
|
||||
Use the existing `Void::Result::Result<T>`/`std::expected` conventions as the starting
|
||||
point for fallible operations. `Result<T>` in designs is shorthand, not a claim that a
|
||||
new top-level alias exists. Functional owns shared error-category and conversion design.
|
||||
Domain errors retain machine-readable classifications and contextual causes.
|
||||
|
||||
Operational failures, cancellation, timeout, overload, unsupported capabilities, and
|
||||
corruption are distinguishable. Exception-based existing APIs get explicit adapters;
|
||||
there is no universal silent conversion of programmer errors into success or empty
|
||||
values. No exception crosses a C ABI boundary. Existing exception/future semantics stay
|
||||
documented until their specific major-release migration is implemented.
|
||||
|
||||
## C-03 — Task ownership and operation completion
|
||||
|
||||
Async owns structured task scopes, executor contracts, and operation completion.
|
||||
Each admitted operation has an owner until exactly one terminal result is delivered
|
||||
and all backend access to its buffers/state has ceased. Scheduler queues must not
|
||||
outlive borrowed coroutine frames. Detached work requires an explicit lifetime and
|
||||
error sink; ordinary scope destruction requests stop and joins owned work.
|
||||
|
||||
The initial shared operation options use `std::stop_token` and an optional absolute
|
||||
`std::chrono::steady_clock::time_point` deadline. Async owns their NEW public type;
|
||||
IO, Net, RPC, and higher modules reference it instead of declaring competing types.
|
||||
Time owns the injected clock contract. Deadlines include admission and all operation
|
||||
phases unless an API explicitly documents a distinct phase budget.
|
||||
|
||||
Cancellation is cooperative, never forceful interruption of arbitrary application code.
|
||||
It cannot undo a write or commit already performed. A cancellation request racing with
|
||||
completion produces one documented terminal outcome and still performs resource cleanup.
|
||||
Single-delivery arbitration does not choose the domain outcome: stop/expiry records intent,
|
||||
while the owning operation classifies its result from backend and persistence evidence.
|
||||
Known commitment returns its receipt even if stop was requested first; uncertain effects
|
||||
return the domain's explicit unknown-outcome error. Cancellation/timeout alone is valid
|
||||
only where the domain can establish that classification, including any partial effects.
|
||||
The sole result is delivered after required backend access ends; a caller's deadline does
|
||||
not permit discarding late commit evidence or freeing still-owned resources.
|
||||
Event subscriptions define whether already-admitted callbacks drain; unsubscribe alone
|
||||
must not be presented as a guarantee that all captured state is no longer in use.
|
||||
|
||||
## C-04 — Execution, clocks, and runtime injection
|
||||
|
||||
Async defines execution; Time defines clocks; Memory defines allocator facilities.
|
||||
Runtime composes those contracts and cannot become their dependency. Applications may
|
||||
inject an executor, clock, allocator/resource budget, and observation hooks. Dependencies
|
||||
borrowed by a context must outlive its final shutdown; managed Runtime retains its owned
|
||||
resources through that boundary.
|
||||
|
||||
Embedded mode uses application-supplied resources. Managed mode creates resources only
|
||||
on explicit startup and stops admission before draining/cancelling and joining. Ordinary
|
||||
module constructors do not silently start a global runtime. Process-wide LogState is a
|
||||
documented logging compatibility bridge, not the owner of execution services.
|
||||
|
||||
Monotonic clocks govern elapsed time, retries, and deadlines. Civil clocks and time zones
|
||||
govern calendar schedules. Tests inject clocks and control task progress. Persistent job
|
||||
identities use scheduled occurrence identifiers, not the current wall clock alone.
|
||||
|
||||
## C-05 — Bounds, admission, and memory
|
||||
|
||||
Each complete module specifies finite default limits for queues, concurrency, input
|
||||
size, buffers, recursion, retained history, and pending output where applicable. Defaults
|
||||
are concrete in its area plan and configurable. New APIs use an explicit unbounded
|
||||
policy when needed; zero must not acquire undocumented unlimited semantics.
|
||||
|
||||
Admission reports overload instead of silently allocating without bound. Async waiting
|
||||
for capacity is explicit and cancellable; blocking admission is an opt-in that cannot
|
||||
block the same executor needed to release capacity. Logging defines its own loss policy
|
||||
and observable counters. In-flight work and batches count toward bounds, not only queue
|
||||
slots. Memory/allocator hooks target owned allocations and documented lifetime domains.
|
||||
|
||||
## C-06 — Native I/O and network interoperability
|
||||
|
||||
IO owns the platform operation backend and byte-stream contracts. Initial Linux sockets
|
||||
use nonblocking descriptors with level-triggered epoll; filesystem operations use bounded
|
||||
blocking workers. Optional io_uring comes later behind capability detection and conformance
|
||||
tests. Backend selection/fallback happens before submission; a potentially effective write
|
||||
is not blindly replayed on another backend.
|
||||
|
||||
Network and protocol APIs remain Void-owned. Preserve existing Boost-based paths during
|
||||
migration; new native runtime/protocol paths need interoperability and fuzz evidence before
|
||||
replacement. Net owns network protocol state and connection reuse; IO owns descriptor,
|
||||
buffer, cancellation, partial-transfer, and completion rules. RPC uses Net/IO and serialization
|
||||
without depending on Coordination or a platform.
|
||||
|
||||
TLS clients verify trust chains and expected peer identity by default, with explicit trust
|
||||
configuration. SNI is not hostname verification. HTTP redirect rules strip origin-sensitive
|
||||
credentials on cross-origin transitions and define method/body behavior. Total deadlines
|
||||
include DNS, connect, proxy negotiation, TLS, request, and response. OpenSSL remains the
|
||||
initial TLS implementation. See the [OpenSSL client guide](https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/).
|
||||
|
||||
## C-07 — Data and signed-document boundaries
|
||||
|
||||
Data owns general structured values, parsing policies, reflection serialization, and
|
||||
schema/version evolution; Binary owns byte encoding/decoding. General JSON adds exact
|
||||
signed/unsigned integer representation and checked numeric conversion without routing
|
||||
all values through double. Limits and duplicate-key policies are explicit.
|
||||
|
||||
Preserve StrictJson's separate restricted representation and acceptance rules. Existing
|
||||
Update envelope parsing uses general Json, not StrictJson, and must retain its own
|
||||
versioned compatibility profile. General JSON improvements must not silently broaden
|
||||
either protected profile. The target Update contract verifies signatures over exact
|
||||
provided payload bytes before payload schema parsing or readable-document comparison;
|
||||
reserialization cannot substitute for those bytes. The current schema-3 path parses the
|
||||
payload for readable-document comparison before signature verification, so this ordering
|
||||
is an explicit hardening task in [Update](modules/Update.md), not completed behavior.
|
||||
Existing signed documents remain regression fixtures.
|
||||
|
||||
## C-08 — Original storage and SQLite
|
||||
|
||||
Storage is an original implementation. Sqlite remains a first-class integration with
|
||||
SQLite itself. Neither is a compatibility facade over the other. Original Storage makes
|
||||
no SQL or SQLite file-format promise.
|
||||
|
||||
The selected initial layout is an append-only checksummed WAL, an ordered in-memory index,
|
||||
and immutable sorted checkpoint/table files; the Storage plan specifies the format and
|
||||
manifest protocol. Begin with one serialized writer, atomic batches, consistent snapshots,
|
||||
and ordered iteration. Incremental bounded compaction follows the durable core. Readers
|
||||
pin versions; reclamation waits for pins and observes configured retention budgets.
|
||||
|
||||
Atomic batches are not a claim of arbitrary read-modify-write transaction isolation.
|
||||
Conditional updates evaluate version/value preconditions atomically with the batch in
|
||||
writer order. A conflict reports failure without partial mutation. Richer transactions
|
||||
and document/index layers require separate documented isolation contracts.
|
||||
|
||||
Durable success follows successful persistence of all recovery dependencies. Weaker
|
||||
durability is an explicit policy. Errors and lost replies may leave an unknown commit
|
||||
outcome, so retries require operation identity or inspection. Failed sync, disk full,
|
||||
short writes, corruption, and recovery interruption are first-class outcomes.
|
||||
See [SQLite's crash-testing methodology](https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior).
|
||||
|
||||
## C-09 — Services, plugins, and ABI
|
||||
|
||||
Service owns registry access and lifecycle contracts; Plugin owns library generations
|
||||
and module hosting. Acquired service handles retain provider ownership throughout calls
|
||||
and replacement. Snapshot lifecycle operations and invoke user callbacks outside registry
|
||||
locks. Dependency ordering, failed-start rollback, and shutdown are deterministic.
|
||||
|
||||
The plugin host composes validation → activation → readiness → publication and, where
|
||||
state transfer requires it, quiescence → checkpoint → candidate restore. Failed candidates
|
||||
preserve the active generation. Existing callers keep their generation pin. Safe unloading
|
||||
requires both generation references and owned asynchronous activity to end.
|
||||
|
||||
The NEW stable C interface uses fixed-width fields, structure sizes/versions, opaque
|
||||
handles, function tables, status codes, byte spans, and explicit release functions.
|
||||
Allocate and release through the same owner. No STL objects, C++ exceptions, or implicit
|
||||
RTTI contract crosses that boundary. Existing C++ descriptors remain same-toolchain
|
||||
interfaces; a C ABI does not make existing C++ objects cross-toolchain compatible.
|
||||
ShortUrl V1 remains frozen as documented in [its contract](../short-url.md).
|
||||
|
||||
## C-10 — Workflow state and updates
|
||||
|
||||
Fsm owns state execution and supervision; Scheduler owns calendar/delayed job admission
|
||||
and persistence. Checkpoints capture application state at documented boundaries, not
|
||||
coroutine frames. Concurrent child scopes must be cancelled/joined when a parent or race
|
||||
finishes. Faulted is a terminal state throughout supervision APIs.
|
||||
|
||||
Update owns signed release selection and durable version activation. Preserve the existing
|
||||
distinction between reversible candidate activation and the durable healthy commit marker
|
||||
in [VersionStore](../../include/Void/Update/VersionStore.hpp). Cleanup failure after that
|
||||
commit cannot be reported as though rollback were still the correct action. Plugin and
|
||||
platform plans coordinate with that boundary rather than inventing another commit point.
|
||||
|
||||
## C-11 — Logging and observability
|
||||
|
||||
Log owns delivery and sinks; Observability owns metrics/traces/context interfaces and
|
||||
export adapters. Foundation and execution modules depend on lightweight optional hooks,
|
||||
not on a concrete exporter or managed runtime. Avoid Log↔Observability and Async↔Log
|
||||
cycles. Preserve process-wide facade state across shared-library boundaries.
|
||||
|
||||
User sinks/callbacks execute outside shared configuration locks. Queue, in-flight batch,
|
||||
flush, loss, and sink-failure semantics are bounded and measurable. Context propagation
|
||||
snapshots values at admission; pointers to transient thread-local state cannot escape.
|
||||
Metrics labels and retained trace data also have cardinality and resource limits.
|
||||
|
||||
## C-12 — Distributed ownership and consistency
|
||||
|
||||
Coordination owns a deterministic Raft protocol core with injected clock, transport,
|
||||
and stable-storage ports. It emits actions; its core does not import RPC, Discovery,
|
||||
DistributedStorage, or platform orchestration. Replication owns the adapters connecting
|
||||
Coordination, transport, and Storage. Discovery starts with static/local providers;
|
||||
coordination-backed discovery is a higher-layer adapter, avoiding a bootstrap cycle.
|
||||
|
||||
Initial replicated groups have fixed membership, one leader, majority commit, and a
|
||||
crash-failure model. Persist protocol state before replies that depend on it. Apply only
|
||||
committed commands in deterministic order. Store application mutations, deduplication
|
||||
records, and the applied-log position in one recoverable Storage batch. Snapshot metadata
|
||||
identifies the included log position and format version.
|
||||
|
||||
Initial consistent reads use quorum-confirmed leadership/read-index behavior; explicitly
|
||||
stale reads have a separate API policy. An isolated old leader must not acknowledge new
|
||||
commits or advertise linearizable local reads. No cross-shard transactions or global
|
||||
exactly-once side-effect guarantee is implied. Later membership changes use a separately
|
||||
tested protocol; sharding follows single-group correctness. See the
|
||||
[Raft extended paper](https://raft.github.io/raft.pdf).
|
||||
|
||||
Messaging begins with explicit at-least-once delivery and acknowledgement, bounded retries,
|
||||
and application deduplication. Replication does not turn an external side effect into an
|
||||
exactly-once transaction. Durable jobs follow the same acknowledgement/unknown-outcome rules.
|
||||
|
||||
## C-13 — Public evolution and integration
|
||||
|
||||
Each area distinguishes EXISTING names from NEW proposed interfaces, names its owner,
|
||||
lists downstream users, and supplies migration examples. Shared contracts in this file
|
||||
are authoritative; area plans reference contract IDs and do not redefine their meaning.
|
||||
Changes to shared contracts update the [decision ledger](../agent-workflow/DECISIONS.md)
|
||||
and all affected area plans before parallel implementation.
|
||||
|
||||
Implementation task identifiers use `M-<MODULE>-NN`, `S-<SUBSYSTEM>-NN`,
|
||||
`P-<PLATFORM>-NN`, or `X-<AREA>-NN`. They are planned feature work, distinct from the
|
||||
`T-DOC-*` tasks that author these documents. New source paths and commands are marked
|
||||
PROPOSED until they exist. Readiness means passing the gate for that phase, not all
|
||||
long-term distributed or portability promises.
|
||||
|
||||
## C-14 — Reference compositions
|
||||
|
||||
NetworkedApplications composes runtime, protocols, storage, configuration, security,
|
||||
observability, and shutdown. ReloadableApplications composes services, plugin generations,
|
||||
FSM supervision, update activation, and observability. DistributedApplications composes
|
||||
transport, replicated state, membership/routing operations, metrics, and recovery tools.
|
||||
Platforms reuse modules; they do not own alternate implementations of shared primitives.
|
||||
Their documents specify future reference applications and acceptance scenarios only.
|
||||
|
||||
## Contract owners
|
||||
|
||||
| Shared responsibility | Authoritative area |
|
||||
| --- | --- |
|
||||
| Result/error adaptation | Functional |
|
||||
| Clocks/calendar | Time |
|
||||
| Allocation facilities | Memory |
|
||||
| Executor, operation options, structured task scope | Async |
|
||||
| Descriptor/stream/backend lifetime | IO |
|
||||
| Managed composition | Runtime |
|
||||
| General values/schema and binary representation | Data and Binary, respectively |
|
||||
| Atomic storage/recovery format | Storage |
|
||||
| Registry ownership and dynamic loading | Service and Plugin, respectively |
|
||||
| Workflow state and job scheduling | Fsm and Scheduler, respectively |
|
||||
| Delivery and telemetry model | Log and Observability, respectively |
|
||||
| Consensus core and application replication adapters | Coordination and Replication, respectively |
|
||||
|
||||
Package edges, phase dependencies, and validation gates are expanded in
|
||||
[DEPENDENCIES.md](DEPENDENCIES.md), [DELIVERY.md](DELIVERY.md), and
|
||||
[VALIDATION.md](VALIDATION.md).
|
||||
@@ -0,0 +1,127 @@
|
||||
# Build, packaging, and distribution plan
|
||||
|
||||
Status: future build improvements and validation. Current behavior is grounded in
|
||||
[CMakeLists.txt](../../CMakeLists.txt), [Module.cmake](../../cmake/Module.cmake),
|
||||
[Dependencies.cmake](../../cmake/Dependencies.cmake), and
|
||||
[VoidConfig.cmake.in](../../cmake/VoidConfig.cmake.in).
|
||||
|
||||
## Current build contract
|
||||
|
||||
The project requires CMake 4.0+, C++26 and compiler support for the features each selected
|
||||
module uses. GCC 16.2.0 and CMake 4.4.4 were observed locally. GNU builds at version 16+
|
||||
receive reflection flags through current build logic. That is not evidence that every
|
||||
other compiler/version supports all reflection consumers.
|
||||
|
||||
Modules are discovered from `src/`; source-bearing modules honor `BUILD_SHARED_LIBS`,
|
||||
while Testing is static and header-only modules are interface targets. Selection uses
|
||||
`VOID_ENABLED_MODULES`; an empty value selects all. Installed consumers use `find_package`
|
||||
and `Void::<Module>` targets. The current package also loads the test scanner helper.
|
||||
|
||||
Current dependencies include Boost (with a pinned 1.84 fallback), OpenSSL, libsodium,
|
||||
SQLite, LibArchive and Threads. Shared compiled modules hide many implementation
|
||||
dependencies from consumers; static links still need their transitive closure. Fetched
|
||||
shared runtime dependencies have packaging obligations independent of development headers.
|
||||
|
||||
## Target configuration profiles
|
||||
|
||||
| Profile | Purpose | Required result |
|
||||
| --- | --- | --- |
|
||||
| Foundation-minimal | Select individual foundation targets without optional packages | Configure, compile public headers, link and run a tiny installed/embedded consumer |
|
||||
| Module-focused | Select a complete module and only required dependencies | No accidental discovery/link of unrelated engines or runtime services |
|
||||
| Full-shared | All supported modules, shared runtime libraries | Full tests and relocatable installed consumers succeed |
|
||||
| Full-static | Selected/full static modules with explicit transitive libraries | Static closure is complete; tests do not wrongly disable required dependencies |
|
||||
| Embedded | Parent project uses add_subdirectory | Parent linkage/cache policy retained; testing/dependency discovery opt-in is predictable |
|
||||
| Hardened diagnostics | Owned-code warnings-as-errors and supported sanitizers | Dependency warnings isolated appropriately; owned-code diagnostics remain strict |
|
||||
| Offline reproducible | Populated verified sources and declared toolchain | No opportunistic downloads; missing prerequisites fail clearly |
|
||||
|
||||
Profiles are validation concepts, not existing preset names. New CMake presets/manifests
|
||||
are PROPOSED until their implementation task creates them.
|
||||
|
||||
## Dependency and toolchain policy
|
||||
|
||||
- Preserve component-aware resolution and pinned/hash-verified fetched sources. Give
|
||||
users explicit system-package, prepopulated-source, and permitted-fetch paths.
|
||||
- Keep external include diagnostics classified as external/system headers where
|
||||
appropriate; retain warnings-as-errors for owned source. This is the initial repair
|
||||
direction for the Boost/C++26 warning failure, followed by a separately reviewed
|
||||
dependency-version update if desired. Do not disable warning classes globally.
|
||||
- Probe required language/library features and provide actionable errors before large
|
||||
builds. Publish verified versions separately from anticipated support.
|
||||
- Test minimal dependencies independently from the all-module build. Source-level
|
||||
includes must match exported target obligations and installed header sets.
|
||||
- Resolve static consumers' external dependencies explicitly. Shared runtime packaging
|
||||
must not reference the build tree or assume undeclared system libraries are present.
|
||||
- Keep reflection/generation deterministic and scoped to declared inputs. Generated
|
||||
code/tables have reproducible commands, pinned inputs, and one owner per wave.
|
||||
|
||||
The current offline configure needs an existing Boost source tree when the system Boost
|
||||
probe fails. That requirement is documented in [VALIDATION.md](VALIDATION.md), not hidden
|
||||
behind an assumption that an offline first configure can fetch missing sources.
|
||||
|
||||
## CURRENT interfaces and portable command templates
|
||||
|
||||
These templates use existing options, but configurations beyond the recorded baseline
|
||||
have not been executed in this documentation task. Prerequisites are the selected
|
||||
compiler/features and the selected modules' development dependencies.
|
||||
|
||||
```sh
|
||||
# TEMPLATE: ordinary build using available system dependencies or permitted fetch.
|
||||
cmake -S . -B build-roadmap-check -G Ninja \
|
||||
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DVOID_ENABLE_TESTING=ON
|
||||
cmake --build build-roadmap-check --parallel 4
|
||||
ctest --test-dir build-roadmap-check --output-on-failure
|
||||
|
||||
# TEMPLATE: minimal foundation library configuration; consumer test is separate.
|
||||
cmake -S . -B build-core-check -G Ninja \
|
||||
-DVOID_ENABLED_MODULES=Core -DVOID_ENABLE_TESTING=OFF
|
||||
|
||||
# TEMPLATE: supported sanitizer configuration; confirm toolchain support first.
|
||||
cmake -S . -B build-sanitize-check -G Ninja \
|
||||
-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON \
|
||||
-DVOID_ENABLE_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
|
||||
```
|
||||
|
||||
Do not reuse a user's existing build directory with incompatible options. Selection plus
|
||||
testing currently needs an audit: internal tests and test-support targets assume broader
|
||||
module availability. A successful `VOID_ENABLE_TESTING=OFF` configure does not prove that
|
||||
selected-module tests or installed consumers work.
|
||||
|
||||
## Packaging and public distribution
|
||||
|
||||
Preserve independent component installs/consumers, shared and static support, correct
|
||||
runtime search paths, and deterministic export metadata. Add relocatability checks that
|
||||
move an installation away from its build tree and execute consumers with only declared
|
||||
runtime dependencies. Verify public headers and adapter targets separately.
|
||||
|
||||
The existing [Gitea release workflow](../../.gitea/workflows/release.yml) builds/tests,
|
||||
installs, packages and publishes on its configured release path, using pinned external
|
||||
release tooling. This documentation does not execute that workflow. Changes must preserve
|
||||
immutable inputs, version/tag agreement, reproducible archive metadata and artifact
|
||||
verification. Do not copy credentials or other repository contents into plans.
|
||||
|
||||
Distribution additions include documented source consumption, installed SDK/runtime
|
||||
consumption, package manifests where justified, artifact checksums, dependency inventory,
|
||||
and version/support metadata. A public release also needs a project-owner decision on
|
||||
licensing if no tracked license exists; this roadmap does not choose or grant a license.
|
||||
|
||||
## CI matrix and tasks
|
||||
|
||||
| ID | Planned work | Acceptance |
|
||||
| --- | --- | --- |
|
||||
| X-BUILD-01 | Module/header/dependency closure audit and metadata repair | All minimal consumers use only declared dependencies; bridge targets isolated. |
|
||||
| X-BUILD-02 | Selected-module test construction and fixtures | Missing unrelated modules do not break configure/build; requested unsupported combinations fail clearly. |
|
||||
| X-BUILD-03 | Toolchain/dependency feature probes and diagnostic policy | Verified compiler matrix; external warnings do not require weakening owned-code warnings. |
|
||||
| X-BUILD-04 | Shared/static/embedded/installed/relocated consumer matrix | Every declared profile has compile/link/runtime evidence. |
|
||||
| X-BUILD-05 | Reproducible preset/dependency and offline workflows | Pinned inputs and explicit prerequisites; no lockfile/source mutation during verification. |
|
||||
| X-BUILD-06 | Release artifacts, package metadata and documentation | Reproducibility and dependency closure checked before separately authorized publication. |
|
||||
|
||||
Current CI is GCC/Linux-focused. Add other compilers/platforms as their required feature
|
||||
probes and implementations pass; do not claim parity from a matrix entry that skips the
|
||||
relevant modules. Start with Linux x86_64 baseline and explicit portability checks, then
|
||||
expand architecture/OS coverage through capability-specific tasks.
|
||||
|
||||
Validation includes configuration failures, missing package diagnostics, install/export
|
||||
consistency, relocation, static closure, scanner integration and parent-project cache
|
||||
preservation. Existing installed-consumer success is useful evidence but does not cover
|
||||
all proposed profiles. Release and remote side effects require separate authorization.
|
||||
@@ -0,0 +1,141 @@
|
||||
# Delivery phases and implementation gates
|
||||
|
||||
Status: future implementation roadmap. Writing these plans does not complete any
|
||||
feature task. User-approved scope is recorded in [REQUIREMENTS.md](REQUIREMENTS.md).
|
||||
No calendar estimates are implied; phase exits depend on evidence and capacity.
|
||||
|
||||
## Documentation delivery now
|
||||
|
||||
The current work authors the 26 module plans, 15 new subsystem plans, three platform
|
||||
plans, and ten shared roadmap documents. The master index maps every agreed area.
|
||||
Workflow records preserve the approved decisions, baseline, ownership and review.
|
||||
|
||||
Completion requires actual document coverage, valid links and source references,
|
||||
coherent contracts, actionable tasks, a fresh integrated review, and disposition of
|
||||
findings. Reference applications and new test infrastructure are specified, not built.
|
||||
Future commands are labeled PROPOSED; executed baseline commands remain separate evidence.
|
||||
|
||||
## P0 — Reliable baseline and visibility
|
||||
|
||||
**Outcome:** maintainers can reproduce the current state and distinguish library defects,
|
||||
test-environment assumptions, missing tooling, and unsupported configurations.
|
||||
|
||||
| Task | Work and owner recommendation | Acceptance |
|
||||
| --- | --- | --- |
|
||||
| X-BASE-01 | sol_implementer: replace process-test assumptions about `/bin/echo` and `/bin/cat` with controlled fixtures or explicit discovered commands | Process argv/stdin cases test the intended behavior on NixOS and conventional Linux; missing prerequisites produce useful diagnostics. |
|
||||
| X-BASE-02 | sol_implementer: resolve pinned Boost/compiler warning incompatibility through dependency/version/system-header policy | Full warnings-as-errors build passes without blanket disabling warnings in owned code; supported dependency versions recorded. |
|
||||
| X-BASE-03 | astra_implementer: reconcile public includes, target closures and selected-module tests | Minimal, full, installed, embedded, static and shared consumer cases isolate dependency requirements. |
|
||||
| X-BASE-04 | sol_implementer: establish compiler/dependency and sanitizer capabilities | Feature probes and supported matrix drive skips/failures explicitly; unknown support is not success. |
|
||||
| X-BASE-05 | sol_implementer: reproducible benchmark/fuzz/property harness and initial inventory | Raw baselines and workload manifests exist; no unmeasured optimization target is called achieved. |
|
||||
|
||||
Documentation baseline defects are recorded now. These repair tasks remain PLANNED.
|
||||
P0 can overlap with design-only foundation work, but no release accepts an unexplained
|
||||
failed check in its declared support matrix.
|
||||
|
||||
## P1 — Shared foundations and execution
|
||||
|
||||
**Outcome:** subsequent modules can agree on errors, ownership, clocks, allocation,
|
||||
serialization, cancellation, I/O completion, and resource limits.
|
||||
|
||||
Complete G-ERROR, G-EXEC, G-IO, and G-DATA from [DEPENDENCIES.md](DEPENDENCIES.md).
|
||||
Implement foundation tasks in Core, Functional, Memory, Containers, Algorithms, Math,
|
||||
Text, Unicode, Time, Binary, and Data. Async/IO and minimal Runtime follow the common
|
||||
clock and lifetime contracts. Testing grows the deterministic tools needed by those areas.
|
||||
|
||||
Critical-path executor and operation-lifetime changes go to astra_implementer; bounded
|
||||
utilities, adapters, and independent tests default to sol_implementer. Each dispatch has
|
||||
exclusive owned files, observed source baseline, exact API contract, and verification.
|
||||
|
||||
Phase acceptance includes self-contained headers, minimal consumers, cancellation races,
|
||||
exactly one terminal operation result, no dangling frames/buffers, bounded admission, and
|
||||
regression fixtures for existing strict signed data. General JSON/codec expansion must
|
||||
not relax Update validation. Existing TLS/lifetime defects can receive focused repairs
|
||||
before the full new API lands.
|
||||
|
||||
## P2 — Complete functional modules
|
||||
|
||||
**Outcome:** modules provide complete documented workflows with defined success,
|
||||
failure, shutdown, and resource behavior, independently of platform compositions.
|
||||
|
||||
| Parallel stream | Main work | Prerequisite gate |
|
||||
| --- | --- | --- |
|
||||
| Network | Listener/HTTP/WebSocket transport, secure clients, pooling and streaming, RPC base | G-EXEC, G-IO, G-DATA |
|
||||
| Storage | Original durable KV, Sqlite completion, snapshots, recovery and typed adapters | G-IO, G-DATA; G-STORE before higher persistence consumers |
|
||||
| Lifecycle | Owning services, plugin host/C ABI, supervised FSM, reloadable configuration | G-EXEC; G-HOST before live replacement compositions |
|
||||
| Operations | Log/Stacktrace, Observability, Resilience, System/IPC, Archive/Crypto/Security/Update | Relevant common contracts; no exporter/core dependency cycles |
|
||||
| Quality | Testing/Mock, deterministic clocks, property/fuzz and fault injection, package consumers | Minimal framework independence maintained throughout |
|
||||
|
||||
The streams need not finish together. Ship completed coherent module sets while others
|
||||
remain experimental. A documented limitation must be visible in capability reporting
|
||||
and supported configuration tests; it cannot become an implicit success path.
|
||||
|
||||
## P3 — Networked and reloadable applications
|
||||
|
||||
**Outcome:** compose complete modules into optional runtimes/platforms with reference
|
||||
workflows and operational procedures.
|
||||
|
||||
- NetworkedApplications: storage-backed service, streaming client/server, typed
|
||||
configuration, trust setup, health, metrics, limits and graceful shutdown.
|
||||
- ReloadableApplications: dependency-aware host, versioned C/C++ plugin paths, state
|
||||
transfer, generation pinning, health validation and recovery/rollback.
|
||||
- CLI/data-processing reference flow: use only the needed modules, demonstrating
|
||||
small consumers and integration without a mandatory application framework.
|
||||
|
||||
Platform ownership does not include alternate copies of module logic. Integrate module
|
||||
APIs, examples, startup policies and operational tools. Define deterministic startup
|
||||
failure cleanup, overload behavior and shutdown deadlines. Reference examples are tested
|
||||
as consumers and documentation examples, not trusted because the monolithic test passes.
|
||||
|
||||
Optimize measured workloads in all phases, with concentrated integration measurements
|
||||
here. Tune connections, allocation/layout, batch size, contention and timers only with
|
||||
the [performance acceptance rules](PERFORMANCE.md). Record resource tradeoffs explicitly.
|
||||
|
||||
## P4 — Distributed infrastructure and platform
|
||||
|
||||
**Outcome:** progress from durable local building blocks to replicated services through
|
||||
bounded correctness claims and reproducible fault evidence.
|
||||
|
||||
1. Finish local durable Messaging/Scheduler behavior, RPC framing/versioning, and static
|
||||
Discovery/bootstrap. Use explicit at-least-once and retry/dedup semantics.
|
||||
2. Implement Coordination's deterministic fixed-membership Raft core with abstract ports;
|
||||
test elections, quorum agreement, persistence order and partitions in simulation.
|
||||
3. Implement Replication adapters and G-REPL: atomic data/applied-index/dedup updates,
|
||||
quorum-confirmed reads, restart, log retention, snapshot creation and installation.
|
||||
4. Complete single-group DistributedStorage and administrative backup/recovery tooling.
|
||||
Only then add reviewed membership changes, shard routing and rebalancing.
|
||||
5. Compose DistributedApplications with deployment examples, failure visibility and
|
||||
bounded operational procedures. Production readiness requires evidence beyond unit
|
||||
tests or deterministic simulation, including sustained and destructive recovery runs.
|
||||
|
||||
Single-node releases continue while P4 develops. Initial guarantees cover crash faults,
|
||||
not malicious consensus participants. Quorum consistency does not imply minority write
|
||||
availability, global transactions, or exactly-once external side effects.
|
||||
|
||||
## Implementation task readiness
|
||||
|
||||
Before executing any area task:
|
||||
|
||||
1. Reconcile its source baseline and requirements with the current branch and worktree.
|
||||
2. Resolve its named prerequisite contracts and define exact owned paths and shared
|
||||
resources. Persist and lint the full WHAT/HOW assignment.
|
||||
3. For substantial implementation, obtain architecture planning and fresh technical
|
||||
preflight. User approval of these documents is distinct from later scope selection.
|
||||
4. Implement with the configured role, inspect actual changes, and obtain fresh
|
||||
adversarial review. Resolve actionable findings and verify integrated behavior.
|
||||
5. Record code-complete, verified, blocked or released accurately. Review does not
|
||||
authorize commits, remote pushes, deployments or destructive operations.
|
||||
|
||||
After two unsuccessful repair cycles, stop that approach and obtain a changed diagnosis
|
||||
with a distinguishing check. Do not hide failure by weakening tests or broadening scope.
|
||||
|
||||
## Release and rollback milestones
|
||||
|
||||
The first major-release integration groups intentional public API changes and migration
|
||||
adapters. Later capabilities can ship as optional experimental modules until their gates
|
||||
pass. Version public C ABI, wire schemas and disk formats independently where necessary;
|
||||
a package version alone is not a compatibility check.
|
||||
|
||||
Release candidates require a support matrix, package/consumer validation, migration
|
||||
examples, known limitations, performance evidence, and explicit rollback boundaries.
|
||||
Native storage formats must refuse unsupported versions safely. Update and plugin
|
||||
rollback must respect committed durable state. See [MIGRATION.md](MIGRATION.md).
|
||||
@@ -0,0 +1,151 @@
|
||||
# Dependencies, contracts, and integration order
|
||||
|
||||
Status: target dependency design; current build metadata and future architecture are
|
||||
separated below. Read [ARCHITECTURE.md](ARCHITECTURE.md) for contract definitions.
|
||||
|
||||
## Current declared build edges
|
||||
|
||||
These edges come from `src/<Module>/module.cmake` at `f1f9ba3`. They are not a complete
|
||||
header-use graph: undeclared includes and optional bridges must be audited separately.
|
||||
|
||||
| Module | Declared internal dependencies | External/platform dependencies |
|
||||
| --- | --- | --- |
|
||||
| Core, Functional, Containers, Math, Text, Time, Resilience, LogState | None | None |
|
||||
| Binary | Functional | None |
|
||||
| Data | Time | None |
|
||||
| Async | LogState | None |
|
||||
| System | Functional, LogState | Threads |
|
||||
| Configuration | Functional, System, Data, Time | None |
|
||||
| Log | Functional, Configuration; optional Stacktrace | None |
|
||||
| Stacktrace | Functional, LogState | Boost.Stacktrace; platform dl/options |
|
||||
| Plugin | Functional, System, Data | UNIX dl |
|
||||
| Service | Functional, Log | None |
|
||||
| Fsm | Async, Data, Functional, Log, Service | None |
|
||||
| Net | Functional, Text | Boost headers/Asio/Beast/URL, OpenSSL, Threads |
|
||||
| Crypto | Functional | OpenSSL.Crypto |
|
||||
| Security | Functional | libsodium |
|
||||
| Archive | Functional | LibArchive |
|
||||
| Sqlite | Functional | SQLite C API |
|
||||
| Update | Crypto, Data, Functional, System, Text | None |
|
||||
| ShortUrl | Service | None |
|
||||
| Testing | LogState; optional Stacktrace, Log, Async, Configuration, Text | None |
|
||||
| TestingMock | Testing, Functional | None |
|
||||
|
||||
The [module helper](../../cmake/Module.cmake) controls target construction/export, and
|
||||
[package config](../../cmake/VoidConfig.cmake.in) resolves requested components.
|
||||
`INTERNAL_DEPS`, public includes, exported target edges, and installed headers must agree.
|
||||
|
||||
## Target package rules
|
||||
|
||||
1. A foundation package resolves only its lower foundation dependencies and standard
|
||||
library requirements. No concrete runtime, network, telemetry exporter, crypto,
|
||||
storage engine, or logging sink enters that closure accidentally.
|
||||
2. Async never depends on a concrete Log backend or managed Runtime. IO depends on Async;
|
||||
Runtime composes them. System may use IO, but IO cannot call back into System for its
|
||||
platform operations. Backend primitives live inside IO.
|
||||
3. Service's registry core does not depend on Plugin. The existing plugin-service bridge
|
||||
becomes an explicit higher-level integration; retaining a compatibility include must
|
||||
not silently add Plugin to every Service consumer.
|
||||
4. Log's configuration adapter is an optional integration above Log and Configuration.
|
||||
Base Log delivery cannot require the entire configuration/system stack just to emit.
|
||||
5. Observation hooks are lightweight contracts. Exporters and network exporters are
|
||||
separate adapter targets; Net cannot depend on an exporter that depends on Net.
|
||||
6. Storage core handles bytes and durable versions. Structured document/index adapters
|
||||
add Data above it. Sqlite is independent; neither engine is the other's prerequisite.
|
||||
7. Coordination is a deterministic core with abstract ports. Replication owns transport
|
||||
and Storage adapters. Discovery can bootstrap from static peers without querying a
|
||||
consensus group that itself needs discovery to start.
|
||||
|
||||
Exact adapter target names are NEW and are specified by the owning area plan. Their
|
||||
direction and ownership are fixed here. No compatibility wrapper may conceal a reverse
|
||||
dependency; installed consumer tests exercise each bridge explicitly.
|
||||
|
||||
## Area dependency map
|
||||
|
||||
The following are implementation prerequisites, not a promise that every listed
|
||||
prerequisite must be a public link dependency of every API.
|
||||
|
||||
| Area | Prerequisites and owned integration boundary |
|
||||
| --- | --- |
|
||||
| Core, Functional | Foundation layering/error contracts; resolve representation bridges without a cycle |
|
||||
| Memory | Core and standard PMR; raw allocation facilities precede allocator-aware containers |
|
||||
| Math | Core and standard-library storage; scalar checked arithmetic precedes Algorithms; no Containers/Algorithms imports or dependency back from Core UUID representation |
|
||||
| Algorithms | Core and narrow Math checked arithmetic; optional Functional/Memory adapters; standard-library scratch storage, never Containers or Text |
|
||||
| Containers | Core; Memory before allocator-aware types; graph convenience adapters may depend on Algorithms, never the reverse |
|
||||
| Text, Unicode | Text byte utilities first; Unicode tables/algorithms above them; optional Text adapters |
|
||||
| Time | Core/error conventions; clock interface before timers and scheduler |
|
||||
| Binary, Data | Binary bounds/encoding first; Data composes codecs, text and time where required |
|
||||
| Async | Error, clock, memory and resource contracts; lifetime model before IO/FSM upgrades |
|
||||
| IO, System, IPC | Async/byte streams → IO backends → System workflows/IPC framing |
|
||||
| Configuration | Data, Text, Time; watching/reload adapters additionally use System/Async |
|
||||
| Log, Stacktrace, Observability | Independent hook contracts; Async for queued delivery; exporters above protocols |
|
||||
| Crypto, Security, Archive | Functional/error/byte interfaces; retained backend feature checks |
|
||||
| Net, RPC | IO/Async, Binary/Text, TLS backend → Net transports → RPC framing/schema |
|
||||
| Sqlite, Storage | Error/byte contracts; Storage additionally IO and memory; independently tested durability |
|
||||
| Service, Plugin, Fsm | Owning service handles → module host and FSM supervision; Async joins before safe unload |
|
||||
| Scheduler, Messaging | Async/Time; optional Storage persistence; network/replication adapters later |
|
||||
| Update, ShortUrl | Existing trust/ABI contracts; higher integration with Net/Plugin/Storage stays optional |
|
||||
| Discovery | Static/local provider first; RPC health/registration; replicated provider in a higher adapter |
|
||||
| Coordination | Deterministic core and stable-storage/clock/transport ports; simulation harness |
|
||||
| Replication | Coordination + Storage + RPC adapters; atomic applied-state and dedup contract |
|
||||
| DistributedStorage | Proven single-group Replication; routing/reconfiguration before sharding/rebalance |
|
||||
| Testing, TestingMock | Minimal framework can validate foundations; fault/property extensions grow alongside modules |
|
||||
| NetworkedApplications | Runtime, Net, chosen Storage/Sqlite, Configuration, Security, Observability |
|
||||
| ReloadableApplications | Runtime, Service, Plugin, Fsm, Update, Configuration, Observability |
|
||||
| DistributedApplications | RPC, Messaging, Discovery, Coordination, Replication, DistributedStorage, operations |
|
||||
|
||||
## Critical path and parallel work
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
B[Baseline and package audit] --> C[Shared contracts and foundation]
|
||||
C --> A[Async ownership and clocks]
|
||||
A --> I[Native IO and bounded streams]
|
||||
C --> D[Data and binary contracts]
|
||||
I --> N[Network transport and streaming]
|
||||
I --> S[Original storage durability]
|
||||
D --> S
|
||||
A --> L[Service and plugin lifecycle]
|
||||
L --> H[Reloadable platform]
|
||||
N --> P[Networked platform]
|
||||
S --> P
|
||||
N --> R[RPC and discovery adapters]
|
||||
S --> M[Durable local messaging]
|
||||
R --> X[Replication adapters]
|
||||
S --> X
|
||||
Q[Deterministic coordination core] --> X
|
||||
X --> Z[Distributed storage and platform]
|
||||
```
|
||||
|
||||
The diagram shows integration gates; it does not prevent building a deterministic
|
||||
coordination simulator while independent module work continues. Single-node deliverables
|
||||
must not wait for distributed completion. Foundation improvements continue across phases.
|
||||
|
||||
## Contract freeze and ownership
|
||||
|
||||
| Gate | Required agreement before parallel dependents |
|
||||
| --- | --- |
|
||||
| G-ERROR | Functional error classification/conversion and allocator ownership |
|
||||
| G-EXEC | Async scope/operation/executor API and Time clock/deadline behavior |
|
||||
| G-IO | Stream buffer lifetime, partial results, cancellation/completion and admission |
|
||||
| G-DATA | Numeric values, codec bounds, schema versioning, strict signed-data compatibility |
|
||||
| G-STORE | Commit/unknown outcome, format/recovery, snapshots, preconditions and retention |
|
||||
| G-HOST | Service pinning, lifecycle callbacks, C ABI and safe generation retirement |
|
||||
| G-REPL | Stable protocol state, committed/applied position, deduplication and snapshot atomicity |
|
||||
|
||||
Area plans may refine interfaces owned by their area; cross-area meaning changes require
|
||||
an updated decision and reconciliation before dispatch. Shared build declarations,
|
||||
generated Unicode tables, disk/wire formats, exported ABI headers, and schemas each have
|
||||
one writer per implementation wave. Source-disjoint tasks may still share ports, storage
|
||||
directories, global log state, or clocks; tests isolate those resources.
|
||||
|
||||
## Integration checks
|
||||
|
||||
- Compile public headers and link installed consumers against the smallest supported
|
||||
component closure, including deliberate absence of unrelated external dependencies.
|
||||
- Compare exported target dependencies to source includes and implementation use.
|
||||
- Exercise adapter packages separately from core packages in shared and static builds.
|
||||
- Check each feature task's prerequisite IDs and cross-plan links before execution;
|
||||
no implementation task is READY with an unresolved required contract.
|
||||
- Re-run affected cross-module scenarios after ownership, wire/disk format, error, or
|
||||
lifetime changes. See [VALIDATION.md](VALIDATION.md) for the evidence matrix.
|
||||
@@ -0,0 +1,108 @@
|
||||
# Documentation, examples, and developer experience
|
||||
|
||||
Status: planned product documentation work. This roadmap package is the current
|
||||
documentation deliverable; guides and runnable examples described here are future tasks.
|
||||
|
||||
## Current evidence and audience
|
||||
|
||||
The [project README](../../README.md) explains the build and an older module inventory.
|
||||
[ShortUrl's contract](../short-url.md) is the existing dedicated service/ABI document.
|
||||
The source tree contains additional modules and evolved behavior that are not fully
|
||||
represented in the README. Public headers/tests are useful evidence but are not a
|
||||
substitute for a supported-use guide.
|
||||
|
||||
Documentation must serve three entry points: a developer selecting a small utility,
|
||||
a developer adopting a complete module in an existing application, and a developer
|
||||
choosing a managed application platform. Each should reach a minimal working example
|
||||
without being required to understand the entire library.
|
||||
|
||||
## Information architecture
|
||||
|
||||
| Layer | Content | Acceptance |
|
||||
| --- | --- | --- |
|
||||
| Start/select | Current capability catalog, module dependencies, supported toolchains, installation choices | Every advertised capability maps to implemented/experimental/planned status and a verified consumer path. |
|
||||
| Learn/use | Foundation recipes, complete module workflows, embedded/managed examples | Preconditions, ownership, failures and cleanup are shown alongside happy paths. |
|
||||
| Reference | Public types/functions, thread-safety, invalidation, errors, limits, ABI/wire/disk versions | References come from public contracts and name version-specific behavior. |
|
||||
| Compose/operate | Platform startup, configuration, health, deployment examples, upgrades and recovery | Operational examples reuse modules and identify the point of durable commitment. |
|
||||
| Maintain | Architecture decisions, dependency/ownership map, contribution/test guidance, migration notes | A new maintainer can select and verify a bounded task without reconstructing chat history. |
|
||||
|
||||
The roadmap stays distinct from implemented-feature documentation. When a task ships,
|
||||
update the capability catalog and guide with actual commands/evidence; retain the plan's
|
||||
decision history and mark its task status accurately.
|
||||
|
||||
## Example contract
|
||||
|
||||
Each future runnable example identifies selected modules, compiler/dependency prerequisites,
|
||||
resource/trust configuration, input/output, failure paths, cleanup and verification command.
|
||||
Examples consume exported/installed targets as appropriate and are compiled/tested in CI.
|
||||
Avoid hidden external accounts, production data, credentials, public endpoints or network
|
||||
services as prerequisites. Use loopback fixtures and private test certificates.
|
||||
|
||||
Start with:
|
||||
|
||||
1. A minimal utility/CLI consumer with no managed runtime or optional engine dependency.
|
||||
2. Reflection/binary/JSON round trips with large integers, bounds and checked errors.
|
||||
3. An application-owned executor with cancellation, deadlines and explicit lifetime.
|
||||
4. A managed streaming service using a selected storage backend and observable shutdown.
|
||||
5. A reloadable host with retained service handles, failed-candidate rollback and a C ABI
|
||||
plugin example distinct from the same-toolchain C++ example.
|
||||
6. A later fixed-membership replicated KV demonstration with partition/restart scenarios
|
||||
and clearly limited consistency/availability claims.
|
||||
|
||||
Documentation snippets marked NEW in these plans are design illustrations. They become
|
||||
copyable supported examples only after interfaces exist and snippets compile in the
|
||||
declared configuration. Do not invent commands that appear executable without labels.
|
||||
|
||||
## Per-module documentation requirements
|
||||
|
||||
- State whether the module is header-only, compiled, an adapter, or a composition, and
|
||||
show its actual CMake target separately from C++ namespaces.
|
||||
- Give the smallest dependency closure and identify optional capabilities/backends.
|
||||
- Explain value/borrow/ownership lifetime, threading, callback execution, allocation,
|
||||
cancellation, deadlines and shutdown wherever relevant.
|
||||
- Document defaults and limits numerically, including the meaning of zero/unbounded
|
||||
options and what overload looks like.
|
||||
- Present errors as actionable caller choices: retry, inspect ambiguous outcome, change
|
||||
configuration, reject input, or report corruption. Avoid broad silent fallbacks.
|
||||
- Include version/default changes, migration adapters and capability restrictions.
|
||||
- Link deeper algorithms and operational implications without duplicating authoritative
|
||||
shared contracts.
|
||||
|
||||
## Developer workflows
|
||||
|
||||
Provide reproducible configure/build/test instructions for supported profiles and clear
|
||||
diagnostics for missing compiler reflection or external packages. Include fast focused
|
||||
tests, full integration checks, package consumers and the criteria for using each.
|
||||
Explain that a selected-module build and a kitchen-sink test build answer different
|
||||
questions. Preserve the user's build directories and local configuration.
|
||||
|
||||
Generated API/reference material must use a documented tool/version and reproducible
|
||||
inputs. Generated output is not hand-edited. Prefer source-adjacent comments for individual
|
||||
symbols and maintained guides for cross-component workflows. No documentation generator
|
||||
or hosting service is mandated by this package before its bounded implementation task.
|
||||
|
||||
## Plan-file authoring and upkeep
|
||||
|
||||
Each area plan records baseline source links, concrete scope and NEW APIs, algorithms
|
||||
and flow, native/backend choice, lifetime/failure/resource behavior, performance workloads,
|
||||
task IDs/dependencies/ownership, validation and migration. The task backlog must be
|
||||
specific to the area; repeated generic paragraphs do not count as expanded design.
|
||||
|
||||
Shared requirements, architecture and decisions have one authoritative home. A changed
|
||||
contract updates dependent plans in the same review. The master coverage matrix identifies
|
||||
all affected areas. Durable workflow records distinguish authoring completion from future
|
||||
feature implementation and record observed commands rather than invented success.
|
||||
|
||||
## Tasks
|
||||
|
||||
| ID | Planned work | Acceptance |
|
||||
| --- | --- | --- |
|
||||
| X-DOC-01 | Reconcile capability/module catalog and README | Every current module has correct target, status, dependency and guide links. |
|
||||
| X-DOC-02 | Author minimal adoption guides and compiled examples | Utility/module/platform entry points each work with declared prerequisites. |
|
||||
| X-DOC-03 | Generate and validate API reference from supported public contracts | No undocumented public defaults/lifetime behavior; links/snippets checked. |
|
||||
| X-DOC-04 | Author operations, recovery and migration recipes | Failure/rollback scenarios are rehearsed against implementation and reflect real commit boundaries. |
|
||||
| X-DOC-05 | Add documentation consistency checks to CI | Broken links, stale snippets, missing capability entries and unresolved contract changes are detected. |
|
||||
|
||||
Root/maintainer owns architecture and release-facing statements. Module owners own their
|
||||
examples and contract accuracy. A documentation or editorial specialist may polish prose,
|
||||
but source/behavior acceptance remains a technical review responsibility.
|
||||
@@ -0,0 +1,112 @@
|
||||
# Compatibility, migration, and rollback
|
||||
|
||||
Status: planned migration design. Current project version is 1.2.1 in
|
||||
[CMakeLists.txt](../../CMakeLists.txt). Intentional source/behavior breaks target a major
|
||||
release; exact release timing follows evidence gates, not this document's creation.
|
||||
|
||||
## Compatibility dimensions
|
||||
|
||||
| Dimension | Promise and verification |
|
||||
| --- | --- |
|
||||
| Source API | Existing entry points remain documented; changed types, errors, defaults and lifetimes have explicit old/new examples and deprecation or major-release handling. |
|
||||
| CMake/package | Public `Void::<Module>` names and component closures are tested. C++ namespaces are not inferred from target names: `Void::Log` is a target while `Void::Logging` is an existing C++ namespace. |
|
||||
| C++ binary ABI | Same-toolchain contract remains explicit; compiler, standard library, build/ABI flags, and interface versions must match where required. |
|
||||
| Stable C plugin ABI | NEW versioned function tables and opaque handles have independent compatibility tests; existing C++ descriptors do not become C-compatible automatically. |
|
||||
| Wire schemas | Protocol IDs, field encoding, optional/required fields and version negotiation are explicit. Unknown required semantics fail rather than being guessed. |
|
||||
| Native storage formats | Every format has a version, integrity checks, recovery rules, and upgrade/rollback boundary. Unknown versions fail without rewriting data. |
|
||||
| Signed update documents | Verify original bytes and preserve strict parser semantics and existing trust checks. |
|
||||
| Observable behavior | Security defaults, limits, ordering, deadlines, loss policies and shutdown semantics are migration-relevant even if signatures compile. |
|
||||
|
||||
## Migration waves
|
||||
|
||||
### Wave A: establish consumer fixtures
|
||||
|
||||
Inventory supported public headers, namespaces, exported targets, default options and
|
||||
error behavior from actual source. Add minimal installed and embedded consumers for
|
||||
foundation, runtime, network, storage, plugins and test integration. Freeze representative
|
||||
old-version fixtures before altering APIs. Record existing defects rather than freezing
|
||||
unsafe behavior as an unconditional compatibility requirement.
|
||||
|
||||
### Wave B: add explicit new contracts and adapters
|
||||
|
||||
Introduce NEW lifetime/operation APIs beside existing conveniences where this preserves
|
||||
clear semantics. Forwarding headers and deprecated wrappers may translate compatible
|
||||
calls. An adapter must not hide asynchronous lifetime differences, insecure trust policy,
|
||||
an unbounded queue, or a new mandatory dependency. Refuse an unsupported conversion rather
|
||||
than returning success with weaker guarantees.
|
||||
|
||||
### Wave C: major-release transition
|
||||
|
||||
Group intentional breaks into a migration guide with before/after examples, diagnostics,
|
||||
test updates, and capability/default changes. Consumer fixtures exercise both retained
|
||||
compatibility paths and native new APIs. Removal of old entry points occurs only at the
|
||||
declared version boundary; area plans name the affected signatures.
|
||||
|
||||
### Wave D: persistent and distributed evolution
|
||||
|
||||
Freeze the first native storage format before public durable-state use. Subsequent
|
||||
upgrades validate source format and available disk space, write a new generation, verify
|
||||
it, and switch the manifest atomically under the writer/recovery protocol. Preserve the
|
||||
old generation until the declared rollback boundary and retention policy allow removal.
|
||||
No blind downgrade follows new-format writes. Export/import and backup/restore provide
|
||||
the explicit path when a backward-compatible downgrade is impossible.
|
||||
|
||||
## Area migration obligations
|
||||
|
||||
| Area | Old/new boundary | Required consumer evidence |
|
||||
| --- | --- | --- |
|
||||
| Core/Functional | Error categories, formatting adapters, foundation dependency cleanup | Existing representations and error chains; minimal consumer with optional packages absent |
|
||||
| Containers/Memory | Allocator-aware variants and changed invalidation/ownership | Move-only values, allocator lifetime, stable-handle/invalidation examples, old default behavior |
|
||||
| Data/Binary/Text | Exact integers, checked conversions, Unicode/limit policies | Large identifiers round-trip; overflow errors; old strict signed documents remain accepted/rejected identically |
|
||||
| Async/IO | Borrowed queued handles and detached work toward structured ownership | Cancellation/parked destruction and explicit join; blocking bridge cannot deadlock its own executor |
|
||||
| Net | Secure TLS defaults, total deadlines, redirect and streaming/session APIs | Private-CA correct-host tests; wrong-host failure; explicit legacy override if offered; no fallback to insecure mode |
|
||||
| Service/Plugin | Reference convenience versus owning handles; new C ABI | Acquired old generation survives replacement; C/C++ paths have separate ABI tests and destruction ownership |
|
||||
| Fsm/Scheduler | Terminal-state consistency and supervised children | Faulted termination, race loser cleanup, state checkpoint restore; no coroutine-frame serialization |
|
||||
| Log/Observability | Bounded total memory, loss and flush semantics | Saturation counters and flush outcomes documented; context snapshots survive shared-library boundaries |
|
||||
| Sqlite/Storage | SQLite integration remains independent; original engine is NEW | No implicit conversion of SQLite databases; adapters/export tools have explicit schemas |
|
||||
| Archive/Update | Expanded workflows with existing safety/commit invariants | Traversal/symlink tests, exact signatures, health commit/reconcile and retention regressions |
|
||||
| ShortUrl | Frozen V1 enum/member/virtual ordering | Same-toolchain V1 fixture; incompatible additions in V2 with explicit provider capability |
|
||||
| Distributed | Versioned commands, membership and snapshot semantics | Mixed-version compatibility only for explicitly tested combinations; reject unsupported peers safely |
|
||||
|
||||
## Stable C ABI rules
|
||||
|
||||
Plugin owns the C boundary design and compatibility fixtures. The initial ABI includes
|
||||
version and structure size, opaque instance handles, fixed-width fields, status values,
|
||||
explicit buffer lengths and owner-provided release operations. Host and plugin negotiate
|
||||
supported capabilities before invoking optional functions. An incompatible major ABI
|
||||
fails before activation.
|
||||
|
||||
No STL object, C++ exception, RTTI identity, implicit ownership transfer, or allocator
|
||||
pairing crosses the C boundary. Callback lifetime, threading and cancellation obligations
|
||||
are contractual. Generation retirement waits for all acquired handles and owned work.
|
||||
Adding a C ABI does not imply process isolation or protection from a malicious in-process
|
||||
plugin; IPC isolation is a separate architecture choice.
|
||||
|
||||
## Rollback boundaries
|
||||
|
||||
- Source changes: revert an owned change only after reconciling dependent work and
|
||||
preserving user modifications. Documentation never authorizes destructive Git actions.
|
||||
- Plugin activation: before publication/commit, discard a failed candidate and keep the
|
||||
active generation. After state has been committed externally, use compensating or
|
||||
forward recovery according to that contract; do not pretend memory swapping undoes it.
|
||||
- Update activation: preserve VersionStore's durable healthy-history commit marker.
|
||||
Post-commit cleanup failure is retryable cleanup, not evidence to roll back healthy state.
|
||||
- Storage: a committed durable batch is not rolled back by cancellation or a lost reply.
|
||||
Failed migration before the manifest switch preserves the old authoritative generation;
|
||||
recovery decides ambiguous switch outcomes from durable records.
|
||||
- Replication: committed log history and applied position are authoritative. A node
|
||||
restart or software downgrade cannot erase acknowledged committed operations.
|
||||
|
||||
## Tasks
|
||||
|
||||
| ID | Planned work | Acceptance |
|
||||
| --- | --- | --- |
|
||||
| X-MIG-01 | Consumer/API/default inventory and legacy fixtures | Every intentional change maps to an existing behavior and migration check. |
|
||||
| X-MIG-02 | Shared adapter/deprecation policy and diagnostics | Wrappers preserve stated semantics and dependency bounds; incompatible cases fail explicitly. |
|
||||
| X-MIG-03 | Major-release migration guide and examples | All source/behavior breaks have before/after instructions and tested consumers. |
|
||||
| X-MIG-04 | C ABI/wire/disk compatibility matrices | Format versions and supported combinations are explicit; unknown inputs fail safely. |
|
||||
| X-MIG-05 | Upgrade, recovery and rollback rehearsals | Failures at each commit boundary yield a defined authoritative state and reproducible recovery. |
|
||||
|
||||
These tasks depend on the area interfaces and their [contract gates](DEPENDENCIES.md).
|
||||
Feature owners own compatibility tests; root owns cross-area versioning and release
|
||||
composition. A documentation review cannot substitute for actual upgrade rehearsals.
|
||||
@@ -0,0 +1,106 @@
|
||||
# Performance profiles and measurement plan
|
||||
|
||||
Status: planned measurement/optimization work. No speedup or benchmark result is claimed
|
||||
by this document. The existing [Bench helper](../../include/Void/Time/Bench.hpp) measures
|
||||
individual calls through `std::function` and a clock; it is useful functionality but is
|
||||
not yet a comparative library-wide performance suite.
|
||||
|
||||
## Goals and profiles
|
||||
|
||||
Runtime and memory have priority. Separate profiles make tradeoffs visible rather than
|
||||
forcing one tuning policy onto every consumer.
|
||||
|
||||
| Profile | Primary metrics | Constraints and representative work |
|
||||
| --- | --- | --- |
|
||||
| Latency | p50/p95/p99 operation and queue latency; deadline misses | Small RPC/HTTP requests, task wakeups, service lookup, log admission, point reads; bounded queues and no hidden blocking |
|
||||
| Throughput | Completed operations/second, bytes/second, CPU per useful operation | Streaming transfers, serialization, batches, message consumption, multi-client workloads; report queue depth and fairness |
|
||||
| Footprint | Allocation count/bytes, peak and retained RSS, working set, binary size | Small consumers, bounded queues, snapshots, caches and idle runtime; peak includes in-flight batches/buffers |
|
||||
| Developer cost | Clean/incremental compile time, link time, dependency closure, artifact size | Single-header consumers, selected modules, complete shared/static installs; tracked alongside runtime profiles |
|
||||
|
||||
Each module plan chooses relevant scenarios and explicit resource limits. A low-latency
|
||||
configuration may trade throughput or memory; publish that tradeoff. An optimization
|
||||
cannot be accepted by excluding failed, rejected, timed-out, or dropped work from the
|
||||
reported totals without reporting those counts separately.
|
||||
|
||||
## Reproducible workload specification
|
||||
|
||||
Every benchmark record includes source revision, dirty state, compiler/standard-library
|
||||
versions, flags, dependency versions, OS/kernel, CPU model/core topology, memory, storage
|
||||
device/filesystem for I/O, affinity policy, power policy, data set and random seed,
|
||||
thread/client count, warmup, duration/sample count, and requested module/profile options.
|
||||
Do not record credentials or production payloads. Use generated or public fixture data.
|
||||
|
||||
Use release-optimized builds for performance results, with a separate instrumented build
|
||||
for allocation/fault investigations when instrumentation changes timing. Keep baseline and
|
||||
candidate workloads identical. Record raw samples in a machine-readable artifact plus a
|
||||
human summary. Preserve correctness assertions outside the timed critical section where
|
||||
possible and validate every run's outputs.
|
||||
|
||||
For initial comparisons use five warmup runs and at least twenty measured repetitions
|
||||
of each aggregate workload. Increase duration/repetitions if confidence intervals overlap
|
||||
too much to distinguish a claimed effect; never select only favorable runs. For extremely
|
||||
small functions batch many operations per timed interval and subtract/report a separately
|
||||
measured harness baseline. Do not interpret clock/dispatch overhead as the function's
|
||||
intrinsic cost. Network latency workloads retain per-request samples and avoid hiding
|
||||
queueing by driving clients only after each previous request finishes.
|
||||
|
||||
## Measurement and acceptance rules
|
||||
|
||||
1. Establish the workload's current baseline before changing algorithms or defaults.
|
||||
2. Select the primary metric and resource budgets in the task contract before measuring
|
||||
the candidate. Hard resource bounds are correctness criteria, not statistical targets.
|
||||
3. Report median aggregate results with 95% confidence intervals and p95/p99 for
|
||||
operation-level latency. Record failed/rejected work and maximum observed resource use.
|
||||
4. A performance improvement requires a repeatable effect larger than observed noise,
|
||||
preserved correctness, and satisfaction of the selected profile's resource budgets.
|
||||
5. Flag a regression exceeding 5% in a non-target metric on the controlled benchmark host
|
||||
when repeated runs distinguish it from noise. Resolve it or record an explicit
|
||||
profile tradeoff before acceptance. Shared/noisy CI measurements are advisory.
|
||||
6. No universal absolute latency or speedup target is asserted before hardware/workload
|
||||
baselines exist. Once established, commit versioned per-workload budgets and require
|
||||
a deliberate reviewed change to revise them.
|
||||
|
||||
## Benchmark inventory
|
||||
|
||||
| Family | Scenarios | Important controls |
|
||||
| --- | --- | --- |
|
||||
| Core/containers/memory | Small/large values, sparse/dense keys, cache hit/miss, pool reuse, arena reset | Lifetime correctness, alignment, bytes retained and allocation failures |
|
||||
| Algorithms/math/text | Input size distributions, adversarial patterns, scalar/vector paths, UTF validity | Identical semantics; compare appropriate standard-library baseline |
|
||||
| Data/binary | Small objects, deep nesting, large integers, large streams, encode/decode/reflection | Validation policies matched; malformed-input throughput separate |
|
||||
| Async/IO | Uncontended/contended queues, cancellation storms, timer scale, partial I/O | Admission counts, fairness, deadline misses and in-flight memory |
|
||||
| Net/RPC | Cold/warm connections, TLS handshakes, keepalive, slow clients, uploads/downloads | Connection reuse, client/server CPU, network topology, total deadlines |
|
||||
| Storage/Sqlite | Point/range reads, atomic batches, read/write mix, snapshots and compaction | Durability/isolation modes matched; dataset larger than cache included |
|
||||
| Log/observability | Disabled path, small/structured events, saturation, slow exporter, flush | Loss policy/counters, queue plus batch memory, cardinality limits |
|
||||
| Service/plugin/FSM | Lookup, pinned calls during replacement, event/timer fan-out, cancellation | No lifetime weakening; reload tail latency and retained generations |
|
||||
| Distributed | Quorum commit, read-index, leader replacement, snapshot catch-up | Fault model, replica placement, acknowledgement semantics, tail latency |
|
||||
| Packaging/build | Foundation consumer, selected module set, all modules; clean and edit/rebuild | Same compiler/cache state; report cold and warm caches separately |
|
||||
|
||||
## Inspected optimization candidates
|
||||
|
||||
These are source properties or investigation targets, not measured bottlenecks:
|
||||
|
||||
- HTTP requests currently create connection/TLS state per attempt; compare reusable
|
||||
sessions and streaming against the exact same trust/deadline policy.
|
||||
- MPSC delivery allocates nodes; investigate pooling/batched ownership only after
|
||||
concurrent destruction, reclamation, and memory bounds are defined.
|
||||
- JSON object lookup, router matching, and FSM timer scans use simple structures;
|
||||
measure workload sizes before replacing them with indexes or timer hierarchies.
|
||||
- Log worker batches can grow independently of queued slot accounting; establish a
|
||||
correct total bound before optimizing batch size or lock contention.
|
||||
- Header-heavy templates/reflection and broad test linkage affect build cost; measure
|
||||
include/dependency isolation before selecting precompiled-header or module experiments.
|
||||
|
||||
## Tasks
|
||||
|
||||
| ID | Work | Dependencies | Acceptance |
|
||||
| --- | --- | --- | --- |
|
||||
| X-PERF-01 | Define workload/result schemas and reproducible runner manifests | P0 inventory; Time/Testing measurement contracts | Every result identifies configuration and raw samples; seeded repeat is reproducible. |
|
||||
| X-PERF-02 | Implement aggregate timing, allocation and resource collectors | X-PERF-01 | Harness overhead measured; counters reconcile; collectors do not change semantic outcomes. |
|
||||
| X-PERF-03 | Establish foundation/runtime/network/storage baselines | Relevant modules available | Comparable workloads and profile budgets versioned before optimization. |
|
||||
| X-PERF-04 | Add controlled-host regression comparison and advisory CI summaries | X-PERF-02, X-PERF-03 | Noise-aware alerts and explicit tradeoff records; no flaky shared-runner release gate. |
|
||||
| X-PERF-05 | Profile and optimize one identified cause per task | Selected baseline and hypothesis | Measured improvement, regression tests, before/after evidence and resource accounting. |
|
||||
|
||||
All tasks are PLANNED. Runner/benchmark command names are PROPOSED until the harness
|
||||
exists; the only CURRENT commands are the existing build/test commands documented in
|
||||
[VALIDATION.md](VALIDATION.md). Cross-area performance work must use those modules'
|
||||
approved ownership and shared contracts.
|
||||
@@ -0,0 +1,124 @@
|
||||
# VoidLibrary expansion roadmap
|
||||
|
||||
This is the approved planning package for a generic C++26/reflection library spanning
|
||||
small foundations, complete modules, and optional application platforms. It describes
|
||||
future work; the presence of a plan does not mean its APIs or capabilities are implemented.
|
||||
|
||||
The user approved authoring this package on 2026-11-24. The source baseline is `main` at
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`. The design retains Linux-first portability,
|
||||
versioned modernization, native implementation preference with per-module backend
|
||||
decisions, embedded and managed runtimes, and separate workload profiles. SQLite support
|
||||
and an original native storage engine are distinct. Distributed capabilities follow
|
||||
single-node foundations and correctness gates.
|
||||
|
||||
## Start here
|
||||
|
||||
1. [Requirements](REQUIREMENTS.md) records confirmed scope and representative journeys.
|
||||
2. [Architecture](ARCHITECTURE.md) defines shared contracts C-01 through C-14 and owners.
|
||||
3. [Dependencies](DEPENDENCIES.md) separates existing build edges from the target DAG.
|
||||
4. [Delivery](DELIVERY.md) orders work from baseline quality to complete distributed platforms.
|
||||
5. Select an area plan below, then follow its task prerequisites and acceptance scenarios.
|
||||
|
||||
## Shared plans
|
||||
|
||||
| Plan | Responsibility |
|
||||
| --- | --- |
|
||||
| [Requirements](REQUIREMENTS.md) | R-001–R-016, approved scope, consumers and planning acceptance |
|
||||
| [Architecture](ARCHITECTURE.md) | Common contracts, layering, ownership and consistency boundaries |
|
||||
| [Dependencies](DEPENDENCIES.md) | Module edges, adapter boundaries, contract gates and parallel integration |
|
||||
| [Delivery](DELIVERY.md) | P0–P4 milestones and implementation readiness/release gates |
|
||||
| [Performance](PERFORMANCE.md) | Workload profiles, measurement protocol, budgets and regression evidence |
|
||||
| [Validation](VALIDATION.md) | Planning checks, current baseline, future behavior/fault/configuration matrix |
|
||||
| [Migration](MIGRATION.md) | Public API/ABI, defaults, wire/disk evolution and rollback boundaries |
|
||||
| [Build and distribution](BUILD-AND-DISTRIBUTION.md) | Toolchains, dependency closure, packaging, CI and reproducibility |
|
||||
| [Documentation](DOCUMENTATION.md) | Capability catalog, guides, future examples, references and upkeep |
|
||||
|
||||
## Existing public modules
|
||||
|
||||
Each module has a separate expanded plan. LogState is an internal supporting target;
|
||||
its process/shared-library obligations are covered by Log and architecture.
|
||||
|
||||
| Module plan | Expansion focus |
|
||||
| --- | --- |
|
||||
| [Core](modules/Core.md) | Small types, concepts, reflection utilities and foundation independence |
|
||||
| [Functional](modules/Functional.md) | Results/errors, functional composition, adapters and retry contracts |
|
||||
| [Containers](modules/Containers.md) | Allocation/lifetime-aware specialized containers and cache behavior |
|
||||
| [Math](modules/Math.md) | General numeric, statistical and checked math utilities |
|
||||
| [Text](modules/Text.md) | Byte/text processing, parsing/formatting and explicit Unicode integration |
|
||||
| [Data](modules/Data.md) | Precise values, bounded parsing, reflection and schema evolution |
|
||||
| [Binary](modules/Binary.md) | Bounded readers/writers, codecs and explicit wire representation |
|
||||
| [Time](modules/Time.md) | Clocks, calendars, deadlines and measurement foundations |
|
||||
| [Async](modules/Async.md) | Structured task scopes, executors, cancellation and bounded completion |
|
||||
| [System](modules/System.md) | Processes, files, watching, metrics and platform capabilities |
|
||||
| [Configuration](modules/Configuration.md) | Typed sources, validation and transactional reload |
|
||||
| [Net](modules/Net.md) | Real server transports, secure clients, persistent sessions and streaming |
|
||||
| [Sqlite](modules/Sqlite.md) | First-class SQLite access, transactions, migrations and concurrency |
|
||||
| [Service](modules/Service.md) | Owning access, scopes, dependency lifecycle and replacement |
|
||||
| [Plugin](modules/Plugin.md) | Complete module hosting, generation retirement and versioned C ABI |
|
||||
| [Fsm](modules/Fsm.md) | Supervised workflows, child lifetime and checkpoint boundaries |
|
||||
| [Log](modules/Log.md) | Bounded delivery, shared facade state, saturation and flush guarantees |
|
||||
| [Stacktrace](modules/Stacktrace.md) | Capture, symbolization, diagnostics and optional integrations |
|
||||
| [Resilience](modules/Resilience.md) | Retry/admission budgets, circuit breaking and overload composition |
|
||||
| [Archive](modules/Archive.md) | Bounded archive workflows with path and extraction safety |
|
||||
| [Crypto](modules/Crypto.md) | Coherent cryptographic operations over reviewed primitives |
|
||||
| [Security](modules/Security.md) | Secret/token/password workflows and explicit policy boundaries |
|
||||
| [Update](modules/Update.md) | Signed release selection, complete activation and durable recovery |
|
||||
| [ShortUrl](modules/ShortUrl.md) | Frozen V1 provider contract and optional richer service composition |
|
||||
| [Testing](modules/Testing.md) | Deterministic, property, fuzz and fault-test infrastructure |
|
||||
| [TestingMock](modules/TestingMock.md) | Expectations, asynchronous behavior and reliable failure diagnostics |
|
||||
|
||||
## New subsystems
|
||||
|
||||
All names in this table are NEW proposed areas, not claims of current source targets.
|
||||
|
||||
| Subsystem plan | Purpose |
|
||||
| --- | --- |
|
||||
| [Memory](subsystems/Memory.md) | Arenas, pools, allocator resources and allocation accounting |
|
||||
| [Algorithms](subsystems/Algorithms.md) | Reusable generic algorithms with workload-based specialization |
|
||||
| [Unicode](subsystems/Unicode.md) | Validated Unicode processing and versioned data tables |
|
||||
| [IO](subsystems/IO.md) | Native backends, byte streams, partial results and operation lifetime |
|
||||
| [Runtime](subsystems/Runtime.md) | Optional managed execution and application-injected composition |
|
||||
| [Scheduler](subsystems/Scheduler.md) | Delayed/calendar jobs, persistence and occurrence semantics |
|
||||
| [Storage](subsystems/Storage.md) | Original transactional key-value engine and durable recovery |
|
||||
| [IPC](subsystems/IPC.md) | Local communication, framing, shared memory and peer lifetimes |
|
||||
| [RPC](subsystems/RPC.md) | Versioned calls, streaming, deadlines and interoperable error contracts |
|
||||
| [Messaging](subsystems/Messaging.md) | Bounded durable queues, acknowledgements, retries and deduplication |
|
||||
| [Observability](subsystems/Observability.md) | Metrics, tracing, context and bounded export adapters |
|
||||
| [Discovery](subsystems/Discovery.md) | Bootstrap, registration, health and pluggable discovery providers |
|
||||
| [Coordination](subsystems/Coordination.md) | Deterministic consensus core and failure simulation |
|
||||
| [Replication](subsystems/Replication.md) | Durable protocol/application-state integration and snapshots |
|
||||
| [DistributedStorage](subsystems/DistributedStorage.md) | Replicated groups, routing, later sharding/rebalance and operations |
|
||||
|
||||
## Application platforms
|
||||
|
||||
| Platform plan | Complete future workflows |
|
||||
| --- | --- |
|
||||
| [NetworkedApplications](platforms/NetworkedApplications.md) | Managed/embedded services, storage, streaming, configuration, trust and shutdown |
|
||||
| [ReloadableApplications](platforms/ReloadableApplications.md) | Module host, dependency lifecycle, state transfer, generation pins and updates |
|
||||
| [DistributedApplications](platforms/DistributedApplications.md) | Replicated services, discovery, messaging, recovery and operational visibility |
|
||||
|
||||
These plans specify future reference applications. This documentation delivery does not
|
||||
create executables, launch services, publish sites or deploy infrastructure.
|
||||
|
||||
## Current evidence and interpretation
|
||||
|
||||
The all-module ordinary RelWithDebInfo build passed. VoidTests reported **1,245 passed,
|
||||
2 failed, 3 skipped** out of 1,250; the failures use `/bin/echo` and `/bin/cat`, absent on
|
||||
the inspected NixOS host. Installed-component consumers passed. Warnings-as-errors failed
|
||||
in pinned Boost headers. Sanitizers, cross-platform tests and performance benchmarks were
|
||||
not run. These facts establish P0 work, not completed repairs.
|
||||
|
||||
See [validation](VALIDATION.md) for commands and limitations, and
|
||||
[verification records](../agent-workflow/VERIFICATION.md) for this package's actual checks.
|
||||
|
||||
## How to execute a task later
|
||||
|
||||
Read the selected area and its shared contract gates. Reconcile source and working-tree
|
||||
state, select bounded implementation scope, freeze its interfaces and ownership, and
|
||||
record a precise task specification. Future feature IDs use M-, S-, P-, or X- prefixes;
|
||||
T-DOC tasks refer only to authoring this package. A plan's task becomes implemented only
|
||||
after actual code, review and verification evidence exist.
|
||||
|
||||
[Workflow state](../agent-workflow/STATE.md), [tasks](../agent-workflow/TASKS.md), and
|
||||
[decisions](../agent-workflow/DECISIONS.md) preserve progress across sessions. No important
|
||||
user choice should need to be reconstructed from the conversation.
|
||||
@@ -0,0 +1,73 @@
|
||||
# Requirements and approved scope
|
||||
|
||||
Status: approved planning scope; feature implementations are planned, not delivered.
|
||||
Baseline: `main`, `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Purpose
|
||||
|
||||
VoidLibrary will span independently usable foundations, complete functional modules,
|
||||
and optional application platforms. Completeness means documented, composable workflows
|
||||
with defined failure and resource behavior, as well as useful individual primitives.
|
||||
The immediate deliverable is this expanded planning package. The user's instruction
|
||||
“Implement the plan” approves authoring that package, whose approved scope explicitly
|
||||
separates future application implementation.
|
||||
|
||||
## Confirmed requirements
|
||||
|
||||
| ID | Requirement | Acceptance in this package |
|
||||
| --- | --- | --- |
|
||||
| R-001 | Generic library from small foundations through complete modules and platforms | Every current public module, agreed new subsystem, and three platforms has a linked area plan. |
|
||||
| R-002 | Keep C++26 and reflection | API designs retain that baseline; feature detection and compiler validation are specified without promising unsupported compilers. |
|
||||
| R-003 | Linux first, portable design | Linux is the first implementation/validation target; capability and future platform parity are explicit. |
|
||||
| R-004 | Versioned modernization | Incompatible changes are grouped into a major-release migration with old/new behavior and consumer checks. |
|
||||
| R-005 | Standard-library-only foundation | Foundation plans require no optional external packages, hidden workers, or mandatory managed runtime. |
|
||||
| R-006 | Prefer native implementations; decide dependencies by module | Every area records native, standard-library, external, or adapter choices with rationale. |
|
||||
| R-007 | SQLite integration plus an original storage engine | SQLite stays a distinct backend; new Storage owns its implementation and makes no SQLite SQL/file-format compatibility claim. |
|
||||
| R-008 | Original transactional key-value core first | Atomic batches, consistent snapshots, durable acknowledgement, recovery, and subsequent richer data models have separate milestones. |
|
||||
| R-009 | Embedded and managed execution | Applications may inject execution resources; an optional Runtime supplies managed startup and shutdown. |
|
||||
| R-010 | Broad module completion and both initial platforms | Module work, networked applications, and reloadable applications all appear in the dependency-ordered delivery plan. |
|
||||
| R-011 | Full distributed platform roadmap | Messaging, discovery, coordination, replication, and distributed storage include failure-model and evidence gates. |
|
||||
| R-012 | Runtime and memory first, with workload profiles | Latency, throughput, and footprint profiles have measurements, limits, and acceptance rules; build cost remains tracked. |
|
||||
| R-013 | C++ plugins plus stable C boundary | Same-toolchain C++ compatibility and separately versioned C ABI are distinguished. |
|
||||
| R-014 | One expanded plan per module/new area | Each area has concrete APIs, tasks, dependencies, failure cases, verification, and migration detail. |
|
||||
| R-015 | Preserve sensitive existing contracts | Strict signed-document parsing, exact signed bytes, update commit points, frozen ShortUrl V1, and generation pins remain explicit obligations. |
|
||||
| R-016 | Evidence-based delivery | Current behavior, proposed behavior, observed checks, and future commands are labeled distinctly. |
|
||||
|
||||
## Scope boundaries
|
||||
|
||||
The selected domain is general software infrastructure: utilities, systems, protocols,
|
||||
data/storage, runtimes, service composition, and distributed platforms. GUI, media,
|
||||
GPU, and embedded product layers are outside this roadmap. General numeric utilities
|
||||
remain in scope; a scientific-computing platform does not.
|
||||
|
||||
No calendar deadline, team size, deployment environment, or spending budget was given.
|
||||
Delivery therefore uses dependency and evidence gates. Documented designs do not claim
|
||||
implemented capability, measured speedup, proven distributed reliability, or release
|
||||
readiness. Publishing, licensing changes, and remote actions are separate work.
|
||||
|
||||
## Representative acceptance journeys
|
||||
|
||||
1. A small CLI links only the utilities it uses and does not need network, database,
|
||||
crypto, or managed-runtime packages merely to include foundation headers.
|
||||
2. An application supplies its executor and clock, then uses streaming I/O and tasks
|
||||
with bounded cancellation and resource ownership.
|
||||
3. A managed network service starts storage and listeners in dependency order, reports
|
||||
health, serves bounded requests, and shuts down without abandoning owned work.
|
||||
4. A reloadable host replaces a provider while existing acquired handles remain valid;
|
||||
a failed candidate does not displace the active generation.
|
||||
5. A durable key-value batch survives restart after successful durable acknowledgement;
|
||||
an interrupted batch never appears partially applied.
|
||||
6. A later replicated service rejects minority writes, preserves committed history,
|
||||
and recovers snapshots and applied positions consistently.
|
||||
|
||||
## Planning completion gate
|
||||
|
||||
The [master index](README.md) is the coverage authority. All listed area documents must
|
||||
exist, link to applicable shared contracts, distinguish existing source from NEW
|
||||
interfaces, and contain implementation tasks and testable acceptance scenarios.
|
||||
The [validation plan](VALIDATION.md) defines checks on the written package itself.
|
||||
High-impact unresolved alternatives must be resolved in the plan, not passed silently
|
||||
to an implementer. Later refinements update the decision ledger and affected contracts.
|
||||
|
||||
See [architecture](ARCHITECTURE.md), [delivery](DELIVERY.md), and the
|
||||
[decision ledger](../agent-workflow/DECISIONS.md).
|
||||
@@ -0,0 +1,119 @@
|
||||
# Validation and evidence gates
|
||||
|
||||
This document separates checks on the planning package, observed baseline evidence, and
|
||||
future implementation validation. A written test scenario is not an executed test.
|
||||
|
||||
## Planning-package acceptance
|
||||
|
||||
The documentation delivery must pass:
|
||||
|
||||
1. Coverage: ten shared roadmap documents, 26 public module plans, 15 NEW subsystem
|
||||
plans, and three platform plans match the master index. LogState obligations are
|
||||
covered under Log and architecture.
|
||||
2. Navigation: relative document/source links resolve; Markdown heading links resolve;
|
||||
no link escapes into protected/private files or another repository.
|
||||
3. Content: every area contains source-backed baseline or explicit NEW status, concrete
|
||||
APIs/dataflow, backend choices, limits/failures, tasks/dependencies, tests, and migration.
|
||||
4. Traceability: requirement IDs, shared-contract references and task IDs are coherent.
|
||||
Feature tasks remain PLANNED; document-writing tasks use separate T-DOC IDs.
|
||||
5. Truthfulness: commands are CURRENT, TEMPLATE for an existing interface, or PROPOSED
|
||||
with prerequisites. Observed outcomes include failures/skips and unrun checks.
|
||||
6. Review: fresh astra_reviewer inspects actual files and cross-plan contracts, not just
|
||||
worker summaries. Actionable findings receive recorded dispositions and focused rechecks.
|
||||
|
||||
Root uses a read-only documentation checker to inventory files, resolve links, find
|
||||
duplicate task definitions and unresolved placeholders, and report missing content.
|
||||
Heuristics assist review; they do not prove the designs correct or justify padding text.
|
||||
No application test is required merely because a Markdown plan changed.
|
||||
|
||||
## Observed baseline on 2026-11-24
|
||||
|
||||
Repository: `main`, `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
Toolchain: GCC 16.2.0, CMake 4.4.4, Ninja. Fresh build directory:
|
||||
`/tmp/voidlibrary-discovery-f1f9ba3`. Existing cached Boost 1.84 sources were reused;
|
||||
no dependency download or tracked source modification was needed.
|
||||
|
||||
| Check | Observed result |
|
||||
| --- | --- |
|
||||
| All-module RelWithDebInfo configure | Passed after pointing FetchContent at existing cached Boost sources |
|
||||
| All-module normal build | Passed, exit 0 |
|
||||
| VoidTests | 1,250 discovered; 1,245 passed, 2 failed, 3 skipped |
|
||||
| Failure cause | Process fixtures hard-code absent `/bin/echo` and `/bin/cat`; observed child exit 127 |
|
||||
| Installed component consumers | Passed, 4.74 seconds in the observed run |
|
||||
| CTest aggregate | Exit 8, one of two CTest entries failed; not a clean test run |
|
||||
| Warnings-as-errors build | Failed in pinned Boost headers on GCC 16/C++26 deprecation warnings |
|
||||
| Sanitizers, fuzzing, benchmarks, other OS/compiler combinations | Not run |
|
||||
|
||||
The process-test diagnosis is supported by
|
||||
[the tests](../../tests/standalone/System/Process.cpp) and
|
||||
[the exec failure path](../../src/System/Process.cpp). It is not a demonstrated defect
|
||||
in the requested process operation itself. Intentional test-framework skip examples
|
||||
must not be relabeled as implemented missing features.
|
||||
|
||||
## CURRENT commands and prerequisites
|
||||
|
||||
The following are the actual commands observed during discovery, with repository root
|
||||
as cwd. Paths identify this session's environment, not a portable toolchain promise.
|
||||
|
||||
```sh
|
||||
cmake -S . -B /tmp/voidlibrary-discovery-f1f9ba3 -G Ninja \
|
||||
-DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=OFF \
|
||||
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
|
||||
-DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src
|
||||
cmake --build /tmp/voidlibrary-discovery-f1f9ba3 --parallel 4
|
||||
ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 \
|
||||
--output-on-failure --timeout 60
|
||||
```
|
||||
|
||||
The separate warnings-as-errors configure used `-DVOID_WARNINGS_AS_ERRORS=ON`.
|
||||
An initial offline configure without a populated Boost source directory failed as expected
|
||||
from its prerequisite. `FETCHCONTENT_FULLY_DISCONNECTED` requires populated dependency
|
||||
sources; it is not a first-install command. Portable build templates and dependency
|
||||
resolution policy belong in [BUILD-AND-DISTRIBUTION.md](BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
## Future implementation test matrix
|
||||
|
||||
| Area | Required scenarios | Evidence gate |
|
||||
| --- | --- | --- |
|
||||
| Foundations/containers | Empty/boundary values, overflow, allocation failure, move-only values, alignment, deterministic seeds | Unit/property tests and minimal consumer/header checks |
|
||||
| Parsing/serialization | Truncation, invalid Unicode, numeric range, duplicate keys, recursion/size bounds, round trips, schema upgrades | Seeded property tests, fuzz corpora, signed-document regression fixtures |
|
||||
| Async/IO/runtime | Completion vs cancellation/deadline, queued/parked destruction, partial transfer, fd reuse, admission saturation, shutdown | Deterministic schedules plus sanitizer/stress evidence; exactly one terminal result |
|
||||
| Network/protocol | Wrong-host/CA/expired TLS, redirects, partial frames, slow peers, body/header limits, connection reuse, graceful stop | Local fixture services/private CA, conformance/fuzz tests; no live public endpoint dependency |
|
||||
| Native Storage | Torn/reordered/short writes, failed sync, disk full, partial commit, crash during recovery/compaction, held snapshots | Injected filesystem failures and restart matrix; acknowledged durable data survives, incomplete batches atomic |
|
||||
| Sqlite | Prepared statement binding, transactions/rollback, migrations, busy contention, connection shutdown | Actual supported SQLite versions/modes; independent from original Storage tests |
|
||||
| Service/plugin/FSM | Reentrant lifecycle, failed-start rollback, provider replacement with pins, ABI mismatch, losing child cleanup, fault termination | Cross-module tests with controlled plugins and executor schedules |
|
||||
| Log/observability | Saturation, slow/failing sinks, flush races, reconfiguration, context lifetime, metric cardinality | Loss counters and total in-flight resource accounting under pressure |
|
||||
| Archive/update/security | Traversal/symlink races, decompression limits, invalid signature/bytes, replay/expiry, durable activation and cleanup failure | Adversarial fixtures and crash recovery; preserve existing trust contracts |
|
||||
| Messaging/scheduler | Duplicate delivery, lost acknowledgement, retries, expired work, restart, wall-clock changes | At-least-once/dedup semantics and bounded retention verified |
|
||||
| Coordination/replication | Partitioned leader/minority, crash/restart, reordered/duplicated RPC, lost reply, snapshot installation | Deterministic reproducible histories, agreement checks, durable state/applied position consistency |
|
||||
| Distributed storage | Single-group correctness, routing epochs, membership transitions, failed rebalance, backup/restore | Failure injection before multi-shard availability claims |
|
||||
| Packaging/platforms | Minimal/full selection, add_subdirectory/find_package, shared/static, installed consumers, explicit capability gaps | Supported configuration matrix and runnable future reference-consumer checks |
|
||||
|
||||
## Sanitizer and platform policy
|
||||
|
||||
Use ASan/UBSan for supported compiler configurations and TSan for applicable concurrency
|
||||
work; check toolchain compatibility before promising coverage. Sanitizers are separate
|
||||
build configurations where combinations are unsupported. Fuzzing/property tests supplement
|
||||
deterministic regressions; they do not replace lifetime reasoning or protocol review.
|
||||
|
||||
Linux is the first validated platform. Windows/macOS ports have explicit capability
|
||||
matrices and platform-specific acceptance, including process APIs, file watching, shared
|
||||
libraries and filesystem durability. A functional fallback is not automatically equivalent
|
||||
to POSIX locking/fsync guarantees. Compiler/reflection support is probed per feature.
|
||||
|
||||
## Tasks and gate ownership
|
||||
|
||||
| ID | Planned work | Acceptance |
|
||||
| --- | --- | --- |
|
||||
| X-VALID-01 | Minimal consumer/header and package-closure matrix | Each supported module/profile has isolated compile/link/runtime evidence. |
|
||||
| X-VALID-02 | Deterministic clock/executor and fault filesystem harness | Seeds reproduce failures; injected effects reach intended boundaries. |
|
||||
| X-VALID-03 | Property/fuzz corpus pipeline for parsers/codecs/protocols | Corpus regressions retained; time/resource budgets enforced. |
|
||||
| X-VALID-04 | Sanitizer/stress jobs and supported-toolchain matrix | Unavailable tooling is reported explicitly; failing supported jobs block the relevant gate. |
|
||||
| X-VALID-05 | Distributed deterministic simulation and history validation | Partition/restart/snapshot scenarios falsify incorrect histories reproducibly. |
|
||||
| X-VALID-06 | Reference-platform and release-candidate validation | Public examples consume installed packages and exercise upgrade/shutdown/recovery. |
|
||||
|
||||
Testing owns harness primitives; feature owners own behavior assertions; root integrates
|
||||
cross-component scenarios. No universal percentage substitutes for coverage of failure
|
||||
boundaries. Record command, cwd, revision, configuration, exit status, outcomes and
|
||||
unrun checks in [verification evidence](../agent-workflow/VERIFICATION.md).
|
||||
@@ -0,0 +1,150 @@
|
||||
# Archive — safe streaming and atomic publication
|
||||
|
||||
Status: plan; all implementation tasks PLANNED. Baseline `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
R-003/R-006/R-014/R-015 and [C-02–C-07](../ARCHITECTURE.md) apply.
|
||||
|
||||
## Existing extraction contract
|
||||
|
||||
[Archive.hpp](../../../include/Void/Archive/Archive.hpp) exposes
|
||||
`Void::Archive::extract(path, destination, ExtractionOptions)` returning an ExtractionResult.
|
||||
Defaults are 10,000 entries, 512 MiB per file, 2 GiB total and no overwrite.
|
||||
[Archive.cpp](../../../src/Archive/Archive.cpp) enables tar plus none/zstd filters through
|
||||
libarchive, rejects absolute/non-normal/traversal/backslash paths, duplicates, links and
|
||||
special entries, and checks declared and actual extracted bytes. POSIX extraction pins the
|
||||
destination directory, walks parents with descriptor-relative no-follow operations, writes
|
||||
temporary regular files, syncs them and publishes them. Windows has a different path-based
|
||||
implementation; identical race resistance is not established by the Unix source.
|
||||
|
||||
[module.cmake](../../../src/Archive/module.cmake) links Functional and LibArchive::LibArchive.
|
||||
[Tests](../../../tests/standalone/Archive/Archive.cpp) include bounded tar.zstd extraction,
|
||||
explicit directories, traversal/links, symlink parents, destination path swapping and actual
|
||||
size limits. These are regression obligations. A failed whole extraction can still leave
|
||||
earlier successfully published entries: the existing per-file workflow is not an atomic
|
||||
replacement of an entire directory tree.
|
||||
|
||||
## Backend and API completion
|
||||
|
||||
Retain libarchive as the initial tar/zstd decoder and later encoder. Void owns path policy,
|
||||
resource admission, stream adapters and publication transactions. Native directory safety
|
||||
logic is preferable to shelling out; a new tar or zstd implementation would add compatibility
|
||||
and security risk without a measured requirement. Other formats require an explicit tested
|
||||
profile; enabling every decoder by default is not part of completion.
|
||||
|
||||
NEW illustrative surface in the existing namespace; shared operation options come from
|
||||
[Async](Async.md), byte streams from [IO](../subsystems/IO.md):
|
||||
|
||||
```cpp
|
||||
struct EntryInfo; // owned normalized path, type, declared size, safe mode
|
||||
struct ReadLimits; // policy defaults below
|
||||
class Reader; // caller-driven next_entry/read_chunk/skip_entry
|
||||
class StagedTree; // owns unpublished directory and cleanup obligation
|
||||
Result<Reader> open_reader(InputStream&, ReadLimits);
|
||||
Result<StagedTree> extract_staged(InputStream&, DirectoryHandle, ExtractionOptions);
|
||||
Result<PublicationReceipt> publish(StagedTree, std::string_view new_child_name);
|
||||
Result<void> create_archive(OutputStream&, EntrySource&, CreationOptions);
|
||||
```
|
||||
|
||||
All types except existing ExtractionOptions are NEW Archive or IO-owned interfaces as
|
||||
indicated; this sketch is not a compiling example. Input/output streams are borrowed through
|
||||
completion, or moved into an owning async operation. EntryInfo never points into libarchive's
|
||||
next-header scratch buffer. Reader has one active entry; callers drain or explicitly skip it
|
||||
before advancing. Skipping still accounts for decompressed work and limits, not just stored
|
||||
bytes. The reader never materializes a complete archive by default.
|
||||
|
||||
Listing is a bounded metadata traversal and carries the same path/entry-count validation.
|
||||
An opt-in forensic listing may report rejected metadata without writing anything, but is
|
||||
not a way to authorize extraction of unsafe entries. Archive creation accepts regular files
|
||||
and directories only, sorts normalized paths, rejects duplicates, and uses reproducible
|
||||
timestamps/owners/modes when requested. It does not follow links while enumerating sources.
|
||||
|
||||
## Atomic extraction workflow
|
||||
|
||||
`extract_staged` creates an exclusive private child beneath a caller-owned parent directory,
|
||||
pins its descriptor, then extracts all content there. Default output permissions are 0644
|
||||
files and 0755 directories, retaining only the explicitly allowed executable bit policy;
|
||||
ignore ownership, setuid/setgid, device metadata and extended attributes. File paths have a
|
||||
4 KiB encoded limit, 255-byte component limit and 64 components. Reject conflicts where
|
||||
a file is required to be a parent directory, including case-collisions on a backend that
|
||||
cannot distinguish them. Do not repair malicious paths by normalizing them into acceptance.
|
||||
|
||||
On success, close/sync every file, sync created directories bottom-up, write a bounded
|
||||
completion inventory, sync the staging root, and return StagedTree. Publication creates a
|
||||
previously absent immediate child name by a no-replace directory rename on the same filesystem,
|
||||
then syncs the parent. An unsupported atomic no-replace primitive returns UnsupportedCapability;
|
||||
there is no fallback to a racy existence-check plus overwrite. Existing nonempty directories
|
||||
are never recursively overwritten under an "atomic" label.
|
||||
|
||||
Replacing an application version uses immutable version directories and a separate pointer/
|
||||
activation owner, such as [Update](Update.md)'s VersionStore. Archive does not invent a new
|
||||
update commit point. If parent sync fails after rename, PublicationReceipt/error records
|
||||
Unknown outcome and the destination/staging identity so recovery can inspect it. It cannot
|
||||
claim the published tree was rolled back. Cancellation before publication cleans only the
|
||||
owned staging tree; after publication it reports the known/unknown publication outcome.
|
||||
|
||||
All filesystem accesses stay relative to retained directory handles on the hardened Linux
|
||||
path. Untrusted siblings cannot redirect extraction by swapping parent paths. Cleanup removes
|
||||
only names created under that owned staging descriptor and never follows links. Cleanup
|
||||
failure preserves the primary error and a retryable staging identifier, rather than masking
|
||||
the original decode/write error. Startup cleanup requires an exclusive operation marker and
|
||||
age/ownership validation, not a broad deletion of directories matching a prefix.
|
||||
|
||||
## Bounds, cancellation and diagnostics
|
||||
|
||||
Retain current file/total/entry defaults. NEW streaming defaults add a 64 KiB transfer buffer,
|
||||
8 MiB aggregate path/inventory metadata, four active jobs and 16 pending jobs per explicit
|
||||
managed service, and a 1 GiB compressed-input cap. Reject zero limits as invalid except an
|
||||
explicit zero-entry policy. Actual decompressed bytes count even when the format omits or
|
||||
lies about size; checked subtraction prevents arithmetic wrap. Nesting archives is never
|
||||
automatic. High compression ratios are allowed only within absolute limits.
|
||||
|
||||
Cooperative checks happen between headers and chunks, but do not make a codec call forcibly
|
||||
interruptible. The NEW hardened untrusted-input profile uses a System-owned child job with
|
||||
128 MiB RSS and 60-second total execution defaults, plus bounded result/output channels;
|
||||
the parent holds publication authority and verifies the staged tree before publishing.
|
||||
Platforms unable to enforce that profile report the capability gap. Ordinary embedded
|
||||
trusted-input mode can call the decoder synchronously with documented cooperative limits.
|
||||
Neither mode promises that a 64 KiB IO buffer bounds the decoder's internal memory.
|
||||
|
||||
Domain errors distinguish unsafe entry, unsupported format, corrupt archive, limit exceeded,
|
||||
permission, no space, cancellation, timeout and unknown publication. Diagnostics cap path
|
||||
rendering at 4 KiB and avoid writing attacker-controlled newlines unescaped. Progress callbacks
|
||||
run outside shared locks, own their event data if retained, and are rate-limited to 10 Hz
|
||||
per job. Failure to deliver progress never changes extraction success.
|
||||
|
||||
## Ordered work
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-ARCHIVE-01 | P0; existing tests | Characterize partial-tree failure, exact accepted path/type policy and platform capabilities; preserve all existing anti-traversal tests. | astra_implementer |
|
||||
| M-ARCHIVE-02 | P1; M-ARCHIVE-01, IO stream ownership, Binary bounds | Reader/listing and chunk adapters, metadata limits and typed errors; truncated/adversarial input cannot exceed accounted limits. | sol_implementer |
|
||||
| M-ARCHIVE-03 | P2; M-ARCHIVE-02, IO directory durability | StagedTree and atomic no-replace publication; crash at each sync/rename recovers either unpublished staging or a complete published tree. | astra_implementer |
|
||||
| M-ARCHIVE-04 | P2; M-ARCHIVE-02/03, System process limits | Hardened decoder isolation, cancellation/cleanup and race fixtures; parent never publishes unvalidated/partial child output. | astra_implementer |
|
||||
| M-ARCHIVE-05 | P3; M-ARCHIVE-03, Update package contract | Reproducible creation and package inventory verification; create/extract roundtrip preserves only allowed metadata and Update retains activation ownership. | sol_implementer |
|
||||
| M-ARCHIVE-06 | P3; M-ARCHIVE-04/05, shared harness | Fuzz corpus, filesystem fault campaign and decoder performance profiles; publish capability matrix before a new format/backend is accepted. | sol_implementer |
|
||||
|
||||
P4 snapshot/package transport reuses bounded archives; a replicated snapshot's correctness
|
||||
and installation marker belong to [Replication](../subsystems/Replication.md), not tar metadata.
|
||||
|
||||
## Verification and compatibility
|
||||
|
||||
CURRENT TEMPLATE: `<existing-build>/tests/VoidTests --filter '^archive_'`, backed by the
|
||||
test names above. [Validation](../VALIDATION.md) contains actual build evidence; no rerun
|
||||
occurred here. PROPOSED after M-ARCHIVE-02–06: malformed headers/zstd, duplicate/conflicting
|
||||
paths, long names, symlink swap at each parent, partial write/disk full/sync failure,
|
||||
cancellation during decode/publication, unsafe staging cleanup, resource-killed child and
|
||||
Windows capability fixtures. Include create→extract property tests and an independent
|
||||
tar consumer when validating generated packages; fixtures must not invoke production paths.
|
||||
|
||||
[Performance](../PERFORMANCE.md) profiles many tiny files, a few large files, incompressible
|
||||
data and compression bombs within test limits. Record p50/p95/p99 completion/admission,
|
||||
bytes/s, allocations, peak RSS/CPU including decoder child, disk amplification and build cost.
|
||||
The common repetition/confidence and regression rules apply; security checks remain enabled.
|
||||
|
||||
[Migration](../MIGRATION.md) keeps `extract` as the documented incremental API. New callers
|
||||
needing all-or-nothing visibility use extract_staged→publish and handle Unknown explicitly.
|
||||
Never change overwrite defaults silently. Rollback of an unselected new workflow can retain
|
||||
legacy extraction; rollback of a published tree is owned by the consuming application.
|
||||
New formats are version/profile gated. [Build/distribution](../BUILD-AND-DISTRIBUTION.md)
|
||||
keeps libarchive optional outside Archive consumers. Graph partial ranges in the header and
|
||||
test helper were read directly; cited source/test files were checked for coverage. No new
|
||||
atomicity, fuzz, portability or measured-performance result is claimed.
|
||||
@@ -0,0 +1,212 @@
|
||||
# Async completion and structured execution plan
|
||||
|
||||
Status: PLANNED feature work. Source baseline: `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
This document implements no execution features. Requirements R-005, R-009, R-012,
|
||||
R-014 and R-016 apply; [architecture](../ARCHITECTURE.md) C-02–C-05 and C-11
|
||||
define the shared boundaries.
|
||||
|
||||
## Existing surface and gaps
|
||||
|
||||
- [Task.hpp](../../../include/Void/Async/Task.hpp) provides move-only lazy
|
||||
`Void::Coro::Task<T>` and `Task<void>`, stored exceptions, continuation transfer,
|
||||
a borrowed `handle()`, and frame destruction by the owning Task. `run()` resumes
|
||||
once and reads the result; it is not a general event-loop driver for externally
|
||||
suspended operations. [Generator.hpp](../../../include/Void/Async/Generator.hpp)
|
||||
is the separate synchronous pull generator.
|
||||
- [Executor.hpp](../../../include/Void/Async/Executor.hpp) defines
|
||||
`Void::Async::Executor::post(coroutine_handle<>)`, a single-consumer
|
||||
`ManualExecutor`, `schedule_on`, and detached `spawn`. Queues hold borrowed
|
||||
handles. Detached exceptions terminate; cancellation and joining are absent.
|
||||
- [ThreadPool.hpp](../../../include/Void/Async/ThreadPool.hpp) is in
|
||||
`Void::Concurrency`, returns futures, drains and joins workers on destruction,
|
||||
and offers blocking `submit` and rejecting `try_submit`. Its historical
|
||||
`max_queue == 0` means unlimited queued work; running work is not part of that
|
||||
queue bound. [Channel.hpp](../../../include/Void/Async/Channel.hpp) is a bounded
|
||||
blocking MPMC channel, not a coroutine channel.
|
||||
- [MpscQueue.hpp](../../../include/Void/Async/MpscQueue.hpp),
|
||||
[ParallelFor.hpp](../../../include/Void/Async/ParallelFor.hpp),
|
||||
[Observable.hpp](../../../include/Void/Async/Observable.hpp), and
|
||||
[EventBus.hpp](../../../include/Void/Async/EventBus.hpp) supply useful primitives.
|
||||
EventBus async mode starts its own worker and snapshots callbacks at publication;
|
||||
unsubscribe cannot retract those copies. Observable/Signal iterate listener
|
||||
collections directly and need a documented reentrancy/threading policy.
|
||||
- [module.cmake](../../../src/Async/module.cmake) declares LogState. Remove
|
||||
mandatory concrete logging from the target execution contract through optional
|
||||
error/observation hooks, preserving compatibility adapters.
|
||||
|
||||
[Executor tests](../../../tests/standalone/Async/Executor.cpp),
|
||||
[coroutine tests](../../../tests/standalone/Async/Coro.cpp),
|
||||
[backpressure tests](../../../tests/standalone/Async/ThreadPoolBackpressure.cpp),
|
||||
[channel tests](../../../tests/standalone/Async/Channel.cpp), and
|
||||
[async event tests](../../../tests/standalone/Async/EventBusAsync.cpp) are existing
|
||||
fixtures. They do not establish structured lifetime or cancellation correctness.
|
||||
Graph coverage was checked for scoped source; Observable line 32 was read directly
|
||||
because it is partially parsed. Important ownership conclusions use source inspection.
|
||||
|
||||
## NEW API contracts
|
||||
|
||||
The following is a design sketch, not a compiling example. Async owns the sole
|
||||
public operation-options type used by IO, Net, RPC, Scheduler and other consumers:
|
||||
|
||||
```cpp
|
||||
namespace Void::Async { // NEW additions
|
||||
struct OperationOptions {
|
||||
std::stop_token stop{};
|
||||
std::optional<std::chrono::steady_clock::time_point> deadline{};
|
||||
};
|
||||
enum class AdmissionError { overloaded, stopped, deadline_expired };
|
||||
class TaskScope {
|
||||
public:
|
||||
Result<JoinHandle> spawn(Coro::Task<void>&& task, OperationOptions = {});
|
||||
void request_stop() noexcept;
|
||||
Coro::Task<Result<void>> join();
|
||||
};
|
||||
// Executor evolution: try_post(owned_resume_ticket) -> Result<void>;
|
||||
// schedule_on(executor, options) -> cancellable scheduling awaitable.
|
||||
}
|
||||
```
|
||||
|
||||
`Result` is shorthand under C-02; Functional owns error representation. JoinHandle,
|
||||
resume tickets, scope construction and executor evolution are NEW Async-owned types.
|
||||
An execution binding borrows the executor, Time's injectable monotonic clock, and
|
||||
optional Memory resource. Their lifetimes extend through scope join. Clock injection
|
||||
is specified in [Time](Time.md); no consumer invents another clock or request context.
|
||||
The options fields above are fixed: consumers add domain options separately. The NEW
|
||||
Time type is `Void::Time::MonotonicClock`; manual-clock tests advance it and explicitly
|
||||
drive timer progress. Backends derive OS wait durations from the injected `now()` and
|
||||
must not compare a manual deadline with the host clock's current time.
|
||||
|
||||
No deadline means no time limit, not unlimited admission. A deadline is absolute in
|
||||
the injected steady-clock domain and covers queue waiting, execution and backend
|
||||
cleanup initiation. Stop already requested or deadline already expired rejects
|
||||
admission without invoking the operation. An accepted operation keeps its cleanup
|
||||
obligations even after its deadline. Parent stop and child stop combine in an owned
|
||||
stop source; they never rely on a temporary callback registration.
|
||||
|
||||
## Frame ownership and terminal arbitration
|
||||
|
||||
1. A lazy Task owns its frame before admission. Successful scope admission transfers
|
||||
the frame into a scope-owned control block; a failed admission leaves ownership
|
||||
with the caller or returns the task through the specified move-failure adapter.
|
||||
Choose a two-step reserve-then-transfer implementation so rejection never silently
|
||||
destroys an operation the caller still considers submitted.
|
||||
2. Executor queues store a retained resume ticket, never a bare handle whose owner
|
||||
may disappear. Only the selected consumer resumes a frame; queued/running flags
|
||||
prohibit concurrent resume and duplicate enqueue. Await suspension registration
|
||||
uses an atomic handshake so completion during `await_suspend` cannot lose a wake.
|
||||
3. The control block tracks admitted, active, stop-requested, backend-released,
|
||||
terminal-recorded and continuation-delivered states. Stop/expiry records intent and
|
||||
initiates cooperative cancellation; it does not immediately fix the result of an
|
||||
effectful operation. Its owner first gathers the required completion/persistence
|
||||
evidence, then one serialized transition or compare/exchange records the domain
|
||||
result. A terminal result already recorded cannot be overwritten by a later stop.
|
||||
4. Backend acknowledgement is awaited before buffer release and continuation delivery.
|
||||
Late completion is evidence for domain-result selection as well as cleanup, even
|
||||
when stop was requested first. A side-effect-free scheduling wait can finalize as
|
||||
cancelled/timed-out at its safe abort point; a transfer error preserves observed
|
||||
bytes/effects. A committing adapter returns a known commit receipt, proven
|
||||
NotCommitted cancellation, or explicit Unknown outcome according to its domain.
|
||||
Generic Async code never rewrites those outcomes to cancellation. The domain owns
|
||||
this classification; Async imports no Storage/Update types. Duplicate notifications
|
||||
cannot deliver again. Cancellation callbacks post control messages instead of
|
||||
destroying frames, and user callbacks never run under internal state locks.
|
||||
5. Join waits for terminal delivery, all children, backend references and callback
|
||||
registrations to drain. The frame is destroyed once, after final suspension and
|
||||
all resume tickets retire. Continuation delivery uses reserved capacity so a full
|
||||
executor cannot strand already admitted operations.
|
||||
|
||||
`TaskScope` destruction requests stop and joins on a permitted owner thread. On an
|
||||
executor thread, callers must `co_await join()` before destruction; blocking a worker
|
||||
needed for progress is a detected programmer error. An embedded single-thread driver
|
||||
can pump its executor while synchronously joining. No timeout frees live frames.
|
||||
Explicit detached launch requires an owner retained through completion plus an error
|
||||
sink; it is not the default scope behavior. CPU-bound user code must poll stop or
|
||||
yield; cancellation cannot impose a hard wall-clock shutdown guarantee.
|
||||
|
||||
NEW committing adapters keep their domain operation alive through evidence collection,
|
||||
including when a lower-level IO awaitable reports cancellation with partial effects.
|
||||
For a durable write, stopping before append yields NotCommitted; stopping during sync
|
||||
leaves the result pending; successful sync and publication after stop yield the receipt;
|
||||
failed sync after append yields Unknown unless non-commit is independently proved. The
|
||||
one continuation is delivered after backend access ends in every case. These are adapter
|
||||
conformance scenarios, not an Async dependency on the native engine.
|
||||
|
||||
## Queues, channels and event delivery
|
||||
|
||||
NEW defaults: 4,096 admitted tasks per executor including running work; 1,024 child
|
||||
tasks per scope; 1,024 values per coroutine channel; 4 MiB aggregate channel payload
|
||||
budget through a supplied size-accounting policy; 1,024 subscriptions and 1,024
|
||||
admitted event dispatches. Variable payloads require a byte-accounting policy rather
|
||||
than pretending element count bounds memory. Zero capacity is invalid; an explicitly
|
||||
named unlimited policy is available only where separately documented.
|
||||
|
||||
Initial scheduling uses a bounded mutex-protected FIFO and condition/event wakeups.
|
||||
Correct admission and lifetime precede work stealing or lock-free specialization.
|
||||
Work is charged until completion cleanup, with a reserved internal completion lane
|
||||
bounded by admitted operations. Default external submission rejects on overload;
|
||||
`async_wait_for_capacity(options)` is explicit and bounded to 1,024 waiters. Blocking
|
||||
submission is an off-executor adapter. ThreadPool futures keep their old behavior
|
||||
until a versioned adapter maps rejection and exceptions explicitly.
|
||||
|
||||
Coroutine channels offer cancellable send/receive and close-with-drain; failed send
|
||||
does not consume the caller's value. Separate closed, empty, full, cancelled and
|
||||
timed-out results. ParallelFor gains explicit grain/concurrency, stop propagation
|
||||
and deterministic exception aggregation after joining started chunks.
|
||||
|
||||
Subscriptions use immutable dispatch snapshots. Removing a subscription prevents new
|
||||
admission; NEW `close_and_join` waits for already admitted callbacks. Callback code
|
||||
and error sinks run outside subscriber locks. Self-unsubscribe is supported;
|
||||
self-join is rejected. Reentrant sync Observable updates queue bounded notifications
|
||||
instead of invalidating iteration. Async EventBus accepts an injected executor and
|
||||
keeps its private-worker constructor only as an explicit compatibility convenience.
|
||||
|
||||
## Backend and performance decisions
|
||||
|
||||
Use C++ standard threads, atomics, stop tokens and coroutines; no external execution
|
||||
engine. Async has no IO or Runtime dependency. [IO](../subsystems/IO.md) supplies
|
||||
operation backends; [Runtime](../subsystems/Runtime.md) composes them. Timer ordering
|
||||
uses a stable min-heap keyed by deadline and sequence with an injected Time clock.
|
||||
Cancellation removes or tombstones a timer while retaining its operation reference.
|
||||
|
||||
Measure empty-task hops, producer contention, 1/64/1,024-byte channel values,
|
||||
ParallelFor skew, event fan-out and cancel storms. Record p50/p95/p99, throughput,
|
||||
allocations/frame, peak RSS/CPU and compile/link cost under each
|
||||
[performance profile](../PERFORMANCE.md). A fixed admitted-work bound must imply a
|
||||
flat retained-frame count after repeated cancellation; no speedup is claimed here.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
Every row is PLANNED; role recommendations are for later root delegation.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-ASYNC-01 | P0 / current source | Characterize Task moves, external suspension, executor and subscription lifetimes; independent-header/package checks | Reproduce unsafe lifetime preconditions without invoking UB in the harness; record existing future/exception behavior / sol_implementer |
|
||||
| M-ASYNC-02 | P1 / M-ASYNC-01; Time clock and Functional error gates | OperationOptions, reserve/transfer admission, owned resume tickets, terminal state machine and domain-outcome classification | Stop/completion/expiry permutations deliver once after backend release; fake committing adapter preserves known receipt/unknown outcome after stop; fake clock controls deadlines / astra_implementer |
|
||||
| M-ASYNC-03 | P1 / M-ASYNC-02 | TaskScope, join, explicit detached owner and shutdown guards | Nested stop joins all children; rejected admission preserves ownership; no self-deadlock / astra_implementer |
|
||||
| M-ASYNC-04 | P2 / M-ASYNC-03 | Bounded executors, cancellable channels, future pool adapter, ParallelFor | Bounds include running work; producer stop and close-drain deterministic; chunk errors join / sol_implementer |
|
||||
| M-ASYNC-05 | P2 / M-ASYNC-04 | EventBus/Observable snapshot dispatch, joined subscriptions, injected scheduling | Reentrancy, callback throw and unsubscribe races leave no captured state in use after join / sol_implementer |
|
||||
| M-ASYNC-06 | P3 / M-ASYNC-05; profile harness | Profile native queues; optimize only measured hot paths; major API migration | Conformance identical across optimized path; bounded allocation and installed consumers verified / astra_implementer |
|
||||
|
||||
## Validation and migration
|
||||
|
||||
CURRENT tests are generated into `VoidTests` by
|
||||
[tests/CMakeLists.txt](../../../tests/CMakeLists.txt). Current available aggregate
|
||||
check: `ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`.
|
||||
It was not rerun for this document; inherited baseline failures are recorded in
|
||||
[VALIDATION](../VALIDATION.md). PROPOSED tests require the tasks above: deterministic
|
||||
pause points around registration/resume/destruction; cancellation at every await;
|
||||
cross-thread posting during shutdown; full queue at terminal delivery; faulting error
|
||||
sink; infinite cooperative child; byte budget exhaustion; sanitizer lifetime/race runs.
|
||||
Use a fake committing backend to stop before append and during sync, then independently
|
||||
release successful or failed sync. Assert the sole domain result and retained ownership;
|
||||
passing a cancellation-only scheduling test does not cover these commit races.
|
||||
|
||||
Keep `Void::Coro`, `Void::Concurrency`, `Void::EventBus` and `Void::Observable` names
|
||||
visible in migration examples. EXISTING `spawn(executor, task)` becomes NEW
|
||||
`scope.spawn(std::move(task), options)` plus `co_await scope.join()`. EXISTING
|
||||
`task.run()` remains for proven synchronous completion until deprecated; general
|
||||
blocking wait uses an explicit driver adapter. Preserve old future exception and
|
||||
zero/unbounded semantics in a versioned legacy adapter, never silently reinterpret
|
||||
them. Roll back a new executor backend behind selection before submission; never
|
||||
replay accepted work. See [MIGRATION](../MIGRATION.md),
|
||||
[DEPENDENCIES](../DEPENDENCIES.md), and [DELIVERY](../DELIVERY.md).
|
||||
@@ -0,0 +1,148 @@
|
||||
# Binary readers, writers and codec boundaries
|
||||
|
||||
Status: planning only; all feature tasks are **PLANNED**. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Existing baseline
|
||||
|
||||
[Binary](../../../src/Binary/module.cmake) currently depends on Functional and has one
|
||||
public header, [Reader](../../../include/Void/Binary/Reader.hpp). `Void::Binary::Reader`
|
||||
borrows `span<const byte>`, tracks its position and provides seek/skip, read/peek bytes,
|
||||
integral endian decoding, copied strings and bounded subreaders. Results use
|
||||
`Void::Result::Result<T>`. Returned byte spans/subreaders do not extend input lifetime.
|
||||
Integral reads use copied storage/bit_cast, so no aligned-load or aliasing requirement
|
||||
is imposed on input. The default byte order is native; it must not silently define a
|
||||
portable file or protocol format.
|
||||
|
||||
[Reader tests](../../../tests/standalone/Binary/Reader.cpp) check big-endian reading,
|
||||
truncation leaving position unchanged, and bounded children. No writer, varint, structured
|
||||
codec, stream backend or format registry exists in this source inventory. Scoped graph
|
||||
coverage reported no recorded gaps and the full reader/test were read directly.
|
||||
|
||||
## Ownership and backend decision
|
||||
|
||||
Per [C-01/C-02/C-07](../ARCHITECTURE.md), Binary owns representation mechanics; Data owns
|
||||
values/schema/reflection, Archive owns archive layouts, Storage owns its persisted
|
||||
records and Net owns protocol frames. IO owns actual transfers. Binary never imports
|
||||
these higher modules or starts workers. Choose native span cursors plus standard byte/
|
||||
bit/PMR tools. Do not add a generic serialization dependency or put JSON schema logic
|
||||
inside a byte reader. Checksums for storage integrity remain distinct from authentication;
|
||||
no homegrown cryptographic primitive is introduced.
|
||||
|
||||
## NEW cursor and buffer APIs
|
||||
|
||||
Illustrative NEW shape in NEW `include/Void/Binary/Writer.hpp` and
|
||||
NEW `include/Void/Binary/Varint.hpp` (signatures are not existing compiling examples):
|
||||
|
||||
```cpp
|
||||
namespace Void::Binary {
|
||||
class Writer {
|
||||
public:
|
||||
explicit Writer(std::span<std::byte> output) noexcept;
|
||||
std::size_t position() const noexcept;
|
||||
std::size_t remaining() const noexcept;
|
||||
Void::Result::Result<void> writeBytes(std::span<const std::byte>);
|
||||
template<std::integral T> requires (!std::same_as<T,bool>)
|
||||
Void::Result::Result<void> write(T, std::endian order); // no wire default
|
||||
Void::Result::Result<void> writeUvarint(std::uint64_t);
|
||||
};
|
||||
struct DecodeLimits {
|
||||
std::size_t max_field_bytes = 16 * 1024 * 1024;
|
||||
std::size_t max_total_bytes = 64 * 1024 * 1024;
|
||||
unsigned max_depth = 64;
|
||||
};
|
||||
Void::Result::Result<std::uint64_t> readUvarint(Reader&);
|
||||
}
|
||||
```
|
||||
|
||||
Writer borrows mutable output and owns only its cursor; caller owns the buffer through
|
||||
all access. Every primitive validates capacity before modifying bytes or position.
|
||||
`writeBytes` supports overlapping source/output via memmove-equivalent behavior; integral
|
||||
encoding uses local fixed storage. Composite encoders validate their exact measured size
|
||||
before publication or stage into bounded scratch. A cursor checkpoint rolls back position
|
||||
only; it must not claim to restore overwritten caller bytes. An explicit transactional
|
||||
encoder stages data when strong all-or-nothing bytes are required.
|
||||
|
||||
NEW `ByteBuffer` is an owning `pmr::vector<byte>` wrapper with an explicit Memory resource
|
||||
and a default 16 MiB capacity ceiling; growth checks current size + requested bytes and
|
||||
resource admission before reserve. It does not expose stable pointers across growth.
|
||||
`freeze()` transfers owned storage without copying and makes published bytes immutable.
|
||||
A borrowed span never becomes owning merely because it came from `freeze().view()`;
|
||||
the frozen owner must remain alive. Empty output is valid; a zero ceiling permits only
|
||||
empty output, never unlimited allocation.
|
||||
|
||||
Reader adds named `readLittle<T>`/`readBig<T>`, cursor transactions for compound parsing,
|
||||
and structured domain code/offset/requested/remaining diagnostics mapped through
|
||||
Functional. Preserve current primitive truncation behavior. Unsupported endian/type
|
||||
checks happen before consuming bytes. Floats use explicitly named IEEE binary32/binary64
|
||||
codecs and capability checks (`is_iec559` and width); no long-double object serialization.
|
||||
Booleans accept only 0/1. Signed integers have an explicit two's-complement wire contract;
|
||||
padding/native object representations are never copied as a schema.
|
||||
|
||||
## Varints, strings and incremental decoding
|
||||
|
||||
Unsigned varints use seven payload bits per byte, low group first, maximum ten bytes
|
||||
for uint64. Byte ten may contain only payload bit 0; continuation there is malformed.
|
||||
Reject nonminimal encodings by default, distinguishing truncated input from overflow and
|
||||
noncanonical data. Signed varints use explicit ZigZag operations in unsigned arithmetic,
|
||||
including INT64_MIN, without signed shifts/overflow. A compatibility permissive decoder
|
||||
must be named; it cannot be selected implicitly by a signed or storage format.
|
||||
|
||||
Length-prefixed byte fields decode length, check configured field and remaining-total
|
||||
limits, check size_t conversion, then borrow/copy as requested. Strings are bytes unless
|
||||
an explicitly named UTF codec is selected by the caller. Embedded NUL is not terminator.
|
||||
Nested limits are shared cumulative budget state, so children cannot each claim a fresh
|
||||
64 MiB allowance. Decompression belongs to Archive; advertised decompressed sizes are
|
||||
not permission for Binary to allocate arbitrary memory.
|
||||
|
||||
NEW incremental decoding returns `complete(value)`, `need_more(minimum_bytes)` or a
|
||||
terminal error plus consumed-byte count. `need_more` owns any retained partial bytes
|
||||
(at most ten for a varint); it never retains a temporary input span. Field assemblers
|
||||
reserve within the same aggregate budget and report cancellation between input chunks
|
||||
through a caller-driven adapter. Cancellation does not reinterpret already emitted
|
||||
streaming output as undone. Binary owns no async operation options; IO/Async adapters
|
||||
use their shared types under C-03.
|
||||
|
||||
## Codec boundary with Data and Storage
|
||||
|
||||
The selected NEW general value codec is **VoidValueBinary V1**, owned and versioned by
|
||||
Data with an adapter using Binary. Binary supplies primitives only. Data assigns value
|
||||
tags, duplicate policy and schema envelope; Storage independently assigns WAL/checkpoint
|
||||
framing, checksums and recovery rules. Neither codec may serialize raw `Value` object
|
||||
memory. Do not add CBOR/MessagePack/Protocol Buffers compatibility claims to this native
|
||||
format. Later standards adapters need named capability tasks and conformance fixtures.
|
||||
|
||||
## Ordered tasks
|
||||
|
||||
| Task | Phase; dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-BINARY-01 | P0; current reader | Freeze cursor, lifetime, byte-order and failure fixtures; enumerate every current consumer before deprecating native-endian defaults. | sol_implementer |
|
||||
| M-BINARY-02 | P1; M-BINARY-01; Functional error gate | Implement Writer, explicit endian primitives and structured diagnostics; truncation/unsupported operations change neither cursor nor bytes. | sol_implementer |
|
||||
| M-BINARY-03 | P1; M-BINARY-02; Memory bounded-resource gate | Add owning ByteBuffer, immutable transfer and cumulative budgets; allocation failure and capacity exhaustion preserve published storage. | sol_implementer |
|
||||
| M-BINARY-04 | P2; M-BINARY-02 | Add canonical varints/ZigZag, length fields and explicit floating codecs; golden bytes, invalid encodings and all uint64 boundaries pass. | sol_implementer |
|
||||
| M-BINARY-05 | P2; M-BINARY-03–04 | Add incremental parsing and Data adapter primitives; all chunk boundaries produce identical values and retained bytes remain within limits. | sol_implementer |
|
||||
| M-BINARY-06 | P3; M-BINARY-05; Data V1 codec gate | Publish portable format examples, fuzz targets and installed minimal consumers; differential round trips and independent golden fixtures pass. | sol_implementer |
|
||||
|
||||
## Validation, migration and resource evidence
|
||||
|
||||
CURRENT checks are the existing Reader suite and parent baseline; no build was rerun.
|
||||
PROPOSED tests include unaligned spans, empty/exact/one-byte-short output, overlapping
|
||||
writeBytes, endian fixtures independent of host, noncanonical varints, all truncated
|
||||
prefixes, INT64_MIN, NaN payload handling and nested cumulative-budget exhaustion.
|
||||
Fuzz decode plus writer replay; include malicious length values near SIZE_MAX before
|
||||
any allocation. Cross-endian emulation/targets are proposed prerequisites, not current
|
||||
compiler/platform evidence. Shared schema owners review the V1 tag and framing fixtures.
|
||||
|
||||
Measure scalar and batched cursor operations, copied versus borrowed fields, incremental
|
||||
chunk sizes and allocation counts with [PERFORMANCE](../PERFORMANCE.md): p50/p95/p99,
|
||||
throughput, peak RSS/CPU and build cost. Track scratch capacity, retained partial fields
|
||||
and owning-buffer capacity separately. No benchmark was executed for this plan.
|
||||
|
||||
[Migration](../MIGRATION.md) preserves Reader's current names through adapters and adds
|
||||
explicit endian overloads before removing ambiguous defaults in a major release. File/
|
||||
wire bytes are versioned by their owner; changing helper APIs cannot rewrite them.
|
||||
Rollback keeps old readers until new-format writes are disabled or compatibility readers
|
||||
are deployed. See [Data](Data.md), [Memory](../subsystems/Memory.md),
|
||||
[Storage](../subsystems/Storage.md), [IO](../subsystems/IO.md),
|
||||
[VALIDATION](../VALIDATION.md), [DEPENDENCIES](../DEPENDENCIES.md),
|
||||
[DELIVERY](../DELIVERY.md) and [requirements](../REQUIREMENTS.md).
|
||||
@@ -0,0 +1,167 @@
|
||||
# Configuration schemas and transactional reload plan
|
||||
|
||||
Status: PLANNED feature work. Baseline: `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`,
|
||||
inspected 2026-11-24. Requirements R-002, R-004, R-009 and R-014 apply. Shared
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-05, C-07 and C-13 governs this plan.
|
||||
|
||||
## Existing source and behavioral boundary
|
||||
|
||||
[Config.hpp](../../../include/Void/Configuration/Config.hpp) implements
|
||||
`Void::Configuration::Config`: string-valued dotted keys, environment allowlists and
|
||||
prefixes, KEY=VALUE/INI/JSON/argument sources, last-writer overlay, sorted keys, subtrees,
|
||||
typed conversion and duration/byte-size handling. Returned string_views borrow the
|
||||
Config's storage. [Bind.hpp](../../../include/Void/Configuration/Bind.hpp) binds
|
||||
reflection aggregates, nested objects, optionals/vectors, defaults, `Key` and `Required`
|
||||
annotations. [Argparse.hpp](../../../include/Void/Configuration/Argparse.hpp) uses the
|
||||
separate `Void::Argparse` namespace, with parser and reflection-generated options;
|
||||
[Argparse.cpp](../../../src/Configuration/Argparse.cpp) implements parsing.
|
||||
[Env.hpp](../../../include/Void/Configuration/Env.hpp) wraps getenv; this plan does
|
||||
not inspect any environment values.
|
||||
|
||||
[Watch.hpp](../../../include/Void/Configuration/Watch.hpp) provides `ConfigWatch`.
|
||||
Parse/load failure preserves the last configuration, deletion preserves it, and a
|
||||
successful load replaces `m_current` before calling `on_reload` outside its mutex.
|
||||
There is no validation/prepare vote before that publication. Initial load failure
|
||||
leaves an empty configuration without a fallible factory result. A callback rejecting
|
||||
the new config cannot roll publication back transactionally today.
|
||||
|
||||
[Source tests](../../../tests/standalone/Configuration/Sources.cpp),
|
||||
[typed tests](../../../tests/standalone/Configuration/Typed.cpp),
|
||||
[binding tests](../../../tests/standalone/Configuration/BindAnnotations.cpp), and
|
||||
[watch tests](../../../tests/standalone/Configuration/Watch.cpp) establish existing
|
||||
fixtures. [module.cmake](../../../src/Configuration/module.cmake) declares Functional,
|
||||
System, Data and Time. Graph coverage is partial at declarations in Config, Bind,
|
||||
Argparse, Env and Watch; all reported ranges were read directly. Reflection behavior
|
||||
must be verified with the actual selected compiler, not inferred from graph parsing.
|
||||
|
||||
## NEW schema and immutable snapshot API
|
||||
|
||||
Design sketch, with Result shorthand from Functional and the sole shared options from
|
||||
[Async](Async.md); these names and methods do not yet exist:
|
||||
|
||||
```cpp
|
||||
namespace Void::Configuration {
|
||||
struct SourceLocation { SourceId source; std::string key; std::uint32_t line; };
|
||||
template<class T> struct Snapshot {
|
||||
std::uint64_t generation;
|
||||
std::shared_ptr<const T> values;
|
||||
std::shared_ptr<const Provenance> provenance;
|
||||
};
|
||||
template<class T> Result<Validated<T>> validate(const Config&, const Schema<T>&);
|
||||
template<class T> class ReloadController {
|
||||
public:
|
||||
Snapshot<T> current() const;
|
||||
Coro::Task<Result<ReloadReport>> reload(SourceSet, Async::OperationOptions);
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
Schema<T> is Configuration-owned and reuses Data's schema/value machinery. Reflection
|
||||
generates field metadata; explicit schema definitions support cross-field constraints,
|
||||
secret flags, restart-required keys, ranges, deprecations and strict unknown-key policy.
|
||||
Default unknown keys are errors in typed managed configuration; legacy Config retains
|
||||
its permissive string map. Validate a separate default-constructed candidate, collect
|
||||
at most 100 diagnostics, and publish only a complete value. Conversion errors retain
|
||||
source/key/line and machine category; secret values never appear in diagnostics.
|
||||
|
||||
Default precedence is schema defaults < declared files in order < explicitly selected
|
||||
environment variables < explicit CLI options. Each key retains winning origin and
|
||||
shadowed-origin identifiers without retaining redundant secret values. Missing, empty,
|
||||
null, malformed and removed keys are distinct. Dotted-key escaping/collision rules are
|
||||
specified before adding richer structured values: default reject an ambiguous literal
|
||||
dot versus nested JSON path collision. No fallback from malformed supplied values to
|
||||
defaults. Vectors require contiguous indexes; gaps are validation errors in NEW binding.
|
||||
|
||||
## Transaction protocol
|
||||
|
||||
Reload is serialized per controller and follows read → bounded parse → merge → typed
|
||||
bind → validate → prepare → publish → notify. The transaction has one immutable aggregate
|
||||
generation containing validated settings and prepared per-component resource views.
|
||||
Consumers acquire that aggregate once per operation, so a request cannot mix generations.
|
||||
A NEW prepare-only port can export the retained candidate view to a platform coordinator.
|
||||
For that mode, the platform's single Service/host generation publisher owns commit;
|
||||
the standalone ReloadController must not independently publish the same resource set.
|
||||
|
||||
1. Snapshot source bytes and a monotonically increasing source revision. Watch events
|
||||
coalesce; changed content during reading schedules a fresh candidate. Metadata
|
||||
debounce is only a hint. Resolve declared sources, never crawl arbitrary paths or
|
||||
enumerate the entire environment by default.
|
||||
2. Run pure validators and restart-required checks without registry/publication locks.
|
||||
Rejected fields preserve the active snapshot. A restart-required delta reports a
|
||||
pending restart; it does not partly apply the remaining fields by default.
|
||||
3. Each registered participant prepares candidate-owned resources without externally
|
||||
visible mutation. `prepare(old, candidate, options)` returns a NEW PreparedChange
|
||||
whose retained immutable view is inserted into the aggregate. Prepare may fail or
|
||||
be cancelled; disposal closes/joins its candidate work. Unregister/close joins
|
||||
participant callbacks before freeing captures.
|
||||
4. Once every prepare succeeds, check source revision, stop/deadline and the active
|
||||
generation under the short publication guard. Publish one retained aggregate pointer.
|
||||
The pointer swap is the commit point. No fallible user code, allocation, resource
|
||||
creation or callbacks are allowed in commit. An operation that needs independent
|
||||
mutable side-effect commits is not a transactional participant and must be redesigned
|
||||
or marked restart-required.
|
||||
5. Post-commit notifications are bounded observations outside locks. Callback failure
|
||||
reports a committed generation plus notification error; it does not claim rollback.
|
||||
Old resources remain pinned by old snapshots until their operations drain. A stop
|
||||
racing after commit returns committed-with-stop-observed, not a false rejection.
|
||||
|
||||
Rollback before commit disposes the candidate in reverse preparation order and leaves
|
||||
the exact old generation active. Reverting after commit is another validated transaction;
|
||||
it may fail and receives its own generation. Persistent config file changes are a separate
|
||||
System durable-replacement operation, not an implied distributed transaction.
|
||||
|
||||
## Resource limits and backend choice
|
||||
|
||||
Native parsing/binding over current Data and standard containers remains the initial
|
||||
implementation; no external configuration framework. General JSON follows Data, while
|
||||
signed release documents remain StrictJson/Update-owned and unchanged (C-07).
|
||||
Default: 1 MiB/source, 8 sources, 4 MiB merged decoded values, 10,000 keys, 4 KiB key,
|
||||
64 KiB scalar, nesting depth 32, 1,024 vector items, 64 participants and one prepared
|
||||
candidate. All source, merged, provenance and diagnostic buffers count toward the limit.
|
||||
Environment capture uses an allowlist or explicitly requested prefix and the same caps.
|
||||
|
||||
Keep at most four retained controller generations by default. If consumers still pin
|
||||
four, reject a fifth reload with `retention_limit`; never invalidate a live snapshot.
|
||||
Each participant declares a preparation resource budget; the controller cannot infer
|
||||
memory held by arbitrary callbacks. Default prepare deadline is 5 seconds using Time's
|
||||
injected monotonic clock; owned work still must drain before disposal can complete.
|
||||
Notification queue: 128 generation events with explicit coalesced-generation reporting.
|
||||
No global Runtime is created; synchronous validation is usable without workers and
|
||||
the async reload adapter uses injected Async/System resources.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
All rows are PLANNED.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-CONFIGURATION-01 | P0 / baseline | Characterize source precedence, borrowing, initial watch failure, vector gaps and key collisions | Regression fixtures separate permissive legacy behavior from strict NEW behavior / sol_implementer |
|
||||
| M-CONFIGURATION-02 | P1 / M-CONFIGURATION-01; Data schema/error gates | Schema metadata, provenance, bounded parsing and all-or-nothing typed binding | Overflow/unknown/range/cross-field failures contain redacted origins and leave input untouched / sol_implementer |
|
||||
| M-CONFIGURATION-03 | P2 / M-CONFIGURATION-02; Async scope gate | Immutable snapshots, serialized prepare/publish protocol and fallible controller factory | Any prepare failure preserves generation; one pointer swap publishes coherent resources / astra_implementer |
|
||||
| M-CONFIGURATION-04 | P2 / M-CONFIGURATION-03; System joined watcher gate | Coalescing watch adapter, source-revision validation, joined participants | Rapid edit/delete/recreate and slow validator never publish stale or partial candidate / sol_implementer |
|
||||
| M-CONFIGURATION-05 | P3 / M-CONFIGURATION-04 | Runtime/Service integration, retained-resource accounting, migration examples | Old operation sees old settings throughout; new acquisition sees new generation; leaked pins reject reload / astra_implementer |
|
||||
|
||||
## Validation, performance and migration
|
||||
|
||||
CURRENT tests run through the aggregate command
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun for this documentation change. PROPOSED tests require the NEW controller:
|
||||
participant 2 fails after participant 1 allocates; cancellation immediately before/after
|
||||
swap; concurrent reload ordering; reader pin across replacement; notification throw;
|
||||
unknown key and nested name collision; secret-bearing parse error; byte/key/depth caps;
|
||||
invalid initial config; rollback cleanup that needs asynchronous join. Validate compiled
|
||||
reflection examples and installed isolated Configuration consumers at implementation time.
|
||||
|
||||
Measure reload p50/p95/p99, reader acquisition cost, parse/validation throughput,
|
||||
allocations, retained-generation RSS/CPU and compile cost under
|
||||
[PERFORMANCE](../PERFORMANCE.md). No benchmark results are asserted.
|
||||
|
||||
EXISTING `ConfigWatch::json(path, callback)` migrates to a NEW fallible controller
|
||||
factory with schema, participants and explicit executor; callback-only users get a
|
||||
notification adapter, not a veto callback after publication. Retain Config's borrowing
|
||||
and overlay API until a major-release transition; snapshot examples keep the owning
|
||||
Snapshot alive while reading fields. Failures in legacy initial load become explicit
|
||||
errors in the NEW factory. Rollback keeps the previous controller active until the
|
||||
replacement controller validates and starts. See [MIGRATION](../MIGRATION.md),
|
||||
[VALIDATION](../VALIDATION.md), [Runtime](../subsystems/Runtime.md),
|
||||
[Service](Service.md) and [DELIVERY](../DELIVERY.md).
|
||||
@@ -0,0 +1,155 @@
|
||||
# Containers completion plan
|
||||
|
||||
Status: planning only; every feature task is **PLANNED**. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Existing structures and gaps
|
||||
|
||||
[The module](../../../src/Containers/module.cmake) declares no dependencies. It already
|
||||
contains [fixed bitsets](../../../include/Void/Containers/Bitset.hpp),
|
||||
[intervals](../../../include/Void/Containers/Interval.hpp),
|
||||
[disjoint sets](../../../include/Void/Containers/DisjointSet.hpp),
|
||||
[a directed graph](../../../include/Void/Containers/Graph.hpp),
|
||||
[a trie](../../../include/Void/Containers/Trie.hpp),
|
||||
[an indexed priority queue](../../../include/Void/Containers/PriorityQueue.hpp),
|
||||
[LRU](../../../include/Void/Containers/LRU.hpp),
|
||||
[TTL/policy cache](../../../include/Void/Containers/Cache.hpp),
|
||||
[object pools](../../../include/Void/Containers/Pool.hpp),
|
||||
[buffer recycling](../../../include/Void/Containers/BufferPool.hpp),
|
||||
[rings](../../../include/Void/Containers/Ring.hpp), and
|
||||
[debug rendering](../../../include/Void/Containers/Debug.hpp).
|
||||
Namespaces follow header families (`Void::Ring`, `Void::Cache`, etc.); a unified
|
||||
`Void::Containers` naming migration must not pretend they already share one namespace.
|
||||
|
||||
`SpscRing<T,N>` exposes N−1 usable entries. `MpscRing` reserves a head position before
|
||||
construction and spins waiting for readiness. That is not a general wait-free guarantee:
|
||||
a stalled producer can stall the consumer, and throwing construction needs a defined
|
||||
reservation-repair contract. Buffer leases store a raw pool pointer; moving/destroying
|
||||
the pool with outstanding leases needs a stronger lifetime rule. Cache already accepts
|
||||
an injected steady-clock callable and supports LRU/LFU/FIFO with lazy TTL expiry.
|
||||
ObjectPool and FixedPool return deleters tied to their pool owner. These are implementation
|
||||
constraints to repair, not proof of production readiness.
|
||||
|
||||
[Existing standalone suites](../../../tests/standalone/Containers) cover each header;
|
||||
[ring](../../../tests/standalone/Containers/Ring.cpp),
|
||||
[pool](../../../tests/standalone/Containers/Pool.cpp),
|
||||
[buffer-pool](../../../tests/standalone/Containers/BufferPool.cpp), and
|
||||
[cache](../../../tests/standalone/Containers/Cache.cpp) are regression starting points.
|
||||
Graph coverage marked PriorityQueue line 23 partial; the constructor was read directly.
|
||||
|
||||
## Target ownership and backend choice
|
||||
|
||||
Under [C-01/C-04/C-05](../ARCHITECTURE.md), [Memory](../subsystems/Memory.md) owns raw
|
||||
allocation resources; Containers owns typed lifetime, handles and data structures.
|
||||
[Algorithms](../subsystems/Algorithms.md) owns reusable graph/range algorithms and
|
||||
imports no Containers. Containers graph convenience members may delegate downward.
|
||||
Standard vector/map/unordered_map/list/heap algorithms remain implementation building
|
||||
blocks. Do not build a general hash-table or tree replacement without a named workload
|
||||
and benchmark gate. Native specializations address bounded admission, stable identities
|
||||
and inline storage that current module users actually need.
|
||||
|
||||
## NEW types and selected algorithms
|
||||
|
||||
Illustrative NEW API in NEW `include/Void/Containers/StaticVector.hpp` and
|
||||
NEW `include/Void/Containers/SlotMap.hpp`:
|
||||
|
||||
```cpp
|
||||
namespace Void::Containers {
|
||||
enum class InsertError { full, allocation_failed, generation_exhausted };
|
||||
template<class T, std::size_t N> class StaticVector {
|
||||
public:
|
||||
template<class... A> std::expected<std::reference_wrapper<T>, InsertError>
|
||||
try_emplace_back(A&&...);
|
||||
std::span<T> values() noexcept;
|
||||
};
|
||||
struct SlotHandle { std::uint32_t slot; std::uint32_t generation; };
|
||||
template<class T> class SlotMap {
|
||||
public:
|
||||
template<class... A> std::expected<SlotHandle, InsertError> emplace(A&&...);
|
||||
T* get(SlotHandle) noexcept;
|
||||
bool erase(SlotHandle);
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
StaticVector uses aligned uninitialized inline storage and constructs exactly `size()`
|
||||
objects. Capacity exhaustion leaves it unchanged. Throwing constructors preserve prior
|
||||
elements and propagate unless an explicit exception adapter is used. Moving an inline
|
||||
container invalidates element pointers. This supports small request metadata and
|
||||
dependency lists without forcing a heap allocation.
|
||||
|
||||
SlotMap starts with segmented slots (256 per block), a free-index list and generation
|
||||
checks. It preserves addresses of other live elements on growth, useful for graph and
|
||||
registry identities, but is not itself a service handle or ownership pin. Erase increments
|
||||
generation; retire a slot permanently on generation exhaustion to prevent ABA reuse.
|
||||
Default maximum: 65,536 live slots; include retired slots and block metadata in the byte
|
||||
budget. No pointer remains valid after its object's erase or container destruction.
|
||||
|
||||
SmallVector is a later NEW inline-then-heap specialization (default inline capacity 8)
|
||||
only after StaticVector and allocator exception safety pass. Growth defaults to at most
|
||||
4,096 elements; allow an explicit larger bound. Contiguous relocation invalidates
|
||||
references. Compare with `std::vector` plus reserve for request-header and configuration
|
||||
workloads before making it an internal default.
|
||||
|
||||
Keep SPSC admission nonblocking and reject full. Require nonthrowing transfer types for
|
||||
the NEW concurrent ring APIs and explicitly quiesced destruction. Replace the MPSC spin
|
||||
path with per-slot sequence publication and a `try_pop` that returns empty/pending/closed
|
||||
without waiting for a reserved but unpublished slot. Ordered consumption may return
|
||||
pending behind a stalled producer; no unconditional lock-free progress claim is made.
|
||||
Async owns waits, wakeups, cancellation and queue shutdown adapters. Rings own no threads.
|
||||
|
||||
Pool control blocks remain stationary; owning leases retain shared pool state through
|
||||
their final return, while explicitly borrowed pools require lease-before-owner
|
||||
destruction. Return paths allocate nothing and never throw; exhausted retention frees to
|
||||
the upstream resource. Default buffer limits: 1 MiB/request, 16 MiB idle bytes and 64 MiB
|
||||
total checked-out plus idle bytes. Size-class rounding is checked before allocation.
|
||||
Object-pool admission defaults to 4,096 live objects with explicit constructor limits.
|
||||
|
||||
## Existing capability completion
|
||||
|
||||
Cache defaults stay explicit-capacity; the NEW convenience constructor selects 1,024
|
||||
entries and a 16 MiB weight budget. Caller-supplied weight functions account for payloads;
|
||||
no pretend exact RSS bound for arbitrary `T`. TTL uses Time's clock contract, with
|
||||
zero-duration meaning immediate expiry. Eviction/expiry callbacks execute after mutation
|
||||
and outside any adapter lock. LFU tie-breaking becomes deterministic by age and its
|
||||
linear-scan cost is documented until workload evidence justifies a different structure.
|
||||
Trie adds iterative traversal, prefix result limits (256 default), and a 4 KiB key limit.
|
||||
Graph traversal takes explicit vertex/edge budgets (65,536/262,144 default). Priority
|
||||
updates preserve heap/index consistency if key copying/allocation fails; comparison must
|
||||
be stable and nonthrowing for its bounded fast path. Interval endpoints remain half-open;
|
||||
closed-to-half-open conversion checks maximum-endpoint overflow. Bitset zero-size and
|
||||
tail masking receive explicit tests. Debug formatting truncates at 256 entries/16 KiB.
|
||||
|
||||
## Ordered implementation tasks
|
||||
|
||||
| Task | Phase; dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-CONTAINERS-01 | P0; current source | Document capacity, invalidation, thread and exception guarantees for every current structure; preserve deterministic fixtures. | sol_implementer |
|
||||
| M-CONTAINERS-02 | P1; Memory bounded-resource gate; M-CONTAINERS-01 | Repair object/buffer lease lifetime and byte accounting; owner destruction with retained leases is safe and recycle allocates zero. | astra_implementer |
|
||||
| M-CONTAINERS-03 | P1; M-CONTAINERS-01 | Implement nonthrowing ring publication and nonspinning MPSC poll semantics; delayed producer, wraparound and quiesced destruction tests pass under sanitizers/TSAN. | astra_implementer |
|
||||
| M-CONTAINERS-04 | P2; M-CONTAINERS-02 | Add StaticVector and SlotMap; capacity failure, over-alignment, constructor exceptions and stale handles leave invariants intact. | sol_implementer |
|
||||
| M-CONTAINERS-05 | P2; M-CONTAINERS-01; Algorithms graph gate; Time clock gate | Complete bounded graph/trie/priority/interval/bitset/cache APIs; deterministic fake-clock eviction and failure injection match reference models. | sol_implementer |
|
||||
| M-CONTAINERS-06 | P3; M-CONTAINERS-04; measured request-metadata profile | Add bounded SmallVector and compare reserved std::vector; publish allocation, relocation and compile-cost evidence before adoption. | sol_implementer |
|
||||
| M-CONTAINERS-07 | P3; M-CONTAINERS-02–06 | Ship compatibility aliases, independent installed consumers and workload report; no unexplained dependency or progress-guarantee regression. | sol_implementer |
|
||||
|
||||
## Validation and transition
|
||||
|
||||
CURRENT checks are the inspected suites, not new executions. PROPOSED model/property
|
||||
tests replay randomized operations against standard containers, force allocation and
|
||||
construction failure at each insertion step, and verify destructor counts. TSAN plus
|
||||
scheduled producer pauses exercise concurrency; TSAN alone cannot establish progress.
|
||||
Bounded polling tests must terminate without a producer resuming. Retained pool leases,
|
||||
moved containers, generation wrap and zero/maximum interval endpoints get dedicated cases.
|
||||
|
||||
Measure mixed cache traces, bursty ring occupancy, pool churn, prefix scans and 0–32-item
|
||||
metadata under [PERFORMANCE](../PERFORMANCE.md): p50/p95/p99, throughput, live/idle bytes,
|
||||
allocations, peak RSS/CPU and build cost. A lock-free label is not an acceptance metric.
|
||||
The [validation](../VALIDATION.md), [dependency](../DEPENDENCIES.md) and
|
||||
[delivery](../DELIVERY.md) gates precede integration into Runtime or Net.
|
||||
|
||||
[Migration](../MIGRATION.md) preserves old namespaces through deprecated aliases while
|
||||
new bounded constructors and poll results require explicit caller changes. Move raw
|
||||
allocation implementation to Memory behind old pool wrappers only after lifetime
|
||||
contracts are tested; do not create Memory→Containers. Rollback uses the old major and
|
||||
adapters without persistent state conversion. Never interchange in-memory SlotHandle
|
||||
values with serialized IDs. [Requirements](../REQUIREMENTS.md) define package scope.
|
||||
@@ -0,0 +1,141 @@
|
||||
# Core completion plan
|
||||
|
||||
Status: planning only. All feature tasks below are **PLANNED**. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Existing capability and evidence
|
||||
|
||||
[Core's declaration](../../../src/Core/module.cmake) currently declares no internal
|
||||
dependencies. Its public headers include [Bits](../../../include/Void/Core/Bits.hpp),
|
||||
[Flags](../../../include/Void/Core/Flags.hpp), [Hash](../../../include/Void/Core/Hash.hpp),
|
||||
[Scope](../../../include/Void/Core/Scope.hpp), [Lazy](../../../include/Void/Core/Lazy.hpp),
|
||||
[Counted](../../../include/Void/Core/Counted.hpp),
|
||||
[TypeList](../../../include/Void/Core/TypeList.hpp),
|
||||
[TypeMap](../../../include/Void/Core/TypeMap.hpp),
|
||||
[Variant](../../../include/Void/Core/Variant.hpp), and reflection
|
||||
[Meta](../../../include/Void/Core/Meta.hpp). These are separate namespaces such as
|
||||
`Void::Bits`, `Void::Meta`, and `Void::Scope`, not an existing `Void::Core` namespace.
|
||||
Reflection is conditionally compiled; retaining C++26 reflection remains R-002.
|
||||
|
||||
[Uuid](../../../include/Void/Core/Uuid.hpp) stores sixteen bytes, parses compact or
|
||||
hyphenated hex, generates v4 through `Void::Random`, and exposes `v5_lite` using
|
||||
noncryptographic hashes. The Math include is a real undeclared dependency to remove.
|
||||
`v5_lite` is not interoperable SHA-1 UUID v5 and must never be advertised as such.
|
||||
Its temporary string allocation and several allocating `noexcept` APIs warrant an
|
||||
exception-specification audit. Hash functions are utility hashes, not authentication.
|
||||
|
||||
[Core tests](../../../tests/standalone/Core) exercise all these header families;
|
||||
[UUID tests](../../../tests/standalone/Core/Uuid.cpp),
|
||||
[scope tests](../../../tests/standalone/Core/Scope.cpp), and
|
||||
[reflection tests](../../../tests/standalone/Core/Meta.cpp) provide baseline fixtures.
|
||||
These are inspected capabilities, not a fresh test-pass claim. Graph coverage reported
|
||||
partial parsing at Meta line 280 and Variant line 17; those ranges were read directly.
|
||||
|
||||
## Ownership and target boundary
|
||||
|
||||
[Architecture C-01/C-02/C-13](../ARCHITECTURE.md) governs this layer. Core stays native
|
||||
and standard-library-only: identity representation, bit operations, traits, lifetime
|
||||
guards, and small vocabulary helpers. It never imports Math, Functional, Memory,
|
||||
execution, logging, or crypto. Fallible Core primitives use
|
||||
`std::expected<T, local_error_enum>`; Functional supplies optional error adapters above
|
||||
Core. Allocator facilities belong to [Memory](../subsystems/Memory.md), checked general
|
||||
numeric arithmetic to [Math](Math.md), and error categorization to [Functional](Functional.md).
|
||||
|
||||
Keep the default include cost small: bit and type-list users must not instantiate
|
||||
reflection or diagnostic formatting. Split heavyweight formatting/reflection bridges
|
||||
into explicitly included headers, preserving forwarding includes for one major migration.
|
||||
Do not replace standard scope or type utilities merely to add another spelling.
|
||||
|
||||
## NEW API shapes and behavior
|
||||
|
||||
The following are illustrative NEW declarations, not compiling current examples.
|
||||
Proposed paths are `include/Void/Core/Uuid.hpp` extensions and NEW
|
||||
`include/Void/Core/CheckedBits.hpp`.
|
||||
|
||||
```cpp
|
||||
namespace Void::Uuid {
|
||||
enum class GenerateError { entropy_unavailable, invalid_source };
|
||||
// Caller-supplied URBG; deterministic tests need no global generator.
|
||||
template<std::uniform_random_bit_generator G> Uuid v4(G& generator);
|
||||
std::expected<Uuid, GenerateError> try_v4();
|
||||
// Fixed-size output excludes string allocation and null termination.
|
||||
std::array<char, 36> format_chars(const Uuid&) noexcept;
|
||||
}
|
||||
namespace Void::Bits {
|
||||
enum class BitError { invalid_range, invalid_alignment, overflow };
|
||||
template<std::unsigned_integral T>
|
||||
std::expected<T, BitError> checked_extract(T value, unsigned offset, unsigned count);
|
||||
template<std::unsigned_integral T>
|
||||
std::expected<T, BitError> checked_align_up(T value, T alignment);
|
||||
}
|
||||
```
|
||||
|
||||
`try_v4()` uses a standard entropy source locally, reports source failure, and makes
|
||||
no cryptographic-strength guarantee. Security-sensitive identifiers obtain bytes from
|
||||
Security/Crypto through the injected-generator overload; that adapter lives above Core.
|
||||
Mask version and variant only after all bytes are acquired. No hidden worker or cached
|
||||
process service is created. Keep `Uuid::Uuid` layout and string representation stable.
|
||||
The legacy no-argument `v4()` becomes a documented throwing convenience in the major
|
||||
release; remove its misleading unconditional `noexcept` rather than returning a nil ID
|
||||
on failure. An explicit legacy adapter preserves old source names during transition.
|
||||
|
||||
Checked bit operations validate offset/count without overflowing their sum. Count zero
|
||||
returns zero for extraction; a full-width mask never shifts by the width. Alignment must
|
||||
be nonzero and a power of two; overflow returns failure before arithmetic. Existing fast
|
||||
preconditioned helpers remain available with their preconditions stated.
|
||||
|
||||
Scope callbacks execute once, must not throw during destruction, and hold decayed owned
|
||||
callables unless references are explicitly wrapped. Conditional move `noexcept` must
|
||||
match the callable. `Lazy` stays single-threaded; `LazySync` uses `call_once` publication,
|
||||
including synchronized observation of `evaluated()`. A failed factory remains retryable;
|
||||
recursive access is documented as invalid and gets a debug diagnostic. Neither lazy
|
||||
wrapper promises a cancellation or reset protocol across concurrent readers.
|
||||
|
||||
TypeMap gains reference lookup without copying `std::any` values; returned references
|
||||
expire on replacement/erase/destruction. It remains a utility, not a service registry.
|
||||
Counters document wraparound and prohibit use as durable identities; an opt-in checked
|
||||
sequence reports exhaustion. Compile-time list operations get diagnostics for missing
|
||||
types and bad indices, rather than accidental template-depth explosions.
|
||||
|
||||
## Backlog and ordered implementation
|
||||
|
||||
| Task | Phase; dependencies | Intended scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-CORE-01 | P0; current source | Inventory every public header, namespace, reflection branch, exception specification and direct include; isolated Core consumer exposes the Math leak and records the compatibility surface. | sol_implementer |
|
||||
| M-CORE-02 | P1; M-CORE-01 | Implement injected UUID generation, allocation-free parse/format and fallible entropy path; preserve byte/string fixtures and remove all Core→Math includes. | sol_implementer |
|
||||
| M-CORE-03 | P1; M-CORE-01 | Add checked bit/alignment helpers and portable hash byte loading; constexpr boundary tests cover zero/full widths, maximum values and endianness. | sol_implementer |
|
||||
| M-CORE-04 | P2; M-CORE-01 | Repair guard move contracts and lazy observation; throwing/move-only factories and contended successful initialization execute/destruct exactly as specified. | astra_implementer |
|
||||
| M-CORE-05 | P2; M-CORE-01 | Add TypeMap reference access, checked sequence exhaustion and useful list diagnostics; no service/runtime dependency and no implicit copy on reference lookup. | sol_implementer |
|
||||
| M-CORE-06 | P2; M-CORE-02–05 | Publish compatibility headers and independent-header consumers; Core-only static/shared installed consumers and reflection-enabled/disabled configurations satisfy the package gate. | sol_implementer |
|
||||
|
||||
## Resource and performance gates
|
||||
|
||||
UUID parse/format and checked bits allocate zero bytes. `v5_lite` retains existing output
|
||||
fixtures but gets an allocation-free incremental implementation only if byte-for-byte
|
||||
compatibility is proved; no collision-resistance claim follows. TypeMap's NEW bounded
|
||||
constructor defaults to 256 distinct types and rejects additional admissions; explicit
|
||||
unbounded construction is separate. Lazy wrappers retain one result and one factory;
|
||||
no histories, queues, shutdown work, or background timers exist.
|
||||
|
||||
Measure fixed-size UUID batches, type-list compiler cost at 16/64/256 types, Meta formatting
|
||||
at shallow/deep aggregates, and contended first lazy access. Follow
|
||||
[PERFORMANCE](../PERFORMANCE.md) for p50/p95/p99, throughput, allocations, RSS/CPU and
|
||||
build cost. Report entropy acquisition separately from UUID masking/formatting.
|
||||
|
||||
## Validation, compatibility and rollback
|
||||
|
||||
CURRENT checks are the source suites linked above and the parent-recorded baseline;
|
||||
this planning task ran no C++ checks. PROPOSED checks require M-CORE-06 consumers and
|
||||
the supported C++26 toolchain: independent headers, ODR across two shared objects,
|
||||
sanitizers for lifetime paths, TSAN for LazySync, and fixed hash/UUID fixtures. Include
|
||||
malformed hyphens, uppercase hex, nil UUIDs, throwing entropy, bit width 0/width/width+1,
|
||||
throwing guard moves and factories that fail once then succeed.
|
||||
|
||||
Migration follows [MIGRATION](../MIGRATION.md) and
|
||||
[BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md). Keep `v5_lite` as a visibly legacy
|
||||
nonstandard operation; never reinterpret persisted IDs as standards-compliant v5.
|
||||
Rollback is an old-version package/header selection with the same persisted UUID bytes.
|
||||
Do not publish the new major until downstream Core-only consumers and optional
|
||||
Functional formatting bridges pass [VALIDATION](../VALIDATION.md). The
|
||||
[requirements](../REQUIREMENTS.md), [dependencies](../DEPENDENCIES.md) and
|
||||
[delivery plan](../DELIVERY.md) own cross-module scope and sequencing.
|
||||
@@ -0,0 +1,126 @@
|
||||
# Crypto implementation plan
|
||||
|
||||
Status: planning only; all tasks PLANNED. Source baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Applies [requirements](../REQUIREMENTS.md) R-004, R-006, R-012, R-014–R-016 and
|
||||
[architecture](../ARCHITECTURE.md) C-02, C-03, C-07, C-13.
|
||||
|
||||
## Existing primitive surface
|
||||
|
||||
[Crypto.hpp](../../../include/Void/Crypto/Crypto.hpp) declares `Void::Crypto::Hasher`,
|
||||
`Digest`, SHA-1/256/512 helpers, file hashing and `verifyEd25519` with fixed 32-byte public
|
||||
keys and 64-byte signatures. [Crypto.cpp](../../../src/Crypto/Crypto.cpp) uses OpenSSL EVP
|
||||
contexts with RAII. Incremental hashers are move-only; use after move/finalize is an
|
||||
error. File hashing streams a 64 KiB buffer. Ed25519 verification uses exact message
|
||||
bytes: malformed sizes are errors, well-formed invalid signatures return false.
|
||||
[module.cmake](../../../src/Crypto/module.cmake) declares Functional and OpenSSL::Crypto.
|
||||
|
||||
[Tests](../../../tests/standalone/Crypto/Crypto.cpp) cover known SHA vectors, streamed/file
|
||||
equivalence, rejected update after finalize and an RFC 8032 Ed25519 vector with modified
|
||||
message rejection. They do not establish provider-failure handling, signing, key management,
|
||||
asynchronous file cancellation or broad malformed-key coverage. Graph metadata matched
|
||||
all four linked source paths with no recorded issue; source was also read directly.
|
||||
|
||||
## Responsibility and backend decision
|
||||
|
||||
Retain OpenSSL as the initial implementation of hashes and signatures. Native preference
|
||||
means Void-owned lifetime/error/stream interfaces and no public EVP types; it does not
|
||||
authorize original cryptographic algorithms. TLS certificate and connection policy belong
|
||||
to [Net](Net.md), authentication/session/authorization workflows to [Security](Security.md),
|
||||
signed document selection and exact-byte verification sequencing to [Update](Update.md).
|
||||
Crypto must not depend on those consumers, Storage, or Runtime.
|
||||
|
||||
Keep existing verification formats intact. NEW HMAC-SHA-256 and HKDF-SHA-256 are staged
|
||||
primitive additions through EVP, with separate known-answer and misuse tests; new signing
|
||||
is Ed25519 through an owning private-key handle. SHA-1 stays available only for explicit
|
||||
legacy interoperability; new security protocols select SHA-256 or stronger. No silent
|
||||
fallback if an algorithm/provider is unavailable. Provider configuration is injected per
|
||||
context; do not mutate process-wide OpenSSL state from a library constructor.
|
||||
|
||||
## NEW API shapes, algorithms and ownership
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::Crypto shapes; Result is C-02 shorthand.
|
||||
class PrivateKey; // move-only opaque backend state, explicit import/generate
|
||||
struct Ed25519PublicKey { std::array<std::byte, 32> bytes; };
|
||||
struct Ed25519Signature { std::array<std::byte, 64> bytes; };
|
||||
Result<Ed25519Signature> sign_ed25519(ByteSpan exact_message, const PrivateKey&);
|
||||
Result<Digest> hmac_sha256(ByteSpan secret_key, ByteSpan message);
|
||||
Result<void> hkdf_sha256(ByteSpan secret_input, ByteSpan salt,
|
||||
ByteSpan context, MutableByteSpan secret_output);
|
||||
// Optional IO adapter, not a new executor or OperationOptions definition:
|
||||
Task<Result<Digest>> hash_stream(HashAlgorithm, IOByteReader&, OperationOptions);
|
||||
```
|
||||
|
||||
Byte-span and reader names above denote proposed owner-provided shapes, not existing aliases.
|
||||
[Memory](../subsystems/Memory.md) owns resource integration. Callers may supply Security's
|
||||
secure buffer through spans; Crypto does not import the authentication module or allocate
|
||||
a general-purpose secret result type. HKDF fills the caller-owned destination, wipes it
|
||||
on failure and rejects overlapping input/output. Primitive APIs borrow inputs until
|
||||
the synchronous call returns; async adapters retain owned buffers through IO completion.
|
||||
PrivateKey has no implicit copy/export/string conversion. Import uses an explicitly
|
||||
named encoding and validates algorithm/size; public export and secret export are separate
|
||||
capabilities. Secret export requires explicit caller intent and a secure owning result.
|
||||
|
||||
Hasher state is Ready → Updating → Finalized or Failed. Backend update/finalize failure
|
||||
poisons the context until destroyed; retrying a partially effective update is invalid.
|
||||
Hash-stream reads at most 64 KiB, updates, checks stop/deadline between chunks, finalizes
|
||||
only at clean EOF and never treats a short failed read as success. Descriptor close or
|
||||
concurrent path replacement has the IO-defined result; hashing a path does not promise
|
||||
a snapshot of a concurrently modified file. Update's downloader must pin its own artifact.
|
||||
|
||||
Signature operations do not prehash/reencode Ed25519 messages implicitly. Binary/text
|
||||
decoding is outside verification; [Data](Data.md)'s StrictJson rules and exact signed
|
||||
payload bytes remain unchanged under C-07. A successful primitive verification is not
|
||||
authorization, freshness, trust-root selection or replay protection.
|
||||
|
||||
NEW defaults: stream chunk 64 KiB, optional file adapter 8 concurrent operations and
|
||||
32 waiting, 8 MiB adapter buffer budget; oversized input is processed incrementally
|
||||
where the algorithm supports it. One-shot signing/verification initially limits messages
|
||||
to 16 MiB and directs larger formats to an explicitly specified signed-manifest design.
|
||||
The NEW HKDF API caps output at 4 KiB and also enforces the backend primitive's limit;
|
||||
invalid sizes fail before mutation. Error context contains operation/provider codes, never keys,
|
||||
passwords or plaintext. Output buffers are wiped on failed secret-producing operations.
|
||||
|
||||
## Failure matrix and evidence
|
||||
|
||||
| Fault | Required behavior | Acceptance scenario |
|
||||
| --- | --- | --- |
|
||||
| Bad key/signature size | Typed invalid input, no backend use | Every length near expected boundary |
|
||||
| Wrong message/key/signature | Successful false verification | Altered bytes and independent vectors |
|
||||
| Algorithm unavailable / provider error | Unsupported/backend error; no downgrade | Inject provider failures per operation |
|
||||
| Hash context fails midway | Failed terminal state, cannot reuse | Update/finalize/move sequences |
|
||||
| File read error / cancellation | No digest success; one terminal result | Partial read then error, stop at EOF race |
|
||||
| Allocation/admission failure | Resource error before secret output publication | Budget exhaustion with no retained secret |
|
||||
| Async shutdown | Stop admission, stop/join readers, destroy contexts last | Caller buffers cannot escape completion |
|
||||
|
||||
## Task DAG
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-CRYPTO-01 | P0; baseline | Preserve existing vectors and exact-byte false-vs-error behavior; record consumers before API migration | sol_implementer |
|
||||
| M-CRYPTO-02 | P1; M-CRYPTO-01, Functional/Memory contracts | Typed size wrappers, poisoned-state/error handling and provider isolation; malformed/state tests pass | astra_implementer |
|
||||
| M-CRYPTO-03 | P2; M-CRYPTO-02 | Owning Ed25519 private key/signing, HMAC/HKDF with caller-owned output; independent known-answer vectors and no secret diagnostics | astra_implementer |
|
||||
| M-CRYPTO-04 | P2; M-CRYPTO-02, IO/Async gates | Optional hash-stream/file adapter, bounded cancellation and workload accounting; no mandatory runtime dependency | sol_implementer |
|
||||
| M-CRYPTO-05 | P3; M-CRYPTO-03, M-CRYPTO-04 | Signed-update integration fixtures, component consumers and resource profiles; exact signed bytes unchanged | astra_implementer |
|
||||
| M-CRYPTO-06 | P4; M-CRYPTO-05, distributed consumers | Snapshot/transport integrity recipes distinguish checksums, authenticated channels and trusted signatures | sol_implementer |
|
||||
|
||||
## Verification and migration
|
||||
|
||||
CURRENT checks are the linked Crypto tests in VoidTests; no build/test was rerun for
|
||||
this documentation task. PROPOSED tests add backend fault injection, independent vector
|
||||
corpora, secret lifetime tests, file mutation/short-read cases, fuzzed imports and sanitizer
|
||||
coverage. Backend-version testing follows [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md);
|
||||
the OpenSSL 3.5 [client guide](https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/)
|
||||
informs Net TLS policy, not a claim about the currently linked version or FIPS certification.
|
||||
|
||||
Measure small-message setup separately from large streaming throughput, with p50/p95/p99,
|
||||
allocations, RSS/CPU and build cost under [PERFORMANCE](../PERFORMANCE.md). No native
|
||||
replacement is justified by speculative speedups. [VALIDATION](../VALIDATION.md) defines
|
||||
future runner prerequisites; do not invent a presently available signing target.
|
||||
|
||||
Major-release evolution adds typed overloads and consistent naming with adapters for
|
||||
existing camelCase entry points. Preserve SHA digest bytes, file semantics and Ed25519
|
||||
verification outcome distinction. Never reinterpret old signatures with a new framing
|
||||
scheme. Rollback retains readable key/algorithm formats and the previous backend adapter;
|
||||
unsupported new algorithms fail explicitly. See [MIGRATION](../MIGRATION.md).
|
||||
@@ -0,0 +1,183 @@
|
||||
# Data values, parsing and schema evolution
|
||||
|
||||
Status: planning only; feature tasks are **PLANNED**. Source baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Existing source and protected profile
|
||||
|
||||
[Data](../../../src/Data/module.cmake) declares Time; its reflection/CSV headers also
|
||||
include Core. [Json](../../../include/Void/Data/Json.hpp) implements `Void::Json::Value`
|
||||
with null/bool/double/string and boxed vectors for arrays/ordered object pairs. Integer
|
||||
constructors convert to double; `as_int()` casts from it. General parsing returns
|
||||
`std::expected<Value, ParseError>` with line/column diagnostics, retains duplicate object
|
||||
pairs, provides JSON pointer access, SAX callbacks and serialization. SAX numeric
|
||||
callbacks currently receive double. Exact 64-bit integers require a representation
|
||||
change, not just a new accessor.
|
||||
|
||||
[Reflect](../../../include/Void/Data/Reflect.hpp) serializes C++26-reflected values,
|
||||
annotations, containers, variants and chrono values, and has `MigrationChain` plus
|
||||
versioned envelopes. [Csv](../../../include/Void/Data/Csv.hpp) exposes allocating Row/
|
||||
Table parsing and reflection conversion; current parse returns a Table without malformed-
|
||||
quote diagnostics. [Ini](../../../include/Void/Data/Ini.hpp) handles sections, values,
|
||||
mutation and serialization. Neither is a full configuration policy engine.
|
||||
|
||||
[StrictJson](../../../include/Void/Data/StrictJson.hpp) is a separate namespace/type:
|
||||
`Void::Json::Strict::Value` uses signed int64, ordered maps and restricted parsing.
|
||||
[StrictJson tests](../../../tests/standalone/Data/StrictJson.cpp) require exact signed
|
||||
64-bit endpoints and reject duplicates, floats, excessive nesting and lone surrogates.
|
||||
**C-07 prohibits broadening this profile through general Data improvements.** Existing
|
||||
[Update envelope parsing](../../../src/Update/Feed.cpp) uses general Json, not StrictJson;
|
||||
schema 3 parses payload bytes for readable-document comparison before verifying their
|
||||
signature. [Update](Update.md) explicitly plans moving that comparison after verification
|
||||
and preserving a versioned legacy parsing profile. Verification before payload parsing is
|
||||
the target contract; no general serializer becomes a replacement signing input. Existing
|
||||
signed documents remain compatibility fixtures.
|
||||
|
||||
[General JSON](../../../tests/standalone/Data/Json.cpp),
|
||||
[query/SAX](../../../tests/standalone/Data/JsonQuery.cpp),
|
||||
[accessors](../../../tests/standalone/Data/JsonAccessors.cpp),
|
||||
[reflection](../../../tests/standalone/Data/Reflect.cpp),
|
||||
[annotations](../../../tests/standalone/Data/ReflectAnnotations.cpp),
|
||||
[chrono](../../../tests/standalone/Data/ReflectChrono.cpp),
|
||||
[CSV](../../../tests/standalone/Data/Csv.cpp),
|
||||
[CSV reflection](../../../tests/standalone/Data/CsvReflect.cpp), and
|
||||
[INI](../../../tests/standalone/Data/Ini.cpp) are current test sources. Partial graph
|
||||
ranges Json 243/1090 and Reflect 595 were read directly. The graph's reflection call
|
||||
edges include heuristic matches; source, not those edges, establishes type behavior.
|
||||
|
||||
## Target ownership and backend rationale
|
||||
|
||||
Keep the native DOM/scanners/reflection implementation. Data owns structured values,
|
||||
general parsing policies, schema envelopes and migration; [Binary](Binary.md) owns
|
||||
encoding primitives. [Math](Math.md) owns checked numeric conversions; Data may depend
|
||||
downward on its small Numeric header. [Unicode](../subsystems/Unicode.md) is an explicit
|
||||
validation/normalization adapter, never a hidden signed-data transform. Functional owns
|
||||
common classifications and adapters for Data's path-aware domain errors. No optional
|
||||
third-party JSON engine becomes a foundation requirement. Dependencies are declared and
|
||||
independently tested, including Core and Time, under [C-01/C-07](../ARCHITECTURE.md).
|
||||
|
||||
## NEW value representation and checked conversion
|
||||
|
||||
Illustrative NEW members on `Void::Json::Value`, not current compiling API:
|
||||
|
||||
```cpp
|
||||
namespace Void::Json {
|
||||
enum class NumberKind { signed_integer, unsigned_integer, real };
|
||||
// Value backing alternatives add int64_t and uint64_t alongside double.
|
||||
// NumberKind Value::number_kind() const;
|
||||
template<class T> std::expected<T, ConversionError> number_as(const Value&);
|
||||
enum class DuplicateKeys { reject, first_wins, last_wins, preserve };
|
||||
struct ParseOptions {
|
||||
DuplicateKeys duplicate_keys = DuplicateKeys::reject;
|
||||
std::size_t max_input_bytes = 16 * 1024 * 1024;
|
||||
std::size_t max_owned_bytes = 64 * 1024 * 1024;
|
||||
std::size_t max_string_bytes = 1024 * 1024;
|
||||
std::size_t max_nodes = 1000000;
|
||||
unsigned max_depth = 64;
|
||||
};
|
||||
std::expected<Value, ParseError> parse(std::string_view, ParseOptions);
|
||||
}
|
||||
```
|
||||
|
||||
Signed integer tokens in range become int64; nonnegative integers above INT64_MAX but
|
||||
within UINT64_MAX become uint64. Integers outside both ranges fail rather than round
|
||||
through double. Decimal/exponent tokens become finite double, with conversion range
|
||||
errors reported. Arbitrary-precision decimals are outside the first value milestone;
|
||||
a later named decimal capability requires a separate representation/schema decision.
|
||||
Numeric lexemes are limited to 256 bytes. General parsing validates full grammar,
|
||||
UTF-8 and escaped scalar pairs, and rejects trailing junk. Integer `-0` becomes integer
|
||||
zero; floating negative zero retains sign and serializes as `-0.0`. Lexical preservation
|
||||
is a separate borrowed raw-document facility, not a promise of the DOM.
|
||||
|
||||
`number_as<T>` delegates exact/range logic to Numeric and adds the document path.
|
||||
Default integer-to-double conversion rejects inexactness; named lossy conversion is
|
||||
explicit. Equality compares integral alternatives exactly with signedness checks;
|
||||
integer/real equality is true only when the real is finite, integral and exactly matches
|
||||
the integer. It never first converts UINT64_MAX to double. Typed wrong-kind access
|
||||
reports an error; legacy throwing accessors remain adapters during the major migration.
|
||||
|
||||
Objects retain insertion order in vector pairs. Duplicate detection uses a temporary
|
||||
key index charged to the owned-byte/node budget. Default reject avoids ambiguous lookup;
|
||||
preserve exposes a multi-member API and requires an explicit occurrence policy for
|
||||
lookup/pointer traversal. first/last-wins are deterministic named compatibility profiles.
|
||||
Keys compare decoded bytes; normalization/case folding is never implicit. Programmatic
|
||||
construction and serialization enforce the same duplicate/finite-number rules selected
|
||||
for output. Stable pretty output is not a security canonicalization standard.
|
||||
|
||||
## Streaming, tables and ownership
|
||||
|
||||
Unify DOM and SAX grammar scanning with typed numeric events (`int64`, `uint64`, `double`).
|
||||
NEW incremental parser owns incomplete tokens, uses at most the configured 1 MiB token
|
||||
buffer, and reports consumed/need-more/completed/error states. Callback string views
|
||||
expire at callback return; an explicit owned-event mode copies within budget. Callbacks
|
||||
may stop parsing with an error/stop result. Check a supplied stop token between tokens
|
||||
and every 4 KiB inside long strings; no Async dependency or worker is introduced.
|
||||
Earlier SAX events remain observed after failure; a DOM result publishes only on full
|
||||
success. Input plus owned output, key indexes, parser stack and migration scratch all
|
||||
count toward explicit resource accounting; allocator overhead is reported separately.
|
||||
|
||||
CSV gets an incremental quoted-field state machine with exact malformed-quote offsets,
|
||||
CRLF/LF policy, delimiter selection and defaults of 65,536 rows, 1,024 columns and 1 MiB
|
||||
per field within 16 MiB input/64 MiB owned bytes. Empty final rows and embedded line breaks
|
||||
have explicit fixtures. Row conversion reports column/name/type errors, not a blanket
|
||||
nullopt. INI gets deterministic serialization, duplicate section/key policies (reject
|
||||
by default in NEW strict mode), escaped-value rules, and the same byte bounds with
|
||||
65,536 keys. Configuration owns overlays, environment expansion and secret policy.
|
||||
|
||||
Reflection decoding selects strict unknown-field rejection or an explicit ignore mode,
|
||||
honors required/default/rename annotations and uses exact numeric conversions. Depth and
|
||||
owned-byte budgets cover reflected containers too. MigrationChain validates a contiguous
|
||||
version path before applying it; run each step on owned candidate data, cap at 32 steps,
|
||||
and publish only after final validation. Migration failure never partially mutates the
|
||||
caller's original value. No claim of database transactionality follows from this local
|
||||
strong exception guarantee.
|
||||
|
||||
## NEW native binary value codec
|
||||
|
||||
Select **VoidValueBinary V1** in NEW `include/Void/Data/ValueBinary.hpp`, with no claimed
|
||||
CBOR/MessagePack compatibility. Envelope: four literal bytes `VVB1`, one flags byte
|
||||
(must be zero), then one value. Tags: 0 null, 1 false, 2 true, 3 ZigZag int64, 4 uvarint
|
||||
uint64, 5 little-endian IEEE binary64, 6 length-prefixed UTF-8 string, 7 array count plus
|
||||
values, 8 object pair count plus string keys/values. Varints are minimal. Reject nonfinite
|
||||
floats, unknown tags/flags, duplicate keys in strict mode and trailing bytes. Preserve
|
||||
array/object order; canonical signing is not part of V1. Defaults reuse Data budgets;
|
||||
validate counts before reserve. Schema transport adds a Data-owned type ID and version
|
||||
inside an explicit envelope value; RPC/Storage independently own their framing/durability.
|
||||
|
||||
## Ordered backlog
|
||||
|
||||
| Task | Phase; dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-DATA-01 | P0; current source | Freeze general/StrictJson behavior and signed fixture boundaries; map Data includes and every numeric consumer before a representation break. | astra_implementer |
|
||||
| M-DATA-02 | P1; M-MATH-02; M-DATA-01 | Add exact signed/unsigned representation and checked access/equality; endpoints and 2^53±1 survive parse/serialize/reflection without silent rounding. | astra_implementer |
|
||||
| M-DATA-03 | P2; M-DATA-02; Functional/Memory bounded-error/resource gates | Implement explicit general JSON limits/duplicate policies and transactional DOM publication; adversarial inputs cannot bypass aggregate budgets. | sol_implementer |
|
||||
| M-DATA-04 | P2; M-DATA-03 | Share scanner with typed SAX/incremental modes; all chunk splits match DOM grammar and callbacks never retain temporary views. | sol_implementer |
|
||||
| M-DATA-05 | P2; M-DATA-02–03 | Complete reflection strictness, annotation diagnostics and bounded migration; failed version step preserves input and missing paths fail before execution. | sol_implementer |
|
||||
| M-DATA-06 | P2; M-DATA-03 | Complete CSV/INI streaming/errors/deterministic output and typed rows; quote, duplicate, field-limit and rollback fixtures pass. | sol_implementer |
|
||||
| M-DATA-07 | P3; M-BINARY-04; M-DATA-03/05 | Implement VVB1 with golden byte fixtures and versioned value envelope; unknown formats reject and resource limits match JSON. | sol_implementer |
|
||||
| M-DATA-08 | P3; M-DATA-04–07; protected Update/Security fixture gate | Publish migration and installed consumers; signed documents retain their exact acceptance profile and no signature uses reserialized bytes. | astra_implementer |
|
||||
|
||||
## Validation, migration and rollback
|
||||
|
||||
CURRENT evidence is the inspected suites and parent baseline; no build/test/fuzz run was
|
||||
performed for these documents. PROPOSED tests cover INT64_MIN/MAX, UINT64_MAX, oversized
|
||||
integers, inexact casts, malformed exponents/UTF-8/surrogates, every duplicate mode,
|
||||
deep/wide trees, escaped pointer keys, callback stop, chunk splits, allocation failure,
|
||||
CSV quote state and interrupted migration. Keep a separate protected StrictJson fixture
|
||||
set: general uint64/float/duplicate policies must not alter it. Cross-check VVB1 against
|
||||
handwritten golden bytes, not only its own round trips.
|
||||
|
||||
Workload profiles include small config DOMs, 16 MiB tables, deep rejection, integer-heavy
|
||||
messages and streaming scans. Measure p50/p95/p99, throughput, allocation count/bytes,
|
||||
peak RSS/CPU and reflection build cost through [PERFORMANCE](../PERFORMANCE.md).
|
||||
No throughput improvement or compiler support is claimed without that evidence.
|
||||
|
||||
[Migration](../MIGRATION.md) groups Value layout, number kind, default duplicate policy,
|
||||
typed SAX events and reflection strictness into the major release. Preserve old general
|
||||
parser behavior only in a named legacy adapter; StrictJson stays separate and unchanged.
|
||||
Deploy VVB1 readers before enabling writers, retain old-format fixtures/readers and never
|
||||
rewrite signed payloads in place. Rollback disables new-format writes; applications must
|
||||
retain a readable prior-format copy before persisted migration. See
|
||||
[VALIDATION](../VALIDATION.md), [DEPENDENCIES](../DEPENDENCIES.md),
|
||||
[DELIVERY](../DELIVERY.md), [requirements](../REQUIREMENTS.md),
|
||||
[Update](Update.md) and [Security](Security.md) for integration gates.
|
||||
@@ -0,0 +1,168 @@
|
||||
# Fsm structured workflows and checkpoint plan
|
||||
|
||||
Status: PLANNED feature work. Source baseline: `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`,
|
||||
inspected 2026-11-24. Requirements R-002, R-009, R-010, R-014 and R-015 apply.
|
||||
Follow [architecture](../ARCHITECTURE.md) C-03–C-05, C-09, C-10 and C-13.
|
||||
|
||||
## Existing source baseline
|
||||
|
||||
[Machine.hpp](../../../include/Void/Fsm/Machine.hpp) implements
|
||||
`Void::Fsm::Machine<R>`, signature/reflection-driven states, entry/exit hooks, typed
|
||||
outcomes, event waits, hierarchy/history, submachines, parallel regions, race-any,
|
||||
pause/restart/jump and JSON serialization. `serialize()` records a named state plus
|
||||
application `on_serialize` data; `restore` requires Idle and invokes `on_restore`.
|
||||
It does not save suspended coroutine stacks. `run_parallel_any` explicitly leaves
|
||||
losers running; a permanently parked loser can retain a frame until stop.
|
||||
|
||||
[StateKey.hpp](../../../include/Void/Fsm/StateKey.hpp) defines `StateKey`, `FsmError`,
|
||||
`LaunchResult` and statuses Idle/Running/Succeeded/Failed/Faulted. Machine::finished
|
||||
includes Faulted, but [Orchestrator.hpp](../../../include/Void/Fsm/Orchestrator.hpp)
|
||||
FsmHandle::finished currently checks only Succeeded/Failed. Despite its non-owning
|
||||
comment, FsmHandle stores a shared_ptr to its model; migration must clarify ownership
|
||||
from the source rather than repeat the comment.
|
||||
|
||||
[Engine.hpp](../../../include/Void/Fsm/Detail/Engine.hpp) and
|
||||
[Engine.cpp](../../../src/Fsm/Engine.cpp) contain a shared executor/event mailbox/timer
|
||||
substrate, optional owning worker and embedder pumping. Nested machines share that
|
||||
substrate. [module.cmake](../../../src/Fsm/module.cmake) declares Async, Data,
|
||||
Functional, Log and Service. NEW execution continues to depend on Async and optional
|
||||
Service access, never on managed Runtime or Scheduler.
|
||||
|
||||
Existing fixtures include [basic pumping](../../../tests/standalone/Fsm/Basic.cpp),
|
||||
[events](../../../tests/standalone/Fsm/Events.cpp),
|
||||
[parallel regions](../../../tests/standalone/Fsm/Parallel.cpp),
|
||||
[policies](../../../tests/standalone/Fsm/Policies.cpp),
|
||||
[hierarchy](../../../tests/standalone/Fsm/Hierarchy.cpp),
|
||||
[history](../../../tests/standalone/Fsm/History.cpp), and
|
||||
[serialization](../../../tests/standalone/Fsm/Serialize.cpp). These remain regression
|
||||
inputs. Graph coverage was checked; Parallel/Direct constructor gaps were directly
|
||||
read. Source inspection establishes the terminal-status and race-loser gaps.
|
||||
|
||||
## NEW execution and supervision contract
|
||||
|
||||
Design sketch; additions are not available APIs:
|
||||
|
||||
```cpp
|
||||
namespace Void::Fsm {
|
||||
struct Checkpoint {
|
||||
std::uint32_t format_version;
|
||||
std::string machine_type;
|
||||
std::uint32_t application_schema;
|
||||
std::uint64_t transition_sequence;
|
||||
Json::Value state; // stable state IDs + app data
|
||||
};
|
||||
// Machine additions:
|
||||
// run(execution_binding, Async::OperationOptions) -> Task<Result<Outcome>>;
|
||||
// request_checkpoint(options) -> Task<Result<Checkpoint>>;
|
||||
// restore_checkpoint(const Checkpoint&) -> Result<void>; // Idle only
|
||||
// post(Event, options) -> Result<void>; // bounded admission
|
||||
// terminal(Status) -> bool; // one shared predicate
|
||||
}
|
||||
```
|
||||
|
||||
Execution binding borrows Async executor/scope and Time clock contracts. Keep it
|
||||
Fsm-specific binding data, not another cancellation/deadline context; all public
|
||||
operations use `Async::OperationOptions`. Machine state runs on one logical strand.
|
||||
Cross-thread posts enqueue owned event envelopes; only that strand mutates active
|
||||
state, timers, waiters and transition history. Service lookups return owning handles
|
||||
retained across await, per [Service](Service.md).
|
||||
|
||||
Machine has a root Async scope and each entered state has a child scope. Exit first
|
||||
closes state-event admission, requests child stop, joins child work, removes waiters
|
||||
and timers, then runs bounded exit cleanup and enters the next state. No queued
|
||||
resume targets a destroyed state. A failed exit cleanup faults the machine after
|
||||
joining all remaining scopes. Stop has a separate completion reason; the first
|
||||
version retains existing Status values and adds `termination_reason` rather than
|
||||
silently treating cancellation as application success or introducing unreviewed enum
|
||||
values. Terminal predicate includes Faulted everywhere.
|
||||
|
||||
Parallel-all joins every child before producing the outcome tuple; a system fault
|
||||
requests sibling stop and joins before returning the fault. Parallel-any selects one
|
||||
winner on the machine strand, requests stop for all losers and awaits their joins
|
||||
before returning the winner. Simultaneous-ready ties use child declaration order in
|
||||
the same dispatch turn. Application Failure remains a typed outcome and can win a
|
||||
race; system Fault remains a separate supervisory failure. Stop/deadline uses Async's
|
||||
one-terminal arbitration. A noncooperative loser delays completion and is reported;
|
||||
its frame is never abandoned to meet a latency target.
|
||||
|
||||
Supervision policies are explicit: default stop-on-fault; optional bounded restart
|
||||
with Time-driven backoff, maximum three restarts per 60-second window, and 1,024
|
||||
supervised machines. A faulted child is terminal in handles/counts/waits. Release
|
||||
finished models from active supervision while acquired handles retain immutable
|
||||
termination evidence and any still-required cleanup ownership. User observer callbacks
|
||||
run outside orchestration locks; their exceptions report observer errors independently
|
||||
from the machine's committed transition.
|
||||
|
||||
## Checkpoint algorithm and state compatibility
|
||||
|
||||
Checkpoints capture state boundaries: after the prior state's child scope and exit
|
||||
cleanup finish, before the next state's entry causes new effects. A parked state may
|
||||
offer an explicit application safe point that drains child work and serializes its
|
||||
resume label. No arbitrary suspension point is implicitly restartable. A request
|
||||
that cannot reach a boundary before its deadline fails without copying a live frame.
|
||||
|
||||
On the strand, freeze event consumption, assign a transition sequence, copy application
|
||||
data and stable state paths/history into a bounded candidate, validate its schema,
|
||||
then release the freeze. Optional queued events are persisted only through an explicit
|
||||
registered serializable event schema and acknowledgement sequence; default checkpoint
|
||||
excludes the mailbox and requires producer replay/deduplication. Relative monotonic
|
||||
timers are application intent with restart policy, never raw process clock readings.
|
||||
|
||||
Default checkpoint contains format version, machine identity, application schema,
|
||||
stable state IDs and transition sequence. State IDs are declared durable names, not
|
||||
compiler type-name spellings. Restore validates all IDs/schema/limits into a private
|
||||
Idle machine and commits its prepared state once; invalid data or migration exceptions
|
||||
leave it unchanged. Resume executes state entry from the selected boundary. Application
|
||||
side effects require idempotent occurrence/operation IDs or an external transaction;
|
||||
checkpointing does not promise exactly-once effects. [Scheduler](../subsystems/Scheduler.md)
|
||||
owns durable job occurrences; Fsm owns their workflow state.
|
||||
|
||||
## Bounds and backend rationale
|
||||
|
||||
Initial implementation remains native C++ coroutines/reflection and reuses Async
|
||||
structured scopes. No external workflow engine. Default mailbox 1,024 events/4 MiB,
|
||||
256 deferred events, 1,024 timers, 128 live child regions, hierarchy depth 32, 256
|
||||
retained transitions and checkpoint 4 MiB. Event types must provide payload accounting
|
||||
for variable data. Overload is returned before enqueue; reserved control messages
|
||||
ensure stop/checkpoint can progress under user-event saturation. Control capacity is
|
||||
bounded by live scopes and requests, not an unbounded priority queue.
|
||||
|
||||
One dispatch turn processes at most 64 events or 1 ms measured by injected Time before
|
||||
yielding; tests use event counts to avoid real-clock flakiness. Expired waiters are
|
||||
removed before state destruction. Low-level hooks remain optional so Fsm does not
|
||||
require an observability exporter or Runtime. Profile tick/transition/race/checkpoint
|
||||
p50/p95/p99, throughput, frame/event allocations, peak RSS/CPU and reflection compile
|
||||
cost under [PERFORMANCE](../PERFORMANCE.md); no results are asserted.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
All rows are PLANNED.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-FSM-01 | P0 / current source | Characterize status, supervision ownership, event waits and race losers | Faulted discrepancy and indefinitely parked race fixture recorded; no claim of safe cancellation / sol_implementer |
|
||||
| M-FSM-02 | P1 / M-FSM-01; M-ASYNC-03 | Inject executor/clock, root/state scopes, waiter/timer ownership | Stop at each suspension frees only after join; borrowed execution outlives final cleanup / astra_implementer |
|
||||
| M-FSM-03 | P2 / M-FSM-02; M-SERVICE-02 | Structured parallel/race, terminal predicate, bounded mailbox/history and supervision | Losers stopped/joined; faults terminate all handle/wait APIs; old provider survives await / astra_implementer |
|
||||
| M-FSM-04 | P2 / M-FSM-03; Data schema gate | Boundary checkpoint, stable state IDs, validate-then-restore and schema migrations | Checkpoint during mutation waits for safe point; invalid restore leaves Idle candidate unchanged / astra_implementer |
|
||||
| M-FSM-05 | P3 / M-FSM-04; Plugin quiescence specification | Reloadable workflow adapter, restart policies, examples and profile harness | Reload migrates application state without frames; fault/restart cap and cleanup evidence visible / sol_implementer |
|
||||
|
||||
## Validation and migration
|
||||
|
||||
CURRENT command:
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun for documentation. PROPOSED tests require NEW scope/checkpoint APIs: race
|
||||
winner with forever-waiting cooperative loser, fault during child exit, timeout versus
|
||||
event delivery, queued timer after state exit, nested cancellation, event saturation,
|
||||
observer reentrancy/throw, Faulted supervision, checkpoint/transition simultaneity,
|
||||
schema migration failure, and restart after effects with operation-ID deduplication.
|
||||
Use fake clocks and deterministic strand stepping before sanitizer stress runs.
|
||||
|
||||
Keep existing state declaration/reflection syntax where possible. EXISTING
|
||||
`MachineOptions{.own_worker=false}` maps to explicit injected execution; owning worker
|
||||
construction becomes an opt-in adapter. JSON `{state,data}` gets an explicit legacy
|
||||
checkpoint reader with declared machine/schema defaults; unknown compiler-derived
|
||||
state names require a migration map. Old race-any behavior is documented until the
|
||||
major-release switch to join-losers; no silent semantic change. Rollback preserves
|
||||
legacy readers and the original persisted checkpoint until the new version validates.
|
||||
See [MIGRATION](../MIGRATION.md), [VALIDATION](../VALIDATION.md),
|
||||
[DEPENDENCIES](../DEPENDENCIES.md), and [DELIVERY](../DELIVERY.md).
|
||||
@@ -0,0 +1,150 @@
|
||||
# Functional completion and error contracts
|
||||
|
||||
Status: planning only; feature tasks are **PLANNED**. Source baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Existing surface
|
||||
|
||||
[Result.hpp](../../../include/Void/Functional/Result.hpp) defines
|
||||
`Void::Result::Result<T, E = Error>` as `std::expected<T,E>`, with `Failure`, `ok`,
|
||||
`fail` and `with_context`. [Error](../../../include/Void/Functional/Error.hpp) stores
|
||||
a message and shared immutable cause chain; it has no current machine-readable category.
|
||||
Keep the standard expected monadic operations rather than wrapping them in a new result
|
||||
class. Existing namespace facts also include `Void::Either` for
|
||||
[Either](../../../include/Void/Functional/Either.hpp) and
|
||||
[Opt](../../../include/Void/Functional/Opt.hpp), and `Void::Pipeline` for
|
||||
[Pipeline](../../../include/Void/Functional/Pipeline.hpp),
|
||||
[Curry](../../../include/Void/Functional/Curry.hpp) and
|
||||
[Memo](../../../include/Void/Functional/Memo.hpp).
|
||||
|
||||
[Retry](../../../include/Void/Functional/Retry.hpp) has delay policies, jitter and a
|
||||
steady elapsed budget, but sleeps synchronously and uses zero for unlimited elapsed
|
||||
time. Its zero-attempt path can return a default-constructed result without calling the
|
||||
operation. `Memoized::get_cache()` uses a function-local static map, so instance ownership
|
||||
and concurrency need deliberate migration. The reflection
|
||||
[diagnostic bridge](../../../include/Void/Functional/Detail/Repr.hpp) includes Core Meta,
|
||||
while [the module declaration](../../../src/Functional/module.cmake) lists no dependency.
|
||||
[Result tests](../../../tests/standalone/Functional/ResultContext.cpp),
|
||||
[memo tests](../../../tests/standalone/Functional/Memo.cpp),
|
||||
[retry tests](../../../tests/standalone/Functional/Retry.cpp), and
|
||||
[jitter tests](../../../tests/standalone/Functional/RetryJitter.cpp) establish useful
|
||||
fixtures. Scoped graph coverage reported no recorded parser gaps here; source was also
|
||||
read because graph cleanliness is not completeness evidence.
|
||||
|
||||
## Owner and dependency decisions
|
||||
|
||||
Functional owns error categories and exception/domain adapters under
|
||||
[C-02](../ARCHITECTURE.md). It imports no Async, Runtime, Log or Containers. Core stays
|
||||
below Functional; optional reflection formatting has the NEW interface target
|
||||
`Void::FunctionalCoreFormatting`, exporting Functional and Core dependencies. Its
|
||||
headers never create a reverse Core→Functional bridge; base `Void::Functional` retains
|
||||
no Core requirement. Time owns clocks; Functional's pure retry
|
||||
decision engine accepts times as values and never owns a timer. Async/Resilience own
|
||||
asynchronous waiting, task cancellation and policy composition above this layer.
|
||||
Native templates plus standard expected/optional/variant are the backend. No external
|
||||
functional framework or general policy runtime is justified.
|
||||
|
||||
## NEW error shape and adapters
|
||||
|
||||
These illustrative NEW additions extend `include/Void/Functional/Error.hpp` and add
|
||||
NEW `include/Void/Functional/Adapters.hpp`; existing `Result<T>` remains an alias.
|
||||
|
||||
```cpp
|
||||
namespace Void::Result {
|
||||
enum class ErrorKind {
|
||||
invalid_argument, not_found, conflict, cancelled, timeout, overloaded,
|
||||
unsupported, io, corrupt, exhausted, internal
|
||||
};
|
||||
struct ErrorCode { std::uint32_t domain; std::int32_t value; };
|
||||
// Compact failure descriptor; expected's value branch represents success.
|
||||
struct Status { ErrorKind kind; ErrorCode code; };
|
||||
// NEW members on Error:
|
||||
// explicit Error(Status) noexcept; // no diagnostic allocation
|
||||
// ErrorKind kind() const noexcept;
|
||||
// ErrorCode code() const noexcept;
|
||||
// std::error_code system_code() const noexcept;
|
||||
// Error with_context(std::string) const&;
|
||||
template<class T, class E, class Map>
|
||||
Result<T> adapt(std::expected<T,E>, Map&& map_error);
|
||||
template<class F, class Map>
|
||||
auto try_invoke(F&&, Map&& map_exception);
|
||||
}
|
||||
```
|
||||
|
||||
The library reserves domain 0 for generic classifications; domain numeric registration
|
||||
is documented by Functional, not generated by hashing type names. Preserve domain code,
|
||||
system code, root category and causes through context wrapping. Human strings are never
|
||||
parsed to decide retryability. Old `Error(string)` maps to `internal` with an unspecified
|
||||
domain code; callers should migrate to typed construction. Domain errors such as
|
||||
`Numeric::Error` may remain small enums and use explicit adapters at integration edges.
|
||||
`adapt` invokes its mapper only on failure and supports move-only values and `void`.
|
||||
|
||||
`try_invoke` catches only exceptions accepted by its caller-provided mapper; unrecognized
|
||||
exceptions rethrow. `std::bad_alloc` propagates by default. No automatic catch-all turns
|
||||
programmer errors into empty values. A C ABI adapter catches at its boundary and emits
|
||||
fixed status codes with explicitly owned diagnostic storage under C-09.
|
||||
|
||||
NEW error context limits default to 16 frames, 1 KiB per message and 16 KiB total rendered
|
||||
diagnostics. Truncation is visible and preserves the original classification. A compact
|
||||
`Status` carrying only kind/code provides an allocation-free boundary for Memory and
|
||||
low-memory paths; enriching it with strings is separate and fallible. Cause copying is
|
||||
immutable and bounded; destructor traversal must not recurse through unbounded chains.
|
||||
|
||||
## Pure retry and callable ownership
|
||||
|
||||
NEW `RetryState::next(now, last_error)` returns either `stop`, `attempt`, or an absolute
|
||||
next-attempt time. Defaults: three total attempts and a 30-second total budget; explicit
|
||||
`no_deadline` is required for unlimited time. Zero attempts is invalid. Backoff arithmetic
|
||||
saturates at a configured cap before overflow, rejects negative durations/nonfinite
|
||||
multipliers, and accepts an injected URBG for reproducible jitter. A stop request or
|
||||
expired admission deadline prevents the next attempt; the policy cannot interrupt an
|
||||
already-running callback or reverse its side effects. Retryability is a supplied
|
||||
predicate and retrying writes still requires the caller's idempotency contract.
|
||||
|
||||
Retain the synchronous `retry` adapter temporarily, explicitly named as blocking. A
|
||||
Time-clock/sleeper adapter belongs in a separate Time-dependent header; Async supplies
|
||||
its own awaiting adapter. This prevents foundational retry code from importing execution.
|
||||
|
||||
Memoization becomes per-instance with an explicit key/result signature, default 1,024
|
||||
entries and FIFO eviction. Recursive calls mark an entry as computing; a repeated key
|
||||
returns `conflict` rather than infinite recursion. Exceptions and failed expected results
|
||||
are not cached by default. Concurrent memoization is a separate externally synchronized
|
||||
adapter, not a hidden mutex in every callable. Pipeline/curry forwarding preserves
|
||||
move-only callables, return references only when the underlying callable does, and
|
||||
documents captured-reference lifetime. Standard ranges remain the default sequence API.
|
||||
|
||||
## Ordered backlog
|
||||
|
||||
| Task | Phase; dependencies | Implementation scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-FUNCTIONAL-01 | P0; current source | Lock existing expected alias, context rendering, namespace and exception behavior; compile minimal and reflection bridge consumers independently. | sol_implementer |
|
||||
| M-FUNCTIONAL-02 | P1; M-FUNCTIONAL-01 | Add compact Status, stable categories/domain codes, bounded context and explicit adapters; root classification survives 16 frames and allocation-free status paths allocate zero. | astra_implementer |
|
||||
| M-FUNCTIONAL-03 | P1; M-FUNCTIONAL-02; Time clock contract | Extract pure retry decisions and retain named blocking adapter; fake-time tests prove exact attempt counts, deadlines, jitter bounds and no zero-attempt success. | sol_implementer |
|
||||
| M-FUNCTIONAL-04 | P2; M-FUNCTIONAL-01–02 | Replace static memo caches with bounded instance caches and recursive-key detection; same callable type with different captures cannot share values. | sol_implementer |
|
||||
| M-FUNCTIONAL-05 | P2; M-FUNCTIONAL-01 | Complete Either/Opt/Pipeline/Curry move/ref-qualified behavior and declared Core bridge dependency; move-only, void and constexpr consumers compile. | sol_implementer |
|
||||
| M-FUNCTIONAL-06 | P2; M-FUNCTIONAL-02–05 | Publish migration adapters, error-domain registry and integration examples for Async/Data/Binary; no dependency cycle and installed minimal consumers pass. | sol_implementer |
|
||||
|
||||
## Evidence and migration gates
|
||||
|
||||
CURRENT verification is the inspected source/test inventory and parent-recorded baseline;
|
||||
no tests were rerun for these documents. PROPOSED tests add category-preserving adaptation,
|
||||
void/move-only expected, known/unknown exceptions, cause-limit truncation, allocator
|
||||
failure while enriching Status, two memo instances, recursive duplicate keys, failed
|
||||
compute cleanup, zero attempts, deadline-at-admission and saturated backoff. Async owns
|
||||
cancellation-race tests for its retry adapter; synchronous policy tests do not prove
|
||||
preemption or timely shutdown of arbitrary callbacks.
|
||||
|
||||
Measure successful expected chains separately from failures with context, memo hit/miss
|
||||
and eviction distributions, and callable compile cost. Follow
|
||||
[PERFORMANCE](../PERFORMANCE.md) for p50/p95/p99, allocations, throughput, RSS/CPU and
|
||||
build cost; do not compare a throwing diagnostic-heavy failure with an allocation-free
|
||||
status without reporting that work difference.
|
||||
|
||||
The [major migration](../MIGRATION.md) changes Error layout, memo ownership and retry
|
||||
defaults explicitly. Keep legacy blocking/zero-unlimited policy wrappers named and
|
||||
documented for one transition; never silently reuse old static caches. No serialized
|
||||
error object becomes a wire contract: RPC owns its versioned mapping. Rollback selects
|
||||
the old major with no persistent-data conversion, but mixed-major ABI objects cannot
|
||||
cross plugin boundaries. See [VALIDATION](../VALIDATION.md),
|
||||
[DEPENDENCIES](../DEPENDENCIES.md), [DELIVERY](../DELIVERY.md) and
|
||||
[requirements](../REQUIREMENTS.md) for integrated gates.
|
||||
@@ -0,0 +1,173 @@
|
||||
# Log — bounded delivery and process-wide facade
|
||||
|
||||
Status: plan; all feature tasks are PLANNED. Baseline `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
Implements R-005/R-009/R-012/R-014 under [C-03–C-05 and C-11](../ARCHITECTURE.md).
|
||||
|
||||
## Existing behavior and gaps
|
||||
|
||||
The names are deliberately distinct: `Void::Log` is the emission facade in
|
||||
[Log.hpp](../../../include/Void/Log/Log.hpp); `Void::Logging` owns `Logger`, `Entry`,
|
||||
formatters and sinks. [LogState/State.cpp](../../../src/LogState/State.cpp) defines the
|
||||
single facade state through a separate compiled target. Preserve this across host/plugin
|
||||
shared-library boundaries; replacing it with inline per-module statics changes behavior.
|
||||
Disabled facade calls gate formatting, and per-module levels override the global level.
|
||||
However, `Detail::emit` currently invokes the sink while holding `State::mutex` shared.
|
||||
Reentrant `set_sink` or level changes therefore need a defined safe design.
|
||||
|
||||
[Logger.cpp](../../../src/Log/Logger.cpp) supports Immediate, Buffered and Async modes.
|
||||
The async policies are Block, DropNewest and DropOldest. DropOldest currently enqueues
|
||||
without reserving capacity and trims later. The worker drains into an unconstrained batch
|
||||
and returns queue permits before delivery; queue capacity is not a bound on total retained
|
||||
entries. Existing derived sinks flush while still alive, whereas the base destructor
|
||||
stops/joins without invoking virtual delivery. Do not weaken that lifetime obligation.
|
||||
|
||||
[Sinks.hpp](../../../include/Void/Log/Sinks.hpp) has callback, null and fan-out sinks;
|
||||
fan-out configuration is assembled before concurrent use. File/rotation/history sinks and
|
||||
pattern/JSON-lines/logfmt formatters are existing capabilities. [FieldScope](../../../include/Void/Log/Field.hpp)
|
||||
and [Field.cpp](../../../src/Log/Field.cpp) maintain thread-local fields;
|
||||
[Entry](../../../include/Void/Log/Entry.hpp) owns snapshots for delivery.
|
||||
[module.cmake](../../../src/Log/module.cmake) currently declares Functional/Configuration
|
||||
and optional Stacktrace. LogState remains the lightweight compatibility bridge; foundation
|
||||
independence is governed by C-01, not by linking the full sink framework everywhere.
|
||||
|
||||
Evidence includes [facade tests](../../../tests/standalone/Log/Log.cpp),
|
||||
[async tests](../../../tests/standalone/Log/AsyncLogger.cpp), and
|
||||
[scope snapshots](../../../tests/standalone/Log/LogScopeSnapshot.cpp). Existing passing
|
||||
queue tests are not proof of a byte budget, reentrant callbacks or throwing-sink safety.
|
||||
|
||||
## Delivery architecture and NEW interfaces
|
||||
|
||||
Keep native delivery and formatting; external logging systems integrate via adapters,
|
||||
not a mandatory backend. Use a mutex-protected bounded ring initially: it makes eviction,
|
||||
permit accounting and flush boundaries auditable. A different concurrent queue is a later
|
||||
measured optimization with identical semantics. No dependency on Runtime or an exporter.
|
||||
|
||||
NEW illustrative additions in `Void::Logging`:
|
||||
|
||||
```cpp
|
||||
struct DeliveryLimits {
|
||||
std::size_t entries = 4096;
|
||||
std::size_t owned_bytes = 8 * 1024 * 1024;
|
||||
std::size_t max_entry_bytes = 64 * 1024;
|
||||
std::size_t batch_entries = 128;
|
||||
};
|
||||
enum class SubmitState { Accepted, Filtered, Dropped, Closed };
|
||||
using Ticket = std::uint64_t;
|
||||
struct SubmitReceipt { SubmitState state; std::optional<Ticket> ticket; };
|
||||
struct FlushReport { std::uint64_t delivered, dropped, failed; };
|
||||
Result<SubmitReceipt> try_submit(Entry); // NEW Logger method
|
||||
Result<FlushReport> flush_through(Ticket, FlushOptions);
|
||||
Result<FlushReport> close(CloseOptions);
|
||||
```
|
||||
|
||||
`Ticket`, `FlushOptions`, `CloseOptions` and admission receipts are NEW Log-owned types;
|
||||
they refer to Async's stop/deadline options rather than invent another cancellation type.
|
||||
Existing void-returning methods remain compatibility adapters until the major migration.
|
||||
NEW configurations default to DropNewest; existing constructors keep their documented
|
||||
Block default until explicitly migrated. Ticket assignment occurs only for admitted
|
||||
entries, under admission order, after fallible preparation succeeds.
|
||||
Non-admitted submissions have no ticket; sequence exhaustion closes admission rather than
|
||||
wrapping a watermark and reporting premature flush completion.
|
||||
|
||||
Reserve bytes and entries before making internal owned copies. Total accounting includes
|
||||
queued entries, producers preparing admitted entries, dequeued batches, sink formatting
|
||||
scratch and fan-out copies. A public caller's pre-existing Entry is outside the logger
|
||||
budget; any retained copy is inside. Format into capped storage; reject oversize by default
|
||||
instead of allocating an unlimited intermediate string. Truncation is an explicit policy
|
||||
and marks the record. Allocator overhead is charged conservatively, not just message size.
|
||||
Add defaults of 32 fields, 16 scope elements, 256-byte keys and 2 KiB field values.
|
||||
|
||||
The worker claims at most 128 entries/256 KiB per batch and retains their permits until
|
||||
delivery or terminal loss. DropNewest rejects immediately. DropOldest evicts only a queued,
|
||||
not-yet-dispatched entry under the admission lock; if all capacity is in flight, drop the
|
||||
new arrival. Block is opt-in, cancellable in the new API, and forbidden on the delivery
|
||||
worker or an executor needed to release capacity. Admission order defines per-logger
|
||||
ordering; no timestamp-based total order across independent loggers is promised.
|
||||
|
||||
Fan-out is bounded to eight children by default, checks cycles on configuration, and owns
|
||||
child handles. A child has a distinct budget; total memory is the sum of parent and child
|
||||
budgets, visible in configuration. Share immutable records where possible, charging the
|
||||
shared payload once to a retained owner and charging each envelope separately. A slow
|
||||
child must not create an unbounded staging queue in the parent.
|
||||
|
||||
## Reentrancy, flush and shutdown
|
||||
|
||||
Facade configuration becomes an immutable sink-registration object retained by emitters.
|
||||
Acquire/snapshot the registration under the configuration lock, then release that lock
|
||||
before formatting/callback invocation and before destroying the old callback. Replacement
|
||||
affects subsequent admissions; already-admitted calls may still use the old registration.
|
||||
NEW `detach_and_drain` waits for those calls to exit and is not callable synchronously
|
||||
from that registration's callback. `set_sink` alone is not an unsubscribe-and-join promise.
|
||||
Callbacks that capture plugin code retain its generation through the last callback.
|
||||
|
||||
A per-thread/per-logger dispatch guard suppresses recursive dispatch into the same sink,
|
||||
increments `reentrant_dropped`, and uses a bounded emergency diagnostic path only if
|
||||
explicitly installed. Logging to a different sink remains allowed within a maximum nesting
|
||||
depth of eight. No retry/error reporting calls back into a failing sink. User callbacks,
|
||||
formatter code and virtual sink methods run outside queue/configuration locks. A callback
|
||||
may request asynchronous close, but self-join or blocking flush returns WouldDeadlock.
|
||||
|
||||
Flush takes a ticket watermark, so later producers cannot extend it forever. Every admitted
|
||||
ticket becomes delivered, evicted or failed; the completion watermark advances only through
|
||||
a contiguous terminal prefix, even if immediate mode completes out of order. The report
|
||||
includes all losses through that watermark. A sink's buffer flush is distinct from durable
|
||||
file sync: a NEW `FlushDurability::SyncFiles` option syncs supported file sinks or returns
|
||||
UnsupportedCapability. Callback sinks cannot claim disk durability on the callback's behalf.
|
||||
|
||||
Catch sink exceptions at delivery boundaries, mark affected tickets failed, record a bounded
|
||||
error summary, and continue or quarantine that sink according to a selected configuration.
|
||||
Default is quarantine after the first delivery failure, with explicit operator reset;
|
||||
never silently retry a possibly written record. Mode/formatter changes use an admission
|
||||
barrier and drain the old generation before publishing the new one. Configuration validation
|
||||
cannot invoke arbitrary callbacks while locked.
|
||||
|
||||
`close` rejects new work, drains or explicitly drops queued work, then joins delivery and
|
||||
releases sink ownership. A deadline may stop waiting but cannot destroy a callback still
|
||||
executing; an owning close handle retains resources until completion (C-03). Legacy derived
|
||||
destructors still need their flush contract; NEW composition owns sink state independently
|
||||
of a partially destructed polymorphic logger. No forceful callback interruption is promised.
|
||||
|
||||
## Capability backlog and implementation order
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-LOG-01 | P0; current tests | Add regressions for callback reconfiguration, slow sink and total queued+in-flight accounting; preserve existing disabled/field/mode behavior. | astra_implementer |
|
||||
| M-LOG-02 | P1; M-LOG-01, C-11 | Snapshot facade registrations, drain handles, reentrancy guard and shared-library test; host sink receives plugin events and can replace itself without deadlock. | astra_implementer |
|
||||
| M-LOG-03 | P2; M-LOG-02, Memory budgeting | Bounded ring, byte admission, batch limits, all saturation policies and contiguous ticket completion; limits hold while sink stalls and producers race. | astra_implementer |
|
||||
| M-LOG-04 | P2; M-LOG-03, Async operation options | Result-based flush/close, failure quarantine, reconfiguration barriers; no self-join, stuck watermark or callback after owner release. | astra_implementer |
|
||||
| M-LOG-05 | P2; M-LOG-04 | Finish sink workflows: file failure reporting, retention quota, rotation/reopen, formatter escaping/redaction and configuration validation; disk-full preserves loss accounting. | sol_implementer |
|
||||
| M-LOG-06 | P3; M-LOG-04, Observability hook/context contract | Optional context bridge, metrics and managed shutdown adapter; no Log↔Observability or Async↔Log cycle. | sol_implementer |
|
||||
| M-LOG-07 | P3; M-LOG-05/06, shared performance harness | Profile disabled, immediate, async, structured and saturated paths; publish measured latency/memory/build costs and rejected counts. | sol_implementer |
|
||||
|
||||
P4 consumers reuse these contracts through [distributed platforms](../platforms/DistributedApplications.md);
|
||||
logging does not become a durable consensus log. For file rotation default NEW retention is
|
||||
five 16 MiB files per sink, with a 1 MiB capped formatting scratch budget. Opening/reopening
|
||||
files is fallible, directory creation is explicit, and partial writes are errors with
|
||||
possible partial external output. Audit records needing durable transactional semantics
|
||||
belong in Storage, not a loss-tolerant logger.
|
||||
|
||||
## Validation and compatibility
|
||||
|
||||
CURRENT interfaces: the existing `VoidTests` supports `--filter`; a TEMPLATE for the verified
|
||||
names is `<existing-build>/tests/VoidTests --filter '^(no_sink_is_silent|disabled_calls_do_not_format|async_.*)$'`.
|
||||
Use the configured build in [validation](../VALIDATION.md); this documentation task does not
|
||||
execute it. PROPOSED tests require M-LOG-01–06: deterministic blocked callbacks, callback
|
||||
replacement/destruction, thrown formatter/sink, concurrent flush, drop-oldest pressure,
|
||||
permit rollback on allocation failure, copied context after producer exit, and shutdown
|
||||
with an admitted callback. Stress and TSan supplement deterministic ownership checks.
|
||||
|
||||
Measure p50/p95/p99 admission and flush separately, throughput, allocations, RSS/CPU and
|
||||
build cost under [performance](../PERFORMANCE.md)'s warmup/repetition/confidence rules.
|
||||
Report drops and reentrant suppression alongside useful delivery; an apparent improvement
|
||||
caused by losing work is not an optimization result.
|
||||
|
||||
[Migration](../MIGRATION.md): preserve namespaces and LogState symbol linkage; add explicit
|
||||
registration and close handles before replacing legacy signatures. Example transition:
|
||||
`logger.info(text); logger.flush();` becomes checked admission plus `flush_through(ticket)`
|
||||
when delivery evidence matters. Frozen C/plugin contracts must use their own versioned
|
||||
bridges, not embed C++ Entry layout. Keep old sinks behind adapters during the major release;
|
||||
roll back a new queue/backend only if ordering, resource and flush tests remain satisfied.
|
||||
|
||||
Coverage: cited files were checked in the repository graph and read directly; partial parses
|
||||
in Logger/Sinks/Field were inspected, so graph absence is not used as evidence. New tests,
|
||||
resource guarantees and performance claims remain unverified planned work.
|
||||
@@ -0,0 +1,148 @@
|
||||
# Math and numeric utility completion
|
||||
|
||||
Status: planning only; all tasks are **PLANNED**. Source baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Current capabilities
|
||||
|
||||
[Math](../../../src/Math/module.cmake) declares no dependencies.
|
||||
[Numeric](../../../include/Void/Math/Numeric.hpp) provides `Void::Numeric::Error`, checked,
|
||||
saturating and unsigned wrapping arithmetic, parsing, range and narrowing helpers.
|
||||
Checked arithmetic currently uses compiler overflow builtins. `parse_int`/`parse_double`
|
||||
pass `string_view::data()` to C conversion functions, so a bounded non-NUL-terminated
|
||||
substring requires correction. The `long long`-based narrowing interface is insufficient
|
||||
for every unsigned conversion. These are concrete foundations work, not scientific scope.
|
||||
|
||||
[Random](../../../include/Void/Math/Random.hpp) implements `Void::Random::Xoshiro256`, a
|
||||
thread-local generator, distributions, shuffle and sampling. Sampling materializes all
|
||||
`n` indices; `k > n` is not explicitly rejected. The generator is for simulations,
|
||||
sampling and jitter, not secrets. [Histogram](../../../include/Void/Math/Histogram.hpp)
|
||||
contains keyed frequency and fixed-bin structures. Fixed-size arithmetic exists in
|
||||
[Matrix](../../../include/Void/Math/Matrix.hpp) under `Void::Matrix` and
|
||||
[Vec](../../../include/Void/Math/Vec.hpp)/[Mat](../../../include/Void/Math/Mat.hpp) under
|
||||
`Void::Math`. Their distinct Mat4 names must not be silently treated as aliases.
|
||||
|
||||
[Numeric](../../../tests/standalone/Math/Numeric.cpp),
|
||||
[Random](../../../tests/standalone/Math/Random.cpp),
|
||||
[Histogram](../../../tests/standalone/Math/Histogram.cpp),
|
||||
[Matrix](../../../tests/standalone/Math/Matrix.cpp), and
|
||||
[VecMat](../../../tests/standalone/Math/VecMat.cpp) suites are current regression sources.
|
||||
Graph parsing is partial at Mat line 15 and Vec lines 13/50/91; these template declarations
|
||||
were read directly. No build or benchmark result is inferred from source inspection.
|
||||
|
||||
## Target and backend decisions
|
||||
|
||||
Keep standard-library-only, native numeric utilities below Data and application modules,
|
||||
per [C-01/C-02](../ARCHITECTURE.md). Core UUID removes its Math include; Math must not
|
||||
depend back on Data to supply numeric conversion. Functional provides optional enum-to-
|
||||
Error adapters, not a required string allocation in every arithmetic operation.
|
||||
Math imports neither Containers nor Algorithms; fixed arrays and standard-library scratch
|
||||
storage keep its scalar arithmetic below both. M-MATH-02 supplies the narrow checked-
|
||||
arithmetic prerequisite for Algorithms before Containers/Text adapters depend on it.
|
||||
Standard `from_chars`, distributions and ranges remain the default tools; overflow
|
||||
builtins are guarded optimizations over a constexpr portable reference path. No BLAS,
|
||||
Eigen, arbitrary precision or general scientific platform is introduced by this plan.
|
||||
|
||||
## NEW conversion and arithmetic APIs
|
||||
|
||||
Illustrative NEW additions in `include/Void/Math/Numeric.hpp`:
|
||||
|
||||
```cpp
|
||||
namespace Void::Numeric {
|
||||
enum class Rounding { exact, toward_zero, nearest_even };
|
||||
template<class To, class From>
|
||||
std::expected<To, Error> checked_cast(From value,
|
||||
Rounding mode = Rounding::exact) noexcept;
|
||||
template<std::integral T>
|
||||
std::expected<T, Error> parse_integer(std::string_view, int base = 10) noexcept;
|
||||
template<std::floating_point T>
|
||||
std::expected<T, Error> parse_real(std::string_view) noexcept;
|
||||
template<std::integral T>
|
||||
std::expected<T, Error> checked_mul_add(T a, T b, T c) noexcept;
|
||||
}
|
||||
```
|
||||
|
||||
Integer-to-integer conversion compares ranges by signedness without first narrowing.
|
||||
Float-to-integer first rejects NaN/infinity, then applies the named rounding policy,
|
||||
then tests against exactly representable exclusive/inclusive bounds before casting.
|
||||
Default exact rejects fractional values. Integer-to-float exact rejects a value if its
|
||||
significand cannot be represented; the implementation checks significant bits instead
|
||||
of performing an unsafe float-to-integer round trip. Float narrowing exact rejects loss
|
||||
of finite value; explicit nearest-even uses the documented floating environment policy.
|
||||
`Error` gains `Inexact` and `NonFinite` in the major release. Data converts these domain
|
||||
errors into path-aware diagnostics without changing Numeric's low-cost enum.
|
||||
|
||||
Parsing consumes precisely the supplied span and requires full token consumption.
|
||||
Integer bases are 2–36; base autodetection is a separate named policy, not default.
|
||||
No locale whitespace, leading plus, partial suffix, or nonfinite token is accepted by
|
||||
the default parser. Maximum numeric token is 256 bytes; an explicit larger bounded policy
|
||||
is separate. Grammar validation precedes conversion; there is no NUL scan beyond input.
|
||||
`checked_mul_add` is specified as sequential checked multiplication then addition, so
|
||||
an overflowing intermediate fails even if cancellation could produce a final in-range
|
||||
mathematical result. Saturating helpers use these classifications deliberately;
|
||||
wrapping arithmetic remains unsigned-only. Resource-size checked add/multiply stays
|
||||
available without a dependency on dynamic matrix or random headers.
|
||||
|
||||
## Other capability backlogs
|
||||
|
||||
Random adds injected-URBG overloads for distributions, shuffle and sampling, leaving
|
||||
thread-local convenience APIs as adapters. Seeded Xoshiro output has fixed golden vectors;
|
||||
standard-distribution output is not promised identical across standard-library vendors.
|
||||
Defaults cap sample output at 1,048,576 elements and scratch at 16 MiB. Reject `k > n`.
|
||||
Use Floyd sampling for sparse `k` (O(k) memory), and partial Fisher–Yates for dense samples
|
||||
only within the scratch cap; the selection threshold is `k <= n/8`, frozen with tests.
|
||||
No unrequested entropy acquisition occurs when a generator is supplied.
|
||||
|
||||
Histogram adds bounded merge, count-overflow errors and deterministic tie-breaking.
|
||||
Keyed defaults cap at 65,536 distinct keys; fixed bins default to 1,024 with maximum
|
||||
65,536, finite ordered endpoints and explicit underflow/overflow counters. NaN is
|
||||
rejected. Quantiles from fixed bins are approximate intervals, not invented exact
|
||||
percentiles; Time's exact benchmark samples do not reuse approximate results unnoticed.
|
||||
|
||||
Matrix work retains stack storage for fixed sizes, adds checked normalization/inversion
|
||||
with singular/nonfinite diagnostics, and documents row-major layout and transformation
|
||||
conventions. Select `Void::Matrix::Matrix<T,R,C>` as the shared arithmetic kernel while
|
||||
keeping Vec named-field value types and `Void::Math::Mat4` facades. Conversion is explicit
|
||||
until a major-version ABI change; no reinterpret-cast view assumes matching layouts.
|
||||
No heap-sized dynamic matrix is included. Generic integer matrix operations get checked
|
||||
variants rather than promising undefined signed overflow is acceptable.
|
||||
|
||||
## Task DAG
|
||||
|
||||
| Task | Phase; dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-MATH-01 | P0; current source | Capture existing numeric, generator and matrix fixtures and namespace/layout contracts; identify builtins and unsupported conversion edges. | sol_implementer |
|
||||
| M-MATH-02 | P1; M-MATH-01 | Implement span-safe parsers, checked_cast and portable overflow fallback; signed/unsigned and float boundaries pass without undefined behavior. | astra_implementer |
|
||||
| M-MATH-03 | P2; M-MATH-02 | Add injected RNGs and bounded sampling; k=0/k=n/k>n, huge n with small k and seeded generator vectors pass within scratch limits. | sol_implementer |
|
||||
| M-MATH-04 | P2; M-MATH-02 | Complete bounded histograms and merge semantics; count overflow leaves prior histogram intact and approximate outputs carry bounds. | sol_implementer |
|
||||
| M-MATH-05 | P2; M-MATH-02 | Consolidate matrix arithmetic kernel with explicit facade conversion; singular/zero-vector, row-major and integer-overflow tests pass. | sol_implementer |
|
||||
| M-MATH-06 | P3; M-MATH-03–05 | Benchmark targeted kernels, publish compatibility adapters and isolated installed consumers; optional vectorization is admitted only after scalar differential tests. | sol_implementer |
|
||||
|
||||
## Limits, verification and migration
|
||||
|
||||
All operations are synchronous and caller-owned; no queue, cancellation thread or shutdown
|
||||
service exists. Batch sampling/merging receives a stop token only in explicit long-running
|
||||
overloads, checked at bounded chunks, returning no partially published output. Matrix
|
||||
template extents are compile-time; recommended instantiated extents are at most 16×16
|
||||
until compiler/build-cost evidence supports larger values. This is a supported profile,
|
||||
not a claim that all larger templates cannot compile.
|
||||
|
||||
CURRENT tests are the linked suites; no new execution was performed. PROPOSED validation
|
||||
uses property tests against wide/reference arithmetic, bounded substrings adjacent to
|
||||
guard pages, all small integer widths, INT64_MIN/UINT64_MAX, 2^53±1, fractional edges,
|
||||
NaN/infinities, subnormals and negative zero. Differential RNG tests check range and
|
||||
deterministic engine vectors; statistical smoke tests do not establish cryptographic
|
||||
quality. Matrix residual tests use stated tolerance and scale, not exact floating equality.
|
||||
|
||||
Follow [PERFORMANCE](../PERFORMANCE.md) for scalar/batch parse throughput, conversion
|
||||
p50/p95/p99, sample allocations/RSS/CPU and header/template build cost. Separate entropy,
|
||||
engine and distribution costs. [VALIDATION](../VALIDATION.md) and
|
||||
[BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md) own future commands/toolchains.
|
||||
|
||||
[Migration](../MIGRATION.md) deprecates unsafe `long long` narrowing wrappers and preserves
|
||||
legacy parsing only through named adapters. Exact Data integer conversion is gated on
|
||||
M-MATH-02 and does not change StrictJson. Old Mat4 storage/ABI remains until a major break;
|
||||
rollback selects the old package with no persisted numeric conversion. Consumers must
|
||||
not persist native object representations as wire formats; [Binary](Binary.md) owns those.
|
||||
See [requirements](../REQUIREMENTS.md), [dependencies](../DEPENDENCIES.md),
|
||||
[delivery](../DELIVERY.md) and [Data](Data.md).
|
||||
@@ -0,0 +1,179 @@
|
||||
# Net implementation plan
|
||||
|
||||
Status: planning only. All feature tasks below are PLANNED. Source baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-002–R-006, R-009–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-06, C-11, C-13.
|
||||
|
||||
## Existing capability and evidence
|
||||
|
||||
The public namespace is `Void::Net`. [Http.hpp](../../../include/Void/Net/Http.hpp)
|
||||
exposes synchronous `HttpClient`, owning request/response strings, HTTP and SOCKS5 proxy
|
||||
configuration, a 30-second request timeout, opt-in redirects, and a 64 MiB body limit.
|
||||
Zero currently means unlimited. Non-2xx responses are successful transport results.
|
||||
[Http.cpp](../../../src/Net/Http.cpp) constructs an Asio context and socket per hop;
|
||||
there is no connection pool. Its watchdog starts after resolution/connect, and each
|
||||
redirect restarts the phase budget. Certificate checking defaults off; enabling it
|
||||
sets peer verification but the inspected handshake only sets SNI, not expected-host
|
||||
verification. Redirects retain the original method, body, and headers.
|
||||
|
||||
[Server.hpp](../../../include/Void/Net/Server.hpp) and
|
||||
[Server.cpp](../../../src/Net/Server.cpp) provide `Router`, `StaticFileResolver`, and
|
||||
`WebSocketSessions`. Routing snapshots a handler before invoking it outside the lock;
|
||||
the session registry also invokes callbacks/close outside its lock. These are useful
|
||||
transport-neutral components, not an HTTP listener or a WebSocket framing engine.
|
||||
Static resolution rejects traversal and canonical symlink escapes but returns a path;
|
||||
opening that path later needs protection against filesystem replacement races.
|
||||
[Socket.hpp](../../../include/Void/Net/Socket.hpp) and
|
||||
[Socket.cpp](../../../src/Net/Socket.cpp) implement connected blocking UDP on POSIX;
|
||||
Windows operations report unsupported. `wait_readable` uses poll.
|
||||
[Url.hpp](../../../include/Void/Net/Url.hpp) / [Url.cpp](../../../src/Net/Url.cpp)
|
||||
use Boost.URL and accept URI references as well as absolute URIs.
|
||||
|
||||
[module.cmake](../../../src/Net/module.cmake) declares Functional, Text, Boost
|
||||
headers/Beast/Asio/URL, OpenSSL, and Threads. Existing tests cover loopback GET/POST,
|
||||
invalid URL/refusal and a stalled response in
|
||||
[HttpClient.cpp](../../../tests/standalone/Net/HttpClient.cpp); router/static/session
|
||||
helpers in [Server.cpp](../../../tests/standalone/Net/Server.cpp); parsing in
|
||||
[Url.cpp](../../../tests/standalone/Net/Url.cpp); and closed/moved UDP state in
|
||||
[Socket.cpp](../../../tests/standalone/Net/Socket.cpp). They do not establish TLS,
|
||||
proxy, real server, WebSocket wire, or sustained reuse conformance.
|
||||
|
||||
Graph coverage was checked for all these files: Http.hpp lines 112/115 and Server.hpp
|
||||
207/211/214 have parse gaps and were read directly. Other paths reported matching
|
||||
metadata with no recorded issue; graph edges are advisory, source is authoritative.
|
||||
|
||||
## Target interfaces and backend ownership
|
||||
|
||||
NEW illustrative APIs below are not compiling examples. `OperationOptions` and `Task`
|
||||
refer to [Async](Async.md)'s C-03 types; byte streams and descriptor lifetime belong to
|
||||
[IO](../subsystems/IO.md). Net owns protocol state, endpoint resolution policy, TLS
|
||||
contexts, parsers, pools, and listener/session policy. No constructor starts workers.
|
||||
|
||||
```cpp
|
||||
// NEW shapes in Void::Net; Result is C-02 shorthand.
|
||||
struct ClientPolicy { TlsPolicy tls; RedirectPolicy redirects; PoolLimits pool; };
|
||||
class Client {
|
||||
Task<Result<StreamingResponse>> send(StreamingRequest, OperationOptions);
|
||||
Task<Result<void>> shutdown(OperationOptions);
|
||||
};
|
||||
class HttpServer {
|
||||
static Result<HttpServer> create(IOContext&, ServerPolicy, Handler);
|
||||
Task<Result<BoundEndpoint>> listen(Endpoint, OperationOptions);
|
||||
Task<Result<void>> shutdown(OperationOptions);
|
||||
};
|
||||
// StreamingResponse owns its connection lease until consumed or cancelled.
|
||||
// Handler receives headers plus a bounded body reader and returns a body producer.
|
||||
```
|
||||
|
||||
Choose native incremental HTTP/1.1 and WebSocket codecs over native IO; retain a
|
||||
separately selectable Boost migration adapter until wire conformance gates pass.
|
||||
Keep OpenSSL as the TLS backend; do not implement cryptographic primitives. Initial
|
||||
Linux IO is level-triggered epoll, owned by IO, with bounded work per readiness turn
|
||||
to avoid monopolizing the executor. Readiness is not a whole-message completion.
|
||||
See [epoll semantics](https://man7.org/linux/man-pages/man7/epoll.7.html).
|
||||
Native URL parsing must preserve encoded components and implement RFC reference
|
||||
resolution before replacing Boost.URL. HTTP/2, QUIC, compression, and proxy servers
|
||||
are later named capabilities, not claims of the first release.
|
||||
|
||||
## Protocol and operation rules
|
||||
|
||||
1. Admit against byte/operation budgets; validate absolute http/https destinations,
|
||||
authority, numeric ports, header syntax, and explicit proxy credential lengths.
|
||||
URI references remain a separate parsing API; they cannot silently become a host.
|
||||
2. Establish one absolute steady deadline at admission. DNS, capacity waiting,
|
||||
address attempts, connect, proxy negotiation, TLS, redirects and body transfer
|
||||
consume it. Resolver workers retain owned inputs after caller cancellation;
|
||||
late results are discarded and accounted until worker completion.
|
||||
3. Verify trusted chain and DNS/IP peer identity by default; SNI alone is inadequate.
|
||||
TLS minimum is 1.2, allow 1.3 through backend negotiation. Trust stores are explicit
|
||||
immutable configuration snapshots. Insecure test policy must be conspicuously
|
||||
named and opt-in. Follow the separate verification and identity setup in the
|
||||
[OpenSSL 3.5 client guide](https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/).
|
||||
4. Parse HTTP framing incrementally: reject conflicting Content-Length values and
|
||||
Transfer-Encoding/Content-Length ambiguity, enforce CRLF and header limits, handle
|
||||
informational responses, HEAD/no-body statuses, chunk extensions/trailers and
|
||||
close-delimited bodies. Never reuse a connection with uncertain message boundaries.
|
||||
Protocol conformance fixtures must cover RFC 9110/9112 before native promotion.
|
||||
5. Default redirects remain disabled; enabling follows only 301/302/303/307/308, up to
|
||||
five hops. 303 changes non-HEAD to GET and drops body/body headers; 301/302 preserve
|
||||
method and require explicit replay permission for non-safe methods; 307/308 preserve
|
||||
method and require a replayable body. Reject HTTPS downgrade by default. Resolve
|
||||
relative references correctly; compare scheme/host/effective port. On origin change,
|
||||
strip Authorization, Cookie and caller-declared sensitive headers; always rebuild
|
||||
Host and keep Proxy-Authorization confined to its proxy hop. No implicit cookie jar.
|
||||
6. Pool by origin, proxy identity and TLS/trust-policy generation. HTTP/1.1 initially
|
||||
allows one exchange per connection, no pipelining. Return a lease only after body
|
||||
and trailers finish; abandon/cancel closes it. No automatic replay after bytes may
|
||||
have reached a peer. Upper layers supply idempotency policy.
|
||||
7. Server accept → TLS → bounded headers/body → dispatch → streamed response → reuse.
|
||||
Handler errors map through a configurable sanitized error mapper; no route is 404,
|
||||
known path with wrong method is 405 with Allow. Disable further admission on stop,
|
||||
drain admitted requests, then cancel/join connections. Static serving opens beneath
|
||||
a retained directory handle through IO/System capability checks, not a stale pathname.
|
||||
8. WebSocket upgrade validates version/key/Connection/Upgrade, origin policy and selected
|
||||
subprotocol. Enforce client masking, server non-masking, fragmentation/control-frame
|
||||
rules, UTF-8 text and close reasons, ping/pong and one close handshake. Disable
|
||||
extensions initially. Frame callbacks borrow payload only during invocation; retained
|
||||
payloads require owned copies. RFC 6455 fixtures and an independent peer are gates.
|
||||
|
||||
## Bounds and failure matrix
|
||||
|
||||
NEW defaults: 256 total client connections, 8/origin, 128 idle, 30-second idle eviction;
|
||||
1,024 admitted client operations; 4,096 server connections and 256 executing handlers.
|
||||
Headers: 32 KiB aggregate/100 fields/8 KiB start line. Buffered bodies: 8 MiB; streaming
|
||||
uses 64 KiB chunks, 256 KiB per-direction windows and a 256 MiB module buffer budget.
|
||||
WebSocket messages: 1 MiB, output: 64 messages or 4 MiB/session; either bound rejects
|
||||
admission. Limits include in-flight buffers. Body streaming has an explicit optional
|
||||
total-byte quota; there is no accidental zero-as-unlimited. Server headers expire at
|
||||
10 seconds, idle at 30 seconds, admitted request at 30 seconds by default; a public
|
||||
long-lived stream must opt into its own liveness policy. Shutdown grace: 10 seconds.
|
||||
|
||||
| Trigger | Terminal behavior and cleanup | Required evidence |
|
||||
| --- | --- | --- |
|
||||
| DNS/connect/proxy/TLS timeout | Timeout with phase; one completion; close/retire state | Stall every phase under one deadline |
|
||||
| Unknown CA / wrong hostname | Peer verification error before request bytes | Separate fixtures for trust and identity |
|
||||
| Body/header limit or malformed framing | Protocol/limit error; connection unusable | Split bytes at every boundary; smuggling corpus |
|
||||
| Capacity exhaustion | Overload before allocation; optional cancellable capacity wait | Queue plus in-flight accounting |
|
||||
| Cancellation mid-upload | Cancelled/unknown remote effect; close lease, retain buffers until IO ends | Stop/completion races, no replay |
|
||||
| Slow consumer / WebSocket output full | Await explicit capacity or return overload; bounded memory | Slow-reader soak with max RSS |
|
||||
| Handler throws or stream fails | Sanitized 500 before headers, otherwise terminate connection | Faulting handlers outside locks |
|
||||
| Shutdown with peer stalled | Stop admission, grace then cancel/join; no callbacks after join | Destruction and descriptor-reuse races |
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
Every row is PLANNED; dependencies refer to completed evidence gates, not file existence.
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-NET-01 | P0; baseline | Freeze current client/router/URL fixtures and secure-behavior gaps; installed Net-only consumer records actual dependencies | sol_implementer |
|
||||
| M-NET-02 | P1; M-NET-01, IO/Async/Time contracts | NEW context, resolver, socket/listener and deadline adapters; every phase cancellable without borrowed-state escape | astra_implementer |
|
||||
| M-NET-03 | P2; M-NET-02 | OpenSSL peer+identity defaults, proxy validation, redirect algorithm; trust/hostname/cross-origin matrix passes on Boost adapter first | astra_implementer |
|
||||
| M-NET-04 | P2; M-NET-03 | Native HTTP codec, real HTTP/HTTPS server, streaming, pool and safe static open; RFC corpus, fuzzing, independent peers pass | astra_implementer |
|
||||
| M-NET-05 | P2; M-NET-04 | Native WebSocket client/server and session lifecycle; fragmented/control/close/UTF-8 conformance and shutdown races pass | sol_implementer |
|
||||
| M-NET-06 | P3; M-NET-05 | Backend parity and performance gate; keep Boost selectable until migration consumer and workload evidence permit default switch | astra_implementer |
|
||||
| M-NET-07 | P4; M-NET-06, RPC/Messaging gates | Distributed transport stress, reconnect and bounded streaming workloads; no safety claims inferred from availability alone | sol_implementer |
|
||||
|
||||
## Validation, compatibility and rollback
|
||||
|
||||
CURRENT checks are existing `VoidTests` and `VoidInstalledComponentConsumers` registered
|
||||
in [tests/CMakeLists.txt](../../../tests/CMakeLists.txt). They were not rerun for this
|
||||
documentation task. Current source fixtures are evidence of coverage intent, not new
|
||||
passing results. PROPOSED checks add deterministic resolver/clock fault injection,
|
||||
TLS/proxy loopback peers, parser fuzz targets and independent HTTP/WebSocket clients;
|
||||
targets must be added before commands are advertised. Use [VALIDATION](../VALIDATION.md)
|
||||
and [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md) for the actual build gate.
|
||||
|
||||
Measure small reused requests, connection churn, large streaming downloads, many idle
|
||||
WebSockets and slow consumers: p50/p95/p99, throughput, allocations, peak RSS/CPU, file
|
||||
descriptors, handshake counts and build cost under [PERFORMANCE](../PERFORMANCE.md).
|
||||
Separate cold DNS/TLS from warm pool results and Boost from native.
|
||||
|
||||
Major-release migration replaces unsafe defaults and whole-body APIs with secure
|
||||
configuration and streaming, with an owning buffered convenience adapter. Existing
|
||||
`HttpClient` remains documented during transition; a synchronous wrapper cannot block
|
||||
the executor needed for its completion. Keep non-2xx transport-result semantics. Pools
|
||||
must be recreated when trust/proxy identity changes. Roll back backend selection only
|
||||
between operations; never replay an uncertain write on the old backend. See
|
||||
[MIGRATION](../MIGRATION.md), [RPC](../subsystems/RPC.md),
|
||||
[Security](Security.md), and [NetworkedApplications](../platforms/NetworkedApplications.md).
|
||||
@@ -0,0 +1,199 @@
|
||||
# Plugin generations, stable C ABI and reload protocol plan
|
||||
|
||||
Status: PLANNED feature work; no new ABI is delivered. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Requirements R-004, R-009, R-010 and R-013–R-016 apply. Preserve
|
||||
[architecture](../ARCHITECTURE.md) C-03–C-05, C-09, C-10 and C-13.
|
||||
|
||||
## Existing source baseline and compatibility classes
|
||||
|
||||
[Plugin.hpp](../../../include/Void/Plugin/Plugin.hpp) defines `Void::Plugin::IPlugin`,
|
||||
`PluginInfo`, `ABI_VERSION == 1`, C-linkage create/destroy/info symbols and optional
|
||||
configuration/readiness/state-transfer exports. The serialized-state protocol carries
|
||||
a state schema version and plugin-owned string release. Existing factory output is
|
||||
still an IPlugin C++ object; its vtable, RTTI and callbacks require compatible toolchains.
|
||||
The source's v2 state protocol is not a new general stable C ABI version.
|
||||
|
||||
[Loader.hpp](../../../include/Void/Plugin/Loader.hpp) owns one instance and is not
|
||||
thread-safe. [Manager.hpp](../../../include/Void/Plugin/Manager.hpp) exposes pinned
|
||||
`PluginHandle`, acquire/load/unload/reload/replace, validators, watching, observers and
|
||||
state snapshots. [Manager.cpp](../../../src/Plugin/Manager.cpp) stages a fresh inode,
|
||||
configures/restores/activates/checks readiness before atomic current-instance publication.
|
||||
Acquisition also takes the registry mutex; do not infer a completely lock-free path
|
||||
from the header's atomic-load description. Reload observers run after unlocking, but
|
||||
candidate validation and plugin activation currently occur inside reload's map lock.
|
||||
`dlclose_on_swap` defaults false to keep code mapped when arbitrary frames/callbacks
|
||||
may survive; a new protocol must prove async quiescence before changing that default.
|
||||
|
||||
[Module.hpp](../../../include/Void/Plugin/Module.hpp) already supplies C++
|
||||
`ModuleDescriptor`, `ModuleDependency`, `ActivationPolicy`, `ModuleHost`, `IModule`,
|
||||
`ModuleReadiness`, activate/quiesce/checkpoint/restore/readiness/deactivate. The descriptor
|
||||
contains STL, Json, Semver and unique_ptr factory types: it is explicitly a C++ descriptor.
|
||||
Its default methods are not proof that a coordinated reload host exists.
|
||||
[module.cmake](../../../src/Plugin/module.cmake) declares Functional/System/Data and
|
||||
Unix dl; target declaration versus public descriptor includes needs isolated-consumer
|
||||
validation under the shared dependency plan.
|
||||
|
||||
[Manager tests](../../../tests/standalone/Plugin/Manager.cpp),
|
||||
[load-under-reload test](../../../tests/standalone/Plugin/HotReloadUnderLoad.cpp),
|
||||
[configuration tests](../../../tests/standalone/Plugin/Configure.cpp), and
|
||||
[module descriptor test](../../../tests/standalone/Plugin/Module.cpp) are existing
|
||||
fixtures, not evidence of a stable C-only boundary or async pin protocol. Scoped graph
|
||||
coverage was checked; Manager declarations/test helper ranges were directly read.
|
||||
|
||||
The initial loader remains native platform dynamic loading (`dlopen` on Linux), with
|
||||
Void-owned descriptors and lifecycle; no external plugin framework is introduced.
|
||||
Portability adapters must satisfy the same pin/release conformance before enabling unload.
|
||||
|
||||
## NEW stable C boundary
|
||||
|
||||
NEW proposed path: `include/Void/Plugin/CAbi.h`; use a separately named export
|
||||
`void_module_query_v1`. Do not change the layout or reinterpret the meaning of
|
||||
`void_plugin_info`, existing ModuleDescriptor or the frozen [ShortUrl V1](../../short-url.md).
|
||||
The following is an illustrative C header shape, not an available ABI:
|
||||
|
||||
```c
|
||||
typedef struct void_module_handle void_module_handle;
|
||||
typedef struct void_operation_handle void_operation_handle;
|
||||
typedef struct { const uint8_t *data; uint64_t size; } void_bytes_v1;
|
||||
typedef struct {
|
||||
uint32_t struct_size;
|
||||
uint32_t abi_major;
|
||||
uint32_t abi_minor;
|
||||
uint32_t reserved;
|
||||
uint64_t capabilities;
|
||||
int32_t (*create)(const void *host_api, void_module_handle **out);
|
||||
int32_t (*activate)(void_module_handle *, void_bytes_v1 config);
|
||||
int32_t (*readiness)(void_module_handle *, uint32_t *out_ready);
|
||||
int32_t (*request_stop)(void_module_handle *);
|
||||
int32_t (*destroy)(void_module_handle *);
|
||||
} void_module_api_v1;
|
||||
/* int32_t void_module_query_v1(uint32_t host_size, void_module_api_v1 *out); */
|
||||
```
|
||||
|
||||
Complete this table with versioned quiesce/resume, checkpoint/restore, interface
|
||||
query/release and async-operation functions in M-PLUGIN-03 before freezing ABI V1.
|
||||
Tail capabilities use size-checked extension tables; reject unknown major, truncated
|
||||
required prefix and required capability mismatch. Copy descriptor metadata into host
|
||||
ownership while the generation is pinned. Reserved fields are zero; lengths are checked
|
||||
before conversion to size_t. Interface identifiers are fixed 128-bit byte values with
|
||||
independent interface major/minor and a function-table size; they are not typeid hashes.
|
||||
|
||||
All boundary functions use fixed-width status codes and explicit error detail access
|
||||
with owner-specific release. No exceptions, STL, reflection objects, standard-library
|
||||
stop tokens or C++ allocation cross the C boundary. C++ adapters catch exceptions and
|
||||
map operational failure; unknown exceptions become `internal_error` without unwinding
|
||||
through C. The host passes a versioned host function table instead of an untyped payload
|
||||
in the final header; the void pointer above stands for that separately sized table.
|
||||
|
||||
Input byte spans borrow only for the call. Checkpoint output is an opaque plugin-owned
|
||||
buffer with `data/size/release`; the host copies within its cap before releasing through
|
||||
the plugin. No allocator mismatch. Async submission copies required descriptors and
|
||||
returns an opaque operation handle plus exactly one terminal callback. Host cancellation
|
||||
maps its Async OperationOptions into explicit C request-stop/deadline fields relative
|
||||
to the negotiated host monotonic clock; it never copies std::stop_token into C memory.
|
||||
Release of an operation handle requires terminal acknowledgement and callback return.
|
||||
The final ABI conformance specification defines callback thread/reentrancy and null-output
|
||||
rules for every status; output handles are null on failed admission.
|
||||
|
||||
## Generation pins and unload invariants
|
||||
|
||||
Each loaded generation owns its mapping, instance, host registrations, service records,
|
||||
subscriptions and an Async scope. Two independent counts matter: external generation
|
||||
references (handles/function-table leases) and admitted async activities. Every callback,
|
||||
coroutine frame, deferred destructor and operation allocated by a plugin retains an
|
||||
activity pin until it and its terminal callback have returned. Capturing a raw plugin
|
||||
function pointer in a host queue without a pin is forbidden by the adapter contract.
|
||||
|
||||
Retirement stops new generation admission, asks its scope/subscriptions to stop, joins
|
||||
operations, releases provider references, calls deactivate/destroy once, then unmaps
|
||||
only after no code/data reference remains. Host-side reclamation executes after a
|
||||
plugin callback returns; never dlclose from the final callback's stack. Plugin-supplied
|
||||
threads must register activity pins and join during quiescence. Native code is trusted
|
||||
in-process code; it cannot be forcefully sandboxed by this ABI. Uncooperative code stays
|
||||
mapped and is reported as pinned; optional process isolation belongs to [IPC](../subsystems/IPC.md).
|
||||
|
||||
Default: 64 modules, 256 interfaces/module, four retained generations/module, 64 MiB
|
||||
retained mapped-image budget/module based on file accounting, 4 MiB checkpoint,
|
||||
1 MiB configuration, 1,024 async activities/generation and 256 pending callbacks.
|
||||
Mapped-image accounting is not an exact RSS measurement. Refuse further reload when
|
||||
retention budget cannot accommodate old + candidate; never unmap to recover the budget.
|
||||
Defaults for prepare/quiesce/readiness are 5/5/10 seconds within a 30-second total
|
||||
reload deadline. Every phase shares Async's absolute total deadline and injected Time
|
||||
clock; phase budgets can shorten it, never restart it.
|
||||
|
||||
## Reload state machine and rollback
|
||||
|
||||
Per-module transitions are serialized by a reload coordinator, outside the manager map
|
||||
lock. The short lock reserves a generation/expected epoch; expensive filesystem work,
|
||||
all validators, plugin code and release/destructor callbacks run after unlocking.
|
||||
Publication rechecks the epoch. Dependency reload batches topologically order modules;
|
||||
cycles or unsupported mixed activation policies fail before activating anything.
|
||||
|
||||
1. Verify immutable candidate identity/path, ABI and declared dependencies. Create and
|
||||
configure a private candidate using a scoped unpublished Service registry. Activation
|
||||
may prepare resources, but externally visible writes/registration are prohibited
|
||||
until publication. A module unable to stage safely is RestartRequired.
|
||||
2. For a stateless compatible replacement, candidate readiness can overlap old calls.
|
||||
For stateful writers, close old mutation admission and call quiesce: complete all
|
||||
admitted mutations and owned async writes, then checkpoint at Fsm/application state
|
||||
boundaries. Old acquired handles remain valid but new mutation attempts receive
|
||||
`quiescing`; they never run on freed objects. Reads can continue only if declared safe.
|
||||
3. Restore the bounded versioned checkpoint into the candidate, activate deferred parts,
|
||||
and await readiness without registry locks. The adapter requires an explicit resume
|
||||
operation for the old generation; existing IModule's no-op quiesce alone is insufficient.
|
||||
State migration is pure candidate construction; no destructive migration of the old
|
||||
persistent state is permitted during a reversible reload.
|
||||
4. Publish one Service-owned registry snapshot containing candidate interfaces and
|
||||
generation metadata. Host `acquire` and service lookup use that same publication epoch,
|
||||
avoiding inconsistent manager-current versus service-current swaps. Standalone legacy
|
||||
PluginManager keeps its existing local publication until explicitly adapted.
|
||||
5. Retire the old generation and drain pins. Before publication, any failure disposes
|
||||
candidate registrations/activities and resumes old mutation admission after validating
|
||||
its state. Resume failure yields degraded/not-ready status and requests a controlled
|
||||
restart; it never falsely reports the old service healthy. Failed-candidate cleanup
|
||||
errors retain its mapping and are reported separately from the original rejection.
|
||||
|
||||
Publication is a reversible in-memory switch only while old state remains a valid
|
||||
continuation. After new writes, reverting requires a compatible reverse migration or
|
||||
recovery from authoritative persistent state; do not silently discard them. Durable
|
||||
release activation follows Update's healthy marker, as detailed in
|
||||
[ReloadableApplications](../platforms/ReloadableApplications.md).
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
All feature rows are PLANNED.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-PLUGIN-01 | P0 / baseline | Inventory existing exports, descriptor includes, load/reload locks and compatibility fixtures | Existing C++ ABI/state protocol and frozen ShortUrl V1 documented independently / sol_implementer |
|
||||
| M-PLUGIN-02 | P1 / M-PLUGIN-01; M-ASYNC-03 | Explicit generation/activity leases and host-owned retirement queue | Callback/operation/frame held through replacement prevents unmap; late completion releases once / astra_implementer |
|
||||
| M-PLUGIN-03 | P2 / M-PLUGIN-02; Functional errors | Full CAbi.h specification, size/version negotiation, byte ownership, host clock/cancellation bridge and C++ adapter | C-only producer/consumer fixture, truncation/unknown-major rejection, throwing C++ shim contained / astra_implementer |
|
||||
| M-PLUGIN-04 | P2 / M-PLUGIN-03; M-SERVICE-03 | Unlocked staged validation, dependency activation and coherent registry publication | Reentrant validator does not deadlock; failed candidate changes no active lookup / astra_implementer |
|
||||
| M-PLUGIN-05 | P3 / M-PLUGIN-04; M-FSM-04 | Quiesce/checkpoint/restore/readiness/resume protocol with phase/total budgets | Outstanding writer drained; every prepublication phase failure resumes old state or reports degraded / astra_implementer |
|
||||
| M-PLUGIN-06 | P3 / M-PLUGIN-05; Update activation gate | Retention accounting, safe unload capability, reloadable-host integration and migration kit | Stuck pins refuse new reload; post-commit cleanup never triggers invalid rollback / astra_implementer |
|
||||
|
||||
## Validation and migration
|
||||
|
||||
CURRENT aggregate command is
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun here. PROPOSED tests need the NEW ABI and host adapters: C compiler headers,
|
||||
different supported compiler producer/consumer matrix, layout/size checks, hostile length
|
||||
fields, missing release, cancelled async callback after generation retirement, queued
|
||||
std::function/frame pins, failed quiesce/restore/readiness/resume, reentrant observers,
|
||||
rapid replacement epoch conflict, and immutable-path replacement under sustained calls.
|
||||
Compile compatibility claims only for observed matrix entries. Native malicious code
|
||||
is outside the in-process fault model; do not fuzz arbitrary plugins in the host process.
|
||||
|
||||
Measure acquire/reload/quiescence p50/p95/p99, call throughput, allocations, retained
|
||||
generation count, image bytes, peak RSS/CPU and adapter build cost under
|
||||
[PERFORMANCE](../PERFORMANCE.md). No measured reload downtime is claimed.
|
||||
|
||||
Keep current IPlugin/ModuleDescriptor APIs as same-toolchain adapters. A stable C module
|
||||
opts into the new query symbol and tables; existing symbols do not silently change.
|
||||
Existing `PluginHandle::raw_symbol` remains valid only while its handle lives; replace
|
||||
manager-wide borrowed-symbol usage with a pinned lease. Default dlclose stays disabled
|
||||
until activity-pin conformance passes. Rollback can select the legacy manager for
|
||||
legacy plugins before loading; it cannot replay external effects or free stuck code.
|
||||
See [MIGRATION](../MIGRATION.md), [VALIDATION](../VALIDATION.md),
|
||||
[DEPENDENCIES](../DEPENDENCIES.md), and [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
@@ -0,0 +1,129 @@
|
||||
# Resilience implementation plan
|
||||
|
||||
Status: planning only; all feature tasks PLANNED. Source baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Applies [requirements](../REQUIREMENTS.md) R-005, R-009, R-012, R-014–R-016 and
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-05, C-11, C-13.
|
||||
|
||||
## Current primitives and gaps
|
||||
|
||||
`Void::Resilience` is a native header implementation with no declared module
|
||||
dependencies in [module.cmake](../../../src/Resilience/module.cmake).
|
||||
[Resilience.hpp](../../../include/Void/Resilience/Resilience.hpp) gathers
|
||||
[TokenBucket](../../../include/Void/Resilience/RateLimiter.hpp),
|
||||
[KeyedRateLimiter](../../../include/Void/Resilience/KeyedRateLimiter.hpp),
|
||||
[CircuitBreaker](../../../include/Void/Resilience/CircuitBreaker.hpp), and
|
||||
[ResourceMonitor](../../../include/Void/Resilience/ResourceMonitor.hpp).
|
||||
Injected steady-clock functions already support deterministic tests. Keyed buckets can
|
||||
be capped but default to historical unbounded `max_keys == 0`; cleanup scans the map.
|
||||
ResourceMonitor invokes threshold callbacks outside its mutex and clamps over-release.
|
||||
|
||||
Important implementation gaps: `CircuitBreaker::allow()` admits all callers after
|
||||
transitioning to HalfOpen; its comment about one probe is not enforced by a lease.
|
||||
Late outcomes are not associated with a breaker generation. Token costs/configuration
|
||||
are not validated for negatives/NaN. ResourceMonitor compares `usage_ + amount`, which
|
||||
needs overflow-safe subtraction, and callback setters need synchronized publication.
|
||||
These are proposed repairs, not claims that the current tests expose every issue.
|
||||
Existing [breaker tests](../../../tests/standalone/Resilience/CircuitBreaker.cpp),
|
||||
[bucket tests](../../../tests/standalone/Resilience/RateLimiter.cpp),
|
||||
[keyed tests](../../../tests/standalone/Resilience/KeyedRateLimiter.cpp), and
|
||||
[monitor tests](../../../tests/standalone/Resilience/ResourceMonitor.cpp) exercise
|
||||
transitions, refill, cap/cleanup and hysteresis. Scoped graph coverage reported matching
|
||||
metadata/no recorded gaps for these paths; implementation and test source were inspected.
|
||||
|
||||
## Native policy model and NEW APIs
|
||||
|
||||
Keep synchronous admission primitives standard-library-only, with no scheduler or logging
|
||||
dependency. Put cancellable waits/composition in an optional Async adapter; retries reuse
|
||||
Functional's policy owner rather than creating a second retry engine. Metrics flow through
|
||||
optional [Observability](../subsystems/Observability.md) hooks outside locks.
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::Resilience shapes; Result follows C-02.
|
||||
struct BucketConfig { double capacity{100}; double refill_per_second{100}; };
|
||||
struct Admission { bool allowed; std::chrono::nanoseconds retry_after; };
|
||||
class Permit { // move-only; exactly one outcome; release on destruction
|
||||
void finish(Outcome); // success, dependency_failure, neutral
|
||||
};
|
||||
class Breaker {
|
||||
Result<Permit> acquire(); // refusal is CircuitOpen, never an empty success
|
||||
};
|
||||
class Bulkhead {
|
||||
Result<Permit> try_acquire(); // limits active plus admitted waiting work
|
||||
};
|
||||
// Async adapter uses Async-owned OperationOptions and Time-owned Clock.
|
||||
```
|
||||
|
||||
Select consecutive-failure breaker initially: five failures opens; 5-second cooldown;
|
||||
one simultaneous HalfOpen permit; two sequential successful probes close. A permit
|
||||
captures generation and probe identity. Old-generation completions release resources
|
||||
but cannot close a newer Open state. Abandoning a probe is neutral and releases its
|
||||
slot; it does not leave the breaker permanently HalfOpen. Timeout counts only when
|
||||
classified as dependency failure; local overload/caller stop/auth rejection are neutral.
|
||||
Callbacks run outside locks and do not change the recorded outcome on observer failure.
|
||||
|
||||
Token refill uses `max(last, now)` so a clock moving backwards cannot cause later double
|
||||
credit. Validate finite positive capacity/cost, finite nonnegative refill and cost ≤
|
||||
capacity. Zero refill is a finite non-refilling bucket, not an unlimited rate. Costs
|
||||
use checked arithmetic; a failed multi-limit admission rolls back every reservation.
|
||||
NEW keyed defaults: 10,000 keys, maximum encoded key 256 bytes, 5-minute idle retention;
|
||||
cleanup processes at most 256 entries/turn using a maintained cursor. At cap reject new
|
||||
keys; do not evict an active client's bucket and reset its quota. Keys must be normalized
|
||||
by the caller and must not become raw high-cardinality metrics labels.
|
||||
|
||||
Composition order: deadline/stop check → rate admission → bulkhead → breaker permit →
|
||||
one attempt → classify outcome → release permits → retry policy decides next attempt.
|
||||
A retry re-enters limits and shares the original total deadline. Default adapter: three
|
||||
attempts total, full jitter with 100 ms base and 2-second cap, only explicitly retryable
|
||||
and replay-safe work. No retry of an unknown write without identity/dedup support.
|
||||
No queue is created by `try_acquire`; asynchronous waiting is explicit FIFO admission.
|
||||
Default bulkhead is 64 active and 128 waiting; expired waiters are removed before admission.
|
||||
|
||||
## Ownership, limits and failures
|
||||
|
||||
Permits own their reservation until finish/destruction; the limiter state is retained
|
||||
until the last permit returns. Closing stops admission, cancels waiters, and joins owned
|
||||
adapter tasks without destroying in-use state. Observers cannot borrow a dead limiter.
|
||||
Resource budgets count queue, executing attempts and delayed retries separately; default
|
||||
aggregate adapter retention is 8 MiB. Monitoring uses `amount > limit - usage` after
|
||||
invariant checks. New strict permits reject over-release; legacy clamping remains an
|
||||
adapter behavior. Default hysteresis remains high 90%, low 70%, with validated ordering.
|
||||
|
||||
| Fault | Decision | Evidence gate |
|
||||
| --- | --- | --- |
|
||||
| Invalid/NaN config or negative cost | Configuration/input error; consume nothing | Boundary/property tests |
|
||||
| Key/queue cap full | Overload with retry hint when computable | Churn cannot reset live quotas |
|
||||
| Stop while waiting/retrying | Remove waiter/timer, one cancelled result | Stop vs grant/retry race |
|
||||
| Failure races with cooldown probe | Generation decides, one active probe | Hundreds of concurrent acquisitions |
|
||||
| Observer throws/reenters | Isolate observer error; reservation remains correct | Reentrant acquire/release tests |
|
||||
| Dependency outage | Open breaker, bounded retry traffic | Deterministic outage/recovery history |
|
||||
| Clock regresses / integer overflow | No refill gain / reject reservation | Min/max integer and reversed time |
|
||||
|
||||
## Task DAG
|
||||
|
||||
| ID | Phase / dependencies | Implementation and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-RESILIENCE-01 | P0; baseline | Record existing semantics and reproduce probe, invalid-cost and overflow gaps with meaningful regressions | sol_implementer |
|
||||
| M-RESILIENCE-02 | P1; M-RESILIENCE-01, Functional/Time contracts | Validated configurations and machine-readable admission errors; ordinary use needs no runtime | sol_implementer |
|
||||
| M-RESILIENCE-03 | P2; M-RESILIENCE-02 | Generation-bound RAII permits, bounded keyed cleanup, monitor synchronization; races and arithmetic tests pass | astra_implementer |
|
||||
| M-RESILIENCE-04 | P2; M-RESILIENCE-03, Async foundations | Optional bulkhead/wait/retry adapter; finite queues, total deadline, stop/join verified | sol_implementer |
|
||||
| M-RESILIENCE-05 | P3; M-RESILIENCE-04, Net/RPC foundations | Network policy recipes and observations; retries cannot amplify beyond configured attempt/admission budgets | sol_implementer |
|
||||
| M-RESILIENCE-06 | P4; M-RESILIENCE-05, Replication gate | Partition/recovery workloads separate local overload from peer failure; limits never substitute for quorum safety | astra_implementer |
|
||||
|
||||
## Validation and migration
|
||||
|
||||
CURRENT tests are the four linked source suites in existing VoidTests; no execution is
|
||||
claimed here. PROPOSED verification adds deterministic model histories, concurrency and
|
||||
sanitizer tests, callback reentrancy, cancelled FIFO waiters and bounded cleanup work.
|
||||
Targets are added in implementation before advertising runner commands; use
|
||||
[VALIDATION](../VALIDATION.md). Benchmark hot-key contention, high key churn, empty/full
|
||||
admission, retry storms and observer overhead; capture p50/p95/p99, throughput, allocations,
|
||||
peak RSS/CPU and build cost per [PERFORMANCE](../PERFORMANCE.md).
|
||||
|
||||
Major-release migration changes zero/unbounded configuration to an explicit policy and
|
||||
replaces boolean breaker admission with a permit. Existing synchronous methods receive
|
||||
deprecated wrappers where semantics can be preserved; do not promise a one-probe guarantee
|
||||
through an API that cannot retain probe ownership. Ship comparison fixtures and a
|
||||
rollback switch for the optional composition layer; never discard active reservations
|
||||
on policy replacement. See [MIGRATION](../MIGRATION.md), [Net](Net.md) and
|
||||
[Messaging](../subsystems/Messaging.md).
|
||||
@@ -0,0 +1,133 @@
|
||||
# Security implementation plan
|
||||
|
||||
Status: planning only; all feature tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-004, R-006, R-009, R-012, R-014–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-05, C-07, C-09, C-13.
|
||||
|
||||
## Existing capabilities and boundary
|
||||
|
||||
[Security.hpp](../../../include/Void/Security/Security.hpp) exposes `Void::Security`
|
||||
random URL-safe bearer tokens, BLAKE2b-256 token digests and verification, Argon2id password
|
||||
hashing/verification, random secret keys and authenticated local secret envelopes.
|
||||
[Security.cpp](../../../src/Security/Security.cpp) initializes libsodium once, uses
|
||||
`sodium_memcmp` for decoded token digests, sodium password presets and `crypto_secretbox_easy`.
|
||||
The actual secret format is a 24-byte nonce followed by secretbox's combined authenticated
|
||||
ciphertext, with 16 bytes authentication overhead; preserve these bytes rather than inferring
|
||||
layout from the header's informal description. Existing `SecretKey` is a copyable 32-byte
|
||||
array; existing plaintext/results are ordinary vectors/strings, not secure allocations.
|
||||
|
||||
[module.cmake](../../../src/Security/module.cmake) declares Functional and Sodium::Sodium.
|
||||
[Tests](../../../tests/standalone/Security/Security.cpp) cover token shape/digest, malformed
|
||||
digest rejection, salted Argon2id with Interactive tests, secret round-trip, tampering and
|
||||
wrong-key rejection. A test name mentioning constant time is not timing side-channel proof.
|
||||
No account store, login/session manager, policy engine, TLS identity service or revocation
|
||||
workflow ships here. Graph coverage for all four source files matched metadata with no
|
||||
recorded issue; source verification grounds these claims.
|
||||
|
||||
## Backend and workflow architecture
|
||||
|
||||
Retain libsodium for existing primitives; do not write replacement crypto. Keep low-level
|
||||
primitives usable without Storage, Net or Runtime. [Crypto](Crypto.md) owns interoperable
|
||||
hash/signature primitives; Net owns TLS peer checks. Security owns NEW authentication,
|
||||
principal/session and authorization workflows expressed through injected ports. Concrete
|
||||
Storage/Sqlite adapters are optional higher targets and cannot become primitive dependencies.
|
||||
External identity protocols such as OIDC are a later explicitly versioned adapter capability;
|
||||
initial completion is local accounts and opaque bearer sessions, not an implicit JWT system.
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::Security shapes; not existing compilable APIs.
|
||||
class SecureBuffer; // move-only; explicit readable span, wiped on release
|
||||
struct Principal { SubjectId subject; std::vector<RoleId> roles; };
|
||||
struct SessionPolicy { std::chrono::seconds ttl{3600}; std::size_t max_per_subject{16}; };
|
||||
class AccountSessionPort { /* versioned compare/exchange, atomic session create/revoke */ };
|
||||
class Authenticator {
|
||||
Task<Result<SessionGrant>> login(LoginInput, OperationOptions);
|
||||
Task<Result<Principal>> authenticate(BearerToken, OperationOptions);
|
||||
Task<Result<void>> revoke(SessionId, OperationOptions);
|
||||
};
|
||||
Decision authorize(const Principal&, ActionId, const ResourceAttributes&);
|
||||
```
|
||||
|
||||
Result/operation/clock/executor shapes are owned by Functional/Async/Time. Identifiers
|
||||
above are NEW Security domain types; no bearer secret has implicit formatting/serialization.
|
||||
Authenticator holds port ownership through shutdown; a principal is an immutable value
|
||||
snapshot with an authorization-policy generation. Authentication validates identity;
|
||||
authorization evaluates explicit actions and resources, default deny, deny overrides allow.
|
||||
Limit roles to 64/principal, policy rules to 4,096 and expression depth to 16. First policy
|
||||
language is native typed predicates without arbitrary scripts or filesystem/network access.
|
||||
|
||||
Login dataflow: bounded parse → identity normalization → rate admission → account lookup →
|
||||
bounded password job → credential-version check → atomic session write → return raw token
|
||||
once. Unknown account and wrong password share public denial and comparable work using a
|
||||
precomputed dummy hash; internal audit reasons differ. Credential changes racing with login
|
||||
invalidate the write through the port's version precondition. Store only digest, subject,
|
||||
expiry, roles/policy version and revocation generation. Tokens contain 32 entropy bytes;
|
||||
logging, URLs and metrics never carry them. Rehash-on-success uses a version-checked update
|
||||
and must not accidentally resurrect disabled credentials.
|
||||
|
||||
Authenticate hashes the token and reads the authoritative session state on every call
|
||||
initially; positive caching is disabled so revocation has no hidden cache window. TTL uses
|
||||
civil time injected by Time with an explicit clock-health check; monotonic deadlines govern
|
||||
operations. Startup clock rollback beyond configured 60-second tolerance fails session
|
||||
admission until reconciled. This tolerance is not a distributed clock safety guarantee.
|
||||
Revocation succeeds only after durable port acknowledgement. Lost replies have unknown
|
||||
outcome; query/retry by session identity. Authorization has no network side effects.
|
||||
|
||||
## Resource and failure decisions
|
||||
|
||||
NEW defaults: password input ≤1 KiB, encoded hashes ≤1 KiB, tokens ≤512 bytes, local secret
|
||||
plaintext ≤16 MiB. Select Moderate for new stored passwords; accept supported existing
|
||||
encoded strengths only within an operator-approved verification budget. Do not reduce hash
|
||||
strength silently. Password jobs reserve their encoded memory cost before starting: default
|
||||
aggregate 512 MiB, at most two jobs and 32 waiters. If a preset exceeds the budget, report
|
||||
configuration/resource error. Password computation is not forcibly interruptible; cancelled
|
||||
jobs retain buffers/budget until completion, discard output and cannot create a session.
|
||||
Default sessions: 10,000 total, 16/subject, one-hour TTL; capacity includes unexpired entries.
|
||||
Explicit expiry cleanup is bounded at 256 records/turn. Shutdown closes admission and joins
|
||||
credential jobs before clearing secure buffers.
|
||||
|
||||
SecureBuffer uses sodium-assisted wiping and optional locked allocation; inability to meet
|
||||
a required locked-memory policy is an error, never an implicit downgrade. It does not claim
|
||||
to prevent every copy made by application code, swapping policy or core dumps. Add a NEW
|
||||
versioned secret envelope with magic/version/algorithm/key-id/length and authenticated metadata;
|
||||
legacy nonce+combined-ciphertext decoding stays a separate explicitly selected API. New writers
|
||||
never guess legacy format after authentication failure. Key rotation reads old key IDs, writes
|
||||
only the active ID, and retires a key only after an inventory proves no required ciphertext remains.
|
||||
|
||||
| Trigger | Outcome and ownership | Validation |
|
||||
| --- | --- | --- |
|
||||
| Sodium init / randomness failure | Backend error; publish no token/key | Backend fault seam |
|
||||
| Wrong/malformed credentials | Public denied; bounded work and internal audit reason | No user enumeration in response |
|
||||
| Encoded password requests excessive cost | Reject before costly allocation | Malicious encoded-hash corpus |
|
||||
| Store unavailable / policy load invalid | Fail closed; do not issue anonymous success | Port outage and version races |
|
||||
| Stop during hash | One cancelled result; running job drains, no session write | Cancellation vs completion |
|
||||
| Session expired/revoked | Denied; never recreate from token alone | Revoke/login/clock histories |
|
||||
| Secret authentication fails | Error with no plaintext publication | Every field and key mutation |
|
||||
| Observer/audit failure | Explicit audit policy; local login default fails if mandatory audit cannot admit | Full audit queue, no secrets retained |
|
||||
|
||||
## Task DAG and acceptance
|
||||
|
||||
| ID | Phase / dependencies | Scope and gate | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-SECURITY-01 | P0; baseline | Freeze token/password/secret fixtures including actual envelope bytes; distinguish test names from security proof | sol_implementer |
|
||||
| M-SECURITY-02 | P1; M-SECURITY-01, Memory/Functional contracts | SecureBuffer, input/cost validation, error separation; wipe and allocation-failure tests | astra_implementer |
|
||||
| M-SECURITY-03 | P2; M-SECURITY-02, Async/Time/Resilience gates | Account/session ports and local workflows; revocation, version races, capacity and hash-stop tests pass | astra_implementer |
|
||||
| M-SECURITY-04 | P2; M-SECURITY-03 | Typed default-deny authorization and versioned secret/key rotation; unknown policy/version fails closed | astra_implementer |
|
||||
| M-SECURITY-05 | P3; M-SECURITY-04, Storage or Sqlite adapter, Net | Durable auth adapter and network integration; no Security→Storage/Net cycle, restart/revocation acceptance | sol_implementer |
|
||||
| M-SECURITY-06 | P4; M-SECURITY-05, Replication | Optional replicated auth port; quorum revocation and partition denial tested; external identity remains a separate capability gate | astra_implementer |
|
||||
|
||||
CURRENT verification is existing VoidTests source coverage above; nothing rerun here.
|
||||
PROPOSED checks require deterministic port/clock fixtures, malformed hashes/envelopes,
|
||||
secret-lifetime instrumentation, concurrent revocation and backend error injection before
|
||||
new runner commands are documented. Measure password queue/work latency separately, token
|
||||
lookup p50/p95/p99, throughput, allocation/RSS/CPU and build cost; run under fixed memory
|
||||
budgets, not reduced password cost to improve a benchmark. See [PERFORMANCE](../PERFORMANCE.md),
|
||||
[VALIDATION](../VALIDATION.md), and [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
Migration preserves old verification and secret decoding, while new APIs adopt move-only
|
||||
secrets and explicit policy. Do not reinterpret old envelope bytes or silently turn existing
|
||||
digest storage into session authentication. Rollback keeps old keys/readers until all new
|
||||
records are supported; disable new writers before reverting. Invalid-policy rollback
|
||||
retains the last validated immutable policy only when the operator explicitly selects that
|
||||
policy; it cannot manufacture authorization. See [MIGRATION](../MIGRATION.md).
|
||||
@@ -0,0 +1,159 @@
|
||||
# Service ownership, lifecycle and replacement plan
|
||||
|
||||
Status: PLANNED feature work. Baseline: `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`,
|
||||
inspected 2026-11-24. Requirements R-004, R-009, R-010 and R-013–R-016 apply.
|
||||
[Architecture](../ARCHITECTURE.md) C-02–C-05 and C-09 owns shared semantics.
|
||||
|
||||
## Existing source baseline
|
||||
|
||||
[Service.hpp](../../../include/Void/Service/Service.hpp) defines
|
||||
`Void::Service::IService`, with `service_name`, `on_start`, and `on_stop`.
|
||||
[Registry.hpp](../../../include/Void/Service/Registry.hpp) defines
|
||||
`ServiceRegistry`: type-indexed shared_ptr providers, replacement/removal, local-first
|
||||
parent lookup, and registration/reverse-registration lifecycle order. `get<I>()`
|
||||
returns an owning shared_ptr, but `require<I>()` returns `I&` after a temporary owning
|
||||
lookup; concurrent replacement can invalidate that reference. `start_all`/`stop_all`
|
||||
invoke callbacks while holding a registry shared lock. Parent lifetime is borrowed.
|
||||
Lifecycle has no dependency DAG, readiness or failed-start rollback contract.
|
||||
|
||||
[PluginService.hpp](../../../include/Void/Service/PluginService.hpp) provides
|
||||
`PluginServiceBinding<I>` using `void_plugin_service`, RTTI cross-cast validation and
|
||||
an aliasing shared_ptr that retains a `PluginHandle`. Its existing generation pin is
|
||||
valuable; C linkage for the factory does not make the returned C++ IService stable
|
||||
across toolchains. [module.cmake](../../../src/Service/module.cmake) declares Functional
|
||||
and Log, while the optional plugin bridge's includes reach Plugin. Packaging that
|
||||
bridge separately is part of the target dependency cleanup, not a reason for Plugin
|
||||
and Service core to depend cyclically on one another.
|
||||
|
||||
Existing [registry tests](../../../tests/standalone/Service/Registry.cpp) cover provider
|
||||
lookup/replacement/removal and lifecycle order;
|
||||
[scoped tests](../../../tests/standalone/Service/ScopedRegistry.cpp) cover parent
|
||||
fallback/shadowing; [orchestrator tests](../../../tests/standalone/Service/Orchestrator.cpp)
|
||||
exercise consumers in Fsm. Graph paths were coverage-checked; PluginService line 52
|
||||
was directly read. Important callback and ownership conclusions were source-verified.
|
||||
|
||||
## NEW owning API and registry model
|
||||
|
||||
Design sketch; these additions are not existing declarations:
|
||||
|
||||
```cpp
|
||||
namespace Void::Service {
|
||||
template<class I> class ServiceHandle { // owns provider and code pin
|
||||
public:
|
||||
I* operator->() const noexcept;
|
||||
std::uint64_t generation() const noexcept;
|
||||
};
|
||||
// NEW registry methods:
|
||||
// acquire<I>() -> Result<ServiceHandle<I>>;
|
||||
// prepare_batch(ProviderSet, ExpectedEpoch) -> Result<PreparedPublication>;
|
||||
// publish(PreparedPublication&&) -> Result<PublicationEpoch>;
|
||||
// start(options) / close_and_join(options) use Async::OperationOptions.
|
||||
}
|
||||
```
|
||||
|
||||
ServiceHandle owns an immutable provider record: interface pointer, shared provider
|
||||
owner, generation pin and publication epoch. Copies extend lifetime. Acquisition of
|
||||
an absent provider returns `missing_service`; a stopped admission gate returns
|
||||
`service_stopping`. The handle is held across an entire call/await. Removing a registry
|
||||
entry prevents new lookup but never invalidates acquired handles or releases plugin
|
||||
code while a continuation is active. Provider retirement is distinct from destruction.
|
||||
|
||||
Use immutable registry snapshots and one atomic retained-snapshot pointer. A batch
|
||||
publication atomically replaces all interfaces belonging to a generation; a request
|
||||
needing a coherent group acquires one snapshot. Type-index keys remain same-toolchain
|
||||
only; stable C interface IDs and version negotiation belong to [Plugin](Plugin.md).
|
||||
ProviderSet rejects duplicate interface IDs, null providers, missing required
|
||||
dependencies and cycles. Aliases of one lifecycle object have a single lifecycle node.
|
||||
|
||||
The base registry is native standard containers/shared ownership, without Runtime,
|
||||
Plugin or a concrete telemetry dependency. Async lifecycle support and the plugin
|
||||
binding are higher adapters. A child snapshot retains its parent snapshot, so it can
|
||||
outlive the parent registry object; new parent publications are observed only through
|
||||
explicit child refresh/new acquisition policy. Choose snapshot parent semantics for
|
||||
NEW scoped handles and document the difference from today's live borrowed fallback.
|
||||
|
||||
## Startup, rollback and safe replacement
|
||||
|
||||
Provider descriptions declare stable local service IDs and required/optional edges.
|
||||
Topologically sort required edges with registration sequence as a deterministic tie
|
||||
break. Prepare a retained lifecycle snapshot under a short guard, then release the
|
||||
guard before invoking any application callback. Lifecycle operations are serialized
|
||||
by a coordinator state machine; ordinary lookups do not wait for callback execution.
|
||||
Reentrant lookup is supported. Reentrant lifecycle mutation queues a bounded request
|
||||
for the next epoch rather than recursively starting/stopping services.
|
||||
|
||||
Start transitions constructed → starting → ready. A provider's start/ready call may
|
||||
fail; then stop every provider whose start succeeded in reverse dependency order.
|
||||
Also call the failed provider's specified abort-start cleanup to release partial work.
|
||||
Aggregate cleanup errors while retaining the original startup error. Providers are
|
||||
unpublished until the required set is ready. Legacy void callbacks adapt by catching
|
||||
exceptions at the C++ boundary and mapping them into structured failures.
|
||||
|
||||
Replacement prepares candidate providers in a private snapshot and validates readiness
|
||||
before publication. ExpectedEpoch prevents stale concurrent replacements. The publish
|
||||
guard performs only a preallocated pointer swap; the old snapshot is retired outside
|
||||
the guard so final shared_ptr destruction cannot run user destructors under a lock.
|
||||
Notification callbacks run outside locks. A failed candidate keeps the old snapshot.
|
||||
Publication success is not a durable Update commit; that belongs to VersionStore.
|
||||
|
||||
Retired providers stop admitting new mutations when their owner requests quiescence,
|
||||
while existing handles remain valid for their documented operations. Their owned Async
|
||||
scope drains before `on_stop`/destruction. Do not call stop merely because a newer
|
||||
provider was published if that would invalidate an acquired handle. A retired-generation
|
||||
coordinator retains cleanup responsibility until all calls and async pins end. Stateless
|
||||
readers may overlap generations; stateful writers require Plugin's quiescence protocol.
|
||||
Shutdown stops publication and lookup admission, stops dependents before dependencies,
|
||||
joins their work, then releases owners. Noncooperative work yields a shutdown report
|
||||
and keeps owners retained; a deadline never licenses freeing live providers.
|
||||
|
||||
## Bounds, failures and observability
|
||||
|
||||
Default 256 providers/registry, 16 parent levels, 1,024 dependency edges, 64 staged
|
||||
changes, 128 lifecycle requests and four retained publication generations. Admission
|
||||
over these limits returns overload before invoking callbacks. At most one lifecycle
|
||||
transaction prepares per registry; concurrent requests have expected-epoch conflicts
|
||||
or bounded waiting using [Async](Async.md) options. Retention exhaustion refuses new
|
||||
replacement until pins drain. No forced eviction of old code or provider objects.
|
||||
|
||||
Errors distinguish missing, conflict, cycle, start failure, not-ready, stop failure,
|
||||
cancelled, timed-out and retained-generation limit. Emit optional bounded observations
|
||||
for epochs, retained handles, callback duration and rollback outcomes, with
|
||||
[Observability](../subsystems/Observability.md) adapters above the registry. Do not log
|
||||
configuration payloads or capture transient thread-local context. Stable interface IDs
|
||||
are not authorization; application policy controls which providers may be registered.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
Every row is PLANNED.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-SERVICE-01 | P0 / baseline | Characterize borrowed require, lock-held callbacks, parent and alias lifetime; package bridge map | Regression cases distinguish owning get from borrowed require; declared dependencies recorded / sol_implementer |
|
||||
| M-SERVICE-02 | P1 / M-SERVICE-01; Functional error gate | Owning handles, immutable snapshots, retained parents, atomic provider batches | Old handles survive remove/replace/parent destruction; batch readers see one epoch / astra_implementer |
|
||||
| M-SERVICE-03 | P2 / M-SERVICE-02; Async scopes | Dependency lifecycle coordinator, readiness, failed-start cleanup and reverse rollback | Callback can acquire services without deadlock; middle-node failure leaves nothing newly published / astra_implementer |
|
||||
| M-SERVICE-04 | P2 / M-SERVICE-03; Plugin pin gate | Separate plugin bridge adapter, staged publication, retired-provider drain | In-flight async call pins exact generation through completion; no callback/destructor under registry guard / astra_implementer |
|
||||
| M-SERVICE-05 | P3 / M-SERVICE-04; Configuration snapshot gate | Bounded retention, Runtime/Fsm composition and migration | Retention saturation rejects reload; shutdown joins dependency graph and reports incomplete owners / sol_implementer |
|
||||
|
||||
## Validation, performance and migration
|
||||
|
||||
CURRENT aggregate command:
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun here. PROPOSED tests require NEW APIs: concurrent remove/acquire, provider
|
||||
destructor reentering registry, start callback registering another service, duplicate
|
||||
lifecycle aliases, parent destruction, dependency cycles, readiness timeout, second
|
||||
provider start failure, stop throws, reader held across four reloads, and async callback
|
||||
completion after publication. Lifetime/race sanitizers supplement deterministic barriers.
|
||||
|
||||
Measure acquisition and publication p50/p95/p99, lookup throughput under read/write
|
||||
contention, allocations, retained provider RSS/CPU, shutdown latency and template build
|
||||
cost per [PERFORMANCE](../PERFORMANCE.md). Compare immutable snapshots with the existing
|
||||
shared-mutex path using identical service sets; do not assert universal improvement.
|
||||
|
||||
EXISTING `auto& svc = registry.require<I>();` migrates to NEW
|
||||
`auto svc = registry.acquire<I>();` and retaining `*svc` through the call. Existing
|
||||
`get<I>()` remains a safe ownership bridge for simple same-toolchain providers.
|
||||
Deprecate borrowed require before removal at the major boundary. Legacy registration
|
||||
order is retained in the no-dependency adapter; dependency-aware startup is explicit.
|
||||
Never roll back a published generation by destroying live handles: publish another
|
||||
validated snapshot. See [MIGRATION](../MIGRATION.md), [VALIDATION](../VALIDATION.md),
|
||||
[Runtime](../subsystems/Runtime.md), [Fsm](Fsm.md), and [DELIVERY](../DELIVERY.md).
|
||||
@@ -0,0 +1,123 @@
|
||||
# ShortUrl implementation plan
|
||||
|
||||
Status: planning only; all feature tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-004, R-010, R-014–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-05, C-09, C-13.
|
||||
|
||||
## Frozen source contract, not a shipped provider
|
||||
|
||||
[ShortUrl.hpp](../../../include/Void/ShortUrl/ShortUrl.hpp) declares the EXISTING
|
||||
`Void::ShortUrl::V1` service, current aliases in `Void::ShortUrl`, service ID
|
||||
`void.short-url`, version 1, request/result/error types, health and `IShortener`.
|
||||
`IShortener` derives from Service::IService; resolution defaults to `ErrorCode::unsupported`.
|
||||
There is no built-in storage or HTTP provider in this module's inventory.
|
||||
[module.cmake](../../../src/ShortUrl/module.cmake) declares only Service.
|
||||
[Tests](../../../tests/standalone/ShortUrl/ShortUrl.cpp) exercise a test subclass, identity,
|
||||
shorten result and optional resolution. This is not a production provider acceptance test.
|
||||
All three source paths reported matching graph metadata/no recorded issue and were read.
|
||||
|
||||
The existing [contract document](../../short-url.md) is preserved. V1 enum ordinals,
|
||||
member order and virtual order are frozen; same-toolchain C++ ABI restrictions remain.
|
||||
Nonempty custom keys and nonzero expiry must be honored or rejected as unsupported/conflict.
|
||||
Zero expiry means permanent; a returned owning provider handle must pin its implementation
|
||||
for the whole call. The existing header's `unsupported` is the exact error enumerator.
|
||||
|
||||
## Completion scope and NEW interfaces
|
||||
|
||||
Build native provider logic around injected repository/clock/randomness ports. Keep V1
|
||||
headers dependent only on Service; optional local and remote provider targets own Storage
|
||||
and Net dependencies respectively. No external short-link service/account is assumed.
|
||||
Select the original [Storage](../subsystems/Storage.md) as the first durable local adapter;
|
||||
an in-memory test adapter establishes semantics but is explicitly nondurable.
|
||||
|
||||
```cpp
|
||||
// NEW illustrative types, outside the frozen V1 interface.
|
||||
namespace Void::ShortUrl::V2 {
|
||||
struct ShortenOptions { OperationOptions operation; OperationId id; };
|
||||
struct Link { std::string key; std::string target_url; Expiry expiry; };
|
||||
class Provider {
|
||||
Task<Result<Link>> shorten(CreateLink, ShortenOptions);
|
||||
Task<Result<Link>> resolve(Key, OperationOptions);
|
||||
Task<Result<void>> revoke(Key, OperationOptions);
|
||||
};
|
||||
}
|
||||
// NEW LocalProvider composes LinkRepositoryPort, Time clock and Security randomness.
|
||||
// NEW V1Adapter implements V1::IShortener without adding virtuals or changing layout.
|
||||
```
|
||||
|
||||
Async owns operation options and task lifecycle; Functional owns Result. V2 uses a new
|
||||
service version/lookup entry, never replaces a V1 provider under an incompatible cast.
|
||||
The proposed Service C ABI is a separate adapter, not a reinterpretation of V1 objects.
|
||||
V1Adapter blocks only on an allowed calling thread and maps domain errors to existing
|
||||
ErrorCode values. It cannot pretend V1 has cooperative cancellation or request identity.
|
||||
|
||||
Local create dataflow: validate URL/key/expiry → authorization/rate admission at the host →
|
||||
generate or validate key → conditional insert plus operation-result record atomically →
|
||||
durable acknowledgement → construct short URL from configured canonical public base.
|
||||
Targets accept absolute http/https, no userinfo/control characters; no fetch/preview happens
|
||||
by default, so create does not contact the target. Host policy can forbid destinations;
|
||||
if previews are later added, SSRF controls are a separate mandatory capability gate.
|
||||
Default generated key is 16 base62 characters from rejection-sampled secure randomness;
|
||||
eight collision retries then conflict/resource error. A custom key is 1–64 ASCII
|
||||
alphanumerics, '-' or '_', case-sensitive, with reserved route names rejected. Target URL
|
||||
limit is 8 KiB. Key and target are owned immutable values after admission.
|
||||
|
||||
Records contain key, exact target, expiry, revocation flag, creation identity and schema
|
||||
version. Resolve reads one consistent record: absent → not_found, revoked → revoked,
|
||||
expired → expired, otherwise return exact stored URL. Expiry is an injected civil instant;
|
||||
clock-health failures do not extend a link silently. Cleanup is separate from logical expiry.
|
||||
Revoke creates a tombstone; key reuse is disabled initially so cached old links cannot point
|
||||
at a new target. V2 idempotency records make retries safe within a configured 24-hour
|
||||
retention window; expired identities return identity_expired, with no silent retry claim.
|
||||
|
||||
RemoteProvider is a NEW generic adapter SPI: explicit origin, secure Net policy, request/
|
||||
response schema and capability flags. Every provider supplies a conformance fixture;
|
||||
unsupported custom key/expiry/resolve is reported before network mutation where possible.
|
||||
Remote errors preserve retry-after and unknown-outcome classification internally; the V1
|
||||
mapping uses provider_error/unavailable/timeout without fabricating a local rollback.
|
||||
|
||||
## Limits and failure matrix
|
||||
|
||||
NEW defaults: 128 concurrent operations, 256 waiters, 16 MiB transient budget; remote
|
||||
responses ≤1 MiB and 10-second total deadline. Local live/tombstone entries have a configured
|
||||
disk quota, initially 1 GiB, and 10,000 retained V2 operation outcomes; full retention blocks
|
||||
new creates until cleanup, never drops active identities arbitrarily. Tombstones count toward
|
||||
quota; reclamation/key reuse requires a later explicit compatibility design. No module-global
|
||||
worker; managed hosts own cleanup scheduling. Shutdown stops admission and joins storage/network
|
||||
operations; V1 plugin pins remain held until synchronous calls finish.
|
||||
|
||||
| Fault | Required outcome | Gate |
|
||||
| --- | --- | --- |
|
||||
| Invalid URL/key/expiry | invalid_request/invalid_url; no mutation | Encoded/control/scheme boundary corpus |
|
||||
| Custom key collision | conflict, no overwrite | Concurrent conditional inserts |
|
||||
| Unsupported capability | unsupported, no ignored request fields | Provider conformance matrix |
|
||||
| Disk/sync failure | storage or unknown commit outcome; inspect/retry by V2 ID | Crash after commit before reply |
|
||||
| Remote timeout after send | timeout with unknown outcome internally; no blind create replay | Lost response test |
|
||||
| Expiry/revoke races | Resolve sees a consistent record; no target resurrection | Controlled clock and transaction histories |
|
||||
| Provider unload during call | Owning Service pin retains generation | Reload during blocked shorten |
|
||||
| Quota/queue exhausted | rate_limited or resource/unavailable mapping, bounded retention | Full quota plus churn |
|
||||
|
||||
## Task DAG
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-SHORTURL-01 | P0; baseline | Freeze V1 headers/ABI fixtures and exact semantics; test aliases and default unsupported | sol_implementer |
|
||||
| M-SHORTURL-02 | P1; M-SHORTURL-01, Service/Functional contracts | NEW V2/domain ports and V1 adapter specification; no V1 layout or method edits | astra_implementer |
|
||||
| M-SHORTURL-03 | P2; M-SHORTURL-02, Time/Security, Storage conditional batches | Native local provider with durable identity and quota; crash/conflict/expiry tests | sol_implementer |
|
||||
| M-SHORTURL-04 | P2; M-SHORTURL-02, Net secure/streaming gate | Remote provider SPI and fixture provider; capability and unknown-outcome tests, no shipped external account assumption | sol_implementer |
|
||||
| M-SHORTURL-05 | P3; M-SHORTURL-03, M-SHORTURL-04, Plugin/Service | Host wiring, metrics and reloadable pins; compatible V1 consumers pass | astra_implementer |
|
||||
| M-SHORTURL-06 | P4; M-SHORTURL-05, DistributedStorage single-group gate | Optional replicated repository adapter; minority create rejection, committed resolve/revoke history | astra_implementer |
|
||||
|
||||
CURRENT checks are linked source tests registered in VoidTests, not rerun here. PROPOSED
|
||||
provider contract fixtures, process crash points, schema/ABI consumers and reload races
|
||||
must be added before runner commands are documented. Measure create/resolve p50/p95/p99,
|
||||
throughput, allocations, RSS/CPU, collision retries, retained records and build cost under
|
||||
[PERFORMANCE](../PERFORMANCE.md); do not infer provider readiness from interface tests.
|
||||
|
||||
Migration leaves V1 and [docs/short-url.md](../../short-url.md) intact. Introduce V2 and
|
||||
versioned records additively, with V1 mapping tests and explicit data export. Rollback
|
||||
disables new writes, retains readable old records and provider generations, and never
|
||||
reuses revoked keys. See [MIGRATION](../MIGRATION.md), [VALIDATION](../VALIDATION.md),
|
||||
[BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md), and
|
||||
[NetworkedApplications](../platforms/NetworkedApplications.md).
|
||||
@@ -0,0 +1,165 @@
|
||||
# Sqlite — first-class SQLite C API integration
|
||||
|
||||
Status: plan; all implementation tasks PLANNED. Baseline `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
R-007 and [C-02–C-05/C-08](../ARCHITECTURE.md) require this module to remain distinct from
|
||||
the original [Storage](../subsystems/Storage.md) engine.
|
||||
|
||||
## Source-backed baseline
|
||||
|
||||
[Sqlite.hpp](../../../include/Void/Sqlite/Sqlite.hpp) exposes `Void::Sqlite::Database`,
|
||||
`Statement`, `Transaction`, `Migration`, `OpenMode` and a local Result alias. Database and
|
||||
Statement are move-only RAII wrappers. Bind indexes are one-based; column indexes are
|
||||
zero-based. `step()` returns Result<bool>, text reads copy, transactions roll back on
|
||||
destruction unless marked done, and migrations use `PRAGMA user_version`.
|
||||
[module.cmake](../../../src/Sqlite/module.cmake) links Functional and SQLite3::SQLite3.
|
||||
|
||||
[Sqlite.cpp](../../../src/Sqlite/Sqlite.cpp) opens writable databases with a 5,000 ms busy
|
||||
timeout and attempts WAL/foreign_keys pragmas without checking their results. Bind/reset
|
||||
and clear-bindings ignore SQLite return codes. Transaction stores a raw Database pointer,
|
||||
and `commit()` marks it done before calling SQLite. Database close ignores the close result.
|
||||
These are concrete lifecycle/error-completion targets, not evidence that all uses fail.
|
||||
[Tests](../../../tests/standalone/Sqlite/Sqlite.cpp) cover memory open, SQL execution,
|
||||
binding/nulls, successful commit, destructor rollback, migrations and bad SQL; they do
|
||||
not establish busy-commit recovery, database moves with live transactions or WAL durability.
|
||||
|
||||
## Backend decision and NEW API
|
||||
|
||||
Keep SQLite itself as the SQL engine, pager, locking and file-format owner. Void supplies
|
||||
checked RAII, lifetimes, configuration, async admission and migrations. Do not reimplement
|
||||
SQL, parse database pages, or translate Storage batches into a pretend identical SQL API.
|
||||
Pin/test supported SQLite versions through [build/distribution](../BUILD-AND-DISTRIBUTION.md);
|
||||
capture runtime version/compile options in diagnostics without claiming untested versions.
|
||||
|
||||
NEW illustrative additions in `Void::Sqlite`:
|
||||
|
||||
```cpp
|
||||
enum class JournalMode { Wal, Rollback };
|
||||
enum class SyncMode { Full, Normal };
|
||||
enum class BeginMode { Deferred, Immediate, Exclusive };
|
||||
struct OpenOptions; // mode, journal/sync, limits, busy budget, capabilities
|
||||
struct SqliteError; // primary and extended code, bounded message, operation
|
||||
Result<Database> open_database(path, OpenOptions);
|
||||
Result<void> Statement::bind_checked(int, ValueView);
|
||||
Result<void> Statement::reset_checked();
|
||||
Result<Transaction> Database::begin(BeginMode);
|
||||
Result<void> Database::close();
|
||||
Result<CheckpointReport> Database::checkpoint(CheckpointMode);
|
||||
```
|
||||
|
||||
These are proposals, not existing declarations. ValueView is a NEW typed view over null,
|
||||
int64, double, text and blob. Checked text/blob bindings copy by default; borrowed/static
|
||||
bindings require an explicit lifetime owner retained until reset/rebind/finalize. Row views
|
||||
expire at the next step/reset/finalize and cannot cross an await; owning row copies are
|
||||
available. Typed reads reject unexpected type/range instead of silently coercing a text
|
||||
column to zero. Named binds and blobs complete the basic API; parameter metadata validates
|
||||
indexes, and strict single-statement prepare rejects non-whitespace trailing SQL.
|
||||
|
||||
Use a shared ConnectionState independent of the Database object's address. Statements and
|
||||
transactions retain it, so moving/destroying a Database handle does not leave dangling
|
||||
transaction pointers. NEW `close()` stops admission and returns Busy while handles remain;
|
||||
destructor release defers final native close to the last owner and reports errors to an
|
||||
optional bounded diagnostic hook. Explicit finalization is available when error reporting
|
||||
matters. Native `handle()` access is an expert borrow under the connection's execution lease;
|
||||
it does not grant concurrent unsynchronized use or ownership transfer.
|
||||
|
||||
## Transactions, concurrency and operational behavior
|
||||
|
||||
A connection has one execution owner at a time. Embedded synchronous callers serialize
|
||||
operations explicitly. Managed async use moves work to a bounded blocking executor and
|
||||
leases one connection for the complete transaction; no await releases that lease midway
|
||||
through a transaction. SQLite's internal mutex modes do not replace wrapper object-lifetime
|
||||
rules. Read pools default to four connections, with one writer lane; users opt into other
|
||||
topologies knowingly. No global connection/thread pool is created by opening a Database.
|
||||
|
||||
Transaction state is Active, Committed, RolledBack or RecoveryRequired. Set Committed only
|
||||
after successful COMMIT. A busy COMMIT can leave the transaction active; retain rollback/
|
||||
retry capability and query SQLite's autocommit state after errors before deciding whether
|
||||
it was automatically rolled back. This follows SQLite's [transaction semantics](https://www.sqlite.org/lang_transaction.html)
|
||||
and [autocommit query](https://www.sqlite.org/c3ref/get_autocommit.html). Do not blindly replay
|
||||
statements or automatically rerun a whole transaction after an error: triggers and external
|
||||
callbacks may already have effects. Savepoints are NEW separately owned nested scopes;
|
||||
ordinary `begin` inside an active transaction fails rather than pretending to nest.
|
||||
|
||||
NEW defaults for file databases are checked WAL + synchronous FULL + foreign_keys ON.
|
||||
Query effective pragma results and fail configuration if a required mode is unavailable.
|
||||
In-memory/read-only databases have explicitly different effective capabilities. NORMAL is
|
||||
an explicit weaker durability choice. WAL permits readers alongside one writer, but long
|
||||
read transactions can hold back checkpoints; it also requires same-host shared-memory
|
||||
coordination and is not the selected network-filesystem deployment mode.
|
||||
[SQLite WAL documentation](https://sqlite.org/wal.html) defines these constraints; no claim
|
||||
is made that Void's native WAL shares SQLite's layout or exact durability modes.
|
||||
|
||||
Busy waiting uses a bounded configured budget (default five seconds), capped by the shared
|
||||
absolute operation deadline. Install cancellation/progress handling per leased operation,
|
||||
and clear it before connection reuse. A connection-wide interrupt must never accidentally
|
||||
cancel the next borrower's query; serialize lease handoff through completion and native
|
||||
interrupt cleanup. Stop can prevent execution or interrupt supported SQLite work, but a
|
||||
commit racing with stop may have taken effect. Return domain outcome evidence rather than
|
||||
claiming cancellation rolled it back. Avoid busy sleeps on an IO event-loop thread.
|
||||
|
||||
Checkpoint reports completed/remaining pages and Busy, with no automatic promise to shrink
|
||||
a WAL held by readers. Default managed policy requests passive checkpoints at 16 MiB WAL,
|
||||
warns at 64 MiB, and stops new write admission at a configured 256 MiB application threshold
|
||||
until reader/checkpoint progress permits it. This is a wrapper admission policy, not a hard
|
||||
SQLite file-size guarantee against other processes. Monitor external writers separately.
|
||||
Never delete a live `-wal`/`-shm` file to reclaim space.
|
||||
|
||||
## Completion capabilities and budgets
|
||||
|
||||
Defaults for NEW wrappers: 128 live statements/connection, 1 MiB SQL text, 16 MiB bound
|
||||
value/row-copy limit, 1,024 queued jobs and 64 MiB aggregate pending input, 64 cached
|
||||
statements with an 8 MiB wrapper-memory ceiling. Evict only idle cache entries; an active
|
||||
statement belongs to its borrower. Apply SQLite limit APIs where supported, and separately
|
||||
bound wrapper allocations. SQLite pager/cache memory is configured and measured, not
|
||||
assumed equal to wrapper memory. Bulk operations stream rows within one explicitly sized
|
||||
transaction; a `query_all` convenience has a row and byte cap.
|
||||
|
||||
Migration completion validates a strictly increasing unique version list before any SQL.
|
||||
The application supplies immutable migration identities/checksums; record them in an
|
||||
application migration table in the same transaction as schema changes and user_version.
|
||||
Reject unexpected newer schemas and checksum drift. A migration may be non-reversible;
|
||||
require a verified backup and explicit application rollback plan before applying it. Do
|
||||
not infer a down-migration from reversing SQL strings. Backup/restore use SQLite's supported
|
||||
backup interface with bounded steps and consistent source lifetime, not a raw copy of an
|
||||
open database file. Extension loading remains disabled by default; optional functions,
|
||||
collations and authorizers have explicit lifetime and no-exception-across-C-callback wrappers.
|
||||
|
||||
## Ordered tasks
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-SQLITE-01 | P0; existing tests, official SQLite contracts | Regress bind errors, busy/failed commit, outstanding statement close and move-with-live-transaction; record supported runtime/build options. | astra_implementer |
|
||||
| M-SQLITE-02 | P1; M-SQLITE-01, Functional typed errors | ConnectionState ownership, checked bind/reset/finalize/close and transaction states; failed COMMIT cannot disable necessary rollback. | astra_implementer |
|
||||
| M-SQLITE-03 | P2; M-SQLITE-02 | Checked options/pragmas, typed rows/blobs/named params, savepoints and migrations; malformed options/schema plans fail before mutation. | sol_implementer |
|
||||
| M-SQLITE-04 | P2; M-SQLITE-03, Async/Time ownership | Leased async connections, bounded jobs, cancellation/busy handling; no cross-query interrupt or transaction interleaving. | astra_implementer |
|
||||
| M-SQLITE-05 | P3; M-SQLITE-03/04, IO/Runtime operations | Checkpoint/backup/restore, health metrics and guarded callback adapters; active-reader pressure is visible and backup restores consistently. | astra_implementer |
|
||||
| M-SQLITE-06 | P3; M-SQLITE-05, shared performance/consumer harness | Supported-version/mode matrix and Storage comparison with matched guarantees; publish all latency/memory/build tradeoffs. | sol_implementer |
|
||||
|
||||
P4 platforms may use SQLite locally, but Sqlite does not become a consensus/replication
|
||||
engine by sharing a file across hosts. [NetworkedApplications](../platforms/NetworkedApplications.md)
|
||||
selects its SQLite profile explicitly.
|
||||
|
||||
## Verification and migration
|
||||
|
||||
CURRENT TEMPLATE for source-verified test names:
|
||||
`<existing-build>/tests/VoidTests --filter '^(open_in_memory|prepared_bind_and_read|transaction_.*|migrations_apply_in_order_and_are_idempotent|prepare_bad_sql_errors)$'`.
|
||||
See [validation](../VALIDATION.md) for actual baseline commands and failures. PROPOSED after
|
||||
M-SQLITE-01–05: two-connection busy fixtures, faulted COMMIT/destructor rollback, explicit
|
||||
null vs empty text/blob, embedded NUL, int64 bounds, wrong column/index, expired row views,
|
||||
long reader checkpoint pressure, cancellation at lease transfer, disk full and migration
|
||||
checksum drift. Use real supported SQLite libraries in addition to deterministic wrapper
|
||||
ports. Restart tests must use file databases; `:memory:` tests cannot prove durability.
|
||||
|
||||
[Performance](../PERFORMANCE.md) covers prepared/unprepared, batch/individual commits,
|
||||
WAL/rollback, FULL/NORMAL, read pool contention and database-larger-than-cache workloads.
|
||||
Report p50/p95/p99 including busy/admission, throughput, allocations, RSS/CPU and build cost,
|
||||
with common repetitions/confidence intervals and all failed/rejected jobs counted.
|
||||
|
||||
[Migration](../MIGRATION.md): add checked methods first; deprecate chainable unchecked binds
|
||||
and address-dependent transaction lifetimes only with a major-release adapter path. Example:
|
||||
`stmt.bind(1, value); stmt.step();` becomes checked bind followed by checked step. File formats
|
||||
remain SQLite's; wrapper upgrades do not convert them to Storage. Roll back code only when
|
||||
the schema remains backward compatible, otherwise restore a verified backup with explicit
|
||||
reconciliation of subsequent writes. Graph coverage reported no recorded gaps for cited
|
||||
Sqlite files, and source was read directly. No SQL tests or performance measurements ran
|
||||
for this documentation assignment.
|
||||
@@ -0,0 +1,123 @@
|
||||
# Stacktrace — bounded diagnostics with explicit capabilities
|
||||
|
||||
Status: plan; feature tasks PLANNED. Baseline `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
Supports R-003/R-006/R-012/R-014 under [C-01–C-05 and C-11](../ARCHITECTURE.md).
|
||||
|
||||
## Existing surface and limits
|
||||
|
||||
[Stacktrace.hpp](../../../include/Void/Stacktrace/Stacktrace.hpp) exposes
|
||||
`Void::Stacktrace::StackFrame`, `capture_stacktrace(skip_frames, max_frames)`,
|
||||
`read_source_snippet`, `format_stacktrace` and `print_stacktrace`. Capture defaults to
|
||||
32 frames; each frame owns function/source/snippet strings. Source reads return Result,
|
||||
whereas capture returns a vector and suppresses exceptions. [Stacktrace.cpp](../../../src/Stacktrace/Stacktrace.cpp)
|
||||
uses Boost.Stacktrace/demangle, resolves source locations and reads snippets during capture,
|
||||
then logs diagnostics. [module.cmake](../../../src/Stacktrace/module.cmake) selects
|
||||
Boost's addr2line backend on the Unix branch and windbg on Windows, depends on Functional
|
||||
and LogState, and applies Unix debug/frame-pointer flags.
|
||||
|
||||
There is no `tests/standalone/Stacktrace` directory in the inspected baseline. Integration
|
||||
through [Testing's signal handler](../../../src/Testing/SignalHandler.cpp) invokes capture
|
||||
and formatting on a fatal signal. Existing allocation, file IO, demangling and logging are
|
||||
not an async-signal-safe crash facility. The plan must not market that path as safe recovery
|
||||
of a corrupted C++ process. [Testing](Testing.md) owns the replacement crash-isolation policy.
|
||||
|
||||
## Selected backend and NEW API
|
||||
|
||||
Retain the existing Boost backend initially behind a Void-owned capability interface;
|
||||
do not add a new unwinding dependency or promise equivalent symbols on every build.
|
||||
Split raw address capture from optional symbol/source enrichment. A standard-library
|
||||
backend is a later M-STACKTRACE-05 gate after toolchain feature probes and conformance,
|
||||
not an assumed C++26 implementation capability. None of this becomes a foundation dependency.
|
||||
|
||||
NEW illustrative surface in the existing namespace:
|
||||
|
||||
```cpp
|
||||
struct CaptureOptions { unsigned skip = 0; unsigned max_frames = 32; };
|
||||
struct ResolveOptions { bool source_snippets = false; std::size_t max_bytes = 64 * 1024; };
|
||||
struct RawTrace; // owning addresses plus module identity snapshot
|
||||
struct ResolvedTrace; // bounded frames, incomplete flag, per-frame status
|
||||
struct Capabilities; // raw capture, symbols, line info; no signal-safety inference
|
||||
Result<RawTrace> capture(CaptureOptions);
|
||||
Result<ResolvedTrace> resolve(const RawTrace&, ResolveOptions);
|
||||
Capabilities capabilities() noexcept;
|
||||
```
|
||||
|
||||
The legacy capture adapter composes capture/resolve using its historical presentation
|
||||
until the major release. NEW capture does not read source or emit through Log; an optional
|
||||
diagnostic hook belongs above the low-level path to avoid recursive logging/stacktrace
|
||||
failures. Unsupported line information is an explicit per-frame result, distinct from
|
||||
an empty stack, permission-denied source read, or a failed unwinder.
|
||||
|
||||
Capture snapshots addresses and module identifiers before a plugin generation can unload.
|
||||
A trace needed for later resolution either retains that generation or owns sufficient
|
||||
module/build-id metadata for an explicitly configured offline symbol resolver. Raw addresses
|
||||
alone are not stable identities across unload, ASLR or process restart. Do not retain a
|
||||
pointer to a transient loader structure. A synchronous embedded resolver is the default;
|
||||
managed deferred symbolization uses caller-supplied execution and bounded admission, not a
|
||||
global worker implicitly started by `capture`.
|
||||
|
||||
## Dataflow, bounds and failures
|
||||
|
||||
1. Validate skip/count and capacity before unwinding; cap NEW calls at 256 frames and
|
||||
return InvalidArgument above that limit. Capture may return a valid truncated trace
|
||||
with an explicit flag when the stack is deeper.
|
||||
2. Copy module identity/address records to owned storage. Resolve symbols outside any
|
||||
application registry or logging lock. Resolve failures preserve raw frames for diagnosis.
|
||||
3. Source snippets are opt-in and constrained to caller-provided allowed roots. Defaults:
|
||||
three context lines, 4 KiB per snippet, 64 KiB total rendered output, 1 MiB source-file
|
||||
scan budget. Enforce overflow-safe line arithmetic, maximum line length and file-read
|
||||
limits; reject unsafe paths and symlink escapes through the configured file-access port.
|
||||
4. A NEW resolver cache holds at most 1,024 entries/4 MiB and keys by module identity and
|
||||
address offset. Invalidated module identities cannot reuse stale symbol entries. Default
|
||||
managed resolution admits 32 jobs/2 MiB total pending trace input with one worker.
|
||||
5. Cancellation/deadline is checked between frames/source reads. The terminal result owns
|
||||
completed frames and indicates Partial/Cancelled; it never frees buffers still used by
|
||||
a backend. Blocking symbol-tool calls require a bounded child-process boundary if that
|
||||
backend cannot otherwise be interrupted.
|
||||
|
||||
Source paths, snippets and module names may reveal private build information. Default
|
||||
rendering removes configured source-root prefixes and omits snippets. Explicit diagnostic
|
||||
configuration enables them; telemetry must not attach arbitrary source text automatically.
|
||||
No debug source file is opened merely because untrusted input names it.
|
||||
|
||||
The initial crash path is subprocess test isolation: the parent records exit/signal and
|
||||
optional externally captured diagnostics. A NEW minimal fatal-signal marker may write a
|
||||
fixed-size record to a preopened descriptor using a reviewed platform-safe implementation,
|
||||
but it does not call the rich Stacktrace API or resume the failed process. A fully signal-safe
|
||||
unwinder is outside this phase and requires a separate safety/capability gate.
|
||||
|
||||
## Ordered backlog
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-STACKTRACE-01 | P0; existing source and Testing contract | Add direct tests for empty formatting, source failures, frame caps and optional symbols; fixture assertions tolerate stripped builds without hiding failed capture. | sol_implementer |
|
||||
| M-STACKTRACE-02 | P1; M-STACKTRACE-01, Functional errors | Separate capture/resolve, capability report, remove logging recursion from NEW path; source access is absent by default. | astra_implementer |
|
||||
| M-STACKTRACE-03 | P2; M-STACKTRACE-02, IO safe file access | Bounded source resolver/cache, redaction, backend timeouts; hostile path/line/size inputs remain within limits. | sol_implementer |
|
||||
| M-STACKTRACE-04 | P2; M-STACKTRACE-02, Testing subprocess isolation, Plugin generation ownership | Crash integration and deferred lifetime tests; fatal child does not corrupt the test runner and resolution cannot use unloaded code. | astra_implementer |
|
||||
| M-STACKTRACE-05 | P3; M-STACKTRACE-03/04, supported-toolchain probes | Evaluate standard backend and platform parity using identical tests/profiles; retain Boost unless evidence supports replacement. | astra_implementer |
|
||||
|
||||
P4 users consume the same diagnostics through [Observability](../subsystems/Observability.md),
|
||||
without transmitting full stacks by default. No independent distributed stacktrace service
|
||||
is required.
|
||||
|
||||
## Verification and migration
|
||||
|
||||
CURRENT: baseline build and aggregate CTest commands are in [validation](../VALIDATION.md).
|
||||
There is no current Stacktrace-specific suite to invoke. PROPOSED after M-STACKTRACE-01:
|
||||
`<configured-build>/tests/VoidTests --filter '^stacktrace_'`; prerequisites include the
|
||||
new tests, selected Boost backend and a build with known debug information. Test both
|
||||
stripped and debug fixtures, shared-library unload, invalid UTF/path text, missing source,
|
||||
huge line number, cancellation and a nonresponsive symbol helper. Never use the current
|
||||
rich handler itself as proof of signal safety.
|
||||
|
||||
[Performance](../PERFORMANCE.md) separates raw capture, symbol resolution, cold/warm cache,
|
||||
source IO and formatting; report p50/p95/p99, allocations, RSS/CPU and build/debug-symbol
|
||||
size using the common repetition and regression rules. Measure disabled hooks separately.
|
||||
|
||||
[Migration](../MIGRATION.md) retains current names through adapters and documents the new
|
||||
default of no source reads. Consumer examples transition from `capture_stacktrace()` to
|
||||
checked `capture()` and optional `resolve()`. Rollback restores the legacy normal-context
|
||||
presentation adapter, never the unsafe promise of surviving fatal signals. Package tests
|
||||
in [build/distribution](../BUILD-AND-DISTRIBUTION.md) verify optional backend linkage and
|
||||
minimal consumers. Cited files have checked graph coverage and direct source verification;
|
||||
no Stacktrace test or performance result was executed for this plan.
|
||||
@@ -0,0 +1,168 @@
|
||||
# System facilities and process lifecycle plan
|
||||
|
||||
Status: PLANNED feature work; no system implementation changes. Source baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Requirements R-003, R-006, R-009 and R-014 apply. Follow
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-06 and C-13.
|
||||
|
||||
## Existing source baseline
|
||||
|
||||
[Process.hpp](../../../include/Void/System/Process.hpp) exposes `Void::Process::run`,
|
||||
`run_streaming`, `shell`, `reexec`, `Output`, and line callbacks. Nonzero child exits
|
||||
are successful Results with an exit code. [Process.cpp](../../../src/System/Process.cpp)
|
||||
uses POSIX pipes/fork/execvp, writes stdin before draining outputs, polls stdout/stderr,
|
||||
sends SIGTERM on timeout, and then waits synchronously. The source derives a 30-second
|
||||
poll deadline when the supplied timeout is zero, despite the header's no-limit wording.
|
||||
It does not establish a bounded termination guarantee for a child ignoring SIGTERM.
|
||||
These are characterization and correction targets, not intentional NEW semantics.
|
||||
|
||||
[FileWatcher.hpp](../../../include/Void/System/FileWatcher.hpp) and
|
||||
[FileWatcher.cpp](../../../src/System/FileWatcher.cpp) provide
|
||||
`Void::FileSystem::FileWatcher`, a polling worker with default 500 ms polls and two
|
||||
stable polls before notification. It compares existence/mtime/size, and invokes copied
|
||||
callbacks outside the watch map lock. Stability of metadata is not proof of complete
|
||||
content or authenticity. Unwatch cannot revoke a copied callback already admitted.
|
||||
|
||||
[SignalWatcher.hpp](../../../include/Void/System/SignalWatcher.hpp) documents
|
||||
`Void::Process::SignalWatcher::create`, blocked signal-mask inheritance before worker
|
||||
startup, synchronous wait/poll, and destruction on its creating thread.
|
||||
[SignalWatcher.cpp](../../../src/System/SignalWatcher.cpp) is the platform implementation.
|
||||
[Path.hpp](../../../include/Void/System/Path.hpp),
|
||||
[Query.hpp](../../../include/Void/System/Query.hpp),
|
||||
[TempFile.hpp](../../../include/Void/System/TempFile.hpp), and
|
||||
[TempDir.hpp](../../../include/Void/System/TempDir.hpp) supply filesystem helpers and
|
||||
RAII temporary resources. `atomic_write` stages to a fixed sibling `.tmp` then renames;
|
||||
it does not fsync and must not be used as a durable-commit primitive based on its name.
|
||||
[Metrics.hpp](../../../include/Void/System/Metrics.hpp) supplies `Void::SystemInfo`
|
||||
Linux memory/process CPU samples, with unavailable/zero fallback on other platforms.
|
||||
[module.cmake](../../../src/System/module.cmake) declares Functional, LogState and Threads.
|
||||
|
||||
Existing fixtures cover [processes](../../../tests/standalone/System/Process.cpp),
|
||||
[streaming](../../../tests/standalone/System/ProcessStream.cpp),
|
||||
[watching](../../../tests/standalone/System/FileWatcher.cpp),
|
||||
[signals](../../../tests/standalone/System/SignalWatcher.cpp), and
|
||||
[paths](../../../tests/standalone/System/Path.cpp). Graph checks covered these source
|
||||
paths; partial Process/SignalWatcher/FileWatcher declarations were directly read.
|
||||
|
||||
## NEW process and filesystem contracts
|
||||
|
||||
Design sketch; Result follows Functional and OperationOptions belongs to Async:
|
||||
|
||||
```cpp
|
||||
namespace Void::Process { // NEW additions
|
||||
struct SpawnOptions {
|
||||
std::filesystem::path executable;
|
||||
std::vector<std::string> arguments;
|
||||
std::filesystem::path working_directory;
|
||||
EnvironmentPolicy environment; // explicit inherit or allowlist
|
||||
CaptureLimits capture; // bytes, line bytes, overflow policy
|
||||
};
|
||||
Result<Child> spawn(SpawnOptions);
|
||||
Coro::Task<Result<ExitStatus>> wait(Child&, Async::OperationOptions);
|
||||
Coro::Task<Result<Output>> communicate(Child&, InputSource&, Async::OperationOptions);
|
||||
}
|
||||
namespace Void::FileSystem { // NEW additions
|
||||
Result<void> replace_file(path, bytes, ReplaceOptions); // atomic visibility vs durable
|
||||
// watch registration -> owning WatchSubscription with close_and_join(options).
|
||||
}
|
||||
```
|
||||
|
||||
Child owns PID/process identity, descriptors and reaping responsibility. Move transfers
|
||||
all ownership. `communicate` concurrently writes stdin and reads both outputs through
|
||||
IO; EOF closes each direction independently, preventing pipe-buffer deadlock. Output
|
||||
retention and line streaming are separate policies: streaming need not retain all bytes.
|
||||
Default cap is 1 MiB each for stdout/stderr, 64 KiB per line, 4 MiB buffered input;
|
||||
overflow terminates the child and reports `output_limit` with truncated diagnostics.
|
||||
An explicit discard-after-limit mode continues draining and marks truncation.
|
||||
|
||||
Default active children per manager: 64; pending spawn requests: 128; admission rejects
|
||||
on overload. Argument/environment input totals are capped at 256 KiB and checked again
|
||||
against platform limits. Use argv execution by default. Shell interpretation is an
|
||||
explicit adapter; never concatenate untrusted arguments. Exec failures use an error
|
||||
pipe and retain errno, distinct from a program intentionally exiting 127. Environment
|
||||
snapshots are immutable per spawn and diagnostics redact marked secrets.
|
||||
|
||||
Timeout/stop first closes admission/input, requests SIGTERM for the owned process group,
|
||||
waits a configurable 2-second grace, then sends SIGKILL and reaps. Report cancelled or
|
||||
timed_out plus exit evidence; termination cannot undo external effects. Platform/kernel
|
||||
stalls can prevent prompt reaping, so a timeout does not release Child ownership. A
|
||||
manager retains outstanding reapers through shutdown. Descendants outside the process
|
||||
group are outside this guarantee; report that boundary. `reexec` remains an explicit
|
||||
application lifecycle action with open-descriptor policy and an error on exec failure.
|
||||
|
||||
System's synchronous primitives remain independently usable. NEW async process/watch
|
||||
adapters depend on [Async](Async.md) and [IO](../subsystems/IO.md) in an optional adapter
|
||||
target; the base System package does not depend on managed Runtime or force Async into
|
||||
small filesystem consumers. Final adapter target names are packaging work under
|
||||
[BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
## Watching, persistence and capability behavior
|
||||
|
||||
Retain polling as the portable initial backend. NEW injected scheduling uses Time's
|
||||
clock and one shared watcher service instead of a thread per file. Default 1,024 paths,
|
||||
256 queued notifications, one coalesced pending notification per path. Overflow emits a
|
||||
rescan-required marker; consumers reread/validate rather than infer a missing history.
|
||||
Path disappearance, atomic rename, symlink change and permission denial are distinct
|
||||
events. Default follows the configured path with no recursive traversal; symlink and
|
||||
directory-root restrictions are explicit options. Later Linux inotify is a capability
|
||||
adapter with the same rescan/overflow contract, gated after polling conformance.
|
||||
|
||||
Subscription state owns copied callback captures until close-and-join completes. User
|
||||
callbacks run outside locks and on the configured executor. Callback exceptions reach
|
||||
an error sink; they do not kill the watcher thread. Self-close requests stop but self-join
|
||||
is rejected. A callback never performs configuration publication itself; it submits a
|
||||
candidate to [Configuration](Configuration.md).
|
||||
|
||||
`replace_file` uses an exclusively created unpredictable sibling temporary file,
|
||||
bounded write loops, checked close/errors and rename on the same filesystem. Atomic
|
||||
visibility is distinct from durable replacement; durable mode syncs staged content,
|
||||
renames, then syncs the containing directory before acknowledgement. Failure after
|
||||
rename can mean visible-but-durability-unknown; return a phase-aware error and do not
|
||||
blindly overwrite on retry. Storage and Update retain their own commit protocols.
|
||||
Directory listing/read helpers gain explicit entry/byte limits and cancellation in
|
||||
the optional adapter. RAII temp factories enforce restrictive permissions and never
|
||||
recursively remove a directory they did not create and retain ownership of.
|
||||
|
||||
Capability queries return supported/unsupported/unavailable with diagnostic context.
|
||||
Metrics distinguish a real zero from unavailable sampling in NEW APIs. Native POSIX
|
||||
and standard filesystem facilities are initial choices; no external process or watcher
|
||||
library is required. Cross-platform backends are separate later conformance work.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
All feature rows are PLANNED.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-SYSTEM-01 | P0 / current source | Characterize zero timeout, SIGTERM resistance, full-duplex pipe and rename/fsync behavior; portable child fixtures | Existing semantics recorded; tests use built fixture paths rather than `/bin` assumptions / sol_implementer |
|
||||
| M-SYSTEM-02 | P1 / M-SYSTEM-01; Functional errors | Owned descriptors/Child, explicit spawn options, error pipe, bounded capture | Exec failure distinct from exit 127; all early failures close/reap; caps enforced / astra_implementer |
|
||||
| M-SYSTEM-03 | P2 / M-SYSTEM-02; Async and IO foundation gates | Full-duplex async communicate, stop escalation, joined process manager | Multi-pipe pressure completes; timeout/child-exit race delivers once and reaps / astra_implementer |
|
||||
| M-SYSTEM-04 | P2 / M-SYSTEM-01; Async/Time injection gates | Shared polling watcher, owned subscriptions, coalescing/rescan and callback errors | Unwatch+join drains callbacks; replacement/deletion/overflow deterministic / sol_implementer |
|
||||
| M-SYSTEM-05 | P2 / M-SYSTEM-02 | Explicit atomic/durable file replacement, safe temp factories, query bounds | Fault-injected write/sync/rename errors report the actual phase and clean only owned temporaries / astra_implementer |
|
||||
| M-SYSTEM-06 | P3 / M-SYSTEM-03, M-SYSTEM-04, M-SYSTEM-05 | Capability matrix, optional inotify, metrics validity, installed adapter checks | Polling/backend conformance identical; unsupported platforms fail explicitly / sol_implementer |
|
||||
|
||||
## Validation, performance and migration
|
||||
|
||||
CURRENT aggregate command is
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun here. The inherited two failures depend on absent `/bin/echo` and `/bin/cat`,
|
||||
not evidence that the proposed process contract passes. PROPOSED fixture executables
|
||||
must exercise ignored SIGTERM, delayed stdin consumption, simultaneous stdout/stderr,
|
||||
huge unbroken lines, inherited descriptors, child exit during stop and callback throw.
|
||||
Signal tests run in isolated processes to protect the test runner's mask. File tests
|
||||
inject short writes, failed fsync, rename collision, symlink replacement and full queues.
|
||||
|
||||
Measure spawn/wait p50/p95/p99, watcher detection latency versus polling interval,
|
||||
throughput, allocations, descriptor/thread counts, peak RSS/CPU and build cost under
|
||||
[PERFORMANCE](../PERFORMANCE.md). A large output producer must keep retained bytes
|
||||
within its cap; an idle watcher must not busy-spin. No benchmarks ran for this plan.
|
||||
|
||||
Keep current namespaces (`Void::Process`, `Void::FileSystem`, `Void::SystemInfo`).
|
||||
Legacy `run`/`run_streaming` adapt into a managed Child only after their timeout/output
|
||||
changes are versioned; no silently reclassified child exits. Replace misleading durable
|
||||
claims on `atomic_write` through documentation/deprecation and a major-release policy,
|
||||
with new explicit visibility/durability choices. Preserve polling as a rollback backend
|
||||
selected before watching starts. Rollback of an effective file replacement requires
|
||||
application version recovery, not repeating a failed syscall. See
|
||||
[MIGRATION](../MIGRATION.md), [VALIDATION](../VALIDATION.md),
|
||||
[DEPENDENCIES](../DEPENDENCIES.md) and [DELIVERY](../DELIVERY.md).
|
||||
@@ -0,0 +1,170 @@
|
||||
# Testing — trustworthy framework and deterministic verification
|
||||
|
||||
Status: plan; all feature tasks PLANNED. Baseline `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
R-002/R-003/R-012/R-016 and [C-01–C-05](../ARCHITECTURE.md) apply. Testing owns reusable
|
||||
harness primitives; each feature owns its behavioral oracle and fixtures.
|
||||
|
||||
## Existing framework and evidence
|
||||
|
||||
The namespace is `Void::Testing`. [Config.hpp](../../../include/Void/Testing/Config.hpp)
|
||||
defines test/assertion results, skip/crash states, filters, reporters, shuffle/seed/repeat
|
||||
and parallel options. [Runner](../../../src/Testing/Runner.cpp) implements regex filters,
|
||||
exact suite/tag filters, sequential and optional Async-thread-pool execution, console/JUnit
|
||||
output and exit handling. [Suite.hpp](../../../include/Void/Testing/Suite.hpp) registers
|
||||
annotated methods using reflection where supported. [tests/CMakeLists.txt](../../../tests/CMakeLists.txt)
|
||||
collects generated standalone shims into `VoidTests`. [module.cmake](../../../src/Testing/module.cmake)
|
||||
declares LogState and optional diagnostics/execution/configuration/text integrations.
|
||||
|
||||
[Math.cpp](../../../tests/standalone/Testing/Math.cpp) intentionally includes DisabledTest
|
||||
examples named `broken_feature` and `unquoted_skip`; these exercise skip behavior and are
|
||||
not missing product implementations. [ContainerFixture](../../../tests/standalone/Testing/ContainerFixture.cpp)
|
||||
and [StructRepr](../../../tests/standalone/Testing/StructRepr.cpp) provide further framework
|
||||
examples. The baseline result is 1,245 passed, two environmental process-fixture failures
|
||||
and three skips out of 1,250; see [validation](../VALIDATION.md). This task ran no tests.
|
||||
|
||||
Source-backed improvement targets: malformed regex currently yields an empty selection;
|
||||
JUnit reporter creation holds a static output stream; sequential signal handling invokes
|
||||
rich diagnostics and jumps out of a signal handler; parallel execution omits that crash
|
||||
recovery. [SignalHandler.cpp](../../../src/Testing/SignalHandler.cpp) has process-global
|
||||
callback/jump state. These are reasons to specify framework regression tests and process
|
||||
isolation, not to infer reliable crash containment from ordinary unit-test passes.
|
||||
|
||||
## Native harness design and NEW API
|
||||
|
||||
Keep the existing native framework and C++26 reflection/scanner paths. No wholesale
|
||||
replacement by a third-party testing framework. Optional compiler fuzz/sanitizer adapters
|
||||
are development tooling, absent from consumer dependencies. Runtime is never required
|
||||
merely to register or execute a synchronous test. [Time](Time.md) owns fake-clock semantics
|
||||
and [Async](Async.md) owns executor semantics; Testing supplies controlled adapters and
|
||||
schedule exploration around those contracts, not competing production types.
|
||||
|
||||
NEW illustrative shapes in `Void::Testing`:
|
||||
|
||||
```cpp
|
||||
struct ReplayToken { std::uint64_t seed; std::uint32_t generator_version; };
|
||||
struct PropertyOptions {
|
||||
unsigned cases = 256;
|
||||
unsigned max_size = 64;
|
||||
unsigned max_shrinks = 1000;
|
||||
};
|
||||
template<class Generator, class Predicate>
|
||||
PropertyResult check_property(Generator, Predicate, PropertyOptions, ReplayToken);
|
||||
class DeterministicRun; // ready-queue control, injected clock, event trace
|
||||
class FailureCapture; // bounded child assertion sink, explicit result inspection
|
||||
struct ProcessTestOptions; // timeout/output/resource budget, expected exit policy
|
||||
```
|
||||
|
||||
These types and `PropertyResult` are NEW. Failures retain the original case, minimized
|
||||
case, seed, generator/codec version, shrink path and schedule decisions. Select
|
||||
`std::mt19937_64` with a recorded 64-bit seed and case ordinal. M-TESTING-03 freezes
|
||||
bounded-uniform rejection mapping over its integer outputs, with cross-toolchain golden
|
||||
sequences; standard distribution implementation details must not silently change replay.
|
||||
User-supplied generators own their values and deterministic
|
||||
shrinkers produce a strictly decreasing complexity measure or exhaust the shrink budget.
|
||||
Example workflow: generate a vector, apply a container operation, compare to a simple
|
||||
reference, then replay the stored minimal case in a normal regression test.
|
||||
|
||||
The deterministic executor runs one ready action at a time in recorded admission order,
|
||||
advances the injected clock only under test control, and records alternative runnable
|
||||
choices. A bounded exploration mode enumerates selected interleavings. It must not claim
|
||||
to simulate OS threads, cache coherence, or arbitrary data races. Dedicated stress/TSan
|
||||
work remains necessary. Stop/completion races are assertions on exactly one terminal
|
||||
result and released ownership, not on wall-clock sleep timing.
|
||||
|
||||
## Framework correctness and failure handling
|
||||
|
||||
Registration becomes a frozen catalog before running tests. Duplicate stable test IDs,
|
||||
invalid regex/options, missing requested suites and unreadable report paths are explicit
|
||||
configuration failures. A NEW default fails an explicitly requested empty selection;
|
||||
`--allow-empty` is an explicit override. Listing is side-effect-free with respect to test
|
||||
bodies. Shuffle/repeat reports seed and iteration; discovery order is stable by test ID.
|
||||
|
||||
Every run owns its reporter streams and context. An assertion emitted outside an active
|
||||
test is a framework error, not silently assigned to the next test. Async test adapters
|
||||
retain a context handle until their task scope joins; thread-local convenience access does
|
||||
not permit borrowed `TestResult*` pointers to escape. Freeze a result only after callbacks
|
||||
and mock verifiers finish. Reporter callbacks see immutable result snapshots outside registry
|
||||
locks; reporter failure makes the overall run fail and preserves an emergency summary.
|
||||
|
||||
One fixture lifecycle controller handles construction, setup, body, teardown and destruction.
|
||||
After setup is entered, teardown is attempted exactly once even if setup/body fails; destroy
|
||||
always runs for a constructed fixture. Report primary and cleanup errors separately. A
|
||||
require/fatal assertion aborts only that test's controlled scope, while ordinary expect
|
||||
records and continues. Intentional skip reasons survive console and JUnit output.
|
||||
|
||||
Crash/timeout tests run in fresh child processes through [System](System.md), with one
|
||||
selected test ID and a bounded result channel. Parent waits/reaps and distinguishes ordinary
|
||||
failure, signal, timeout, infrastructure failure and missing result. It can terminate the
|
||||
child after its deadline; it cannot safely kill an in-process C++ test thread and continue
|
||||
using its corrupted objects. Remove promises of rich signal-handler recovery in coordination
|
||||
with [Stacktrace](Stacktrace.md). Ordinary exception tests remain in-process.
|
||||
|
||||
## Resource policies and fuzz/property capabilities
|
||||
|
||||
NEW defaults: sequential execution; explicit parallel mode caps workers at four unless
|
||||
configured otherwise; 100,000 registered tests; 1,000 retained assertions/1 MiB diagnostics
|
||||
per test; 64 MiB aggregate report buffer. Above the assertion cap, retain first failures
|
||||
and counters, mark truncation, and continue or abort according to test policy without
|
||||
unbounded growth. Reporters stream results to avoid retaining all output text.
|
||||
|
||||
Property defaults above additionally cap generated input at 1 MiB, corpus at 64 MiB and
|
||||
one property at five seconds/10,000 scheduled steps. Time checks occur between generator,
|
||||
case and shrink calls; uncooperative custom callbacks require subprocess isolation for a
|
||||
hard timeout. A budget exhaustion is Inconclusive,
|
||||
not Pass. Rejection sampling is limited to ten times the requested successful case count;
|
||||
an impossible precondition is reported. Shrinking preserves the original failure category
|
||||
and never consumes production network/filesystem state. Use generated fixtures, not private data.
|
||||
|
||||
Process-test defaults: 60-second timeout, 1 MiB captured output per stream, four concurrent
|
||||
children, 256 pending jobs. Optional Linux resource limits are capability-reported rather
|
||||
than assumed portable. Output overage truncates with counts; it cannot deadlock a full pipe.
|
||||
Stop requests close admission, terminate opted-in child jobs, drain pipes, reap children
|
||||
and join owned harness work. Embedded in-process deadlines remain cooperative.
|
||||
|
||||
Fuzz entry points accept byte spans and use feature-owned parsers/models. NEW compiler
|
||||
adapters expose those same functions to supported fuzz engines; a deterministic corpus
|
||||
replay runner works without them. Corpus metadata records format, fixture license/source,
|
||||
seed and maximum memory/time. Minimized failures become normal regression fixtures.
|
||||
Mutation/crash-injection campaigns verify the oracle: intentionally broken length checks,
|
||||
lost writes or duplicate completions must be detected by the harness.
|
||||
|
||||
## Ordered tasks
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-TESTING-01 | P0; existing runner/registration | Framework self-tests for filter/seed/skip/fixture/reporter/exit behavior, with subprocess expected-failure fixtures; skip demonstrations remain intentional. | astra_implementer |
|
||||
| M-TESTING-02 | P1; M-TESTING-01, Async context ownership, System child process | Per-run contexts/reporters and crash isolation; cleanup runs once, child crash is contained, invalid selection cannot produce false success. | astra_implementer |
|
||||
| M-TESTING-03 | P1; M-TESTING-02, Time fake clock, Async test executor | Deterministic schedule driver, versioned generator/shrinker and replay token; cross-build seed replay and schedule minimization are reproducible. | astra_implementer |
|
||||
| M-TESTING-04 | P2; M-TESTING-03, Binary/Data bounded fixtures | Property combinators, model traces and failure capture; known faulty algorithms are caught and shrink to replayable cases. | sol_implementer |
|
||||
| M-TESTING-05 | P2; M-TESTING-02/04, supported compiler probes | Corpus runner, optional fuzz adapters, subprocess resource controls and sanitizer matrix; unsupported tooling is reported and corpus replay still works. | sol_implementer |
|
||||
| M-TESTING-06 | P3; M-TESTING-03/05, shared validation/performance schemas | Fault-file/transport ports and benchmark evidence adapters used by Storage/IO/Net; injected faults occur at named boundaries and totals reconcile. | astra_implementer |
|
||||
| M-TESTING-07 | P4; M-TESTING-06, Coordination/Replication models | Distributed schedule/history harness; partition/restart/duplicate scenarios reproduce and reject deliberately invalid histories. | astra_implementer |
|
||||
|
||||
## Validation and migration
|
||||
|
||||
CURRENT test-runner syntax is source-verified. TEMPLATE:
|
||||
`<existing-build>/tests/VoidTests --filter '^(addition|db_query|broken_feature|unquoted_skip)$'`.
|
||||
`--filter` matches test names and suite-qualified names using regex search. No run is claimed
|
||||
here. PROPOSED after M-TESTING-01: a separate framework-verification child fixture set with
|
||||
known exit codes, exact counts and parsed JUnit output, driven by a parent checker independent
|
||||
of the framework assertions being checked. A green self-hosted suite alone is insufficient.
|
||||
|
||||
Required regressions include malformed regex, empty explicit selection, report-open failure,
|
||||
two runs to different output files, duplicate registration, require during setup/teardown,
|
||||
late async assertion, deterministic repeat/shuffle, intentional skips, signal/timeout,
|
||||
pipe saturation and a deliberately failing property. Verify expected failures without
|
||||
editing a live result to Passed. Run isolated module consumers and supported reflection
|
||||
configurations under [build/distribution](../BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
Apply [performance](../PERFORMANCE.md) to assertion overhead, reflection/registration build
|
||||
cost, worker scheduling and bounded report memory; preserve p50/p95/p99, throughput,
|
||||
allocations and RSS/CPU evidence without turning benchmark variance into test failure.
|
||||
[Validation](../VALIDATION.md) owns sanitizer/toolchain gates and baseline failure reporting.
|
||||
|
||||
[Migration](../MIGRATION.md) keeps Test/Suite/expect/require adapters while introducing
|
||||
explicit contexts, replay and isolation. NEW strict option validation is a documented
|
||||
major behavior change. Rollback may keep old output formats via adapters, but must not
|
||||
restore silent passing of invalid selections. [TestingMock](TestingMock.md) integrates
|
||||
through FailureCapture and joined contexts, with no reverse dependency from Testing to mocks.
|
||||
Graph coverage was checked for all cited source; partial Registrar syntax was read directly.
|
||||
No new framework, fuzz, crash or benchmark checks ran during documentation authoring.
|
||||
@@ -0,0 +1,149 @@
|
||||
# TestingMock — deterministic expectations and owned actions
|
||||
|
||||
Status: plan; implementation tasks PLANNED. Baseline `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
R-002/R-014/R-016 and [C-02–C-05](../ARCHITECTURE.md) govern future work.
|
||||
|
||||
## Existing capabilities and concrete gaps
|
||||
|
||||
`Void::TestingMock` provides [MockFunction](../../../include/Void/TestingMock/MockFunction.hpp),
|
||||
[Expectation](../../../include/Void/TestingMock/Expectation.hpp),
|
||||
[matchers](../../../include/Void/TestingMock/Matcher.hpp), and
|
||||
[Mock/MockBase](../../../include/Void/TestingMock/Mock.hpp). Expectations match arguments,
|
||||
record calls and run actions; `times`, `once`, `returns` and `invokes` are existing names.
|
||||
Actions use `std::move_only_function`; the [move-only action test](../../../tests/standalone/TestingMock/MoveOnlyAction.cpp)
|
||||
specifically demonstrates a unique_ptr-capturing lambda, not arbitrary move-only arguments
|
||||
or move-only returned values. Matching/execution currently passes arguments through several
|
||||
by-value layers, and `returns` returns its stored value as an lvalue.
|
||||
|
||||
`MockFunction::operator()` holds its mutex while matching and executing user actions.
|
||||
Expectation registration and verify/clear do not use that same synchronization. MockBase
|
||||
stores non-owning function pointers; registration has no lifetime token. `verify()` clears
|
||||
expectations, while destructors call it automatically. Preserve existing convenient usage
|
||||
but do not infer concurrent reconfiguration or reentrant action safety from the mutex.
|
||||
|
||||
[Reflect.hpp](../../../include/Void/TestingMock/Reflect.hpp) lists virtual methods and checks
|
||||
handwritten mocks; its source explicitly distinguishes introspection from unsupported
|
||||
override-code injection. Reflection availability is toolchain-probed, not a promise that
|
||||
complete automatic mock generation already exists. [module.cmake](../../../src/TestingMock/module.cmake)
|
||||
depends on Testing and Functional. Evidence includes
|
||||
[VerifyAll](../../../tests/standalone/TestingMock/VerifyAll.cpp),
|
||||
[FailureMessages](../../../tests/standalone/TestingMock/FailureMessages.cpp), and
|
||||
[Reflect tests](../../../tests/standalone/TestingMock/Reflect.cpp).
|
||||
|
||||
## Selected native design and NEW contract
|
||||
|
||||
Retain a native header-oriented mock library integrated with [Testing](Testing.md); no new
|
||||
external mocking engine. Separate configuration from invocation. A NEW session freezes
|
||||
expectations before concurrent calls, retains action/registration state, and closes after
|
||||
the test's task scope has joined. Existing `expect(...).invokes(...).times(...)` remains a
|
||||
builder adapter. Mutating a frozen session returns InvalidState rather than racing.
|
||||
|
||||
Illustrative NEW shapes in the existing namespace:
|
||||
|
||||
```cpp
|
||||
enum class Concurrency { SingleThread, ConcurrentActions };
|
||||
struct MockLimits { std::size_t expectations = 1024; std::size_t events = 4096; };
|
||||
class MockSession; // owns registrations, diagnostics and verification state
|
||||
class Sequence; // explicit order group, never global registration order
|
||||
struct Verification; // structured missing/excess/unmatched/action failures
|
||||
Result<void> freeze(MockSession&, Concurrency);
|
||||
Verification verify_and_close(MockSession&);
|
||||
// NEW builder operations: at_least(n), at_most(n), in_sequence(seq),
|
||||
// returns_once(move_only_value), invokes_once(move_only_action).
|
||||
```
|
||||
|
||||
`SingleThread` is the NEW default and permits same-thread reentrant calls after releasing
|
||||
internal locks; concurrent entry from another thread returns a deterministic framework
|
||||
failure. `ConcurrentActions` explicitly requires custom matchers/actions to support concurrent
|
||||
invocation. The library does not secretly serialize arbitrary user code under a mutex and
|
||||
cannot make a captured mutable object thread-safe by retaining it.
|
||||
|
||||
Invocation dataflow: snapshot immutable candidate matchers under a short session lock,
|
||||
evaluate pure matchers outside it, then reacquire to reserve a matching unsaturated
|
||||
expectation and sequence position. If another call consumed it, retry the remaining immutable
|
||||
candidates against the same borrowed arguments. Reservation is the call's linearization
|
||||
point. Release the lock, run the reserved action, then record terminal outcome. Keep the
|
||||
expectation/action storage alive through that outcome; verification waits for owned calls.
|
||||
Registration order breaks ties among otherwise eligible expectations. A custom matcher
|
||||
must be side-effect-free because it may be reevaluated; exceptions become MatcherFailure.
|
||||
|
||||
Once-actions transfer their move-only callable/value to the reserved invocation. Repeated
|
||||
actions stay in a retained immutable registration holder and use the explicitly selected
|
||||
concurrency policy; do not copy a move-only callable. Matchers inspect arguments through
|
||||
const references; forward each argument to the action exactly once after selection. Provide
|
||||
compile-time diagnostics for impossible reference lifetimes and missing return actions.
|
||||
For reference-return mocks the user must supply a lifetime-safe referent. A mismatched
|
||||
non-default-constructible return cannot fall back to `R{}`: record failure then throw a
|
||||
Testing-owned invocation-abort exception, caught at the test boundary. No exception crosses
|
||||
a plugin C boundary; C-facing mocks use status/result actions.
|
||||
|
||||
Explicit order groups model call dependencies. `never()` is an explicit prohibition checked
|
||||
before ordinary candidate selection; it is not a saturated zero-count expectation silently
|
||||
skipped by the matcher loop. Negative counts are invalid; min≤max is checked at freeze.
|
||||
Verification is idempotent and reports each unmet condition once, retaining a bounded
|
||||
summary for subsequent calls rather than destroying evidence prematurely.
|
||||
|
||||
## Ownership, diagnostics and resource limits
|
||||
|
||||
A registration token replaces MockBase's untracked raw-pointer lifetime for dynamic mocks.
|
||||
Removing a registration stops admission and joins its admitted calls before releasing action
|
||||
state. Destructors never throw; they perform best-effort verification through a retained
|
||||
Testing context. Explicit `verify_and_close` is preferred so failures cannot arrive after
|
||||
the result has frozen. Closing from inside an action returns WouldDeadlock or schedules
|
||||
deferred close; it cannot synchronously wait for itself.
|
||||
|
||||
NEW defaults: 1,024 expectations per session, 64 matchers per expectation, 4,096 retained
|
||||
invocation events, 4 MiB diagnostic memory and 4 KiB rendering per argument. Event overflow
|
||||
keeps total counters and first/last bounded samples, marks truncation, and does not drop
|
||||
the fact that an unexpected call happened. Bound matcher-description depth at 32. Test
|
||||
configuration may lower these; zero means zero capacity, never unlimited. User action
|
||||
allocations remain outside the framework's memory bound and are subject to process-test
|
||||
limits. Use Time's injected clock for timestamps and Testing's event sequence for ordering.
|
||||
|
||||
FailureCapture from Testing records expected mock failures in an isolated child assertion
|
||||
sink. Replace framework tests that temporarily alter the live test result with this API.
|
||||
Diagnostics report actual arguments, candidate matcher descriptions, declaration location,
|
||||
reserved call index and order-group position. Redaction is available for fixtures containing
|
||||
sensitive-looking fields; captured arbitrary object bytes are never a default diagnostic.
|
||||
|
||||
Async actions compose with Async tasks owned by the test scope. A NEW scripted action can
|
||||
yield a response, error, partial transfer, cancellation or delayed completion through the
|
||||
deterministic executor. It cannot retain borrowed arguments after return unless it copies
|
||||
them into an admitted owned buffer. The mock does not invent a second scheduler or wall-clock
|
||||
sleep mechanism. Scripted transport/file mocks are reusable test ports, not production APIs.
|
||||
|
||||
## Ordered backlog
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-TESTINGMOCK-01 | P0; current tests, Testing failure capture | Characterize once/count/unmatched/destructor semantics with isolated expected failures and compile fixtures; preserve current examples. | sol_implementer |
|
||||
| M-TESTINGMOCK-02 | P1; M-TESTINGMOCK-01, Testing context ownership | Session freeze/close, registration tokens and action-outside-lock reservation; reentrant actions complete, destroyed dynamic registrations cannot dangle. | astra_implementer |
|
||||
| M-TESTINGMOCK-03 | P2; M-TESTINGMOCK-02 | Perfect forwarding, once/repeated actions, explicit prohibition/ranges/sequence groups; move-only args/returns and count races have defined results. | astra_implementer |
|
||||
| M-TESTINGMOCK-04 | P2; M-TESTINGMOCK-03 | Bounded structured diagnostics, matcher combinators, property models and regression tests of the mock framework itself; injected wrong behavior is detected. | sol_implementer |
|
||||
| M-TESTINGMOCK-05 | P3; M-TESTINGMOCK-04, Testing deterministic run, Async/Time contracts | Scripted async/file/transport faults and cancellation; no post-close callback and every script is replayable by seed. | astra_implementer |
|
||||
| M-TESTINGMOCK-06 | P3; M-TESTINGMOCK-03, compiler probes | Reflection signature checks for overload/cv/ref/noexcept/inheritance cases; unsupported code generation remains explicitly unavailable. | sol_implementer |
|
||||
|
||||
P4 distributed tests reuse scripted ports; consensus assertions stay with Coordination and
|
||||
Replication. Cross-module ownership is tracked in [dependencies](../DEPENDENCIES.md).
|
||||
|
||||
## Acceptance and migration
|
||||
|
||||
CURRENT TEMPLATE for verified names:
|
||||
`<existing-build>/tests/VoidTests --filter '^(invokes_accepts_unique_ptr_capturing_lambda|verify_all_.*|failure_message_.*)$'`.
|
||||
See [validation](../VALIDATION.md) for build prerequisites and actual baseline outcomes.
|
||||
PROPOSED after M-TESTINGMOCK-02–05: deterministic two-call reservation races, action reentry,
|
||||
action throwing, verification while calls are admitted, unmatched move-only return,
|
||||
dynamic unregister, expired test context, never/range violations, scripted cancellation,
|
||||
seed replay and diagnostics saturation. Compile-negative fixtures verify lifetime/signature
|
||||
diagnostics separately from runtime tests. Use sanitizers where supported.
|
||||
|
||||
[Performance](../PERFORMANCE.md) measures matching cost versus expectation count, contention,
|
||||
diagnostic allocation and reflection build cost, with p50/p95/p99 and peak RSS/CPU. Avoid
|
||||
optimizations that skip mismatch evidence. [Migration](../MIGRATION.md) adds explicit sessions
|
||||
first; legacy destructor verification stays documented until the major transition. Repeated
|
||||
stateful actions must opt into concurrency; existing serial tests should need only optional
|
||||
explicit close. Keep handwritten mocks usable when reflection lacks a capability.
|
||||
|
||||
Coverage: graph checks and direct reads covered cited files, including MockFunction's flagged
|
||||
template parse range. New thread-safety, property/fuzz and async behavior is planned, not
|
||||
verified by the existing move-only action test or this documentation change.
|
||||
@@ -0,0 +1,141 @@
|
||||
# Text, byte encodings and parsing utilities
|
||||
|
||||
Status: planning only; tasks below are **PLANNED**. Source baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Existing source and tests
|
||||
|
||||
[Text's declaration](../../../src/Text/module.cmake) has no dependencies.
|
||||
[Str](../../../include/Void/Text/Str.hpp) supplies trim, case conversion, split/join,
|
||||
replacement, padding and numeric conversion in `Void::Str`.
|
||||
[Format](../../../include/Void/Text/Format.hpp) adds placeholder rendering, wrapping and
|
||||
tables; [Tokenizer](../../../include/Void/Text/Tokenizer.hpp) owns ordered matching
|
||||
rules and allocating tokens; [Semver](../../../include/Void/Text/Semver.hpp) supplies
|
||||
versions and ranges. [Diff](../../../include/Void/Text/Diff.hpp) implements Myers-style
|
||||
edit reconstruction with stored trace vectors and line adapters. This exposes a meaningful
|
||||
memory/work bound to add, including checked conversion from size_t to internal indices.
|
||||
|
||||
Byte encoders live in `Void::Encoding::Base64`, `Hex` and `Url`:
|
||||
[Base64](../../../include/Void/Text/Base64.hpp),
|
||||
[Hex](../../../include/Void/Text/Hex.hpp), [Url](../../../include/Void/Text/Url.hpp).
|
||||
URL decoding explicitly distinguishes plus-as-space; URL-safe Base64 decoding rejects
|
||||
padding and invalid trailing bits. [Html](../../../include/Void/Text/Html.hpp) has
|
||||
entity unescaping, not a complete HTML parser or sanitizer. Neither existing case helpers
|
||||
nor byte length are a Unicode normalization or grapheme contract.
|
||||
|
||||
Current suites include [Str](../../../tests/standalone/Text/Str.cpp),
|
||||
[Encoding](../../../tests/standalone/Text/Encoding.cpp),
|
||||
[Tokenizer](../../../tests/standalone/Text/Tokenizer.cpp),
|
||||
[Format](../../../tests/standalone/Text/Format.cpp),
|
||||
[Semver](../../../tests/standalone/Text/Semver.cpp), and
|
||||
[Diff](../../../tests/standalone/Text/Diff.cpp). Graph parsing is partial at Diff lines
|
||||
30/96; both signatures and surrounding algorithm were read directly.
|
||||
|
||||
## Boundary and native implementation
|
||||
|
||||
Text remains byte/ASCII infrastructure under [C-01/C-05/C-13](../ARCHITECTURE.md).
|
||||
NEW Unicode owns UTF decoding, normalization, casing and segmentation. Select one-way
|
||||
dependency **Unicode→Text**: Text never imports Unicode. An opt-in NEW
|
||||
`include/Void/Unicode/TextAdapters.hpp` lives with Unicode. Existing Text byte operations
|
||||
remain useful without versioned Unicode tables. General numeric policy stays in Math;
|
||||
legacy Text numeric wrappers may use a small explicitly declared Math adapter header,
|
||||
not force Math on every Str include. Native byte scanners and standard string/span/
|
||||
from_chars are sufficient; no regex engine, ICU or formatting dependency is required.
|
||||
Generic diff mechanics move to Algorithms; Text keeps line/patch formatting above it.
|
||||
|
||||
## NEW bounded APIs and dataflow
|
||||
|
||||
Illustrative NEW additions in NEW `include/Void/Text/Bounded.hpp`:
|
||||
|
||||
```cpp
|
||||
namespace Void::Text {
|
||||
struct TextLimits {
|
||||
std::size_t max_input = 16 * 1024 * 1024;
|
||||
std::size_t max_output = 16 * 1024 * 1024;
|
||||
std::size_t max_parts = 65536;
|
||||
};
|
||||
struct TextError { enum Code { invalid_encoding, invalid_rule, limit } code;
|
||||
std::size_t offset; };
|
||||
std::expected<std::vector<std::string_view>, TextError>
|
||||
split_views(std::string_view input, std::string_view delimiter, TextLimits);
|
||||
std::expected<std::string, TextError>
|
||||
replace_bounded(std::string_view input, std::string_view needle,
|
||||
std::string_view replacement, TextLimits);
|
||||
}
|
||||
```
|
||||
|
||||
The code is a proposed shape, not an existing compiling example. `split_views` borrows
|
||||
input; delimiter is literal bytes; empty delimiter is invalid, empty fields are retained
|
||||
unless an explicit policy drops them. Returned views expire with input. `replace_bounded`
|
||||
counts matches then checks multiply/add before reserving; it never grows beyond the
|
||||
configured cap. Empty needle is invalid. Trim/case helpers gain explicit `_ascii` names
|
||||
and deterministic classification of bytes 0–127; bytes ≥128 are preserved, avoiding
|
||||
locale-dependent behavior. Unicode casing is requested from Unicode explicitly.
|
||||
|
||||
Encoders gain `encode_into(span<char>)`/`decode_into(span<byte>)`, reporting required
|
||||
capacity and error offset. Validate the whole token and required output size before
|
||||
publishing output for all-or-nothing overloads. Separate streaming codecs expose consumed/
|
||||
produced counts and partial-output semantics. Base64 defaults are strict alphabet,
|
||||
padding and unused-bit validation; URL-safe unpadded is a named profile. Permissive MIME
|
||||
whitespace decoding is explicit. Hex rejects odd length by default. URL percent decoding
|
||||
does not apply UTF normalization, path traversal resolution or repeated decoding.
|
||||
Protocol owners decide when decoding is permitted; Text does not reinterpret signed bytes.
|
||||
|
||||
Tokenizer's NEW view mode returns kind, byte range, line and byte-column offsets without
|
||||
copying lexemes. Defaults: 128 rules, 65,536 tokens, 1 MiB/token and the common 16 MiB input
|
||||
cap. First matching rule wins, preserving current ordered-rule intent. A callback result
|
||||
of zero means no match; a result beyond remaining bytes is `invalid_rule`. Every successful
|
||||
token advances, preventing non-progress loops. Rule callables may allocate or throw;
|
||||
exceptions propagate unless the caller selects an explicit Functional adapter. An
|
||||
incremental tokenizer owns its incomplete token buffer and limits it; views passed to
|
||||
callbacks are valid only for that callback. Long scans check optional stop tokens every
|
||||
4 KiB and return an explicit stopped result with consumed offset.
|
||||
|
||||
Format gains sink/output-span variants and bounded table cell/column counts (256 columns,
|
||||
65,536 rows, 16 MiB output). Missing placeholders remain literal by compatibility policy;
|
||||
strict rendering reports missing keys. Width is bytes in Text, never terminal display
|
||||
width. Semver separates strict SemVer parsing from the existing convenient `v` prefix
|
||||
profile, and caps versions at 4 KiB, identifiers at 256 and range clauses at 128. Range
|
||||
evaluation documents prerelease admission and build metadata comparison.
|
||||
|
||||
Diff defaults cap combined input at 65,536 elements, edit distance at 4,096 and scratch at
|
||||
16 MiB. Exceeding a work limit returns `limit`, not a silently approximate patch. Use
|
||||
Algorithms' checked Myers engine and leave later linear-space reconstruction behind the
|
||||
measured large-diff capability gate. A patch includes source identity/expected deletes;
|
||||
applying it validates input instead of merely emitting inserts/equalities as proof of a
|
||||
matching source. Human patch rendering escapes control bytes and caps output.
|
||||
|
||||
## Implementation tasks
|
||||
|
||||
| Task | Phase; dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-TEXT-01 | P0; current source | Freeze legacy byte behavior, encoding profiles, Semver ordering and diff fixtures; document allocating/borrowed return lifetimes. | sol_implementer |
|
||||
| M-TEXT-02 | P1; M-TEXT-01 | Add ASCII-explicit helpers, view splitting and checked bounded growth; high bytes and overflow sizes are deterministic without Unicode linkage. | sol_implementer |
|
||||
| M-TEXT-03 | P2; M-TEXT-02 | Add strict into-span and streaming encoding APIs; every split boundary, malformed tail and insufficient-output case preserves its stated publication contract. | sol_implementer |
|
||||
| M-TEXT-04 | P2; M-TEXT-02 | Add tokenizer view/incremental modes and rule budgets; invalid rule lengths and chunk-split tokens cannot overread or loop forever. | sol_implementer |
|
||||
| M-TEXT-05 | P2; M-TEXT-02 | Complete bounded formatting and strict/compatibility Semver profiles; prerelease/range and output-limit tests pass. | sol_implementer |
|
||||
| M-TEXT-06 | P2; Algorithms bounded-diff gate; M-TEXT-01 | Delegate generic diff, add checked patch apply and rendering; replay reconstructs target and mismatched source is rejected. | sol_implementer |
|
||||
| M-TEXT-07 | P3; M-TEXT-03–06; Unicode conformance gate | Publish optional Unicode adapter examples and installed consumers; Text-only binary links without Unicode tables and legacy adapters retain fixtures. | sol_implementer |
|
||||
|
||||
## Validation, resources and migration
|
||||
|
||||
CURRENT checks are the linked suites and parent baseline, with no new test execution.
|
||||
PROPOSED tests include arbitrary byte fuzzing, every codec chunk split, invalid padding,
|
||||
overlong percent escape tails, embedded NUL, CRLF location tracking, adversarial tokenizer
|
||||
callbacks, integer length overflow, large repeated diff inputs and strict Semver vectors.
|
||||
Round-trip tests alone are insufficient: independently specified invalid inputs must fail.
|
||||
No security claim treats HTML unescaping as sanitization or URL decoding as authorization.
|
||||
|
||||
Measure ASCII and mixed UTF-8 byte workloads, allocations per split/token, streaming
|
||||
throughput, diff worst-case scratch and build cost under [PERFORMANCE](../PERFORMANCE.md).
|
||||
Report p50/p95/p99, peak RSS/CPU and limits hit; do not compare owning and borrowed output
|
||||
without labeling their lifetime/work difference. No module starts threads; streaming
|
||||
state is owned by its caller and finalization reports incomplete input.
|
||||
|
||||
[Migration](../MIGRATION.md) retains old namespaces and byte semantics through named
|
||||
compatibility functions. Unicode adapters never silently normalize keys or signed
|
||||
documents. Existing URL-safe Base64 strictness stays protected. Rollback selects the old
|
||||
package; applications that persisted normalized data need their own format/version
|
||||
transition, not a Text-wide rewrite. See [requirements](../REQUIREMENTS.md),
|
||||
[DEPENDENCIES](../DEPENDENCIES.md), [VALIDATION](../VALIDATION.md),
|
||||
[DELIVERY](../DELIVERY.md) and [Unicode](../subsystems/Unicode.md).
|
||||
@@ -0,0 +1,146 @@
|
||||
# Time, injected clocks and measurement
|
||||
|
||||
Status: planning only; all feature work is **PLANNED**. Source baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Current source
|
||||
|
||||
[Time](../../../src/Time/module.cmake) has no declared dependencies.
|
||||
[Stopwatch](../../../include/Void/Time/Stopwatch.hpp) uses `steady_clock`, mutable
|
||||
single-writer state and an unbounded vector of laps. [Format](../../../include/Void/Time/Format.hpp)
|
||||
supplies duration formatting/parsing, UTC strings and an ISO-8601 duration subset;
|
||||
fractional interval seconds are truncated and calendar years/months are unsupported.
|
||||
Some allocating format functions are `noexcept`, which requires migration review.
|
||||
[Bench](../../../include/Void/Time/Bench.hpp) lives in `Void::Bench`, distinct from
|
||||
`Void::Time`, and calls a `std::function<void()>` between two clock reads per iteration.
|
||||
It records total/min/max/mean/operations-per-second and a vector-backed Suite. There
|
||||
are no existing per-sample percentile, injected-clock or managed-timer contracts here.
|
||||
`run_for` measures each body but checks the wall budget outside it; a body can exceed
|
||||
the budget and cannot be forcibly stopped. `run` with zero iterations leaves min/max
|
||||
sentinels, unlike `run_for`'s normalized empty result.
|
||||
|
||||
[Stopwatch](../../../tests/standalone/Time/Stopwatch.cpp),
|
||||
[Time](../../../tests/standalone/Time/Time.cpp) and
|
||||
[Bench](../../../tests/standalone/Time/Bench.cpp) tests cover existing behavior. Some
|
||||
tests sleep/use real time; future deterministic tests must supplement those, not claim
|
||||
that elapsed-time nonnegativity proves clock injection. Scoped graph coverage reported
|
||||
no recorded gaps; relevant implementation and tests were read directly.
|
||||
|
||||
## Clock ownership and NEW shape
|
||||
|
||||
Time owns clocks under [C-03/C-04](../ARCHITECTURE.md); Async owns waiting, operation
|
||||
options and completion. Scheduler owns calendar jobs. Runtime may retain clock objects
|
||||
but Time never imports these modules. Native `std::chrono` is the initial backend.
|
||||
No external timer thread or timezone service starts on inclusion or construction.
|
||||
|
||||
Illustrative NEW API, proposed NEW `include/Void/Time/Clock.hpp`:
|
||||
|
||||
```cpp
|
||||
namespace Void::Time {
|
||||
enum class ClockError { negative_step, overflow };
|
||||
class MonotonicClock {
|
||||
public:
|
||||
using time_point = std::chrono::steady_clock::time_point;
|
||||
virtual time_point now() const noexcept = 0;
|
||||
virtual ~MonotonicClock() = default;
|
||||
};
|
||||
class CivilClock {
|
||||
public:
|
||||
virtual std::chrono::system_clock::time_point now() const noexcept = 0;
|
||||
virtual ~CivilClock() = default;
|
||||
};
|
||||
class ManualClock final : public MonotonicClock {
|
||||
public:
|
||||
time_point now() const noexcept override;
|
||||
std::expected<void, ClockError> advance(std::chrono::nanoseconds);
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
Native adapters return standard steady/system clock points. ManualClock starts at the
|
||||
steady epoch, rejects backward steps and overflow, and publishes atomic ticks for tests.
|
||||
The injected clock must have a stable lifetime through final operation shutdown. It
|
||||
does not itself wake executors: a manual-time test advances the clock then explicitly
|
||||
drives Async's timer backend. Backends must not compare manual clock deadlines with
|
||||
the host's steady `now()`. Conversion to OS waits uses `deadline - injected.now()`;
|
||||
native absolute OS deadlines are used only for a verified matching clock domain.
|
||||
An expired deadline at admission fails without submitting work. This preserves Async's
|
||||
standard steady time-point operation options while making clock-domain ownership explicit.
|
||||
|
||||
Stopwatch gains a borrowed MonotonicClock constructor and a maximum 4,096 retained laps;
|
||||
`try_lap()` reports full without growing storage. Existing convenience stopwatch uses
|
||||
the native adapter. Stop/start/reset semantics are specified independently: start clears
|
||||
elapsed and laps, resume accumulates, and split restarts at the same sampled instant.
|
||||
No operation pretends a civil-clock adjustment changes monotonic elapsed time.
|
||||
|
||||
## Duration, civil time and calendar work
|
||||
|
||||
NEW parsing accepts bounded spans (256 bytes default), uses checked accumulation in
|
||||
integer nanoseconds, and returns precise error offset, invalid-unit, overflow and
|
||||
unsupported-calendar-unit classifications. Preserve the old truncating ISO interval
|
||||
parser as a compatibility profile; NEW exact parsing never silently truncates fractions.
|
||||
Separate elapsed durations from calendar periods. UTC timestamp parse/format has fixed
|
||||
precision policies (seconds/milliseconds/nanoseconds), explicit offset handling and
|
||||
overflow checks. Do not persist `steady_clock::time_point`; persist civil instants,
|
||||
durations or Scheduler occurrence identities with a versioned schema.
|
||||
|
||||
Calendar conversion uses the standard chrono timezone facility through an optional
|
||||
adapter, with explicit `unsupported` if the selected toolchain/environment has no
|
||||
usable database. No network download is performed. Record the timezone database version
|
||||
in reproducible scheduling fixtures. Ambiguous local times require earliest/latest/reject
|
||||
policy; nonexistent local times reject by default. Leap-second handling is explicit UTC
|
||||
conversion policy, not hidden normalization. Scheduler owns next-occurrence recurrence
|
||||
algorithms and durable admission; Time owns the conversions and their diagnostics.
|
||||
|
||||
## Measurement design
|
||||
|
||||
NEW benchmark options default to 10 warmup batches, 100 measured batches, 1,000 operations
|
||||
per batch and at most 65,536 retained raw samples. Templates accept the callable directly,
|
||||
avoiding mandatory `std::function` dispatch. Record both batch elapsed time and operation
|
||||
count. Two modes are separate: throughput batching reports amortized time/op; latency
|
||||
sampling clocks individual operations and reports p50/p95/p99 of those samples. Batch
|
||||
means are never labeled individual latency percentiles.
|
||||
|
||||
Measure the empty harness/clock-read pair and type-erased versus templated call overhead
|
||||
alongside raw results. Do not automatically subtract a noisy overhead estimate or publish
|
||||
negative corrected latencies. Retain the raw baseline and explain resolution limits.
|
||||
Warmup is excluded from measured samples but still charged to total wall/CPU resource
|
||||
use. Exceptions stop a run with a failure and partial-run metadata. Zero iterations and
|
||||
nonpositive budgets are invalid in the NEW API; the old API gets normalized zero results
|
||||
for compatibility. A maximum total admission budget defaults to 30 seconds per case,
|
||||
checked between batches; one arbitrary callback may overrun and this is reported.
|
||||
Allocation/RSS/CPU probes are optional injected observers outside timed regions, not
|
||||
global interception. Result sets cap at 1,024 cases and 16 MiB retained metadata.
|
||||
|
||||
## Ordered tasks
|
||||
|
||||
| Task | Phase; dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-TIME-01 | P0; current source | Record parser precision, exception and bench semantics; capture empty/zero and stopwatch transition fixtures. | sol_implementer |
|
||||
| M-TIME-02 | P1; M-TIME-01 | Add native/manual MonotonicClock and CivilClock adapters plus bounded stopwatch; deterministic start/resume/split and overflow tests pass. | sol_implementer |
|
||||
| M-TIME-03 | P1; M-TIME-02; Functional pure retry contract | Validate injected-deadline domains with Async and blocking retry adapters; advancing manual time plus explicit polling expires an operation once. | astra_implementer |
|
||||
| M-TIME-04 | P2; M-TIME-01 | Add exact duration/UTC parsing and optional timezone conversions; fractions, offsets, DST folds/gaps and unsupported database paths are explicit. | sol_implementer |
|
||||
| M-TIME-05 | P2; M-TIME-02 | Add templated bounded benchmark runs, separate latency/throughput results and overhead baselines; synthetic sample quantiles and empty runs have deterministic tests. | sol_implementer |
|
||||
| M-TIME-06 | P3; M-TIME-03–05 | Publish measurement methodology, compatibility adapters and isolated consumers; observed results include environment, harness cost and resource probes. | sol_implementer |
|
||||
|
||||
## Validation and compatibility
|
||||
|
||||
CURRENT verification is the linked source/tests and the parent baseline; no benchmark
|
||||
or C++ test was rerun. PROPOSED tests use manual clocks, fixed sample arrays for quantile
|
||||
rank definitions (nearest-rank, documented), clock-domain adapters, integer overflow,
|
||||
maximum lap/sample caps and throwing bodies. Keep a small real-clock smoke test with
|
||||
tolerances; do not use sleeps for logical deadline assertions. Timezone tests pin their
|
||||
database fixtures and skip only with an explicit capability reason.
|
||||
|
||||
[PERFORMANCE](../PERFORMANCE.md) requires p50/p95/p99, throughput, allocations, peak RSS/CPU
|
||||
and build cost. Benchmark infrastructure must report its own clock resolution and
|
||||
overhead before supporting other modules' performance claims. Instrumentation overhead
|
||||
is measured separately; passing a benchmark test establishes semantics, not speed.
|
||||
|
||||
[Migration](../MIGRATION.md) retains `Void::Bench` convenience names through adapters,
|
||||
documents changed empty-run and allocating-noexcept behavior, and versions benchmark
|
||||
output schemas. Rollback selects the prior package; persisted civil timestamps must keep
|
||||
their precision/schema marker and cannot be replaced by monotonic ticks. See
|
||||
[VALIDATION](../VALIDATION.md), [DELIVERY](../DELIVERY.md),
|
||||
[DEPENDENCIES](../DEPENDENCIES.md), [requirements](../REQUIREMENTS.md),
|
||||
[Async](Async.md) and [Scheduler](../subsystems/Scheduler.md).
|
||||
@@ -0,0 +1,192 @@
|
||||
# Update — verified releases and recoverable activation
|
||||
|
||||
Status: plan; all feature tasks PLANNED. Baseline `f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`.
|
||||
R-010/R-015 and [C-02–C-07/C-09/C-10](../ARCHITECTURE.md) govern this module.
|
||||
|
||||
## Existing source and protected behavior
|
||||
|
||||
[Feed.hpp](../../../include/Void/Update/Feed.hpp) defines `Void::Update::Feed`, `Release`,
|
||||
`VerificationPolicy`, `VerifiedFeed`, `VerifiedEnvelope`, component catalog/release types,
|
||||
verification/parsing functions and selection. Defaults cap envelopes at 5 MiB, payloads at
|
||||
4 MiB and releases at 10,000; replay floor and injected current time are already policy
|
||||
inputs. [Feed.cpp](../../../src/Update/Feed.cpp) verifies Ed25519 signatures over decoded
|
||||
payload bytes and retains those bytes as `signedPayload`. Component-set validation and
|
||||
greatest-compatible-version selection are existing capabilities.
|
||||
|
||||
Important baseline distinction: Feed.cpp includes general `Void::Json` from
|
||||
[Json.hpp](../../../include/Void/Data/Json.hpp), not
|
||||
[StrictJson.hpp](../../../include/Void/Data/StrictJson.hpp). The latter has a separate
|
||||
restricted representation/profile. Schema-3 readable-document equality currently parses
|
||||
the signed payload before the signature call; `verifyFeedEnvelope` parses the feed schema
|
||||
after `verifyEnvelope`. The target verify-before-schema rule is therefore an explicit
|
||||
hardening task, not a claim that every current envelope path already follows that order.
|
||||
Do not broaden StrictJson or silently change legacy accepted documents when modernizing Data.
|
||||
|
||||
[VersionStore.hpp](../../../include/Void/Update/VersionStore.hpp) and
|
||||
[VersionStore.cpp](../../../src/Update/VersionStore.cpp) implement prepare/publish/activate,
|
||||
commit/rollback/reconcile, external lifecycle health recording and retention. Candidate
|
||||
activation is reversible until a durable healthy-history marker newer than the activation
|
||||
journal baseline commits it. `commit` rechecks marker evidence after an apparent write/sync
|
||||
failure. After that point journal cleanup is idempotent maintenance; `rollback` finalizes a
|
||||
committed candidate instead of undoing it. Preserve these exact semantics.
|
||||
|
||||
[Update tests](../../../tests/standalone/Update/Update.cpp) cover signatures/replay/selection,
|
||||
readable envelopes, component sets, idempotent commit, durable marker reconciliation,
|
||||
external lifecycle recording, health-order/prune behavior and unsafe filesystem layouts.
|
||||
[module.cmake](../../../src/Update/module.cmake) depends on Crypto, Data, Functional, System
|
||||
and Text. The module is not currently a complete transport/download/orchestrator service.
|
||||
|
||||
## Chosen composition and NEW interfaces
|
||||
|
||||
Keep native release-selection/workflow logic and existing cryptographic implementations
|
||||
from [Crypto](Crypto.md)/[Security](Security.md). OpenSSL/libsodium remain the initial
|
||||
primitives; Update does not write its own signature algorithm. Net handles transport,
|
||||
Archive handles bounded package extraction, Plugin/Service handle live candidate lifetimes,
|
||||
and VersionStore owns durable activation. Runtime/Fsm adapters are optional composition
|
||||
layers, so parsing and store operations remain usable in an embedded application.
|
||||
|
||||
NEW illustrative Update-owned orchestration API:
|
||||
|
||||
```cpp
|
||||
enum class InstallState {
|
||||
Verified, Downloading, Staged, Published, Activated, HealthyCommitted,
|
||||
CleanupPending, RolledBack, RecoveryRequired
|
||||
};
|
||||
struct InstallReceipt { InstallId id; InstallState state; ReleaseIdentity release; };
|
||||
struct InstallOptions; // admission limits plus Async operation options
|
||||
class InstallSession; // owns candidate, staging, callbacks and progress
|
||||
Result<InstallSession> plan_install(VerifiedSelection, InstallOptions);
|
||||
// async run/stop/status adapters use Async-owned task/operation contracts
|
||||
```
|
||||
|
||||
All names in this sketch beyond existing types are NEW, including VerifiedSelection and
|
||||
ReleaseIdentity. VerifiedSelection retains the original verified envelope bytes, signer
|
||||
identity, selected component dependency set, artifact digest/size and policy decision.
|
||||
It cannot be constructed from an arbitrary caller string pretending to be verified. The
|
||||
public unsigned parsers remain clearly named structural tools and never confer trust.
|
||||
|
||||
## Verification, selection and installation dataflow
|
||||
|
||||
1. Snapshot explicit trust keys, channel/platform/ABI constraints, clock and policy at
|
||||
admission. Fetch within Net's total deadline and bounded response size. Outer envelope
|
||||
parsing is bounded and only extracts schema/key/encoded payload/signature; decode exactly
|
||||
once, retain the decoded bytes, and verify their signature before payload schema parsing
|
||||
or readable-document comparison. No reserialization or whitespace normalization is
|
||||
substituted for those signed bytes.
|
||||
2. Select the Data-owned versioned parsing policy for that envelope schema. Pin the accepted
|
||||
legacy behavior with golden signed fixtures; general JSON improvements cannot silently
|
||||
enlarge it. StrictJson's numeric/duplicate/depth rules remain unchanged. New strict-profile
|
||||
schemas must explicitly declare their representation and compatibility in M-UPDATE-02;
|
||||
migration of legacy documents requires a separate schema version if the existing corpus
|
||||
cannot be preserved. This gate cannot be bypassed by switching parser aliases globally.
|
||||
3. Validate expiry, monotonic feed sequence, platform/toolchain/ABI and component dependency
|
||||
closure before downloading artifacts. Persist a high-water sequence per configured feed
|
||||
identity/channel using atomic file replacement and directory sync before accepting a
|
||||
lower sequence on any later restart. Key rotation does not reset that floor. Valid but
|
||||
unusable releases may advance the verified-feed floor; retain their signed metadata so
|
||||
the same verified selection can resume. Explicit rollback to an already known healthy
|
||||
local version is a separate operator action, not acceptance of a replayed feed.
|
||||
4. Stream artifacts to an exclusive staging area while checking actual size and incremental
|
||||
digest. Require exact final size/digest. A resumable download is accepted only after a
|
||||
server identity/validator match and final whole-artifact digest verification; default is
|
||||
restart into a new temporary file. Redirects follow Net's credential/origin policy.
|
||||
5. Extract using [Archive](Archive.md)'s safe staging workflow and validate the release
|
||||
manifest/ABI/component inventory. Publishing immutable version directories is distinct
|
||||
from activation. Do not substitute a tar filename for authenticated artifact identity.
|
||||
6. An explicit lifecycle owner activates the candidate, waits for bounded readiness/health,
|
||||
then calls the existing VersionStore commit path (internal activation) or `recordHealthy`
|
||||
(external activation). These modes remain separate; external health recording cannot
|
||||
implicitly commit an internal activation journal. [ReloadableApplications](../platforms/ReloadableApplications.md)
|
||||
owns generation publication and quiescence; acquired old handles keep their pins.
|
||||
7. Report HealthyCommitted only after the durable marker. Cleanup/prune failures become
|
||||
CleanupPending with diagnostics and retry state, never an invitation to rollback.
|
||||
|
||||
TLS trust-chain and peer-host checks remain enabled in transport. SNI alone does not verify
|
||||
the expected peer, as the [OpenSSL 3.5 client guide](https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/)
|
||||
explains. Network trust does not replace signed release verification. Diagnostics/progress
|
||||
must omit keys, authorization headers and artifact contents.
|
||||
|
||||
## Failure, cancellation and recovery semantics
|
||||
|
||||
Before activation, failure leaves the active version unchanged and cleans only owned staging.
|
||||
During reversible activation, readiness failure requests stop, joins candidate work, then
|
||||
rolls back through VersionStore. Cancellation after the durable healthy marker reports the
|
||||
committed state and stops only optional cleanup. A lost acknowledgement or failed sync can
|
||||
be Unknown; run `reconcile` and inspect durable health/journal evidence before choosing the
|
||||
next action. A caller must not convert every error into a rollback command.
|
||||
|
||||
One coordinator per store serializes workflow transitions; filesystem mutation still uses
|
||||
VersionStore's locking. Network work and user health/lifecycle callbacks execute outside
|
||||
store/configuration locks. Progress subscriptions snapshot owning events; unsubscribe stops
|
||||
future admissions and has a separate drain boundary. Shutdown rejects new sessions, cancels
|
||||
downloads, joins extraction/candidate work and reconciles any transition already entered.
|
||||
No forced plugin unload or asynchronous use of destroyed staging paths is allowed.
|
||||
|
||||
Restart reads the operation journal, immutable publication identity, activation journal and
|
||||
healthy history. A journal is versioned/checksummed and written before its dependent side
|
||||
effect where compensation requires it; it references existing VersionStore evidence instead
|
||||
of declaring another activation commit point. Unknown or mismatched records stop automation
|
||||
with RecoveryRequired. Corrupt metadata is not discarded to make an update appear successful.
|
||||
Retain active, pending candidate, previous candidate and pinned plugin generations; retention
|
||||
must respect both durable store protection and external live-generation pins.
|
||||
|
||||
Trust changes are explicit configuration operations: bootstrap keys come from the application,
|
||||
rotation requires an authenticated old-trust transition or an operator-approved replacement,
|
||||
and removal/revocation invalidates future selections without rewriting historical signed bytes.
|
||||
Expiry is a civil-time policy with an injected clock; time rollback cannot lower the stored
|
||||
sequence floor. Update does not invent a network time authority.
|
||||
|
||||
## Defaults and operation budgets
|
||||
|
||||
Keep existing envelope/payload/release limits. NEW defaults: one active install per store,
|
||||
eight queued selections, two concurrent artifact downloads, 512 MiB per compressed artifact,
|
||||
2 GiB staging quota, 32 components and 256 dependency edges per transaction. Package
|
||||
extraction retains Archive's absolute limits and additionally obeys the session quota.
|
||||
Reserve disk headroom for candidate plus previous healthy content before admission; do not
|
||||
delete the rollback version to make an unverified candidate fit.
|
||||
|
||||
The default install deadline is ten minutes including admission, download and activation,
|
||||
with a 30-second readiness phase bounded by the remaining total time. Use a one-second
|
||||
health probe interval and require three consecutive ready responses in the reference
|
||||
workflow; applications can replace that health policy explicitly. Health callbacks are
|
||||
cooperative owned work, not forcefully killed code. Retain two previous healthy versions
|
||||
by default, subject to pins and space diagnostics; bounded cleanup batches process at most
|
||||
16 publications per pass. A pin preventing cleanup reports pressure rather than being broken.
|
||||
|
||||
## Ordered implementation tasks
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| M-UPDATE-01 | P0; current signed/store tests | Freeze exact-byte and durable-marker fixtures, including schema-3 verification order and cleanup failure; record baseline general-vs-strict parser boundary. | astra_implementer |
|
||||
| M-UPDATE-02 | P1; M-UPDATE-01, Data profile owner, Crypto contract | Verify-before-payload-parse, pinned schema policy and durable replay floor; invalid signatures never trigger payload schema processing and legacy fixtures retain defined behavior. | astra_implementer |
|
||||
| M-UPDATE-03 | P2; M-UPDATE-02, Net streaming/deadlines, Archive staging | Bounded download/verify/extract/publication session and resumability; wrong size/digest/path never reaches activation. | astra_implementer |
|
||||
| M-UPDATE-04 | P2; M-UPDATE-03, Plugin/Service/Fsm lifecycle | Readiness, internal/external lifecycle adapters and operation journal; exactly one activation owner and no second commit marker. | astra_implementer |
|
||||
| M-UPDATE-05 | P3; M-UPDATE-04, Runtime/Observability | Managed shutdown, retained-generation-aware pruning, trust operations and recovery status; committed cleanup failure is visible but not rollback-safe. | sol_implementer |
|
||||
| M-UPDATE-06 | P3; M-UPDATE-05, Testing fault harness | Crash/race matrix and installed reference workflow; repeated reconcile is idempotent at every transition. | astra_implementer |
|
||||
|
||||
P4 rollout coordination uses [DistributedApplications](../platforms/DistributedApplications.md)
|
||||
policy above Update; a fleet controller cannot override a host's exact-byte verification,
|
||||
generation ownership or healthy commit semantics.
|
||||
|
||||
## Validation and migration
|
||||
|
||||
CURRENT TEMPLATE, with source-verified filters:
|
||||
`<existing-build>/tests/VoidTests --filter '^(update_feed_.*|component_feed_.*|readable_component_.*|version_store_.*)$'`.
|
||||
The actual baseline and unrun checks are in [validation](../VALIDATION.md). PROPOSED after
|
||||
M-UPDATE-02–06: mutate signed bytes while preserving equivalent JSON, invalid signature with
|
||||
malformed payload, duplicate/oversized/deep fields under each declared profile, schema-3
|
||||
mirror mismatch, replay after restart/key rotation, download redirect/partial/hash failure,
|
||||
disk full, callback reentry, activation-time cancellation and crash at every health/journal
|
||||
sync. Inject cleanup failure after commit and assert that rollback preserves the candidate.
|
||||
|
||||
Use [performance](../PERFORMANCE.md) for verify/select latency, streaming throughput, activation
|
||||
p50/p95/p99, peak RSS/CPU/staging space and build cost; use common sample/confidence rules.
|
||||
Report retained generations and failed installs, not only successful fast paths.
|
||||
|
||||
[Migration](../MIGRATION.md) preserves existing verification and VersionStore interfaces via
|
||||
adapters. Store-journal upgrades are versioned and recover old records before admitting new
|
||||
work; backup old metadata without erasing commit evidence. Unknown newer schemas are rejected.
|
||||
Roll back candidate code only before its healthy commit, or perform a new explicit activation
|
||||
of a known healthy version afterward. No automatic schema/data downgrade is implied.
|
||||
Graph coverage was checked; partial Feed declarations/definitions and adjacent Json ranges
|
||||
were read directly. These planned changes have not been built, fuzzed or crash-tested.
|
||||
@@ -0,0 +1,152 @@
|
||||
# DistributedApplications platform plan — NEW reference compositions
|
||||
|
||||
Status: planning only; reference applications below are future artifacts, not runnable
|
||||
applications in this checkout. All tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-009–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-01–C-14, especially C-12/C-14.
|
||||
|
||||
## Baseline and product boundary
|
||||
|
||||
Current [Net](../../../include/Void/Net/Http.hpp),
|
||||
[Security](../../../include/Void/Security/Security.hpp) and
|
||||
[ShortUrl V1](../../../include/Void/ShortUrl/ShortUrl.hpp) are individual building blocks.
|
||||
They do not constitute a distributed platform. Source/graph metadata was checked; Net
|
||||
Http.hpp gaps 112/115 were read directly. There is no distributed launcher, membership
|
||||
operator, broker, replicated database or acceptance suite claimed at this baseline.
|
||||
Proposed reference source under `examples/distributed/` and tests under
|
||||
`tests/integration/distributed/` are NEW; names/targets are assigned only during implementation.
|
||||
|
||||
This platform composes [NetworkedApplications](NetworkedApplications.md)'s managed service
|
||||
and [ReloadableApplications](ReloadableApplications.md)'s optional upgrade discipline with
|
||||
RPC, Messaging, Discovery, Coordination, Replication and DistributedStorage. It owns startup,
|
||||
readiness, operator workflows, fault scenarios and reference applications. It does not own
|
||||
alternative consensus, storage, TLS, task or observability implementations. Linux is the
|
||||
initial validation host; process/container orchestration is a test/deployment adapter,
|
||||
not a hidden dependency of embedded libraries.
|
||||
|
||||
## Future reference applications and NEW composition API
|
||||
|
||||
Choose two bounded first applications: a three-node fixed-membership replicated KV service,
|
||||
and an at-least-once durable worker queue backed by one replicated group. The KV example
|
||||
exercises conditional batches, read policies, session dedup, snapshot/restart and backup;
|
||||
the queue example exercises durable publish/ack, duplicate delivery, poison messages/DLQ
|
||||
and consumer recovery. A distributed ShortUrl repository is a later optional integration
|
||||
recipe and must preserve its frozen V1 interface. No arbitrary external service/account or
|
||||
paid infrastructure is required to run the future loopback tests.
|
||||
|
||||
```cpp
|
||||
// NEW illustrative platform composition; component types remain owner-defined.
|
||||
struct NodeConfig {
|
||||
ClusterId cluster; NodeId self; FixedVoterSet voters; BootstrapEndpoints peers;
|
||||
StorageConfig data; NetServerPolicy transport; ResourceBudget resources;
|
||||
};
|
||||
class DistributedHost {
|
||||
static Result<DistributedHost> compose(NodeConfig, InjectedResources);
|
||||
Task<Result<Readiness>> start(OperationOptions);
|
||||
Task<Result<void>> stop(OperationOptions);
|
||||
};
|
||||
```
|
||||
|
||||
The host retains owned services and borrows injected executor/clock/allocator only through
|
||||
final join. Async owns operation options and scopes, Runtime owns managed resources, Service
|
||||
owns lifecycle handles. Embedded applications can construct the same graph with supplied
|
||||
resources and explicit startup. Configuration is an immutable validated snapshot; changing
|
||||
voter lists is not hot-reload configuration. Local node identity, data directory, peer trust
|
||||
mapping and static bootstrap endpoints are explicit. No global singleton starts a cluster.
|
||||
|
||||
## Startup, readiness and shutdown algorithm
|
||||
|
||||
1. Validate config/schema, fixed group identity, peer identities, directory ownership,
|
||||
quotas and available backend capabilities. Missing trust material is a startup failure;
|
||||
credentials are runtime inputs and never checked into examples or printed in diagnostics.
|
||||
2. Create owned resources, open native Storage and recover protocol/application/snapshot
|
||||
state. Verify application+dedup+applied index consistency before listeners accept work.
|
||||
Expose an isolated administrative health interface only under explicit bind/auth policy.
|
||||
3. Start authenticated peer RPC listener and static Discovery provider. Connect fixed peers;
|
||||
run the Replication adapter and election. Discovery availability is not a quorum vote.
|
||||
User listener may bind but rejects calls until the selected service's readiness gate.
|
||||
4. KV readiness requires an available leader path, current-term committed barrier and local
|
||||
recoverable application state; leader-only write readiness is distinct from follower
|
||||
process liveness. Queue readiness additionally requires storage quota and consumer/queue
|
||||
admission health. A follower can report healthy-but-not-write-ready. Consistent reads
|
||||
still perform per-operation quorum confirmation; readiness is not a lease.
|
||||
5. Publish services/endpoint hints after readiness. Start periodic snapshot/observation tasks
|
||||
through owned scopes; optional coordination-backed Discovery starts only after the
|
||||
replicated directory is ready and never replaces static Raft membership.
|
||||
6. Stop external admission and readiness publication, finish or cancel client scopes, drain
|
||||
mandatory durable actions, stop consumers and peer admission as appropriate, join all
|
||||
replication/transport/snapshot tasks, then close storage and finally execution resources.
|
||||
Default grace is 30 seconds; expiry reports incomplete stop while preserving owned state
|
||||
until join. Do not destroy resources merely to make shutdown appear bounded.
|
||||
|
||||
## Operational decisions and failure matrix
|
||||
|
||||
Initial profile: three voters, one group/service, one data directory/node, no shared database
|
||||
file, no automatic member replacement. Use explicit static cluster identity and per-node
|
||||
authenticated TLS identity. Security authorization separates peer, client and administration
|
||||
actions; a client cannot issue peer consensus messages. Certificates/trust policy are rotated
|
||||
with overlapping validated trust generations and connection draining, never disabling checks.
|
||||
Default platform budgets are the minimum of component limits, plus a host aggregate: 256 MiB
|
||||
queued/stream payloads, two simultaneous snapshots, 16 active groups and 1,024 external calls.
|
||||
Account storage caches/indexes separately in RSS; this is not a 256 MiB total-process promise.
|
||||
|
||||
| Scenario | Expected service/operational result | Acceptance evidence |
|
||||
| --- | --- | --- |
|
||||
| One of three nodes stops | Majority continues after election; no acknowledged state lost | Client history plus durable recovered state |
|
||||
| Two of three unavailable | No new committed writes or consistent reads; stale reads only by explicit policy | Minority old-leader test |
|
||||
| Apply committed, response lost | Same identity returns original result | Kill leader at apply/reply boundary |
|
||||
| Slow/full/failed disk | Admission pressure or group fault; no pre-sync success | Fault port plus real filesystem pressure |
|
||||
| Corrupt log/snapshot | Quarantine node/group; restore or rebuild under explicit procedure | Mutation/restart test and diagnostics |
|
||||
| Poison work / worker crash after effect | Retry/DLQ; duplicate side effect possible without application dedup | Worker inbox/outbox demonstration |
|
||||
| Discovery or metrics unavailable | Static peer transport remains usable; observation failures bounded; no quorum weakening | Disable optional adapters |
|
||||
| Snapshot load / slow follower | Rate-limited catch-up; bounded queues and readable leader | Long-lag soak and RSS/disk metrics |
|
||||
| Rolling binary/schema mismatch | Refuse unsupported peer/command; operator halt before unsafe rollout | Mixed-version fixture matrix |
|
||||
| Loss of quorum disks | Operator recovery into separately identified cluster; no automatic force-new-cluster | Recovery rehearsal and explicit data-loss report |
|
||||
|
||||
Metrics: term/role/quorum state, commit/applied lag, sync duration/errors, queue/DLQ depth,
|
||||
admission rejection, cancellation, snapshot progress and disk headroom. Cap labels at
|
||||
configured node/group/queue identities; no payloads, raw keys or bearer tokens. A diagnostic
|
||||
bundle contains version/config fingerprints and sanitized histories, not credentials/data.
|
||||
SLO profiles are chosen from measured workloads, with separate normal, failover and recovery
|
||||
latency. Benchmark absence cannot be reported as a production reliability claim.
|
||||
|
||||
## Ordered platform backlog
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| P-DISTRIBUTED-01 | P0; baseline | Define future examples, deterministic failure histories and readiness states; no runnable artifact claim | astra_implementer |
|
||||
| P-DISTRIBUTED-02 | P1; P-DISTRIBUTED-01, Runtime/Service/Async contracts | NEW host graph specification and fake component lifecycle tests; injected resources outlive join | astra_implementer |
|
||||
| P-DISTRIBUTED-03 | P3; P-DISTRIBUTED-02, NetworkedApplications gate, RPC/Discovery | Single-node reference composition and authenticated peer fixture; bounded startup/rollback/shutdown | sol_implementer |
|
||||
| P-DISTRIBUTED-04 | P4; P-DISTRIBUTED-03, Coordination/Replication/DistributedStorage single-group gates | Three-node KV reference and linearizability/crash histories; quorum reads and durable replies | astra_implementer |
|
||||
| P-DISTRIBUTED-05 | P4; P-DISTRIBUTED-04, Messaging replicated queue gate | Worker queue reference, inbox/outbox and DLQ operations; at-least-once failure matrix passes | sol_implementer |
|
||||
| P-DISTRIBUTED-06 | P4; P-DISTRIBUTED-04, snapshot/recovery gates | Backup/restore, trust rotation, mixed-version rollout and chaos tooling; restore rehearsals retain identities correctly | astra_implementer |
|
||||
| P-DISTRIBUTED-07 | P4 later; P-DISTRIBUTED-06, DistributedStorage routing/movement gates | Range movement operations and optional replicated directory; ownership/freeze/crash evidence before scale claims | astra_implementer |
|
||||
|
||||
## Evidence, migration and release gate
|
||||
|
||||
CURRENT evidence is the root-recorded baseline build/tests in [VALIDATION](../VALIDATION.md),
|
||||
not distributed feature evidence. No builds, benchmarks, fault tests or deployments ran
|
||||
for this document. PROPOSED tests first run deterministic adapters, then three independent
|
||||
processes with isolated ports/directories, controlled packet faults and kill/restart points.
|
||||
Test harnesses collect complete operation histories including unknown outcomes, seeds and
|
||||
fault timelines; acceptance checks linearizability, dedup, applied positions, durable replies,
|
||||
resource bounds and shutdown. No future launcher command is advertised as presently usable.
|
||||
Build/consumer gates follow [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
Use [PERFORMANCE](../PERFORMANCE.md) to record p50/p95/p99, throughput, allocations, peak
|
||||
RSS/CPU, disk amplification/recovery, network traffic and build cost. Compare one/three/five
|
||||
node profiles only after corresponding membership configurations are supported and verified.
|
||||
Durability tests follow [SQLite's crash fault methodology](https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior);
|
||||
consensus safety follows the selected [Raft protocol](https://raft.github.io/raft.pdf), with
|
||||
application-specific integration evidence still mandatory.
|
||||
|
||||
Rollout first verifies every node can read existing log/snapshot/application formats, then
|
||||
deploys readers, then enables new commands only after all voters advertise support. Rollback
|
||||
stops new command admission and requires old readers for everything already durable. Plugin
|
||||
reload does not unload an in-use state-machine implementation: pin through active apply and
|
||||
snapshot work, and migrate state only at a recoverable checkpoint. Majority-loss restoration,
|
||||
voter changes and data-destructive repair are operator-authorized procedures, never automated
|
||||
startup fallbacks. See [MIGRATION](../MIGRATION.md), [DELIVERY](../DELIVERY.md) and
|
||||
[DEPENDENCIES](../DEPENDENCIES.md). A fresh independent integrated review and full affected
|
||||
behavior checks precede any merge/release recommendation; documentation completion is not release.
|
||||
@@ -0,0 +1,244 @@
|
||||
# NetworkedApplications — bounded reference services and operations
|
||||
|
||||
Status: NEW platform composition plan; all tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`. This document specifies future reference
|
||||
applications only; it creates no server, deployment, open port or runnable command.
|
||||
R-003/R-007/R-009/R-010/R-012 and [C-01–C-08/C-11/C-14](../ARCHITECTURE.md) apply.
|
||||
|
||||
## Existing pieces and composition boundary
|
||||
|
||||
The inspected repository already contains [Sqlite](../../../include/Void/Sqlite/Sqlite.hpp)
|
||||
RAII operations, [Log](../../../include/Void/Log/Log.hpp) facade/sinks,
|
||||
[Archive](../../../include/Void/Archive/Archive.hpp) extraction and
|
||||
[Update VersionStore](../../../include/Void/Update/VersionStore.hpp) activation primitives.
|
||||
They do not by themselves establish the startup, request ownership, durability or shutdown
|
||||
contract of a complete service. Their existing tests remain module evidence, not an
|
||||
end-to-end platform acceptance result. Native Storage and Observability are NEW designs.
|
||||
|
||||
The platform composes [Runtime](../subsystems/Runtime.md), [Async](../modules/Async.md),
|
||||
[IO](../subsystems/IO.md), [Net](../modules/Net.md), [Configuration](../modules/Configuration.md),
|
||||
[Service](../modules/Service.md), [Security](../modules/Security.md),
|
||||
[Storage](../subsystems/Storage.md), [Sqlite](../modules/Sqlite.md),
|
||||
[Log](../modules/Log.md) and [Observability](../subsystems/Observability.md).
|
||||
It owns wiring, reference domain workflows, lifecycle policy and operational acceptance.
|
||||
It does not own a second executor, HTTP parser, TLS engine, database, logger or error type.
|
||||
Optional RPC/jobs use their existing plan owners, and no foundation imports this platform.
|
||||
|
||||
Choose Void-owned native protocol/IO paths when their conformance gates pass. Preserve
|
||||
the existing Boost-based paths behind documented adapters during migration; do not replace
|
||||
them merely to declare the platform native. IO owns level-triggered epoll/nonblocking sockets
|
||||
and bounded file workers under C-06, Net owns protocol/session reuse, and OpenSSL supplies
|
||||
TLS. Verify both trust and peer identity for outbound clients; SNI is a distinct setting.
|
||||
[OpenSSL's client guide](https://docs.openssl.org/3.5/man7/ossl-guide-tls-client-block/)
|
||||
is the primary TLS implementation reference.
|
||||
|
||||
## Reference applications and NEW composition surface
|
||||
|
||||
PROPOSED source locations are `examples/platforms/networked-kv/`,
|
||||
`examples/platforms/networked-client/` and later `examples/platforms/networked-jobs/`.
|
||||
These are NEW paths, not existing examples to run. Build them as installed-package consumers
|
||||
so accidental whole-repository linkage cannot hide missing dependencies. The reference
|
||||
service first uses a native Storage backend; a separate SQLite profile exercises first-class
|
||||
SQL integration with its own schema/migrations. Both implement only the explicitly common
|
||||
reference-domain contract; they are not interchangeable engine/file-format facades.
|
||||
|
||||
NEW illustrative platform-owned API, subject to module-owned type definitions:
|
||||
|
||||
```cpp
|
||||
struct NetworkedConfig; // validated listener/domain/limit configuration
|
||||
struct ApplicationResources; // owning/borrowed handles to module-owned resources
|
||||
class NetworkedApplication {
|
||||
public:
|
||||
static Result<NetworkedApplication> create(ApplicationResources, NetworkedConfig);
|
||||
Result<void> start();
|
||||
Result<HealthSnapshot> health() const;
|
||||
// stop/join use Async's operation options and completion contract
|
||||
};
|
||||
```
|
||||
|
||||
`Result` is C-02 shorthand; HealthSnapshot and the composition wrapper are NEW platform
|
||||
types. Resources do not define competing executor/clock/memory/telemetry interfaces. Embedded
|
||||
mode borrows application-supplied module resources through final join. Managed mode explicitly
|
||||
starts Runtime, which owns them through shutdown. Construction alone opens no listeners or
|
||||
workers. The reference client uses Net sessions, total deadlines and checked responses;
|
||||
it never blindly retries a mutating request on a new connection.
|
||||
|
||||
## Initial HTTP key-value workflow
|
||||
|
||||
HTTP/1.1 is the first protocol profile. The service has the following NEW application
|
||||
endpoints; Net remains responsible for parsing and framing.
|
||||
|
||||
| Endpoint | Contract and storage effect |
|
||||
| --- | --- |
|
||||
| `GET /v1/kv/{key}` | Canonical base64url key, bounded owning value response and opaque version ETag; 404 only for an absent key in the captured snapshot. |
|
||||
| `PUT /v1/kv/{key}` | Raw value body, required idempotency ID and explicit absent/version precondition; atomically store value/new version and request outcome. |
|
||||
| `DELETE /v1/kv/{key}` | Required version precondition/idempotency ID; atomically tombstone/remove plus record outcome. |
|
||||
| `GET /v1/scan` | Bounded page within a retained snapshot; opaque expiring cursor, no leaking raw database sequence/file offsets. |
|
||||
| `GET /v1/operations/{id}` | Auth-scoped known outcome or explicit Unknown; absence/expired retention is never proof that a write did not commit. |
|
||||
| `/live`, `/ready`, `/metrics` | Separate administrative listener; lifecycle status and bounded telemetry, no data mutation or credential dump. |
|
||||
|
||||
Request flow is accept → protocol bounds → deadline/admission → authentication/authorization
|
||||
→ decode/validate → domain operation → durable backend result → response encoding/write.
|
||||
Each request owns a task scope, context snapshot, body buffers and storage handles until
|
||||
exactly one completion and final backend access. Buffer ownership extends past socket close
|
||||
if a write is still completing; disconnect does not roll back an already committed mutation.
|
||||
|
||||
Native Storage uses one conditional batch for the business key/version plus a reserved
|
||||
application namespace containing idempotency record/result. SQLite uses one explicit
|
||||
transaction and unique request-id constraint plus version-checked update; affected-row
|
||||
count and stored outcome are checked before commit. No operation spans both backends in
|
||||
one atomic promise. Domain adapters expose Conflict, NotFound, Overloaded, Unavailable and
|
||||
UnknownCommit separately, preserving backend causes in bounded internal diagnostics.
|
||||
|
||||
Idempotency IDs are scoped to authenticated principal and operation type. Persist a digest
|
||||
of canonical operation/key/precondition/body with the outcome; the same ID with different
|
||||
inputs is Conflict. Retain records for at least 24 hours, with a default 100,000-record/
|
||||
256 MiB budget; when full of unexpired records, reject new mutations instead of evicting
|
||||
live deduplication promises. After the advertised retention window, clients must inspect
|
||||
business state or obtain a new explicit decision, not retry an old ID as though dedup were
|
||||
permanent. GC runs in bounded backend transactions/batches. Persist enough time/high-water
|
||||
metadata that backward clock changes cannot shorten the advertised retention horizon.
|
||||
|
||||
Durable success is returned only after the chosen backend's durable commit succeeds. If
|
||||
commit succeeded but the socket write fails, a retry with the same ID retrieves the stored
|
||||
outcome. A backend Unknown makes readiness reflect recovery state and returns a structured
|
||||
503 with operation ID/outcome=unknown when a reply is possible. A canceled pre-admission
|
||||
request has no effect; cancellation after submission must retain outcome uncertainty.
|
||||
Do not classify a transport timeout as a safe reason to create a new ID and replay the write.
|
||||
|
||||
## Startup, configuration and shutdown
|
||||
|
||||
Startup is a dependency-ordered transaction:
|
||||
|
||||
1. Validate configuration and capabilities, select embedded/managed resource ownership,
|
||||
install bounded early diagnostics, load trust/auth policy and reserve budgets.
|
||||
2. Open the selected database, recover/reconcile it, and validate schema/format compatibility.
|
||||
Required migrations run only under their explicit migration gate; never expose readiness
|
||||
while silently upgrading a store of unknown provenance.
|
||||
3. Register service/domain handlers and telemetry, then start protocol listeners. Default
|
||||
reference data listener is `127.0.0.1:8080`, admin is `127.0.0.1:9090`; tests use assigned
|
||||
ephemeral loopback ports. Binding external interfaces requires explicit application
|
||||
configuration with TLS and authentication policy.
|
||||
4. Publish readiness only after storage, handler dependencies and mandatory resources are
|
||||
healthy. On failure, close listeners/registrations and unwind started resources in reverse
|
||||
dependency order, preserving the original failure and cleanup diagnostics.
|
||||
|
||||
Configuration reload parses a complete candidate, validates limits/paths/certificates,
|
||||
then atomically publishes an immutable configuration generation. In-flight requests keep
|
||||
their old generation. Level/telemetry policy and new-connection TLS material can change
|
||||
live; backend selection, database path and persistent schema require a restart/migration
|
||||
workflow. Do not partly install a configuration whose second listener fails to bind.
|
||||
Hot code replacement follows [ReloadableApplications](ReloadableApplications.md), not an
|
||||
uncoordinated callback swap in this platform.
|
||||
|
||||
Shutdown first marks unready and closes new admission/keepalive reuse, then drains requests
|
||||
for 20 seconds, requests cooperative stop, and joins them within a default 30-second total
|
||||
shutdown budget where supported. Storage operations that already crossed a commit boundary
|
||||
finish/report their outcome. If arbitrary application code does not cooperate, an external
|
||||
process supervisor may terminate the service; the library does not forcibly destroy its
|
||||
objects and claim clean shutdown. After tasks join: flush/checkpoint as configured, close
|
||||
database handles, flush telemetry/logging, stop IO/executors and release resources. Never
|
||||
destroy the logger/exporter first while tasks still hold callbacks into it.
|
||||
A timed-out telemetry flush retains its backend ownership and execution dependencies;
|
||||
Runtime reports shutdown_incomplete until those calls quiesce and can be joined. The
|
||||
platform must not treat the flush timeout as permission to stop their IO/workers.
|
||||
|
||||
## Admission, security and operation budgets
|
||||
|
||||
These are NEW reference-profile defaults, not universal module defaults. Apply the smaller
|
||||
of platform and module limits; reject contradictory configurations at startup.
|
||||
|
||||
| Resource | Default |
|
||||
| --- | --- |
|
||||
| Connections | 1,024 total; 128 per authenticated principal/source admission bucket, with bounded bucket registry. |
|
||||
| Requests | 256 active, 512 waiting; four pipelined requests/connection; overload returns 503 or closes before body admission. |
|
||||
| Input/output | 16 KiB headers, 64 header fields, 64 KiB mutation body, 1 MiB output page; 64 MiB total admitted request/response buffers including sends in flight. |
|
||||
| Time | Five-second total request deadline, two-second header deadline, 30-second keepalive idle timeout; retries consume the original total budget. |
|
||||
| Scans | 64 retained cursor snapshots, 30-second idle lease, 1,024 rows/page; expiry explicitly ends the cursor instead of switching snapshots silently. |
|
||||
| Control plane | Four admin requests concurrently, 64 KiB admin response, separate admission reserve so data overload cannot starve health. |
|
||||
|
||||
Rate-limit registry cardinality is bounded at 4,096 buckets with conservative shared overflow
|
||||
limits, preventing attacker-created IP/identity labels from exhausting memory. Use a caller-
|
||||
approved authentication adapter; the reference profile uses explicit static test identities
|
||||
on loopback and a configured verified credential mechanism for external deployment. Production
|
||||
secrets stay in runtime secret/config facilities and never appear in examples, metrics or logs.
|
||||
Map authorization to key namespaces before storage access, including scans and operation-status
|
||||
lookups. Admin endpoints expose aggregate health only and bind separately by default.
|
||||
|
||||
Malformed framing, conflicting lengths, oversized bodies, slow readers and connection churn
|
||||
are Net conformance cases plus platform resource tests. Optional compression cannot expand
|
||||
past the same body cap. TLS configuration is replaced only for new handshakes; active sessions
|
||||
retain their state through completion. Outbound redirects cannot forward origin-sensitive
|
||||
credentials cross-origin. Untrusted trace headers supply context, never user identity.
|
||||
|
||||
## Operational workflows and later capabilities
|
||||
|
||||
Health reports separate process liveness, readiness and degraded optional exporters. Database
|
||||
RecoveryRequired, mandatory auth failure or exhausted durable-write capacity makes the service
|
||||
unready for mutations; a telemetry outage alone does not. Metrics use bounded route/status/
|
||||
backend labels and include admission rejection, active requests, total owned bytes, commit
|
||||
latency, Unknown outcomes, oldest snapshot and exporter loss. Request IDs belong in bounded
|
||||
logs/traces, not metric labels.
|
||||
|
||||
Backup is an authenticated operator workflow using the selected backend's consistent backup
|
||||
API. Verify a restore into a separate directory and run read-only domain checks before any
|
||||
traffic switch. Do not copy an open SQLite main file alone or a moving native table set.
|
||||
Upgrades validate module/package versions and persistence compatibility; [Update](../modules/Update.md)
|
||||
can stage signed application artifacts, while application schema changes remain separately
|
||||
gated. A committed data migration is not undone by choosing the previous executable.
|
||||
|
||||
The later job reference composes [Scheduler](../subsystems/Scheduler.md) and
|
||||
[Messaging](../subsystems/Messaging.md) for durable admission, retries and acknowledgements.
|
||||
It demonstrates an outbox/deduplication workflow with at-least-once external delivery, not
|
||||
exactly-once effects. The RPC profile reuses [RPC](../subsystems/RPC.md) serialization and
|
||||
transport contracts. P4 service discovery/replication integrate through
|
||||
[DistributedApplications](DistributedApplications.md); this initial single-node platform
|
||||
makes no minority-write, leader-election or cross-shard consistency promise.
|
||||
|
||||
## Ordered platform tasks
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| P-NETWORKED-01 | P0; shared contracts and module plans | Freeze reference-domain operations, limits, error mapping and startup/shutdown DAG; backend-specific guarantees are explicit. | astra_implementer |
|
||||
| P-NETWORKED-02 | P2; P-NETWORKED-01, Runtime/Async/IO/Net lifecycle gates | Embedded/managed composition skeleton and installed-package consumer; no hidden workers before start, failed startup unwinds ownership. | astra_implementer |
|
||||
| P-NETWORKED-03 | P3; P-NETWORKED-02, Storage durable batches/snapshots, Security, Configuration | Native durable KV service and client, idempotency/version/scan workflows; lost replies never cause partial or duplicate mutations inside retention. | astra_implementer |
|
||||
| P-NETWORKED-04 | P3; P-NETWORKED-02, Sqlite checked transaction/migration gates | Independent SQLite service profile with schema/backup workflow; shared domain tests pass without claiming identical engine semantics. | sol_implementer |
|
||||
| P-NETWORKED-05 | P3; P-NETWORKED-03/04, Log/Observability, Update recovery | Operational health, graceful shutdown, config generations, backup/restore and signed-code-upgrade scenario; cleanup failure and schema rollback limits stay visible. | astra_implementer |
|
||||
| P-NETWORKED-06 | P3; P-NETWORKED-05, Testing fault/performance harness | Protocol interoperability, overload/crash matrix and workload baselines; bounded memory and durable-ack invariants hold with slow clients/storage/exporters. | astra_implementer |
|
||||
| P-NETWORKED-07 | P3; P-NETWORKED-05, Scheduler/Messaging/RPC capability gates | Job and RPC reference compositions; retries, cancellation and duplicate delivery match their module contracts. | sol_implementer |
|
||||
| P-NETWORKED-08 | P4; P-NETWORKED-06/07, distributed platform gates | Add discovery/replicated domain adapters through owners; partition behavior is tested before an availability/consistency claim. | astra_implementer |
|
||||
|
||||
## Acceptance scenarios, commands and migration
|
||||
|
||||
CURRENT: aggregate module build/tests exist, as recorded in [validation](../VALIDATION.md).
|
||||
No reference-server executable or platform-specific CTest entry is claimed. PROPOSED command
|
||||
templates after P-NETWORKED-02 registers the consumers and P-NETWORKED-06 adds the test label:
|
||||
`cmake --build <configured-build> --target <registered-reference-target>` and
|
||||
`ctest --test-dir <configured-build> -L networked-platform --output-on-failure`.
|
||||
Target/label registration is implementation work; these commands were not run.
|
||||
|
||||
Acceptance exercises both embedded and managed modes: start/fail-start/restart, parallel
|
||||
conditional writes, duplicate ID with same/different body, disk full and failed sync,
|
||||
response loss after commit, cursor expiry under compaction, slow header/body/response,
|
||||
wrong-host/untrusted TLS, authenticated namespace isolation, config reload races, telemetry
|
||||
failure, signal-triggered shutdown and restore of a consistent backup. Use private local
|
||||
fixtures, assigned ports and disposable directories; no public endpoint or production data
|
||||
is required. Check durable receipts against recovered backend contents after forced process
|
||||
termination. SQLite and native Storage get separate evidence records.
|
||||
|
||||
[Performance](../PERFORMANCE.md) governs warmup, repetitions, confidence intervals and
|
||||
regression thresholds. Measure cold/warm TLS, keepalive, tiny/large values, mixed reads/writes,
|
||||
scans and overload, retaining per-request p50/p95/p99 plus throughput, rejection/timeouts,
|
||||
allocations, total peak RSS/CPU (all workers), storage amplification and installed build cost.
|
||||
Drive independent client arrival schedules so queueing latency is not hidden. Hard budgets
|
||||
are correctness gates; only measured workload baselines can set later numerical latency SLOs.
|
||||
|
||||
[Migration](../MIGRATION.md) versions HTTP/domain schemas separately from package/storage
|
||||
formats. Additive response fields remain ignorable; required semantic changes use a new
|
||||
endpoint version. Backend migration exports a consistent logical snapshot into a new store,
|
||||
checks key/value/version/dedup invariants, then changes routing under a controlled write pause.
|
||||
Rollback to an old store after new writes requires reconciliation; switching a config string
|
||||
is not sufficient. [Documentation](../DOCUMENTATION.md) owns operator/client walkthroughs and
|
||||
[delivery](../DELIVERY.md) owns evidence gates. Cited existing component headers have graph
|
||||
coverage checks and source verification; all platform APIs, applications and end-to-end
|
||||
validation here are future work.
|
||||
@@ -0,0 +1,257 @@
|
||||
# Reloadable applications reference-platform specification
|
||||
|
||||
Status: PLANNED platform and future runnable-host specification. No host, executable,
|
||||
deployment configuration or feature code is implemented by this document. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Requirements R-004, R-009, R-010 and R-013–R-016 apply.
|
||||
[Architecture](../ARCHITECTURE.md) C-03–C-05, C-07, C-09, C-10, C-11 and C-14
|
||||
defines the platform contract.
|
||||
|
||||
## Source baseline and composition boundary
|
||||
|
||||
Existing [PluginManager](../../../include/Void/Plugin/Manager.hpp) supports pinned
|
||||
generations, transactional candidate validation and immutable-path replacement.
|
||||
[Module.hpp](../../../include/Void/Plugin/Module.hpp) supplies C++ module descriptors
|
||||
and lifecycle hooks; it is not a stable C-only interface.
|
||||
[PluginServiceBinding](../../../include/Void/Service/PluginService.hpp) pins providers;
|
||||
[ServiceRegistry](../../../include/Void/Service/Registry.hpp) still has borrowed require
|
||||
and lock-held lifecycle gaps. [Fsm Machine](../../../include/Void/Fsm/Machine.hpp)
|
||||
already serializes named application state but needs boundary/quiescence guarantees.
|
||||
[Configuration Watch](../../../include/Void/Configuration/Watch.hpp) preserves parse
|
||||
failures but publishes before its observer callback, so it is not a platform transaction.
|
||||
|
||||
[VersionStore.hpp](../../../include/Void/Update/VersionStore.hpp) explicitly separates
|
||||
reversible activate/rollback from durable commit: the durable healthy-history event is
|
||||
the commit marker, and later journal cleanup can fail after commitment. This boundary
|
||||
must remain authoritative. Source paths were coverage-checked, with partial Plugin,
|
||||
Service and Configuration declarations directly read. Existing
|
||||
[reload-under-load](../../../tests/standalone/Plugin/HotReloadUnderLoad.cpp),
|
||||
[replacement](../../../tests/standalone/Plugin/Manager.cpp),
|
||||
[Fsm serialization](../../../tests/standalone/Fsm/Serialize.cpp), and
|
||||
[configuration watch](../../../tests/standalone/Configuration/Watch.cpp) fixtures cover
|
||||
ingredients; they do not prove a runnable reload platform exists.
|
||||
|
||||
The platform composes [Runtime](../subsystems/Runtime.md),
|
||||
[Async](../modules/Async.md), [IO](../subsystems/IO.md),
|
||||
[Service](../modules/Service.md), [Plugin](../modules/Plugin.md),
|
||||
[Fsm](../modules/Fsm.md), [Configuration](../modules/Configuration.md),
|
||||
[Update](../modules/Update.md), [Security](../modules/Security.md),
|
||||
[Log](../modules/Log.md) and [Observability](../subsystems/Observability.md).
|
||||
It owns ordering, host policy and operator experience, not alternate implementations
|
||||
of their shared primitives. Optional process workers use [IPC](../subsystems/IPC.md).
|
||||
Distributed membership/consensus is not a prerequisite for local reload.
|
||||
|
||||
## Future reference host and user journeys
|
||||
|
||||
NEW proposed application root: `examples/reloadable-host/`; NEW proposed target and
|
||||
installed executable: `void-reloadable-host`. These are specification names only.
|
||||
The host starts from an explicit trusted release directory/config path, validates a
|
||||
release, creates Runtime resources, starts required services, restores boundary state,
|
||||
then admits application calls. It never watches arbitrary directories or loads an
|
||||
unverified library solely because its mtime changed.
|
||||
|
||||
The reference workload is a counter/workflow provider. Version A serves acquire/read/
|
||||
increment and a cancellable delayed operation; version B changes internal layout and
|
||||
migrates a versioned checkpoint while preserving durable counter operations. It exposes
|
||||
both a same-toolchain C++ fixture and a separate stable C-table fixture. A client holds
|
||||
an old read handle across replacement, while a delayed callback proves activity pinning.
|
||||
Stateful increments use operation IDs and one authoritative state owner; the example
|
||||
does not promise duplicate-free external effects from checkpointing alone.
|
||||
|
||||
Future local operator commands are inspect, validate-candidate, reload, health, drain,
|
||||
shutdown and recover. They run through an authenticated local IPC control endpoint;
|
||||
network exposure is disabled by default. Inspect reports active release/publication
|
||||
epoch, readiness, retained generations, async pins, quiescence phase and last error
|
||||
category without secrets. Reload returns a transaction ID and a phase-aware outcome.
|
||||
Remote request cancellation can stop preparation but cannot undo publication or a
|
||||
durable healthy commit. A lost reply is inspected by transaction ID before retry.
|
||||
|
||||
Future CLI examples below are PROPOSED syntax, not available commands:
|
||||
|
||||
```text
|
||||
void-reloadable-host --release-root <owned-directory> --config <validated-file>
|
||||
void-reloadable-host ctl inspect --endpoint <local-socket>
|
||||
void-reloadable-host ctl reload --candidate <immutable-release-id> --deadline 30s
|
||||
void-reloadable-host ctl recover --release-root <owned-directory>
|
||||
```
|
||||
|
||||
Angle-bracket arguments denote application inputs in proposed documentation, not
|
||||
unresolved implementation choices. Build/install/run prerequisites and target selection
|
||||
will be added only when the reference target exists, following
|
||||
[BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
## NEW host generation and interfaces
|
||||
|
||||
Illustrative composition types, not library declarations:
|
||||
|
||||
```cpp
|
||||
struct HostGeneration { // NEW platform-owned aggregate
|
||||
ReleaseId release;
|
||||
PublicationEpoch epoch;
|
||||
ValidatedConfigurationView configuration;
|
||||
ServiceRegistrySnapshot providers;
|
||||
WorkflowCheckpointMetadata workflow;
|
||||
std::vector<PluginGenerationLease> plugins;
|
||||
};
|
||||
// prepare_reload(candidate, Async::OperationOptions) -> Task<Result<PreparedReload>>;
|
||||
// publish(PreparedReload&&, ExpectedEpoch) -> Result<PublicationEpoch>;
|
||||
// inspect(transaction_id) -> ReloadOutcome; // includes durable commit state
|
||||
```
|
||||
|
||||
Shared types belong to their module plans. HostGeneration is retained behind a single
|
||||
publication pointer; its providers/configuration/plugin identities describe one epoch.
|
||||
The Service-owned publication primitive is the publication authority for the host:
|
||||
store HostGeneration/config views as part of that immutable registry generation and
|
||||
derive manager/host acquisition from it. Do not separately swap PluginManager current,
|
||||
Configuration current and the service table and call that atomic. Configuration exports
|
||||
a prepared immutable view to this coordinator; its standalone controller is not another
|
||||
publisher for the same host generation. A request captures one generation at admission.
|
||||
|
||||
Initial host supports one reload transaction at a time and one application process.
|
||||
Required dependencies form a DAG; optional dependencies have explicit absence behavior.
|
||||
ActivationPolicy Reloadable uses the protocol below; RestartRequired performs a supervised
|
||||
stop/start with persisted application checkpoint; InstallerRequired returns an operator
|
||||
action without executing a privileged installer. No mode silently escalates permissions.
|
||||
|
||||
## Candidate-to-commit dataflow
|
||||
|
||||
1. **Discover/verify.** Resolve an immutable release ID under the owned release root.
|
||||
Update/Security verify the signed manifest and exact signed payload bytes before
|
||||
parsing its schema. Validate path containment, hashes, ABI/application contracts,
|
||||
dependency versions and retained-resource budgets. Existing StrictJson and frozen
|
||||
ShortUrl V1 fixtures remain unchanged. A file watch only suggests a validation job.
|
||||
2. **Prepare privately.** Create candidate module instances and configuration/resource
|
||||
views in a private Service snapshot. No candidate accepts user requests or publishes
|
||||
external writes. Validate startup/readiness prerequisites before interrupting the old
|
||||
application. A module that cannot stage reversibly requires restart policy.
|
||||
3. **Quiesce stateful owners.** Stop old-generation mutation admission, await admitted
|
||||
writes and child scopes, and ask Fsm to checkpoint at a declared state boundary.
|
||||
Existing read handles can remain valid if the provider declares snapshot-safe reads;
|
||||
other old-handle calls return quiescing rather than entering a second writer. Stop
|
||||
and join race losers, subscriptions and generation-owned activities as specified by
|
||||
Async/Fsm/Plugin. A deadline retains ownership and fails the candidate safely.
|
||||
4. **Restore/readiness.** Candidate validates checkpoint schema into private state,
|
||||
prepares compatible persistent views, activates staged resources and reports readiness.
|
||||
Readiness includes dependency health and a bounded synthetic operation; it is not
|
||||
merely a successful factory call. Do not perform an irreversible persistent format
|
||||
migration inside a reversible reload. Such a release requires an explicit migration
|
||||
gate with separate backup/rollback policy.
|
||||
5. **Activate reversibly and publish.** Persist the bounded versioned application
|
||||
checkpoint to an immutable file using System's NEW durable replacement protocol,
|
||||
with release/schema identity and checksum; sync its recovery dependencies before
|
||||
recording its reference. Today's non-fsync `atomic_write` is insufficient. Call
|
||||
VersionStore activation for the verified candidate to record the durable reversible
|
||||
activation journal. Then publish one
|
||||
preallocated host/Service generation after rechecking expected epoch. No fallible
|
||||
plugin code or user callback runs under the publication guard. A failure before
|
||||
publication rolls back VersionStore activation, disposes/joins the candidate and
|
||||
resumes the old owner. Failed rollback/resume is degraded recovery, not success.
|
||||
6. **Health window.** Observe required services and bounded synthetic checks for a default
|
||||
10-second window. During this reversible window, admit snapshot-safe reads only;
|
||||
queue no unbounded writes. Mutation requests receive retryable not-ready/quiescing.
|
||||
This preserves the old checkpoint as a valid rollback continuation. A release that
|
||||
requires writable probation needs a separately proven compatible shared-state protocol
|
||||
before enabling it. On failure, republish the retained old generation, roll back the
|
||||
reversible activation and resume old mutation admission after validation.
|
||||
7. **Commit and reopen writes.** Commit through VersionStore's durable healthy event.
|
||||
Once commitment is known durable, enable candidate mutations and retire old owners.
|
||||
Failure/lost acknowledgement is resolved by VersionStore reconciliation/inspection
|
||||
before choosing rollback. Cleanup failure after the healthy marker reports
|
||||
committed-with-cleanup-error; never roll back as though the commit had not occurred.
|
||||
8. **Reclaim.** Drain old external generation references and async activity pins. Run
|
||||
deactivate/destruction/release outside locks and after plugin stacks return, then
|
||||
unmap only if unload conformance is enabled. Retain stuck generations and refuse
|
||||
further reload when budgets saturate. Process shutdown is a separate explicit choice.
|
||||
|
||||
This selected initial health policy trades brief write unavailability for deterministic
|
||||
rollback. The platform does not claim zero write downtime. Read continuity and delayed
|
||||
old-handle completion are measured independently.
|
||||
|
||||
## Failure matrix and recovery
|
||||
|
||||
| Failure point | Active ownership / required outcome |
|
||||
| --- | --- |
|
||||
| Manifest/ABI/dependency/config rejection | Old generation unchanged; candidate never activated publicly |
|
||||
| Quiescence timeout | Old/candidate owners retained; resume old admission only after confirming safe ownership; report phase |
|
||||
| Restore/readiness failure | Dispose and join candidate; restore old mutation gate; no new publication |
|
||||
| Activation journal written, crash before registry swap | On startup VersionStore reconcile chooses prior healthy release; no in-memory generation survives crash |
|
||||
| Published during reversible read-only health window, crash | Reconcile uncommitted activation to prior healthy release/checkpoint |
|
||||
| Health failure before healthy marker | Publish retained old state and roll back activation; no new writes admitted |
|
||||
| Commit acknowledgement lost | Inspect/reconcile durable healthy event; classify unknown until resolved |
|
||||
| Healthy marker durable, cleanup fails | Candidate remains committed; retry cleanup; preserve marker and report cleanup error |
|
||||
| Old plugin activity never ends | Keep mapping/owner; report retained pins; reject reload beyond retention cap |
|
||||
|
||||
On first bootstrap with no prior healthy release, failed candidate health leaves
|
||||
admission closed, joins the candidate and enters diagnostic/not-ready mode. Recovery
|
||||
never invents a previous release or labels an unvalidated candidate healthy.
|
||||
|
||||
Host transaction metadata persists release/transaction identity, activation phase and
|
||||
checkpoint reference through Update-owned durable facilities. It never introduces a
|
||||
second independent commit marker that can disagree with VersionStore. Crash recovery
|
||||
validates checkpoint/release compatibility before opening listeners. Candidate checkpoints
|
||||
are versioned and bounded; credentials/configuration secrets are not dumped into them by
|
||||
default. Recovery failure starts diagnostic/not-ready mode without user mutation admission.
|
||||
|
||||
## Limits, security and performance
|
||||
|
||||
Platform defaults: 64 modules, 256 services, four retained generations/module, one reload
|
||||
transaction, 4 MiB checkpoint/module, 32 MiB aggregate checkpoint bytes, 64 MiB total
|
||||
candidate images and 256 MiB owned runtime dynamic budget. All candidate/retired resources
|
||||
share global permits as well as local module caps. Image bytes, stacks/kernel buffers,
|
||||
external application state and RSS are reported separately. Control endpoint defaults
|
||||
to 16 sessions, 64 KiB requests and 32 in-flight operations; reload admission rejects a
|
||||
second transaction with busy. Phase limits fit a default 30-second total Async deadline;
|
||||
cleanup retains resources beyond expiry when safety requires it.
|
||||
|
||||
Native module compositions are selected; preserve current OpenSSL/libsodium primitives
|
||||
through Security/Update and existing same-toolchain plugin support. Stable C ABI is an
|
||||
opt-in separate path. A native plugin is trusted code; signatures establish authorized
|
||||
origin, not memory isolation. Optional isolated workers use IPC/System with explicit
|
||||
restart/effect semantics and narrower exposed capabilities. Diagnostics use bounded,
|
||||
redacted logs/metrics with transaction correlation, not unbounded plugin names as labels.
|
||||
|
||||
Measure reload/ready/quiescence/commit p50/p95/p99, read throughput during replacement,
|
||||
write-unavailable duration, allocations, retained pins, peak RSS/CPU and complete host
|
||||
build cost under [PERFORMANCE](../PERFORMANCE.md). Test slow callbacks and memory pressure;
|
||||
do not infer platform latency from an uncontended PluginManager test. No host benchmarks
|
||||
or deployment checks ran for this plan.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
All rows are PLANNED; none authorizes building the host in this documentation task.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| P-RELOADABLE-01 | P0 / current Plugin/Service/Fsm/Update source | Freeze source-based fixture matrix, release/health/rollback state diagram and isolated-consumer baseline | Existing C++ versus NEW C ABI and Update commit boundary are independently testable / astra_planner |
|
||||
| P-RELOADABLE-02 | P2 / P-RELOADABLE-01; Async/IO/Runtime, Service owning snapshots and Configuration prepare gates | Host-generation composition and lifecycle coordinator with fake modules | Failed prepare publishes nothing; readers acquire one coherent epoch; no user callback under locks / astra_implementer |
|
||||
| P-RELOADABLE-03 | P3 / P-RELOADABLE-02; Plugin C ABI/activity pins and Fsm checkpoint gates | Future reference host, counter/workflow A/B fixtures and local IPC controls | C++/C fixture migration, old read handle and delayed operation survive replacement without unmap / sol_implementer |
|
||||
| P-RELOADABLE-04 | P3 / P-RELOADABLE-03; Update durable activation/reconciliation gate | Signed candidate lifecycle, reversible read-only health window, healthy commit and crash recovery | Crash matrix obeys one durable commit marker; precommit health failure loses no admitted writes / astra_implementer |
|
||||
| P-RELOADABLE-05 | P3 / P-RELOADABLE-04; validation/profile harness | Failure injection, sustained reload/load, retained-resource limits, runbook and package examples | Uncooperative plugin remains pinned; budget saturation rejects reload; measured downtime/RSS reported / astra_implementer |
|
||||
| P-RELOADABLE-06 | P4 / P-RELOADABLE-05; IPC worker-isolation gate | Optional supervised out-of-process provider composition | Worker crash yields explicit unknown effects and restart policy; no claim of distributed/exactly-once reload / astra_implementer |
|
||||
|
||||
## Validation and migration evidence gates
|
||||
|
||||
CURRENT ingredient tests can be invoked with
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun here. The inherited build/test observations in [VALIDATION](../VALIDATION.md)
|
||||
are not host acceptance evidence. PROPOSED checks require the future application and
|
||||
fixtures: continuous readers and operations during A→B, cancelled delayed callbacks,
|
||||
writer quiescence, failed schema/ABI/readiness, lost commit acknowledgement, killed host
|
||||
at each matrix boundary, failed journal cleanup after commit, invalid config during
|
||||
reload, stuck generation pins, endpoint authorization and repeated shutdown under load.
|
||||
Persist expected counter operation IDs and compare recovery state after every crash.
|
||||
|
||||
Proposed build template, only after the NEW target is implemented and configured with
|
||||
its dependencies: `cmake --build <configured-build-dir> --target void-reloadable-host`.
|
||||
This is not a current command result. Add isolated package/ABI consumers and documented
|
||||
manual recovery drills under [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
Migration initially wraps existing PluginManager and IModule without changing their
|
||||
symbols; explicit host staging is opt-in. Legacy plugins lacking async pin/quiescence
|
||||
evidence remain restart-required with dlclose disabled. Persistent state upgrades keep
|
||||
old readers/checkpoints until verified; incompatible destructive migrations require a
|
||||
separate release plan. Preserve [ShortUrl V1](../../short-url.md), exact signed payload
|
||||
bytes and Update healthy markers throughout. Rollback after committed new writes is
|
||||
another compatible release/recovery action, never an automatic pointer reversal.
|
||||
See [MIGRATION](../MIGRATION.md), [DEPENDENCIES](../DEPENDENCIES.md),
|
||||
[DELIVERY](../DELIVERY.md), and [DOCUMENTATION](../DOCUMENTATION.md).
|
||||
@@ -0,0 +1,155 @@
|
||||
# NEW Algorithms subsystem
|
||||
|
||||
Status: NEW design; no Algorithms source directory/target is claimed to exist. All
|
||||
tasks are **PLANNED**. Source baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Existing algorithms and extraction candidates
|
||||
|
||||
[Containers Graph](../../../include/Void/Containers/Graph.hpp) already includes BFS,
|
||||
DFS, topological sorting, reachability and unweighted BFS shortest paths on its owning
|
||||
directed-graph structure. [DisjointSet](../../../include/Void/Containers/DisjointSet.hpp)
|
||||
uses path compression and union/rank-style bookkeeping; it remains a container with
|
||||
algorithmic methods. [PriorityQueue](../../../include/Void/Containers/PriorityQueue.hpp)
|
||||
maintains key-to-heap indices. [Text Diff](../../../include/Void/Text/Diff.hpp) supplies
|
||||
a generic span-based Myers edit engine plus text adapters. [Math sampling](../../../include/Void/Math/Random.hpp)
|
||||
uses standard ranges shuffle over an allocated index pool. These do not establish a
|
||||
current common Algorithms API.
|
||||
|
||||
Existing [graph](../../../tests/standalone/Containers/Graph.cpp),
|
||||
[disjoint-set](../../../tests/standalone/Containers/DisjointSet.cpp),
|
||||
[priority-queue](../../../tests/standalone/Containers/PriorityQueue.cpp),
|
||||
[diff](../../../tests/standalone/Text/Diff.cpp), and
|
||||
[random](../../../tests/standalone/Math/Random.cpp) suites are migration fixtures.
|
||||
Coverage reported partial parsing at PriorityQueue line 23 and Diff lines 30/96; these
|
||||
ranges and the relevant implementations were read directly. Graph-derived relationships
|
||||
are navigation hints, not proof that every algorithmic precondition is enforced.
|
||||
|
||||
## Scope and acyclic dependency decision
|
||||
|
||||
Algorithms is native, standard-library-first foundation under
|
||||
[C-01/C-05](../ARCHITECTURE.md). It owns reusable algorithms whose explicit work budgets,
|
||||
graph views or edit semantics add value beyond `std::ranges`. Do not reimplement standard
|
||||
sort, binary search, transform, reductions, heaps, or a parallel execution runtime merely
|
||||
for naming consistency. Containers/Text may depend on Algorithms; Algorithms imports
|
||||
neither, avoiding an extraction cycle. It may use Core traits, small local expected error
|
||||
enums and standard PMR supplied by the caller. Optional Functional/Memory adapters are
|
||||
separate downward dependencies; no Log/Runtime/Async imports.
|
||||
Checked distance/size arithmetic may use Math's narrow Numeric interface after
|
||||
M-MATH-02; Math itself imports neither Algorithms nor Containers. This prerequisite
|
||||
does not pull dynamic matrices or random-generation headers into algorithm APIs.
|
||||
|
||||
NEW proposed paths: `include/Void/Algorithms/Graph.hpp`, `Diff.hpp`, `TopK.hpp`,
|
||||
`src/Algorithms/module.cmake`, `tests/standalone/Algorithms/`. No files or test commands
|
||||
for them exist yet. PriorityQueue/DisjointSet ownership remains Containers; Algorithms
|
||||
uses standard priority_queue/vector scratch rather than pulling the owning types back in.
|
||||
|
||||
## NEW graph port and result shapes
|
||||
|
||||
Illustrative NEW API:
|
||||
|
||||
```cpp
|
||||
namespace Void::Algorithms {
|
||||
struct WorkLimits {
|
||||
std::size_t max_vertices = 65536;
|
||||
std::size_t max_edges = 262144;
|
||||
std::size_t max_scratch_bytes = 16 * 1024 * 1024;
|
||||
};
|
||||
enum class AlgorithmError { limit, invalid_vertex, invalid_weight,
|
||||
overflow, cancelled, inconsistent_view, allocation_failed };
|
||||
struct Topology {
|
||||
std::vector<std::uint32_t> order;
|
||||
std::vector<std::uint32_t> cycle; // one witness if cyclic
|
||||
};
|
||||
template<class IndexedGraphView>
|
||||
std::expected<Topology, AlgorithmError>
|
||||
topological_order(const IndexedGraphView&, WorkLimits, std::stop_token = {});
|
||||
}
|
||||
```
|
||||
|
||||
The graph view contract supplies `vertex_count()` and repeatable `out_edges(vertex)`
|
||||
with dense indices [0,V); edge views supply target and weight only when required.
|
||||
The caller owns immutable input through the call. Concurrent mutation is invalid;
|
||||
an optional version stamp lets adapters detect changes and return `inconsistent_view`.
|
||||
No references to temporary edge ranges escape. Containers supplies an adapter from
|
||||
arbitrary vertex keys to dense stable indices; its mapping allocation is charged by
|
||||
that adapter, not hidden from memory reports.
|
||||
|
||||
Use iterative BFS/DFS with visited arrays and explicit stacks, avoiding recursion depth
|
||||
as input control. Topological sorting uses Kahn's indegrees and FIFO ready vertices
|
||||
in input order; if not all vertices are emitted, iterative colored DFS over remaining
|
||||
vertices returns a concrete cycle witness. Stable results require stable input ordering;
|
||||
unordered container iteration is not secretly normalized. Dijkstra accepts finite
|
||||
nonnegative weights, checked distance addition and lazy duplicate heap entries. Each
|
||||
heap admission counts against scratch, including duplicates. Negative weights reject;
|
||||
Bellman–Ford is outside the initial gate. An unreachable target returns an empty optional
|
||||
path inside a successful result, distinct from resource exhaustion or invalid graph.
|
||||
|
||||
Work budgets count scanned edges and vertices before expanding scratch. Check stop at
|
||||
least every 1,024 edge visits and each outer iteration. Pure result-building operations
|
||||
publish only complete results. Visitor variants document already-delivered callbacks
|
||||
on cancellation/failure, run without internal locks, and do not claim to undo effects.
|
||||
Owned scratch allocation failure returns `allocation_failed` without a partial owning
|
||||
result; exceptions from caller predicates/visitors propagate unless explicitly adapted.
|
||||
No worker, scheduler or forceful callback interruption is introduced.
|
||||
|
||||
## NEW diff and bounded selection
|
||||
|
||||
The generic diff engine accepts spans, an equality predicate, edit-distance and scratch
|
||||
limits, returning index ranges instead of copied payloads. Text owns line splitting,
|
||||
patch escaping and human formatting. Default combined input cap is 65,536 elements,
|
||||
distance cap 4,096 and scratch 16 MiB. Index arithmetic is size_t with checked conversion
|
||||
where signed diagonals are needed. Trace storage reserves only after budget admission.
|
||||
Hitting a limit returns `limit`; a separately named coarse-replacement strategy may be
|
||||
added by Text, never silently substituted as a minimal edit script.
|
||||
|
||||
Myers trace reconstruction is the initial native implementation to preserve fixtures.
|
||||
A linear-space divide/reconstruct implementation is a P3 capability gate with the same
|
||||
deterministic tie-breaking and independent script-application tests. No claimed universal
|
||||
complexity improvement ignores output size or predicate cost.
|
||||
|
||||
NEW streaming `top_k` retains k elements in a standard heap (default k≤1,024, maximum
|
||||
65,536, 16 MiB scratch), tracks arrival index for stable tie-breaking, and reports k=0
|
||||
as empty success without allocation. Caller comparator must define strict weak order.
|
||||
The output policy is explicit ascending/descending and sorted after ingestion. This
|
||||
supports histogram ranking and bounded diagnostics; it does not replace ordinary
|
||||
partial_sort for in-memory spans. Math remains owner of probability sampling and RNGs.
|
||||
|
||||
## Task DAG
|
||||
|
||||
| Task | Phase; dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-ALGORITHMS-01 | P0; extraction source/tests | Record traversal order, path/cycle and diff tie-breaking fixtures; approve one-way Containers/Text→Algorithms adapters. | astra_implementer |
|
||||
| S-ALGORITHMS-02 | P1; S-ALGORITHMS-01 | Add indexed graph view, work budgets and iterative traversals/topology; stable input yields stable order and cyclic graphs include valid witnesses. | sol_implementer |
|
||||
| S-ALGORITHMS-03 | P2; S-ALGORITHMS-02; M-MATH-02 | Add bounded shortest paths; negative/nonfinite weights reject, overflow reports and unreachable targets are distinct. | sol_implementer |
|
||||
| S-ALGORITHMS-04 | P2; S-ALGORITHMS-01 | Extract bounded Myers engine and keep Text adapters; replay transforms source to target and all caps fail before excess allocation. | sol_implementer |
|
||||
| S-ALGORITHMS-05 | P2; S-ALGORITHMS-01 | Add streaming top-k and instrumentation-free progress counters; reference sorting confirms values/ties and retained scratch stays bounded. | sol_implementer |
|
||||
| S-ALGORITHMS-06 | P3; S-ALGORITHMS-02–05; measured large-diff profile | Implement linear-space diff only behind conformance/performance gate; publish isolated consumers and compare real graph/diff/top-k workloads. | astra_implementer |
|
||||
|
||||
## Verification, compatibility and limits
|
||||
|
||||
CURRENT verification is source/test inspection and the parent baseline; no new Algorithms
|
||||
test or benchmark was executed. PROPOSED property tests generate bounded graphs and
|
||||
compare reachability/path cost with simple exhaustive small-graph references; validate
|
||||
every cycle edge and topological relation. Include self-loops, disconnected graphs,
|
||||
parallel edges, zero weights, invalid targets, cancellation and view-version changes.
|
||||
Diff tests compare minimal edit lengths against dynamic programming on small sequences,
|
||||
then replay scripts on large/adversarial inputs. Top-k compares full standard sorting,
|
||||
including repeated keys and k greater than input size. Allocation fault injection must
|
||||
leave owning inputs untouched. Sanitizers check index/lifetime bugs; deterministic work
|
||||
counters prove budget enforcement independent of machine speed.
|
||||
|
||||
[PERFORMANCE](../PERFORMANCE.md) profiles sparse/dense dependency graphs, short/long equal
|
||||
prefix diffs, worst-case dissimilar spans and streaming ranking. Measure p50/p95/p99,
|
||||
throughput, predicate calls, allocations, scratch peaks, RSS/CPU and build cost. External
|
||||
algorithm libraries may be reference oracles in development only after separate dependency
|
||||
approval; initial shipped Algorithms has no external package requirement.
|
||||
|
||||
[Migration](../MIGRATION.md) keeps Graph member methods and `Void::Diff` forwarding wrappers
|
||||
through the major transition. Borrowed index-range results must not be confused with
|
||||
the old owning copied edits. Rollback uses old wrapper implementations; no persisted
|
||||
format changes are involved. New consumers need the Algorithms component declared rather
|
||||
than relying on whole-library tests to supply it. See
|
||||
[VALIDATION](../VALIDATION.md), [DEPENDENCIES](../DEPENDENCIES.md),
|
||||
[DELIVERY](../DELIVERY.md), [requirements](../REQUIREMENTS.md),
|
||||
[Containers](../modules/Containers.md), [Text](../modules/Text.md) and [Math](../modules/Math.md).
|
||||
@@ -0,0 +1,140 @@
|
||||
# Coordination subsystem plan — NEW deterministic Raft core
|
||||
|
||||
Status: NEW design, all tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-005, R-011, R-012, R-014–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-01–C-05, C-12, C-13.
|
||||
|
||||
## Baseline, algorithm and hard boundary
|
||||
|
||||
No current consensus module or tests exist; PROPOSED roots are `include/Void/Coordination`,
|
||||
`src/Coordination`, `tests/standalone/Coordination`. Existing
|
||||
[Resilience breaker](../../../include/Void/Resilience/CircuitBreaker.hpp) is a local
|
||||
admission primitive, not leader election or fencing; source and matching graph metadata
|
||||
were checked. Coordination is a native deterministic protocol with standard-library and
|
||||
lower-foundation dependencies only. It imports no RPC, Discovery, Storage implementation,
|
||||
Replication or Runtime. [Replication](Replication.md) owns concrete transport/persistence
|
||||
adapters and application state machines. This direction is mandatory C-12.
|
||||
|
||||
Select fixed-membership Raft first, three or five voting nodes, majority commit, crash-stop/
|
||||
recovery faults, authenticated non-Byzantine peers and stable storage. A single-node mode
|
||||
is explicitly a development profile. Protocol design follows the
|
||||
[extended Raft paper](https://raft.github.io/raft.pdf); timing affects liveness, while
|
||||
persistence and quorum rules enforce safety. No lease-based linearizable reads, automatic
|
||||
voter replacement, multi-leader writes or Byzantine tolerance are included initially.
|
||||
|
||||
## NEW event/action contract
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::Coordination shapes; no IO occurs inside Core.
|
||||
struct PersistBatch { BarrierId id; DurableStateDelta delta; };
|
||||
struct Persisted { BarrierId id; }; // confirms durable persistence, not merely write admission
|
||||
struct Tick { SteadyInstant now; ElectionRandomSample election_sample; };
|
||||
using Event = Variant<Tick, PeerMessage, Propose, ReadRequest,
|
||||
Persisted, PersistenceFailed, Applied, SnapshotInstalled>;
|
||||
using Action = Variant<PersistBatch, SendAfterPersist, ApplyCommitted,
|
||||
ReadBarrier, RejectProposal, RoleChanged, Fatal>;
|
||||
class Core {
|
||||
static Result<Core> recover(FixedConfig, RecoveredProtocolState);
|
||||
Result<ActionBatch> step(Event);
|
||||
};
|
||||
```
|
||||
|
||||
These are shape illustrations, not existing Variant/Result aliases. Binary owns wire
|
||||
encoding primitives; Coordination owns versioned term/index/node/message types. Inputs
|
||||
own message bytes; emitted actions own or pin their data until acknowledged. Each persist
|
||||
action has an increasing barrier ID; only matching successful durable completion releases
|
||||
dependent sends/votes/commit acknowledgements. One adapter event loop serializes `step`;
|
||||
the core never calls user code or locks an external service. Time progression and election
|
||||
random samples are explicit events, allowing byte-for-byte replay of histories.
|
||||
|
||||
Persisted state includes cluster/group identity, fixed voter list/hash, current term,
|
||||
voted-for, indexed log records and snapshot's last-included index/term. Recovery validates
|
||||
contiguity, snapshot boundary and monotonic terms before admitting a peer. Commit knowledge
|
||||
can be recovered conservatively; applied index is supplied by the application's atomic
|
||||
state and must never exceed known recoverable committed history. Contradictions fault the
|
||||
group rather than trimming application state to make a test pass.
|
||||
|
||||
## Required state transitions and algorithms
|
||||
|
||||
1. Follower election timeout defaults to an injected uniform 300–600 ms; heartbeat 100 ms.
|
||||
Deployments tune these from measured persistence/network delay, not from a safety claim.
|
||||
Candidate increments term, votes for self and persists before requesting votes. Grant at
|
||||
most one vote/term after log freshness check and durable term/vote update. Higher-term
|
||||
messages cause step-down and persistence before any dependent reply.
|
||||
2. AppendEntries checks previous index/term, rejects mismatch with a conflict hint and
|
||||
truncates only an uncommitted conflicting suffix. Never overwrite an applied/committed
|
||||
position. Persist suffix/term changes before success response. Duplicate or reordered
|
||||
messages cannot regress match/commit indices. Ignore responses from old terms/rounds.
|
||||
3. Leader tracks next/match per voter, sends bounded batches and advances commit only when
|
||||
a majority match an entry from its current term; preceding entries then become committed.
|
||||
New leader appends a no-op for its term. Proposals are not client successes until the
|
||||
Replication adapter durably applies the committed command and result. Losing leadership
|
||||
rejects uncommitted callers as unknown/not-leader without claiming their writes vanished.
|
||||
4. For a consistent read, first commit the current-term entry. Start a fresh read context,
|
||||
confirm leadership through current-term responses from a majority after that request,
|
||||
record its safe read index and emit a barrier. Reply only when application applied index
|
||||
reaches that index. Step-down invalidates pending read contexts. An isolated old leader
|
||||
cannot serve linearizable reads from its local data. Explicit stale reads live above core.
|
||||
5. Emit apply actions in contiguous committed order, bounded by adapter capacity; require
|
||||
Applied(index) acknowledgement before discarding ownership. Core does not execute commands.
|
||||
If apply fails, fault/pause the group; never skip an index and acknowledge later writes.
|
||||
6. Snapshot messages identify cluster/config/format/index/term and bounded chunks. Core
|
||||
validates boundary and requests installation; adapter atomically installs application,
|
||||
dedup and applied position, durably records snapshot metadata, then acknowledges. Log
|
||||
truncation waits for that durable installation; incomplete snapshots cannot displace active
|
||||
state. Retain a suffix only when the included index/term matches.
|
||||
|
||||
The selected read and durability rules correspond to the paper's stable-state and client
|
||||
interaction sections. Detailed defaults and action barriers here are NEW implementation
|
||||
decisions, not an assertion that a paper alone verifies this implementation.
|
||||
|
||||
## Bounds and failure matrix
|
||||
|
||||
NEW defaults: 1 MiB command, AppendEntries ≤64 entries/2 MiB including envelope metadata,
|
||||
4 in-flight batches/follower,
|
||||
1,024 proposals and 64 MiB uncommitted payload budget, 256 read contexts, 4,096 queued events
|
||||
and 64 MiB queued bytes. Log disk quota belongs to the adapter (initially 1 GiB/group).
|
||||
When lag prevents reclamation, reject new proposals; do not remove required history without
|
||||
a durable snapshot. Read/proposal deadlines use Async/Time contracts in adapters; expiry
|
||||
removes caller interest, not protocol history. Core transitions are bounded by batch size;
|
||||
long catch-up/snapshot work yields between chunks. Shutdown is adapter-driven: stop proposals,
|
||||
finish persistence barriers and release action ownership only after completion/join.
|
||||
|
||||
| Fault | Protocol action / forbidden shortcut | Required evidence |
|
||||
| --- | --- | --- |
|
||||
| Minority partition / old leader | No new committed success or consistent local read | Partition histories with concurrent reads |
|
||||
| Crash before vote/append persistence | No dependent success was sent | Crash every barrier boundary |
|
||||
| Disk write/sync failure | Fatal/pause; never send a dependent affirmative reply | Inject short write and failed sync |
|
||||
| Duplicate/reordered/delayed packets | Term/round/log checks; no state regression | Deterministic message permutations |
|
||||
| Divergent uncommitted suffix | Conflict repair; committed prefix untouched | Election with conflicting histories |
|
||||
| Snapshot interrupted/corrupt | Keep old state; reject/quarantine candidate | Chunk loss/restart/checksum mutation |
|
||||
| Apply failure / state mismatch | Fault group and surface corruption | Applied-index invariant fixtures |
|
||||
| Clock stall/jump / election storm | Liveness may stop; no relaxed quorum | Adversarial Tick schedules |
|
||||
| Unknown peer/config/version | Reject before core mutation | Cross-cluster/spoofed node messages |
|
||||
|
||||
## Task DAG and evidence gates
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-COORDINATION-01 | P0; baseline | Write formal invariants, event model and deterministic test harness specification | astra_implementer |
|
||||
| S-COORDINATION-02 | P1; S-COORDINATION-01, Binary/Time/Functional contracts | NEW pure types/codec/ports, replay harness; no network/storage/runtime dependency | astra_implementer |
|
||||
| S-COORDINATION-03 | P4; S-COORDINATION-02 | Fixed voters, elections, append/commit and persistence barriers; model/simulation safety gate | astra_implementer |
|
||||
| S-COORDINATION-04 | P4; S-COORDINATION-03 | Current-term no-op, read contexts and apply barriers; isolated-leader reads fail | astra_implementer |
|
||||
| S-COORDINATION-05 | P4; S-COORDINATION-04, snapshot port defined in S-COORDINATION-02 | Snapshot boundary/recovery against a fake port; crash/suffix/corruption tests pass without a Replication dependency | astra_implementer |
|
||||
| S-COORDINATION-06 | P4 later; S-COORDINATION-05, integrated fixed-group acceptance | Explicit joint-consensus membership protocol plus learners; separate proof/review and fault gate before any voter edits | astra_implementer |
|
||||
|
||||
CURRENT: no Coordination targets exist; no consensus execution evidence is claimed.
|
||||
PROPOSED verification includes a reference state-machine model, exhaustive bounded schedules,
|
||||
seeded randomized simulations, persistent replay artifacts, partitions and crash/recovery.
|
||||
Check election safety, log matching, leader completeness, state-machine safety and read
|
||||
linearizability on recorded histories. Separate adversarial review is required even when
|
||||
tests pass; commands await target creation in [VALIDATION](../VALIDATION.md).
|
||||
Measure step p50/p95/p99, actions/second, allocations, RSS/CPU, bytes retained and build
|
||||
cost under [PERFORMANCE](../PERFORMANCE.md), not a universal consensus speed claim.
|
||||
|
||||
Migration versions protocol and persistent formats; mixed unsupported majors refuse peers.
|
||||
Fixed membership is immutable after bootstrap. Rollback replays a compatible durable
|
||||
format or restores an approved snapshot into a separately identified cluster; never reset
|
||||
term/vote in place or reuse a node identity with an empty disk. See [MIGRATION](../MIGRATION.md),
|
||||
[BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md) and [Replication](Replication.md).
|
||||
@@ -0,0 +1,121 @@
|
||||
# Discovery subsystem plan — NEW
|
||||
|
||||
Status: NEW design; all feature tasks PLANNED. Source baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-003, R-009, R-011, R-014–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-01–C-05, C-11–C-13.
|
||||
|
||||
## Baseline and dependency direction
|
||||
|
||||
No Discovery source/target exists in the assigned baseline. Existing
|
||||
[Net Url](../../../include/Void/Net/Url.hpp) provides endpoint parsing, not a membership,
|
||||
health or service-discovery protocol; source/graph coverage matched with no recorded issue.
|
||||
NEW paths are `include/Void/Discovery`, `src/Discovery` and `tests/standalone/Discovery`.
|
||||
Begin with a static immutable endpoint catalog and local in-process registrations.
|
||||
Do not require DNS multicast, an external agent, RPC or consensus to discover initial peers.
|
||||
|
||||
Discovery owns endpoint sets, revisioned snapshots, local registration lifetime and watch
|
||||
semantics. [RPC](RPC.md) accepts injected endpoints; its optional Discovery integration
|
||||
lives above RPC. [Coordination](Coordination.md) imports no Discovery. A later replicated
|
||||
directory adapter belongs in the Replication/platform integration layer and uses separately
|
||||
configured bootstrap peers. Discovered leader hints never redefine Raft membership.
|
||||
|
||||
## NEW native contract and algorithm
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::Discovery shapes.
|
||||
struct EndpointRecord {
|
||||
InstanceId instance; ServiceId service; Endpoint endpoint;
|
||||
std::uint32_t weight; Attributes attributes;
|
||||
};
|
||||
struct Snapshot { Revision revision; std::vector<EndpointRecord> records; Freshness freshness; };
|
||||
class Catalog {
|
||||
Result<Snapshot> resolve(ServiceId, ResolvePolicy) const;
|
||||
Result<Registration> register_local(EndpointRecord, LeasePolicy);
|
||||
Result<Watch> watch(ServiceId, Revision after, WatchCallback);
|
||||
};
|
||||
```
|
||||
|
||||
Names above are NEW domain types; Endpoint follows Net's endpoint owner, operation options
|
||||
remain Async-owned. Catalog construction is pure and creates no thread. Static configuration
|
||||
is validated as a complete snapshot then atomically published; duplicate service+instance
|
||||
identities, invalid authorities and unsupported metadata cause rejection of the entire
|
||||
candidate, preserving the active revision. Revisions are local monotonic values with a
|
||||
provider generation; they are not cluster-wide consensus indices.
|
||||
|
||||
Local registrations return move-only RAII handles retaining catalog state. Release removes
|
||||
future snapshots. Leased registration is explicit, default 30-second TTL and renewal every
|
||||
10 seconds in an optional managed adapter, measured by injected steady time. Static entries
|
||||
never expire. A registration handle without a lease is valid until explicit release; zero
|
||||
TTL is invalid rather than an undocumented permanent registration. Local process shutdown
|
||||
removes local entries and joins admitted callbacks; destruction alone only requests stop.
|
||||
|
||||
Resolution snapshots immutable owned values, sorts by instance identity for deterministic
|
||||
tests and excludes expired/unready entries by default. Optional stale resolution explicitly
|
||||
returns freshness/provider error. Failure detection changes availability hints only; it
|
||||
cannot certify uniqueness, leadership or permission. Weighted round-robin selection is an
|
||||
optional client-side selector over a snapshot; affinity selection uses stable hashing
|
||||
only when requested. Address refresh retains the peer's configured identity, so DNS changes
|
||||
do not disable TLS expected-name checks.
|
||||
|
||||
Watch admission returns an initial complete snapshot followed by revisioned changes.
|
||||
Changes are serialized per watch on the injected executor. If its bounded queue loses
|
||||
continuity, replace pending deltas with a `resync_required` event and a full latest snapshot;
|
||||
do not silently pretend all changes were delivered. Callbacks run outside catalog locks.
|
||||
`cancel` stops new admission; `join` waits for already-admitted callbacks. A callback may
|
||||
cancel itself, but synchronous self-join is invalid and diagnosed instead of deadlocking.
|
||||
No watch callback borrows a temporary catalog buffer.
|
||||
|
||||
## Upper replicated directory capability
|
||||
|
||||
After [Replication](Replication.md) readiness, add a separate directory application with
|
||||
versioned register/renew/remove commands and quorum-consistent snapshots. Bootstrap endpoints
|
||||
and cluster identity remain static operator input; it cannot resolve itself into existence.
|
||||
The replicated application assigns revisions from applied log positions. Lease expiry is a
|
||||
leader-proposed deterministic command, never each follower independently deleting entries
|
||||
from local wall clocks. Connection loss reports unavailable/stale according to caller policy.
|
||||
This adapter depends on Discovery's value/watch interfaces, not the reverse. Dynamic Raft
|
||||
voting membership remains a separate tested protocol, not an effect of registering an endpoint.
|
||||
|
||||
## Bounds and failure matrix
|
||||
|
||||
NEW defaults: 1,024 services, 256 endpoints/service, 10,000 total records, 16 metadata
|
||||
fields/4 KiB aggregate per record, 1,024 watches with 64 events/watch and a shared 16 MiB
|
||||
event budget. Reject registrations when any cap would be exceeded. Coalesce watch events
|
||||
before exhausting the shared budget. Cleanup handles at most 256 expirations/turn; resolution
|
||||
also filters logically expired records so deferred cleanup cannot revive them. Optional
|
||||
network resolver adapter has 128 outstanding operations and a 5-second total deadline.
|
||||
|
||||
| Failure | Required outcome | Acceptance |
|
||||
| --- | --- | --- |
|
||||
| Invalid replacement config | Keep old revision; report structured diagnostics | Atomic bad/good snapshot replacement |
|
||||
| Duplicate registration | conflict; do not steal the old handle's registration | Release/replace race |
|
||||
| Lease renewal delayed | Expire availability hint; no claim peer is dead | Inject clock/executor delay |
|
||||
| Watch queue overflow | Explicit resync, bounded retained events | Slow observer sees coherent snapshot |
|
||||
| Endpoint/TLS identity mismatch | Net verification error; no downgrade | DNS/address replacement fixture |
|
||||
| Catalog shutdown during callback | Stop admission then join; state retained | Callback reentrancy and self-cancel |
|
||||
| Replicated directory loses quorum | Strict lookup unavailable; stale API marks revision/freshness | Partition/stale-result tests |
|
||||
| Malicious metadata/cardinality | Reject before publication; no arbitrary metric labels | Max sizes and cap churn |
|
||||
|
||||
## Task DAG and verification
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-DISCOVERY-01 | P0; baseline | Record NEW interfaces and static bootstrap invariants; no consensus dependency | sol_implementer |
|
||||
| S-DISCOVERY-02 | P1; S-DISCOVERY-01, Time/Functional contracts | Immutable catalog and local RAII registrations; conflict/expiry/atomic replacement tests | sol_implementer |
|
||||
| S-DISCOVERY-03 | P2; S-DISCOVERY-02, Async scope gate | Bounded watches/selectors and managed renewal adapter; cancel/join/resync tests | sol_implementer |
|
||||
| S-DISCOVERY-04 | P3; S-DISCOVERY-03, RPC/Net gates | Optional RPC endpoint adapter, observations and identity-preserving refresh; RPC package remains independent | sol_implementer |
|
||||
| S-DISCOVERY-05 | P4; S-DISCOVERY-04, Replication single-group gate | Upper replicated directory, deterministic expiry commands and static bootstrap; quorum/stale contract tests | astra_implementer |
|
||||
|
||||
CURRENT: only the linked Net parsing surface exists; no Discovery checks ran. PROPOSED
|
||||
tests model revisions, reordered renew/release, clock advancement, executor stalls and
|
||||
callback overflow, then partition the upper adapter. Add targets before publishing commands;
|
||||
see [VALIDATION](../VALIDATION.md), [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
Measure resolve/watch p50/p95/p99, throughput, churn allocations, peak RSS/CPU, maximum
|
||||
resync backlog and build cost under [PERFORMANCE](../PERFORMANCE.md).
|
||||
|
||||
Migration introduces provider-generation/revision schemas explicitly. Replacing a provider
|
||||
publishes a full reset snapshot; clients cannot compare unrelated revision domains. Rollback
|
||||
retains the static catalog and rejects incompatible provider records, without changing voting
|
||||
membership or trust roots. See [MIGRATION](../MIGRATION.md) and
|
||||
[DistributedApplications](../platforms/DistributedApplications.md).
|
||||
@@ -0,0 +1,151 @@
|
||||
# DistributedStorage subsystem plan — NEW
|
||||
|
||||
Status: NEW design; all tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-007, R-008, R-011, R-012, R-014–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-05, C-08, C-12–C-14.
|
||||
|
||||
## Baseline and selected backend
|
||||
|
||||
There is no DistributedStorage source directory, client, shard manager or transaction
|
||||
coordinator at this baseline. NEW proposed roots are `include/Void/DistributedStorage`,
|
||||
`src/DistributedStorage`, `tests/standalone/DistributedStorage`. Existing
|
||||
[Net client](../../../include/Void/Net/Http.hpp) is only a future transport precursor;
|
||||
its coverage gaps 112/115 were checked directly. Neither networking nor the existing Sqlite
|
||||
module establishes distributed storage. The new design composes [Storage](Storage.md)'s
|
||||
original engine and [Replication](Replication.md)'s deterministic application host.
|
||||
|
||||
Choose native key-value service logic. Local data format, WAL, conditional batches,
|
||||
snapshots and compaction remain Storage-owned. Consensus remains Coordination-owned;
|
||||
Replication supplies adapters. DistributedStorage owns key routing, replicated KV commands,
|
||||
client semantics and later shard movement. It neither exposes SQL nor claims SQLite file
|
||||
compatibility. SQLite WAL itself requires same-host shared state; putting a WAL database on
|
||||
a shared network filesystem is not this replication design. See [SQLite WAL restrictions](https://sqlite.org/wal.html).
|
||||
|
||||
## First deliverable: one fixed replicated group
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::DistributedStorage shapes.
|
||||
struct Version { GroupId group; LogIndex index; std::uint32_t mutation; };
|
||||
struct ReadResult { OwnedBytes value; Version version; AppliedPosition observed; };
|
||||
struct WriteOptions { RequestIdentity identity; OperationOptions operation; };
|
||||
class Client {
|
||||
Task<Result<ReadResult>> get(Key, ReadPolicy, OperationOptions);
|
||||
Task<Result<CommitReceipt>> write(ConditionalBatch, WriteOptions);
|
||||
Task<Result<ScanPage>> scan(ScanCursor, ScanLimits, ReadPolicy, OperationOptions);
|
||||
};
|
||||
```
|
||||
|
||||
RequestIdentity/ReadPolicy/CommitReceipt refer to Replication-owned types, conditional
|
||||
batches and snapshot views to Storage-owned types, and OperationOptions to Async. The Version
|
||||
shown is a NEW distributed identity, not an assumed Storage version representation. Initial
|
||||
service has one group and no hidden routing indirection. All writes, deletes and compare/
|
||||
version predicates serialize in Raft command order. Conditional failure is a committed,
|
||||
deduplicated result with no partial mutation; a retry returns that same failure/result.
|
||||
Readers use quorum-confirmed ReadPolicy by default. Stale-local is a separately requested
|
||||
result with observed position; no cache can silently weaken the policy.
|
||||
|
||||
Batch admission validates key/value sizes, identities and precondition syntax before
|
||||
logging. Committed apply checks predicates against the latest state, computes mutations
|
||||
and emits one Storage batch containing application state, application result, dedup and
|
||||
applied-log position. This is atomic within the group. It is not arbitrary client-side
|
||||
read-modify-write isolation. Get → compute → write requires a version predicate to detect
|
||||
concurrent updates. Multi-operation batches are all-or-none within one group only.
|
||||
|
||||
Scan starts after a fresh read barrier and pins one local Storage snapshot. Cursor binds
|
||||
group, snapshot ID, route epoch, last key, limits and expiry with integrity protection from
|
||||
Security; it is opaque and server-owned state remains bounded. All pages use that same
|
||||
snapshot. Losing its serving node expires the cursor; client restarts explicitly, rather
|
||||
than getting a mixed-version continuation under the old cursor. One-page scans need not
|
||||
retain a cursor. Initial cursor TTL is 30 seconds; empty pages cannot extend it forever.
|
||||
|
||||
## Resource, failure and operations contract
|
||||
|
||||
NEW defaults: key ≤4 KiB, value ≤768 KiB, batch ≤128 mutations/1 MiB for the complete
|
||||
encoded command including metadata, fitting Replication's command limit;
|
||||
1,024 writes/group with Replication's 64 MiB/group and 256 MiB/host aggregate limits.
|
||||
Reads: 256 active/512 waiting; scans: 64 pinned snapshots/group, page ≤1,000 records or
|
||||
1 MiB, 64 MiB aggregate pinned-version retention budget. Storage pressure can reject new
|
||||
scans; existing pins live until completion/expiry or explicitly reported cancellation.
|
||||
Disk defaults inherit Replication's 1 GiB/group development quota; operators size actual
|
||||
volumes using measured data+WAL+snapshot+compaction headroom. No claimed production capacity.
|
||||
Default operation deadline 10 seconds; client retries preserve the same session/sequence.
|
||||
The client follows at most three authenticated not-leader hints within that total deadline;
|
||||
it never treats an arbitrary redirect as authority to change cluster identity.
|
||||
|
||||
| Fault | Behavior | Evidence |
|
||||
| --- | --- | --- |
|
||||
| Conditional conflict | Atomic no-mutation result, deduplicated | Competing compare-and-set histories |
|
||||
| Timeout/lost response after write | Unknown outcome; inspect/retry same identity | Crash after apply before response |
|
||||
| Minority leader / stale route | No consistent reads or write success; authenticated hint only | Partition and stale leader clients |
|
||||
| Node dies during scan | Cursor expired/unavailable; no mixed snapshot | Fail serving node between pages |
|
||||
| Disk full / compaction or pin pressure | Explicit overload/storage fault before unsafe acknowledgement | Quota with long scans and writes |
|
||||
| Corrupt recovery/snapshot | Group unavailable and quarantined; never return fabricated empty values | Byte mutation/recovery faults |
|
||||
| Client cancel at commit | One local result; durable outcome still inspectable | Cancel/commit race |
|
||||
| Incompatible command schema | Reject admission or stop group; never partially apply | Mixed-version command fixtures |
|
||||
|
||||
Shutdown stops client admission, drains/cancels reads and scan pins, joins group operations,
|
||||
then closes the native Storage generation. Cancellation is not distributed rollback. Internal
|
||||
keys are reserved and unreachable from user keyspace; authorization scopes tenant/key prefix
|
||||
before routing. Observations label group/shard/method only within cardinality budgets and
|
||||
never include raw user keys or values.
|
||||
|
||||
## Later gate: sharding and rebalance
|
||||
|
||||
Do not start sharding until single-group crash/linearizability/snapshot acceptance passes.
|
||||
Select ordered range shards so scans have a defined traversal order. An upper replicated
|
||||
metadata group stores range boundaries, owning group IDs and monotonic route epochs.
|
||||
Bootstrap metadata endpoints are static; metadata is not a prerequisite for the one-group
|
||||
service. Requests carry shard/epoch; stale epochs return a versioned route hint. Clients
|
||||
validate nonoverlap/coverage and cache bounded snapshots. Metadata-group loss blocks route
|
||||
changes; known unaffected ranges can continue only under their current ownership epoch.
|
||||
|
||||
Move a range with a freeze-and-copy protocol first, accepting bounded unavailability:
|
||||
commit `freeze(range, epoch)` in source group → wait for applied barrier → create a pinned
|
||||
snapshot including all data and retained dedup outcomes → copy/verify/install into destination
|
||||
as inactive → commit metadata activation of destination at epoch+1 → destination records
|
||||
activation proof and admits writes → source retains a tombstone/redirect. Old source never
|
||||
unfreezes autonomously. Before metadata activation an explicit abort may restore source;
|
||||
after activation complete forward, never roll back by enabling both. Destination checks a
|
||||
quorum-confirmed metadata proof and persists it before serving, even after restart.
|
||||
|
||||
Retain source data until destination durability and metadata acknowledgement are confirmed,
|
||||
all relevant snapshot pins have ended and a configured seven-day recovery retention elapses.
|
||||
Transport cancellation only pauses copy. Session IDs include origin group; moved retained
|
||||
results are consulted before re-executing a retry, including retries arriving at the old
|
||||
source. Stop writes for any range whose ownership proof is ambiguous. Split/rebalance reuses
|
||||
the same state machine and journaled phases. Default: one range move/host, 16 MiB/s and 1 MiB
|
||||
chunks, with required copy headroom validated before freeze.
|
||||
|
||||
Cross-shard batches are rejected before mutation. A scan across multiple shards returns
|
||||
per-shard snapshot positions and explicitly lacks a single global snapshot. Cross-shard
|
||||
transactions, global serializability and automatic exactly-once external effects are
|
||||
unimplemented and outside this gate; adding them requires a new architecture/acceptance
|
||||
contract. Do not disguise partial multi-shard progress as a transactional batch.
|
||||
|
||||
## Task DAG and validation
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-DISTRIBUTEDSTORAGE-01 | P0; baseline | NEW KV/identity/consistency contract and history-checker scenarios | astra_implementer |
|
||||
| S-DISTRIBUTEDSTORAGE-02 | P1; S-DISTRIBUTEDSTORAGE-01, Storage conditional batch contracts | Deterministic KV application with atomic result/dedup/applied batch; local model fixtures | astra_implementer |
|
||||
| S-DISTRIBUTEDSTORAGE-03 | P4; S-DISTRIBUTEDSTORAGE-02, Replication fixed-group acceptance | Single-group client/server, quorum reads, durable replies; crash/lost-reply histories pass | astra_implementer |
|
||||
| S-DISTRIBUTEDSTORAGE-04 | P4; S-DISTRIBUTEDSTORAGE-03 | Snapshot scans, quotas, backup/recovery tooling and compatibility; pressure and cursor failure tests | sol_implementer |
|
||||
| S-DISTRIBUTEDSTORAGE-05 | P4 later; S-DISTRIBUTEDSTORAGE-04, integrated single-group gate | Range metadata, route epochs and ownership proofs; no overlapping owners in model histories | astra_implementer |
|
||||
| S-DISTRIBUTEDSTORAGE-06 | P4 later; S-DISTRIBUTEDSTORAGE-05 | Freeze/copy/activate rebalance and split; crash at every phase, cross-shard batch rejection | astra_implementer |
|
||||
|
||||
CURRENT: no subsystem tests/commands exist. PROPOSED verification uses a sequential KV model,
|
||||
linearizability checking with unknown outcomes retained, repeated process kills, disk faults,
|
||||
partition schedules, duplicate identities and exhaustive selected move crash points. Persistence
|
||||
faults follow [atomic-commit testing methodology](https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior),
|
||||
without claiming the original engine shares SQLite's implementation. Targets must precede
|
||||
commands; see [VALIDATION](../VALIDATION.md), [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
Measure read/write/CAS/scan p50/p95/p99, throughput, allocations, RSS/CPU, disk/write amplification,
|
||||
recovery and movement pause, plus build cost through [PERFORMANCE](../PERFORMANCE.md). Benchmark
|
||||
single-group correctness before shard scaling. Migration versions commands, route tables,
|
||||
cursor and snapshot formats; drain obsolete cursors. Rollback accepts only readable durable
|
||||
formats and completed ownership proofs, never enables a frozen source after activation.
|
||||
Backups capture each group and declared metadata positions; a multi-group backup is not a
|
||||
global transaction snapshot. See [MIGRATION](../MIGRATION.md) and
|
||||
[DistributedApplications](../platforms/DistributedApplications.md).
|
||||
@@ -0,0 +1,177 @@
|
||||
# IO native operations and backend plan
|
||||
|
||||
Status: NEW subsystem, all feature work PLANNED. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
There is no existing IO module in the scoped baseline. Requirements R-003, R-006,
|
||||
R-009, R-012 and R-014 apply; [architecture](../ARCHITECTURE.md) C-02–C-06 is
|
||||
authoritative. Proposed source roots are NEW `include/Void/IO`, `src/IO` and
|
||||
`tests/standalone/IO`; none is created by this plan.
|
||||
|
||||
## Source anchors and ownership
|
||||
|
||||
[Async Executor](../../../include/Void/Async/Executor.hpp) queues borrowed coroutine
|
||||
handles today; [Task](../../../include/Void/Async/Task.hpp) owns/destroys its frame.
|
||||
These require [Async's structured ownership gate](../modules/Async.md) before IO
|
||||
can expose safe cancellable awaits. [System Process](../../../src/System/Process.cpp)
|
||||
contains local nonblocking pipe/poll logic, and
|
||||
[System FileWatcher](../../../src/System/FileWatcher.cpp) has a polling thread.
|
||||
These are integration anchors, not an existing unified reactor. Current
|
||||
[executor tests](../../../tests/standalone/Async/Executor.cpp) and
|
||||
[process-stream tests](../../../tests/standalone/System/ProcessStream.cpp) supply
|
||||
regressions when optional adapters migrate. These paths were graph-coverage checked
|
||||
and important ownership/source bodies directly inspected.
|
||||
|
||||
IO owns native descriptors, transport readiness, partial transfer, buffers, operation
|
||||
registration and backend shutdown. [Net](../modules/Net.md) owns DNS/protocol semantics,
|
||||
connection reuse and TLS; IO never imports Net or Runtime. A portable contract with
|
||||
an explicitly unsupported platform is preferable to pretending Linux facilities exist
|
||||
elsewhere. Embedded applications inject their driver/executor/clock; Runtime is only
|
||||
an optional owner of these same resources.
|
||||
|
||||
## NEW API sketch
|
||||
|
||||
Illustrative types, not compiling examples or delivered declarations:
|
||||
|
||||
```cpp
|
||||
namespace Void::IO {
|
||||
struct Transfer { std::size_t bytes; bool eof; };
|
||||
struct BackendOptions { Limits limits; BackendPreference preference; };
|
||||
class Driver; // explicit poll/run/stop/join
|
||||
class ByteStream { // owns shared descriptor state
|
||||
public:
|
||||
Coro::Task<Result<Transfer>> read_some(
|
||||
std::span<std::byte>, Async::OperationOptions = {});
|
||||
Coro::Task<Result<Transfer>> write_some(
|
||||
std::span<const std::byte>, Async::OperationOptions = {});
|
||||
Coro::Task<Result<void>> close_and_join(Async::OperationOptions = {});
|
||||
};
|
||||
// read_exact / write_all are bounded composed operations on ByteStream.
|
||||
// File::read_at / write_at / sync and socket accept/connect use the same options.
|
||||
}
|
||||
```
|
||||
|
||||
`Result` is Functional's shorthand. The sole OperationOptions type belongs to Async:
|
||||
`std::stop_token` plus optional absolute steady deadline, with Time's injected clock
|
||||
bound to the driver. No IO request context duplicates it. A caller holds borrowed spans
|
||||
stable until the terminal result is delivered, including delayed backend cancellation
|
||||
acknowledgement. An owning-buffer overload transfers Memory-owned buffer leases for
|
||||
cross-component use. IO never retains a bare pointer beyond that lease.
|
||||
|
||||
Default one active read and one active write per stream; a second same-direction
|
||||
operation returns busy rather than quietly changing ordering. Read zero indicates
|
||||
EOF only when requested length is nonzero and the backend reports peer EOF; a zero-length
|
||||
request succeeds immediately without probing EOF. Half-close affects one direction;
|
||||
readable buffered data drains before EOF. Write success means accepted by the OS, not
|
||||
received or durably stored by a peer. Transfer failures retain bytes already transferred
|
||||
and native error cause. Exact/all compositions preserve progress and the original total
|
||||
deadline; cancellation cannot undo transferred bytes.
|
||||
|
||||
## Initial Linux algorithms
|
||||
|
||||
Select native nonblocking sockets with level-triggered epoll, no EPOLLET. Readiness is
|
||||
a hint; syscalls still handle EAGAIN, EINTR, short transfer, EOF and errors. Level-triggered
|
||||
semantics avoid requiring every dispatch to drain a descriptor completely; the fairness
|
||||
budget can yield while data remains ready. This follows the
|
||||
[Linux epoll interface](https://man7.org/linux/man-pages/man7/epoll.7.html).
|
||||
|
||||
One driver thread owns interest updates and descriptor generations. Producers submit
|
||||
bounded control messages and wake it through eventfd; an embedder may drive bounded
|
||||
`poll_once` turns instead. Dispatch up to 64 ready descriptors and 64 KiB/direction per
|
||||
descriptor per turn before yielding. Enable writable interest only with pending writes
|
||||
to avoid idle busy loops. HUP/ERR still trigger final read/error inspection. Async
|
||||
completion tickets transfer continuations to the supplied executor outside driver locks.
|
||||
|
||||
Registration token is `(slot, generation)`, not just the integer fd. Close invalidates
|
||||
the slot, removes epoll interest, cancels pending operations and drains their backend
|
||||
references before descriptor reclamation. Stale ready events cannot target a reused fd.
|
||||
Stop callbacks enqueue retained control records; they never close a potentially reused
|
||||
integer directly. Socket connect completion checks the socket error state; accept loops
|
||||
obey the same fairness/admission budget. Platform-specific endpoint conversion remains
|
||||
an IO/Net adapter detail until the Net endpoint contract is integrated.
|
||||
|
||||
Files initially use a bounded native blocking worker pool. Positional pread/pwrite
|
||||
avoids shared offset races; default writes/syncs for one file are serialized in admission
|
||||
order, and reads expose explicit offsets. Worker ownership retains descriptor and buffer
|
||||
until the syscall returns. Cancelled queued work is removed before execution; an active
|
||||
blocking syscall may continue. Deadline expiry records intent; result classification and
|
||||
delivery wait for backend evidence and the end of buffer access. A sync that actually
|
||||
succeeds returns success even after stop/expiry, so a higher-level commit can use that
|
||||
evidence. A sync failure preserves its native cause and unknown-durability classification;
|
||||
stop neither hides it nor turns it into success. Cancelled before execution is distinct
|
||||
from executed with unknown effects. Do not promise hard shutdown bounds for stalled
|
||||
filesystems.
|
||||
|
||||
## Completion state and shutdown
|
||||
|
||||
IO uses Async's operation control block rather than a second completion state machine.
|
||||
Submission reserves global and per-descriptor quotas, attaches stop/timer registrations,
|
||||
then exposes a retained backend request. Completion before suspension uses Async's
|
||||
handshake. Stop/timeout requests cancellation; the operation owner classifies one result
|
||||
from backend evidence under Async's single-delivery contract. Cancellation before a
|
||||
syscall starts can return cancelled/timed-out with zero effects. A completed syscall
|
||||
preserves its successful result or failure and byte/effect count, even after stop intent;
|
||||
composed exact/all transfers may then stop before their next syscall and report cumulative
|
||||
progress. Late sync success/failure must remain available to Storage/Update adapters.
|
||||
Only terminal delivery is arbitrated once; no callback is delivered merely because stop
|
||||
arrived while backend access or outcome classification was still pending.
|
||||
|
||||
Driver shutdown closes admission, cancels queued requests, asks active requests to
|
||||
stop, drains readiness/control/completion lanes, joins file workers, then releases
|
||||
descriptors/wake resources. It must keep the executor alive until all completion tickets
|
||||
drain. `close_and_join` cannot free buffers when its own deadline expires; return an
|
||||
incomplete-shutdown report through the owning driver and retain work. Blocking joins
|
||||
are off-driver/off-worker operations; embedded drivers pump until their scopes join.
|
||||
|
||||
## Finite defaults and backend gate
|
||||
|
||||
Default limits per driver: 4,096 descriptors, 8,192 admitted operations including active
|
||||
workers and pending completion delivery, 4,096 timers, 16 MiB owned buffer leases,
|
||||
1,024 ordinary control submissions and four file workers with 256 queued file requests.
|
||||
One pending read/write per stream counts toward all relevant quotas. Internal completion
|
||||
slots are reserved per admitted operation. Control stop records coalesce by operation,
|
||||
so cancellation cannot create an unbounded secondary queue. Reserve before allocation;
|
||||
return overloaded on exhaustion. Caller-owned buffers count in operation size accounting
|
||||
but remain the caller's allocation; telemetry separates owned and borrowed bytes.
|
||||
|
||||
Initial backend choice is fixed at driver creation. Optional io_uring is P3 work only
|
||||
after epoll/file-worker conformance and measured need; it uses capability probes and the
|
||||
same ownership/error model. Unsupported capability falls back before submission when
|
||||
policy permits. Never retry a possibly effective write/sync on a different backend.
|
||||
No libuv/Asio dependency is introduced. Existing Boost paths in Net remain until their
|
||||
own interoperability/migration gate passes. Future non-Linux backends get independent
|
||||
capability tables and the common operation conformance suite.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
All rows are PLANNED; dependency references are capability gates where peer task IDs
|
||||
are not owned by this document.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-IO-01 | P1 / Async operation ownership and Time clock gates | Portable transfer/error/driver API, buffer leases, descriptor and quota ownership | Mock backend completes/stops in every ordering with exactly one result and no borrowed-buffer escape / astra_implementer |
|
||||
| S-IO-02 | P1 / S-IO-01 | Level-triggered epoll driver, wake/control path, generation-safe close and stream operations | Fragmentation/EAGAIN/EINTR/HUP/fd reuse and full queues do not lose completion or busy-spin / astra_implementer |
|
||||
| S-IO-03 | P2 / S-IO-01 | Bounded positional file workers, serialization, sync and active-cancel handling | Short writes preserve progress; active timeout retains buffers; sync success/failure after stop remains authoritative in the sole result / astra_implementer |
|
||||
| S-IO-04 | P2 / S-IO-02, S-IO-03 | Embedded pumping, joined shutdown, optional System/Net adapters | Shutdown during pending socket/file work retains resources; no IO→Runtime/Net dependency / sol_implementer |
|
||||
| S-IO-05 | P3 / S-IO-04; performance harness | Optional io_uring capability/backend gate and portability conformance specification | Same tests pass; denied/unsupported capability falls back only before submission; profile evidence justifies enablement / astra_implementer |
|
||||
|
||||
## Validation, measurements and migration
|
||||
|
||||
CURRENT source fixtures run through
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun here, and there are no IO tests/targets today. PROPOSED implementation adds
|
||||
socketpair/loopback fixtures with tiny buffers, half-close, reset during write, no-data
|
||||
idle soak, stop while completion queue is full, fd reuse with stale events, immediate
|
||||
completion during await registration, and stalled file-worker tests with manually
|
||||
released gates. Inject stop before sync execution and during it, then release success or
|
||||
failure; verify the distinct results, single delivery and retained descriptor ownership.
|
||||
Use injected clocks, syscall shims and isolated filesystem fixtures;
|
||||
race/lifetime sanitizer checks are specified in [VALIDATION](../VALIDATION.md).
|
||||
|
||||
Measure operation p50/p95/p99, loopback/file throughput, wake/syscall counts, allocations,
|
||||
peak owned bytes/RSS/CPU, descriptor leaks and build cost under latency/throughput/footprint
|
||||
profiles in [PERFORMANCE](../PERFORMANCE.md). No backend benchmark ran here. Existing
|
||||
System and Boost Net implementations migrate through explicit adapters with equivalent
|
||||
partial-transfer/error tests. A backend rollback requires draining the old driver and
|
||||
creating a new one; accepted operations are never replayed. See
|
||||
[MIGRATION](../MIGRATION.md), [DEPENDENCIES](../DEPENDENCIES.md),
|
||||
[Runtime](Runtime.md), [IPC](IPC.md), and [DELIVERY](../DELIVERY.md).
|
||||
@@ -0,0 +1,178 @@
|
||||
# IPC framed local transport and resource isolation plan
|
||||
|
||||
Status: NEW subsystem; all feature work PLANNED. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
No existing IPC source module is assumed. NEW proposed roots are `include/Void/IPC`,
|
||||
`src/IPC` and `tests/standalone/IPC`. Requirements R-003, R-006, R-009 and R-014
|
||||
apply; [architecture](../ARCHITECTURE.md) C-02–C-06, C-09 and C-13 governs the design.
|
||||
|
||||
## Existing anchors and target boundary
|
||||
|
||||
[System Process](../../../include/Void/System/Process.hpp) and
|
||||
[Process.cpp](../../../src/System/Process.cpp) already use subprocess pipes, output
|
||||
capture and synchronous streaming callbacks. They do not provide framed request/reply
|
||||
IPC, peer authorization or negotiated quotas. [Async Channel](../../../include/Void/Async/Channel.hpp)
|
||||
is in-process blocking synchronization, not a process channel. These paths and their
|
||||
[streaming](../../../tests/standalone/System/ProcessStream.cpp)/
|
||||
[channel](../../../tests/standalone/Async/Channel.cpp) tests were coverage-checked;
|
||||
the relevant Process partial declarations were directly read.
|
||||
|
||||
IPC owns local framing, handshake, peer policy and bounded request correlation over
|
||||
[IO](IO.md) streams. [Binary](../modules/Binary.md) owns encoding primitives;
|
||||
[Data](../modules/Data.md) owns optional payload schemas. [RPC](RPC.md) may compose
|
||||
IPC as a transport; IPC never imports RPC, Runtime, Plugin or distributed coordination.
|
||||
Process supervision stays System/Runtime-owned. Using IPC for plugin isolation requires
|
||||
an application protocol and restart policy; it is not an ABI-compatible dlopen adapter.
|
||||
|
||||
## NEW API sketch and Linux transport choice
|
||||
|
||||
Illustrative additions, not compiling examples:
|
||||
|
||||
```cpp
|
||||
namespace Void::IPC {
|
||||
struct Limits { std::uint32_t frame_bytes, inflight_requests, queued_frames; };
|
||||
struct PeerPolicy { AllowedIdentity identity; EndpointPermissions endpoint; };
|
||||
class Session {
|
||||
public:
|
||||
Coro::Task<Result<Message>> request(
|
||||
OwnedBytes payload, Async::OperationOptions = {});
|
||||
Coro::Task<Result<void>> send(OwnedBytes, Async::OperationOptions = {});
|
||||
Coro::Task<Result<void>> close_and_join(Async::OperationOptions = {});
|
||||
};
|
||||
// listen_local(path, PeerPolicy, Limits, injected_io) -> Result<Listener>;
|
||||
// adopt_pipe_pair(owned_descriptors, trusted_child_identity, Limits) -> Result<Session>;
|
||||
}
|
||||
```
|
||||
|
||||
Use pathname Unix-domain SOCK_STREAM sockets on Linux first, with IO's nonblocking
|
||||
level-triggered epoll backend. A stream does not preserve message boundaries; framing
|
||||
is mandatory. The listener applies restrictive socket/directory permissions and
|
||||
checks kernel-reported peer credentials against explicit policy. Linux credential and
|
||||
pathname behavior is described by [unix(7)](https://man7.org/linux/man-pages/man7/unix.7.html).
|
||||
Credentials identify the local OS peer; the host still authorizes operations. A PID
|
||||
alone is not a durable identity or permission to access every service.
|
||||
|
||||
Default policy allows only the configured user ID checked against reported peer
|
||||
credentials, not every local account.
|
||||
Create endpoints beneath an application-owned directory with mode 0700 and socket mode
|
||||
0600. Refuse an unexpected existing path/symlink; never unlink an arbitrary caller path.
|
||||
Stale endpoint cleanup requires verified ownership and failed connection under a serialized
|
||||
listener startup lock. Abstract namespace sockets are an explicit later option because
|
||||
their access-control behavior differs. Anonymous pipe-pair transport is initially limited
|
||||
to descriptors created for a supervised child; it inherits the same framing and quotas
|
||||
without pretending it has socket peer credentials. No shared-memory transport in P2.
|
||||
|
||||
## Wire format and handshake
|
||||
|
||||
NEW V1 framing uses a fixed 24-byte header, encoded field-by-field in big-endian order;
|
||||
never send a native C++ struct or assume its packing:
|
||||
|
||||
| Offset / bytes | Field | Rule |
|
||||
| --- | --- | --- |
|
||||
| 0 / 4 | Magic | ASCII `VDIP` |
|
||||
| 4 / 2 | Version | 1; reject unsupported major before payload allocation |
|
||||
| 6 / 2 | Flags/type | Low byte: hello=1, request=2, response=3, error=4, cancel=5, one-way=6, goaway=7; high byte zero |
|
||||
| 8 / 4 | Payload length | Excludes header; capped by negotiated limit |
|
||||
| 12 / 4 | Stream ID | Must be zero in V1; streaming/multiplexed flow control is a later versioned capability |
|
||||
| 16 / 8 | Request ID | Nonzero for request/response/cancel; zero for connection control/one-way |
|
||||
|
||||
Incremental parser states are header → validate → reserve bytes → payload → dispatch.
|
||||
Handle fragmented headers, multiple coalesced frames and EOF mid-frame. Validate magic,
|
||||
version, flags, length and request ID before allocation. Oversized/malformed frames close
|
||||
the connection with a bounded protocol error; do not attempt unbounded resynchronization.
|
||||
Only dispatch a complete frame. Payload encoding is opaque bytes unless an explicitly
|
||||
negotiated Data/Binary schema is selected; general JSON acceptance never relaxes signed
|
||||
StrictJson contracts.
|
||||
|
||||
Both peers first exchange hello frames, each at most 4 KiB, with protocol version,
|
||||
capabilities, frame/concurrency limits and application-protocol ID/version. Choose the
|
||||
minimum supported limits, fail required-capability mismatch and complete within a
|
||||
5-second injected steady deadline. Authenticate/authorize peer before admitting user
|
||||
requests. Default session is full-duplex request/reply: each side chooses monotonically
|
||||
increasing nonzero IDs from its own outgoing namespace, and message direction/type
|
||||
disambiguates replies. IDs are not reused during a session; exhaustion triggers goaway
|
||||
and reconnect. One-way sends report only local write completion, never remote execution.
|
||||
|
||||
## Ownership, cancellation and quotas
|
||||
|
||||
Session owns its stream, parser buffers, pending request map, send queue and Async scope.
|
||||
OwnedBytes retains Memory storage until IO completes; received Message owns its payload
|
||||
through handler return. No string_view into a recycled parser buffer escapes. Handlers
|
||||
run on the injected executor outside session/map locks. Retain correlation entries
|
||||
until the single terminal result is selected, and remove them on all failure paths.
|
||||
|
||||
Async OperationOptions supplies std::stop_token and the total absolute steady deadline;
|
||||
no IPC-specific context. Cancellation removes a queued unsent request or emits one
|
||||
bounded cancel frame for an admitted request. Remote cancellation is advisory: it cannot
|
||||
undo effects and requires an acknowledgement to establish remote quiescence. A locally
|
||||
timed-out request can have an unknown remote outcome. Do not automatically resend it
|
||||
after reconnect. Applications use idempotency keys for retryable effects. A bounded
|
||||
tombstone set recognizes late responses; never complete a reused ID or deliver twice.
|
||||
|
||||
Defaults: 1 MiB payload/frame, 64 in-flight outgoing requests/session, 64 active incoming
|
||||
handlers/session, 128 queued output frames, 4 MiB queued output bytes, 2 MiB receive
|
||||
buffer/session, 256 late-response tombstones and 128 sessions/listener. Listener global
|
||||
owned-buffer budget defaults 64 MiB; global permits are reserved as well as per-session
|
||||
permits, preventing the product of local caps from escaping the global budget. User
|
||||
admission rejects overload; optional capacity waiting is cancellable with 128 waiters.
|
||||
|
||||
Output control frames have a reserved 8 KiB/16-frame lane and coalesce duplicate cancels.
|
||||
When handler capacity is full, reject new complete requests with overload using reserved
|
||||
capacity rather than blocking all reads and deadlocking bidirectional replies. Bound
|
||||
per-peer request rate to a configurable default 1,000 requests/second with burst 128;
|
||||
violations receive bounded error/goaway. Waiting payload bytes and active handlers count
|
||||
toward quotas. Default idle session deadline 60 seconds, header/payload progress timeout
|
||||
5 seconds within the total request deadline; no byte trickle can restart that total.
|
||||
|
||||
V1 does not transfer file descriptors, arbitrary object references or shared memory.
|
||||
Ancillary descriptor passing is a later explicitly negotiated feature with descriptor
|
||||
quotas and ownership checks. Current transport scope therefore excludes confused ownership
|
||||
of received file handles. Connection loss faults all pending calls with transport-lost
|
||||
and known/unknown effect metadata; it does not imply a failed remote commit.
|
||||
|
||||
## Shutdown and backend evolution
|
||||
|
||||
Close listener admission, send goaway, stop new user sends/requests, drain already admitted
|
||||
responses under the caller deadline, request handler stop, join callbacks and IO, then
|
||||
release stream/path ownership. Joining is off the session's own handler strand unless
|
||||
already drained; self-join is rejected. Incomplete shutdown retains handler/IO owners.
|
||||
Peer crash mid-frame releases all reserved bytes after IO stops accessing them.
|
||||
|
||||
Native Unix sockets/pipes and Binary framing are selected over an external messaging
|
||||
library to keep protocol and quotas Void-owned. Windows named pipes and local TCP are
|
||||
future capability adapters with identical framing/error conformance and explicit peer
|
||||
identity differences. Shared-memory rings need a later measured gate defining crash
|
||||
ownership, atomics/layout and buffer reclamation; they are not an implicit fast path.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
All rows are PLANNED.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-IPC-01 | P1 / Binary codec, Async ownership and IO stream gates | Versioned codec, incremental parser and global/per-session permits | Every fragmentation/coalescing/length boundary respects quotas before allocation / sol_implementer |
|
||||
| S-IPC-02 | P2 / S-IPC-01; System ownership gate | Unix listener, pathname lifecycle, credential policy and supervised pipe adoption | Wrong user/path/symlink rejected; failed startup removes only owned endpoint / astra_implementer |
|
||||
| S-IPC-03 | P2 / S-IPC-02 | Handshake, request correlation, bounded handlers/cancel/tombstones and goaway | Late response/timeout/loss delivers once; saturated bidirectional sessions still process control / astra_implementer |
|
||||
| S-IPC-04 | P3 / S-IPC-03; Runtime/Plugin process-host specification | Joined shutdown, isolated-worker reference protocol and diagnostics | Worker crash faults pending calls without replay; retained payloads/handlers drain within ownership rules / sol_implementer |
|
||||
| S-IPC-05 | P3 / S-IPC-04; measured transport need | Portable transport capability specification and optional descriptor-passing design gate | Common conformance on each supported backend; unsupported identity/feature never silently downgrades / astra_implementer |
|
||||
|
||||
## Validation, performance and migration
|
||||
|
||||
CURRENT aggregate source-regression command:
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun; no IPC tests exist today. PROPOSED checks need NEW fixtures: frame-byte
|
||||
fragmentation/fuzzing, maximum/overflowing length, duplicate ID, invalid hello, slow
|
||||
header, peer death after effect before reply, cancellation before/after send, request
|
||||
flood/global cap, bidirectional overload, unauthorized credentials, stale socket path,
|
||||
callback throw and shutdown with live response buffers. No real credentials enter
|
||||
fixtures or traces. Use isolated user/path fixtures where the test environment permits.
|
||||
|
||||
Measure round-trip p50/p95/p99, frame throughput, allocations/copies, peak RSS/CPU,
|
||||
descriptor count, queue occupancy and build cost under [PERFORMANCE](../PERFORMANCE.md).
|
||||
No performance claims or benchmark runs accompany this plan. There is no legacy IPC
|
||||
API; System process-stream output remains text until explicitly adapted to a framed
|
||||
worker. Wire upgrades negotiate before requests; reject incompatible version, retain
|
||||
old reader fixtures and reconnect only after draining. No automatic request replay
|
||||
on protocol/backend rollback. See [MIGRATION](../MIGRATION.md),
|
||||
[VALIDATION](../VALIDATION.md), [DEPENDENCIES](../DEPENDENCIES.md),
|
||||
[RPC](RPC.md), and [DELIVERY](../DELIVERY.md).
|
||||
@@ -0,0 +1,164 @@
|
||||
# NEW Memory subsystem
|
||||
|
||||
Status: NEW design; no Memory source directory or target exists in the inspected
|
||||
foundation inventory. All tasks are **PLANNED**. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
|
||||
## Existing capabilities to reuse
|
||||
|
||||
[Containers ObjectPool/FixedPool](../../../include/Void/Containers/Pool.hpp) manage typed
|
||||
objects; [BufferPool](../../../include/Void/Containers/BufferPool.hpp) recycles power-of-two
|
||||
vector buffers. Their leases/deleters currently reference pool objects. These are
|
||||
Containers APIs, not existing Memory resources. Their
|
||||
[pool](../../../tests/standalone/Containers/Pool.cpp) and
|
||||
[buffer-pool tests](../../../tests/standalone/Containers/BufferPool.cpp) provide fixtures
|
||||
for later adapters. [Core Scope](../../../include/Void/Core/Scope.hpp) can supply lifetime
|
||||
guards above a low-level resource without becoming an allocator implementation.
|
||||
These source files were read; coverage reported no recorded graph gaps. No current
|
||||
resource-accounting or allocator-performance claim is inferred from their existence.
|
||||
|
||||
## Owner, dependency and backend decisions
|
||||
|
||||
Memory owns allocation facilities under [C-01/C-04/C-05](../ARCHITECTURE.md). Select native
|
||||
bounded arenas, tracking/budget resources and fixed-block free lists on top of standard
|
||||
`std::pmr::memory_resource`. The foundation needs only the standard library. Typed object
|
||||
pools, small vectors and lease semantics remain in Containers. Do not pull Containers,
|
||||
Runtime, IO, Log or platform allocators into Memory. System may later provide an OS page
|
||||
resource adapter above this contract; Memory must not require mmap or huge pages.
|
||||
No replacement global operator new, process allocator interposition or mandatory
|
||||
jemalloc/mimalloc backend is part of the initial design.
|
||||
|
||||
NEW proposed paths: `include/Void/Memory/Resource.hpp`, `Arena.hpp`, `BudgetResource.hpp`,
|
||||
`BlockPool.hpp`, `src/Memory/module.cmake` and `tests/standalone/Memory/`. Their creation
|
||||
is future feature work, not an artifact claimed by this documentation task.
|
||||
|
||||
## NEW API shape
|
||||
|
||||
Illustrative proposed declarations:
|
||||
|
||||
```cpp
|
||||
namespace Void::Memory {
|
||||
enum class AllocationError { invalid_alignment, size_overflow, exhausted,
|
||||
upstream_failure, live_allocations };
|
||||
struct ResourceStats {
|
||||
std::size_t requested_live, committed_live, peak_committed;
|
||||
std::uint64_t allocations, failures;
|
||||
};
|
||||
class BudgetResource : public std::pmr::memory_resource {
|
||||
public:
|
||||
explicit BudgetResource(std::size_t byte_limit,
|
||||
std::pmr::memory_resource& upstream);
|
||||
std::expected<void*, AllocationError>
|
||||
try_allocate(std::size_t bytes, std::size_t alignment) noexcept;
|
||||
ResourceStats stats() const noexcept;
|
||||
// PMR virtual allocate/deallocate/equality overrides supplied by implementation.
|
||||
};
|
||||
class Arena {
|
||||
public:
|
||||
explicit Arena(std::span<std::byte> initial, std::size_t maximum_bytes,
|
||||
std::pmr::memory_resource& upstream);
|
||||
std::expected<void*, AllocationError> try_allocate(std::size_t, std::size_t) noexcept;
|
||||
std::expected<void, AllocationError> reset();
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
Keep the compact enum allocation-free; Functional owns its optional error adaptation.
|
||||
PMR `allocate()` throws `std::bad_alloc` on exhaustion as its standard contract requires;
|
||||
`try_allocate` translates upstream allocation failure to the enum and does not allocate
|
||||
diagnostics. Programmer misuse (wrong owner, byte size or alignment on deallocation)
|
||||
is a contract violation with debug diagnostics, not silently ignored successful cleanup.
|
||||
Resources compare equal only when their deallocation ownership domains are interchangeable.
|
||||
|
||||
## Allocation algorithms and ownership
|
||||
|
||||
BudgetResource admits committed bytes atomically before asking upstream. Charge requested
|
||||
bytes plus resource-controlled alignment/header overhead, guard addition against overflow,
|
||||
and undo the reservation if upstream fails. Current and high-water counts use the same
|
||||
definitions. Standard upstream hidden allocator overhead/RSS is measured separately;
|
||||
a resource limit does not falsely bound all process memory or allocations by arbitrary
|
||||
user callbacks. Deallocate is noexcept and updates counters after returning memory to the
|
||||
same upstream owner. Optional event observers receive compact records after bookkeeping
|
||||
and outside locks; no dependency on a logging/export backend exists.
|
||||
|
||||
Arena uses checked aligned bump offsets in owned slabs. Initial profile: 64 KiB slabs,
|
||||
maximum 16 MiB per arena, power-of-two geometric growth up to 1 MiB/slab. An empty initial
|
||||
span requests the first owned slab lazily; a fixed-buffer mode has no upstream fallback.
|
||||
Alignment must be a nonzero power of two; over-aligned requests use an appropriately
|
||||
aligned slab and charge padding. Zero-byte allocation reserves one addressable byte,
|
||||
making its accounting explicit. Reset invalidates all raw pointers; it is legal only
|
||||
after clients release their objects/leases. The arena does not discover destructors of
|
||||
raw allocations. A separate typed scope records destructors in reverse construction
|
||||
order within a bounded metadata budget (4,096 registrations default).
|
||||
|
||||
Arena checkpoints contain resource identity, generation, slab and offset. Rewind accepts
|
||||
only a current checkpoint with no surviving typed allocations after it; generation
|
||||
validation rejects stale checkpoints. Do not imply rewind undoes externally visible
|
||||
side effects. `reset()` on an arena with registered live leases returns `live_allocations`.
|
||||
Bare raw-pointer clients obey the documented precondition; no runtime can prove every
|
||||
raw pointer has gone away.
|
||||
|
||||
BlockPool preallocates slab metadata and uses a free-index list for fixed-size aligned
|
||||
blocks. Default cap: 4,096 blocks and 16 MiB committed bytes, whichever is reached first.
|
||||
Free/recycle performs no allocation. A single-thread resource is the default; a NEW
|
||||
synchronized wrapper serializes admission/free and snapshots stats. Do not advertise
|
||||
lock-free allocation. Idle trimming is explicit and never releases outstanding blocks.
|
||||
Large-object fallback is opt-in, charged to the same budget and owner.
|
||||
|
||||
Borrowed `memory_resource*` must outlive every allocation, PMR container, final backend
|
||||
completion and destructor using it. NEW `SharedResource` retains a stationary resource
|
||||
control block for owning cross-component leases; it does not extend the lifetime of a
|
||||
separately borrowed upstream. Containers' owning pool leases retain that state, while
|
||||
embedded callers may choose documented borrowing. Runtime holds its resources through
|
||||
stop-admission → cancel/drain → join → destroy-objects → destroy-resources. Memory owns
|
||||
no threads and cannot itself cancel outstanding application work.
|
||||
|
||||
## Admission and performance policy
|
||||
|
||||
Aggregate resources may be nested (request within service within process). Charge every
|
||||
owned allocation to each relevant parent once; avoid counting an arena slab both as its
|
||||
own internal allocation and a duplicate child request in the same reported total.
|
||||
Expose requested bytes and committed slab bytes separately. Cancellation/failure paths
|
||||
must release reserved capacity even when construction above Memory throws.
|
||||
|
||||
Budget exhaustion reports before partial object construction. Callers may explicitly
|
||||
wait for capacity through Async, but Memory never blocks on an executor or starts a
|
||||
reclaimer thread. Zero cap allows no positive allocation. Unlimited policy is a named
|
||||
tag, not zero. Sensitive erasure belongs to Security's buffer type: Memory reuse is not
|
||||
a promise that prior bytes are scrubbed.
|
||||
|
||||
## Task DAG
|
||||
|
||||
| Task | Phase; dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-MEMORY-01 | P0; existing pool inventory; shared C-04/C-05 | Define requested/committed accounting and resource lifetime fixtures; enumerate pool migrations without changing their APIs yet. | astra_implementer |
|
||||
| S-MEMORY-02 | P1; S-MEMORY-01 | Add resource/budget/PMR contracts and failure-safe admission; zero/exact/overflow and concurrent cap tests show no leaked reservation. | sol_implementer |
|
||||
| S-MEMORY-03 | P1; S-MEMORY-02 | Implement fixed/growing arenas, generation checkpoints and typed destructor scopes; over-alignment, failed growth and stale rewind tests pass. | sol_implementer |
|
||||
| S-MEMORY-04 | P1; S-MEMORY-02 | Implement bounded block pool and synchronized wrapper; recycle allocates zero and trimming never touches live blocks. | sol_implementer |
|
||||
| S-MEMORY-05 | P2; S-MEMORY-03–04; Containers lease contract | Add SharedResource and adapt typed pools without a reverse dependency; retained leases safely release after front-end owner destruction. | astra_implementer |
|
||||
| S-MEMORY-06 | P3; S-MEMORY-05; Runtime shutdown gate | Validate embedded/managed teardown and allocator workload profiles; installed Memory-only consumer links with no runtime/backend packages. | sol_implementer |
|
||||
|
||||
## Validation, migration and rollback
|
||||
|
||||
CURRENT source tests above cover existing pools only; no Memory test or benchmark exists
|
||||
or was run. PROPOSED checks require the NEW target/suites and supported toolchain:
|
||||
allocation-failure injection at every upstream call; alignment 1 through over-aligned
|
||||
types; SIZE_MAX arithmetic; zero-byte requests; destructor ordering; generation wrap;
|
||||
cross-owner misuse diagnostics; concurrent admission/free; and shutdown with outstanding
|
||||
leases. ASAN/UBSAN validate storage lifetime, TSAN the synchronized resource; invariants
|
||||
also need deterministic counters and free-list model tests.
|
||||
|
||||
Profiles compare std::pmr defaults, bounded arena, fixed block and synchronized wrappers
|
||||
for request parsing, coroutine/frame storage and buffer churn. Report p50/p95/p99,
|
||||
allocations, throughput, committed/requested peaks, RSS/CPU and build cost under
|
||||
[PERFORMANCE](../PERFORMANCE.md). Separate fresh-page cost from warmed recycle cost.
|
||||
No allocator-speed claim is made in advance.
|
||||
|
||||
[Migration](../MIGRATION.md) introduces Memory independently, then replaces pool internals
|
||||
behind tested Containers adapters. Caller-supplied PMR pointers remain explicitly borrowed;
|
||||
no migration silently promotes them to owned. Rollback restores old pool implementations
|
||||
and package selection after draining all new-resource allocations. Never free through
|
||||
another allocator or unload a plugin generation while its resource/deleter is still used.
|
||||
See [VALIDATION](../VALIDATION.md), [DEPENDENCIES](../DEPENDENCIES.md),
|
||||
[DELIVERY](../DELIVERY.md), [requirements](../REQUIREMENTS.md),
|
||||
[Containers](../modules/Containers.md) and [Runtime](Runtime.md).
|
||||
@@ -0,0 +1,124 @@
|
||||
# Messaging subsystem plan — NEW
|
||||
|
||||
Status: NEW design; all tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-009, R-011, R-012, R-014–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-05, C-08, C-11–C-13.
|
||||
|
||||
## Baseline and ownership
|
||||
|
||||
No current Messaging directory, broker or delivery guarantee is claimed. Existing
|
||||
[Net WebSocketSessions](../../../include/Void/Net/Server.hpp) is a connection registry,
|
||||
not durable messaging. Its graph parse gaps at 207/211/214 were read directly; source
|
||||
does not imply a wire transport. Proposed roots `include/Void/Messaging`, `src/Messaging`
|
||||
and `tests/standalone/Messaging` are NEW. Messaging owns delivery state, queue/group
|
||||
semantics, acknowledgements and retry policy. [Storage](Storage.md) owns durable batches;
|
||||
[RPC](RPC.md) owns remote envelopes; [Replication](Replication.md) optionally supplies a
|
||||
replicated queue state machine. None depends back on Messaging.
|
||||
|
||||
Select native queue/delivery logic with a single-node durable Storage adapter first.
|
||||
Transport remains optional. An in-process ephemeral channel is explicitly nondurable;
|
||||
it must not use the same success label as durable publish. An external broker adapter
|
||||
is a later capability gate with its own conformance matrix, not the initial backend.
|
||||
|
||||
## NEW API and delivery contract
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::Messaging shapes; Result/Task/options follow C-02/C-03.
|
||||
enum class PublishDurability { memory, durable };
|
||||
struct Message { MessageId id; OwnedBytes payload; Headers headers; };
|
||||
struct Delivery { Message message; Receipt receipt; std::uint32_t attempt; };
|
||||
class Queue {
|
||||
Task<Result<PublishReceipt>> publish(Message, PublishDurability, OperationOptions);
|
||||
Task<Result<Delivery>> receive(ConsumerGroup, OperationOptions);
|
||||
Task<Result<void>> ack(Receipt, OperationOptions);
|
||||
Task<Result<void>> nack(Receipt, RetryDelay, OperationOptions);
|
||||
};
|
||||
```
|
||||
|
||||
Durable delivery is explicitly at-least-once. Message IDs are application-visible;
|
||||
receipts additionally identify queue, group and delivery generation. Ack means the queue
|
||||
durably recorded processing acknowledgement, not that the external world changed exactly
|
||||
once. Consumer effects followed by a crash before ack can run again. An application may
|
||||
atomically write effects plus an inbox dedup record only when both share one supported
|
||||
Storage batch; an email, payment or arbitrary RPC is outside that atomicity boundary.
|
||||
Outbox recipes store a business mutation and outbound message in the same local batch,
|
||||
then publish/retry by stable ID. They do not create cross-system transactions.
|
||||
|
||||
Initial durable model is FIFO work queues per consumer group with competing consumers.
|
||||
Order is enqueue sequence within a queue, not completion order when concurrency >1.
|
||||
Single-active-consumer mode provides ordered processing only if the application waits
|
||||
for ack before the next delivery; retries block that group's head in this mode. Parallel
|
||||
mode can complete out of order. Pub/sub uses named groups, each with independent offset,
|
||||
retry and retention state. There is no global order across queues/groups.
|
||||
|
||||
Native state machine: Pending → InFlight(receipt-generation, visibility deadline) →
|
||||
Acked, or Pending after nack/visibility expiry, or DeadLetter after exhaustion. Publish
|
||||
durably inserts payload, sequence and initial group records before returning durable
|
||||
success. Receive persists delivery generation/attempt before exposing the receipt.
|
||||
Ack is a conditional atomic state change matching the current receipt. Old receipt:
|
||||
stale_receipt; repeat ack of the same acknowledged receipt: successful idempotent result.
|
||||
Nack/ack races serialize in writer order. An abandoned Delivery is not implicitly acked.
|
||||
|
||||
Visibility defaults to 30 seconds, extension explicit up to 5 minutes per delivery.
|
||||
Use injected monotonic timers while running. On restart all prior InFlight records become
|
||||
eligible for redelivery with a higher generation; old worker receipts cannot acknowledge
|
||||
the new attempt. Retention expiry uses recorded civil instants and an injected clock;
|
||||
clock-health failure pauses expiry rather than discarding potentially live messages.
|
||||
Retry: five delivery attempts total, full jitter base 1 second/cap 60 seconds, injectable
|
||||
randomness. DLQ insertion and source removal are one atomic batch in the same store.
|
||||
If DLQ is full or unavailable, keep the message and block/drop no data; expose stuck count.
|
||||
|
||||
## Bounds, shutdown and operational failures
|
||||
|
||||
NEW defaults: message ≤768 KiB, headers ≤8 KiB/32 fields, 1,024 queues, 32 groups/queue,
|
||||
64 in-flight deliveries/group, 1,024 waiting receives/module and 64 MiB transient payload
|
||||
budget. Persistent quota defaults to 1 GiB, including retry/DLQ/group metadata. Durable
|
||||
publish identity outcomes retain 24 hours and at most 100,000 IDs; at capacity reject new
|
||||
publish, never silently evict an identity still within its contract. Older IDs outside
|
||||
the retention contract can be published again, so application dedup remains necessary.
|
||||
Logical retention defaults to seven days and requires an explicit policy for unread
|
||||
messages: the initial policy blocks further publish at quota, rather than expiring unread
|
||||
work silently. Operators may explicitly choose lossy expiry in a separately named mode.
|
||||
|
||||
Stop admission → wake/cancel pending receives → drain active consumers for 10 seconds →
|
||||
persist remaining visibility state → join owned tasks. A callback receives an owning
|
||||
message handle until it returns; no payload is reclaimed while a delivery owns it.
|
||||
Observers run outside queue/storage locks with bounded labels and no payload/secret logging.
|
||||
|
||||
| Trigger | Required behavior | Gate |
|
||||
| --- | --- | --- |
|
||||
| Publish sync fails / reply lost | Error or unknown outcome; stable ID permits inspection/retry | Crash at insert/sync/reply boundaries |
|
||||
| Consumer effect then process dies | Redeliver; duplicate expected | Inbox/outbox sample proves stated boundary |
|
||||
| Visibility expires / old ack arrives | New generation; stale ack cannot remove newer work | Controlled timer/receipt histories |
|
||||
| Poison message | Retry bound then atomic DLQ move | Attempt counter survives restart |
|
||||
| DLQ or queue quota full | Stop affected admission; retained work remains durable | Disk full and retention pressure |
|
||||
| Cancellation during ack | Ack may have committed; query by receipt | Lost-reply and duplicate-ack cases |
|
||||
| Partition in replicated mode | Minority cannot durable-publish/ack | Quorum adapter tests |
|
||||
| Unknown schema / corrupt payload | Quarantine/report; no acknowledgement as processed | Corruption and consumer-version tests |
|
||||
|
||||
## Task DAG and validation
|
||||
|
||||
| ID | Phase / dependencies | Implementation and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-MESSAGING-01 | P0; baseline | Record NEW boundary and build-independent delivery model fixtures | sol_implementer |
|
||||
| S-MESSAGING-02 | P1; S-MESSAGING-01, Async/Time/Binary contracts | Typed IDs/receipts, native state model and bounded ephemeral channel; deterministic cancel/order tests | sol_implementer |
|
||||
| S-MESSAGING-03 | P3; S-MESSAGING-02, Storage durable batches | Durable queues, visibility generations, retries/DLQ and recovery; crash injection preserves acknowledged state | astra_implementer |
|
||||
| S-MESSAGING-04 | P3; S-MESSAGING-03, RPC/Security gates | Remote publish/receive/ack and inbox/outbox examples; no blanket exactly-once assertion | sol_implementer |
|
||||
| S-MESSAGING-05 | P4; S-MESSAGING-04, Replication single-group gate | Replicated queue adapter; leader change/lost replies preserve at-least-once and ack state | astra_implementer |
|
||||
| S-MESSAGING-06 | P4; S-MESSAGING-05 | Partitioned queues/group operations and operational tooling; per-queue ordering explicit, no cross-shard atomic publish | astra_implementer |
|
||||
|
||||
CURRENT: no Messaging executable or test target exists. PROPOSED verification adds state
|
||||
model enumeration, receipt race tests, crash/restart fault injection, poison/DLQ pressure,
|
||||
slow consumers and minority partitions. Use [SQLite's crash-test methodology](https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior)
|
||||
as a model for persistence faults, not a claim of SQLite compatibility. Future targets
|
||||
and commands follow [VALIDATION](../VALIDATION.md) and
|
||||
[BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
|
||||
Measure publish durable latency, receive-to-ack p50/p95/p99, redelivery lag, throughput,
|
||||
allocations, peak RSS/CPU, retained disk and build cost under [PERFORMANCE](../PERFORMANCE.md).
|
||||
Migration versions persisted receipt/state records and drains old consumers before changing
|
||||
semantics. Export retains message IDs, groups, attempts and DLQ reasons. Rollback must keep
|
||||
old format readers and receipt fencing; it cannot make previously delivered effects disappear.
|
||||
See [MIGRATION](../MIGRATION.md), [Scheduler](Scheduler.md) and
|
||||
[DistributedApplications](../platforms/DistributedApplications.md).
|
||||
@@ -0,0 +1,166 @@
|
||||
# Observability — optional hooks, bounded metrics and traces
|
||||
|
||||
Status: NEW subsystem design; all tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`; there is no Observability module/source directory
|
||||
or exporter at this revision. R-005/R-009/R-012 and [C-01–C-05/C-11](../ARCHITECTURE.md)
|
||||
define the layering and lifetime obligations.
|
||||
|
||||
## Existing evidence and ownership boundary
|
||||
|
||||
[Log.hpp](../../../include/Void/Log/Log.hpp) provides a process-wide logging facade;
|
||||
[Entry.hpp](../../../include/Void/Log/Entry.hpp) owns log record data, and
|
||||
[FieldScope](../../../include/Void/Log/Field.hpp) provides thread-local structured fields.
|
||||
These are useful integration points, not existing metrics/tracing context propagation.
|
||||
[Logger.cpp](../../../src/Log/Logger.cpp) snapshots fields/scopes for async delivery.
|
||||
[Log](../modules/Log.md) retains all delivery, sink, saturation and flush ownership.
|
||||
|
||||
Observability owns instrumentation identities, metric aggregation, trace/span context and
|
||||
export adapters. Its lowest layer is a standard-library-only optional hook surface with no
|
||||
Net, Runtime, Log or Async imports. Proposed NEW paths are `include/Void/Observability/Hooks.hpp`,
|
||||
`include/Void/Observability/Context.hpp` and `src/Observability/`; proposed component separation
|
||||
is hooks/context, aggregation, then optional exporters. [Dependencies](../DEPENDENCIES.md)
|
||||
and [build/distribution](../BUILD-AND-DISTRIBUTION.md) own final packaging validation.
|
||||
|
||||
Higher modules may inject these hook objects. Foundation headers must still compile and
|
||||
link without a telemetry backend or runtime. Async propagates an owning context carrier
|
||||
through an optional adapter; it must not import a concrete tracer or exporter. Log's context
|
||||
bridge lives above both modules so neither imports the other. Managed Runtime composes
|
||||
resources; it never becomes a dependency of the hook definitions.
|
||||
|
||||
## NEW hook and context shape
|
||||
|
||||
Illustrative NEW interfaces in `Void::Observability`, not existing compilable APIs:
|
||||
|
||||
```cpp
|
||||
struct TraceContext {
|
||||
std::array<std::byte, 16> trace_id;
|
||||
std::array<std::byte, 8> span_id;
|
||||
std::uint8_t flags;
|
||||
};
|
||||
class ContextSnapshot; // immutable owning trace context + bounded baggage
|
||||
struct MetricPoint; // pre-registered instrument id, bounded attributes, value
|
||||
struct ObservationHooks {
|
||||
void* state;
|
||||
void (*record)(void*, const MetricPoint&) noexcept;
|
||||
};
|
||||
class HookLease; // retains callback owner until admitted calls drain
|
||||
class Span; // move-only handle, one end transition
|
||||
Result<Span> start_span(ContextSnapshot parent, SpanSpec);
|
||||
Result<ExportReport> flush(ExportOptions);
|
||||
```
|
||||
|
||||
The raw function table is a synchronous borrowing view: it never outlives its HookLease.
|
||||
The configured context retains that lease, and detach has a distinct drain operation.
|
||||
Hook callbacks must be nonblocking/noexcept; adapter boundaries catch foreign exceptions,
|
||||
increment bounded failure counters and quarantine a broken callback. A null hook performs
|
||||
no allocation or backend initialization. Registration is explicit, not done lazily per
|
||||
user-supplied label value on a hot path.
|
||||
|
||||
Trace IDs are opaque values generated through the application's approved random/id source,
|
||||
not from raw addresses. ContextSnapshot captures values at operation admission. A lexical
|
||||
thread-local scope is a convenience view only: scheduled work owns a snapshot and restores
|
||||
the previous context on entry/exit, including exceptions. A context scope cannot remain
|
||||
installed on a worker across coroutine suspension. Async's resume adapter sets it for each
|
||||
resume, or code passes the snapshot explicitly. Never retain a pointer to another thread's
|
||||
TLS, request object or stack buffer.
|
||||
|
||||
Span has one terminal end; repeated end is harmless and counted diagnostically. A child
|
||||
can finish after its parent because it owns IDs, not a parent Span pointer. Destroying an
|
||||
unended local handle ends it with Abandoned unless ownership was explicitly moved. Remote
|
||||
context is untrusted metadata: validate lengths/encoding, reject all-zero required IDs, cap
|
||||
baggage, and never use it as an authorization identity. A protocol propagation adapter belongs
|
||||
above Net/RPC; compliance with a named wire standard requires a later conformance task and
|
||||
does not alter the lightweight in-process representation.
|
||||
|
||||
## Metrics, tracing and export algorithms
|
||||
|
||||
Instrument registration freezes name, unit, kind and label schema. The same name with a
|
||||
different schema is an error. Counters are monotonic unsigned totals with checked/saturating
|
||||
overflow plus a diagnostic flag; gauges are last-value samples with timestamp; histograms
|
||||
use configured fixed bucket boundaries (default request-duration buckets from 100 µs
|
||||
through 10 s plus overflow). No per-event dynamically expanding sketch is required initially.
|
||||
Thread-local bounded shards aggregate updates; collection snapshots/swaps shards and merges
|
||||
outside producer locks. A collector must retain shard ownership while a worker exits.
|
||||
|
||||
Use cumulative metric snapshots for the first exporter, so retrying export need not double
|
||||
add a delta. Process/registry epochs distinguish restarts and reset counters. Instrument and
|
||||
label IDs come from a bounded registry; never use request IDs, raw URLs, user names or keys
|
||||
as metric labels. Route templates, fixed operation names and bounded error categories are
|
||||
the selected defaults. Cardinality overflow records a dropped-series counter under one
|
||||
pre-registered overflow series, not a newly labelled series per rejected value.
|
||||
|
||||
Tracing initially uses parent-based head sampling. Root sampling defaults to one in 100,
|
||||
implemented from a stable trace-ID hash so descendants agree without a global lock. Export
|
||||
only completed sampled spans; a separate bounded diagnostic event path may record failures
|
||||
without retaining every unsampled request. Tail sampling is explicitly deferred to
|
||||
S-OBSERVABILITY-06 because it changes memory/decision horizons. Span durations use Time's
|
||||
steady clock; exported civil timestamps use a sampled civil/steady correspondence and do
|
||||
not control deadlines.
|
||||
|
||||
Collector/exporter startup is explicit. Native aggregation and a local callback/text snapshot
|
||||
exporter come first; an optional interoperable remote exporter is a later adapter over Net.
|
||||
No external telemetry SDK is mandatory. An exporter owns immutable batches; transport retries
|
||||
are bounded and may duplicate remote trace records, which have stable IDs. The subsystem
|
||||
does not claim exactly-once delivery. Export failure must never recursively emit into the
|
||||
same telemetry path; counters and a separate optional emergency diagnostic hook suffice.
|
||||
|
||||
## Concrete limits and shutdown
|
||||
|
||||
| Resource | NEW default / failure behavior |
|
||||
| --- | --- |
|
||||
| Registry | 256 instruments, 1,024 series/instrument, 4,096 series globally; reject excess registration/series with fixed counters. |
|
||||
| Attributes | Eight metric labels, 32 span attributes, 128-byte keys, 256-byte values; reject invalid identity labels, truncate opted-in diagnostic text with a marker. |
|
||||
| Context | 16 baggage items and 2 KiB total; immutable owned copy at admission; baggage is not automatically exported or logged. |
|
||||
| Trace state | 1,024 active spans, 8 MiB active-span memory, 32 events/span and 8 KiB/span maximum; exhausted sampled admission returns an inert context-preserving handle with loss count. |
|
||||
| Completed data | 8,192 spans and 16 MiB including active export batches; reject newest completed data on saturation with loss accounting. |
|
||||
| Aggregation | 32 MiB total registry/shard/histogram storage; 32 registered producer shards, fallback to a shared bounded shard when exhausted. |
|
||||
| Export | One active batch, 256 spans/512 KiB batch, two retries within five seconds; default metrics interval ten seconds, trace flush interval one second. |
|
||||
|
||||
Storage for default bucket counts is included in aggregation limits. All strings, queues,
|
||||
callback-held batches and copied metadata count toward the appropriate byte budget, not
|
||||
just record counts. Backend transport memory has its own Net budget; composition reports
|
||||
the sum. Configuration cannot accidentally set zero to mean unlimited.
|
||||
|
||||
Admission stops first at shutdown; owned task contexts/spans drain with their tasks, then
|
||||
final metric collection and export flush run before exporter/clock/executor destruction.
|
||||
Default flush budget is five seconds. Timeout reports unsent/dropped counts and retains
|
||||
resources for admitted backend activity until its completion; it does not free buffers under
|
||||
an in-flight send. A failure to export does not roll back the business operation. Embedded
|
||||
users drive collection/flush explicitly; no hidden background thread is created by a span.
|
||||
|
||||
## Implementation tasks
|
||||
|
||||
| ID | Phase / dependencies | Scope and acceptance | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-OBSERVABILITY-01 | P1; Memory/Time/Functional contracts | Freeze lightweight hook/context headers and no-backend consumer; null hooks allocate nothing and bring no Runtime/Net/Log dependency. | astra_implementer |
|
||||
| S-OBSERVABILITY-02 | P2; S-OBSERVABILITY-01, Async admission ownership | HookLease, detach/drain, context snapshots/resume adapter and span lifetime; callbacks cannot touch freed owner/TLS after request completion. | astra_implementer |
|
||||
| S-OBSERVABILITY-03 | P2; S-OBSERVABILITY-01/02 | Bounded metric registry, shards and histograms; cardinality storm stays within limits and overflow/reset totals are visible. | sol_implementer |
|
||||
| S-OBSERVABILITY-04 | P2; S-OBSERVABILITY-02/03 | Head sampling, completed-span queue, callback/text exporter and flush; slow exporter cannot grow total memory or stall producers. | astra_implementer |
|
||||
| S-OBSERVABILITY-05 | P3; S-OBSERVABILITY-04, Net/Runtime/Log adapters | Managed lifecycle, interoperable remote export and protocol context adapter; compliance fixtures and ownership tests pass without dependency cycles. | sol_implementer |
|
||||
| S-OBSERVABILITY-06 | P3; S-OBSERVABILITY-05, measured profile | Optional bounded tail sampling with fixed trace/byte/time horizons; accept only with explicit eviction semantics and measured benefit. | astra_implementer |
|
||||
| S-OBSERVABILITY-07 | P4; S-OBSERVABILITY-05, distributed platform contracts | Replica/term/commit lag instruments using bounded identities; telemetry outage cannot block majority commit or become an authority for leadership. | sol_implementer |
|
||||
|
||||
## Verification, performance and migration
|
||||
|
||||
CURRENT: no Observability tests exist. Adjacent Log snapshot tests cover only logging;
|
||||
[validation](../VALIDATION.md) is the baseline evidence authority. PROPOSED after
|
||||
S-OBSERVABILITY-01–04 creates/discovers tests:
|
||||
`<configured-build>/tests/VoidTests --filter '^observability_'`. Test detached callback
|
||||
drain, queued work after TLS destruction, coroutine migration, nested scope restore,
|
||||
duplicate span end, zero/invalid remote IDs, clock discontinuity, exiting producer shards,
|
||||
cardinality attack, slow/failing/reentrant exporter and timeout with in-flight buffers.
|
||||
Use deterministic schedules and allocation counters, then supported sanitizers/stress.
|
||||
|
||||
Apply [performance](../PERFORMANCE.md)'s common samples/confidence/regression rules to
|
||||
null hooks, unsampled spans, counter increments, histogram contention, collection and export.
|
||||
Report p50/p95/p99, throughput, allocations, total peak/retained RSS/CPU and build cost,
|
||||
with dropped observations and export failures included. No instrumentation overhead target
|
||||
is asserted before measured baselines.
|
||||
|
||||
[Migration](../MIGRATION.md) first adds optional adapters; existing Log fields retain their
|
||||
meaning and are not automatically converted into metric labels. New consumers explicitly
|
||||
pass ContextSnapshot at admission. Telemetry configuration has schema versions and unknown
|
||||
required fields fail validation; disabling exporters is a reversible operational rollback
|
||||
that leaves null hooks safe. This is not a stable cross-toolchain C ABI until separately
|
||||
versioned through C-09. Cited Log sources have graph coverage checks and direct inspection;
|
||||
all metrics, trace/export behavior and conformance/performance results remain proposed.
|
||||
@@ -0,0 +1,130 @@
|
||||
# RPC subsystem plan — NEW
|
||||
|
||||
Status: NEW design only; all feature tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-009–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-06, C-07, C-11–C-13.
|
||||
|
||||
## Starting point and package boundary
|
||||
|
||||
No current RPC source directory or target is claimed. Existing
|
||||
[Net client](../../../include/Void/Net/Http.hpp) and
|
||||
[router/session abstractions](../../../include/Void/Net/Server.hpp) are building blocks,
|
||||
not RPC transport, dispatch or schema negotiation. Scoped coverage checks identify parse
|
||||
gaps in these headers (Http 112/115, Server 207/211/214); those declarations were read
|
||||
directly. New source roots `include/Void/RPC`, `src/RPC`, and `tests/standalone/RPC` are
|
||||
PROPOSED and require implementation-time build ownership.
|
||||
|
||||
RPC depends downwards on [Net](../modules/Net.md), [IO](IO.md),
|
||||
[Async](../modules/Async.md), [Data](../modules/Data.md) and [Binary](../modules/Binary.md).
|
||||
It does not import Coordination, Discovery, Replication or platform hosts. Endpoint
|
||||
selection is injected; a Discovery adapter belongs above RPC. Authentication hooks take
|
||||
Security-owned immutable principals; no socket is a principal merely because TLS succeeded.
|
||||
Choose native Void envelope/dispatch logic with HTTP/1.1 POST unary transport first;
|
||||
WebSocket multiplexed streaming follows Net conformance. Initial backend is the selected
|
||||
Net transport, with Boost/native parity inherited from Net. No gRPC compatibility claim
|
||||
and no new protobuf dependency are implicit.
|
||||
|
||||
## NEW contracts and concrete wire design
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::RPC shapes; not currently available APIs.
|
||||
struct MethodId { std::uint64_t service; std::uint32_t method; };
|
||||
struct CallContext { RequestId id; PrincipalView principal; OperationOptions operation; };
|
||||
class Client {
|
||||
Task<Result<OwnedBytes>> call(MethodId, OwnedBytes, OperationOptions);
|
||||
Task<Result<DuplexCall>> open_stream(MethodId, OperationOptions);
|
||||
};
|
||||
class Server {
|
||||
Result<Registration> bind(MethodDescriptor, Handler);
|
||||
Task<Result<void>> shutdown(OperationOptions);
|
||||
};
|
||||
```
|
||||
|
||||
Task/options are Async-owned; Result is C-02 shorthand. RPC owns MethodDescriptor,
|
||||
request/correlation IDs, status mapping and call handles. Shared binary encoding and
|
||||
schema primitives are referenced from Binary/Data, not reimplemented here. Registration
|
||||
retains handler/provider ownership; destruction unregisters future admission and offers
|
||||
an explicit drain operation for already admitted calls. Borrowed views expire on callback
|
||||
return; handlers retaining data must take ownership.
|
||||
|
||||
Wire v1 is versioned length-delimited Binary encoding, explicit network byte order:
|
||||
four-byte magic `VRPC`, u16 major/minor, u32 header length/total frame length, u8 frame
|
||||
kind/flags, u16 reserved (zero), 128-bit call ID, u64 service ID, u32 method ID/schema
|
||||
version/remaining timeout milliseconds, u16 metadata count and length-delimited metadata.
|
||||
The total length includes the fixed header, metadata and payload; validate overflow and
|
||||
minimum length before subtracting. Reserved flags and required unknown fields fail closed.
|
||||
No native struct dump, pointer or std::string layout crosses the wire. Header ≤16 KiB,
|
||||
64 metadata entries; payload ≤4 MiB/frame. Unknown major/required fields fail negotiation;
|
||||
minor optional fields are length-skippable. Initial unary POST uses one envelope under
|
||||
`/void-rpc/v1/call`, with an envelope response carrying domain status. Transport HTTP errors
|
||||
and RPC domain errors remain distinguishable. Data owns schema compatibility rules;
|
||||
numeric method IDs are explicit checked manifest assignments, not unstable reflection order.
|
||||
|
||||
Streaming uses WebSocket subprotocol `void.rpc.v1`: OPEN, DATA, CREDIT, HALF_CLOSE,
|
||||
CANCEL and TERMINAL frames. One ordered sequence per direction/call; at most one terminal
|
||||
frame, at most 128 calls/connection. Initial credit 256 KiB/direction; each acknowledged
|
||||
consumed byte replenishes credit. Data frames ≤64 KiB; control frames have a separate
|
||||
bounded 64 KiB reserve so saturated data cannot prevent CANCEL/TERMINAL. Half-close stops
|
||||
that sender only. On disconnect every unfinished stream returns transport_lost; no hidden
|
||||
resumption. Schema negotiation and method permission happen before handler admission.
|
||||
|
||||
Client dataflow: acquire budget → resolve injected endpoint → encode → Net send → decode
|
||||
bounded envelope → terminal result. Server: bounded decode → protocol/schema validation →
|
||||
authenticate/authorize → method admission → handler scope → encode result → release. User
|
||||
handlers and hooks execute outside dispatch locks. Relative timeout travels across machines;
|
||||
receivers create a local steady deadline, clamped to server max 30 seconds. Each forwarder
|
||||
subtracts its elapsed time, never sends a steady-clock timestamp from another process.
|
||||
Caller deadline includes connection/admission and all frames. Expiry cancels the server scope
|
||||
but cannot undo an application commit. The peer may complete after the caller loses its reply.
|
||||
|
||||
## Bounds, retry and failure matrix
|
||||
|
||||
NEW defaults: 1,024 client calls, 256 executing server calls, 512 waiting, 64 MiB queued
|
||||
payload budget, 8 MiB aggregate retained payload/call. Reject before parsing/allocating an
|
||||
oversized frame. Metadata disallows secrets in tracing labels; trusted identity metadata
|
||||
is authenticated by the transport/hook, never accepted from an arbitrary caller field.
|
||||
Retries default off. A method may declare read-only/replay-safe, or require an explicit
|
||||
application operation ID and durable dedup contract. A correlation call ID alone provides
|
||||
no exactly-once processing. Stop propagation is best effort; client cancellation completes
|
||||
only when local backend access ends. Graceful shutdown rejects new calls, drains for 10
|
||||
seconds, cancels remaining scopes, joins then releases registrations and transports.
|
||||
|
||||
| Fault | Result / resource action | Required test |
|
||||
| --- | --- | --- |
|
||||
| Unknown method/schema/major version | Typed protocol status; no handler invocation | Mixed-version fixtures |
|
||||
| Bad length / malformed metadata | Protocol error; close if frame boundary uncertain | Fuzz/truncated frame corpus |
|
||||
| Handler error/exception | Mapped sanitized status; exactly one terminal result | Throws before/after suspension |
|
||||
| Unauthorized request | Denied before method dispatch | Spoofed identity and role tests |
|
||||
| Queue/credit exhaustion | Overload or explicit cancellable capacity wait | Slow stream consumer RSS bound |
|
||||
| Deadline/cancel races with reply | One local outcome; remote commit may be unknown | Terminal-vs-cancel permutation tests |
|
||||
| Lost reply after durable write | Unknown outcome; caller queries/retries by domain ID | Replication adapter fixture |
|
||||
| Connection/provider shutdown | Stop/join owned scopes; no handler or buffer use after release | Unregister and reconnect races |
|
||||
|
||||
## Ordered work and acceptance
|
||||
|
||||
| ID | Phase / dependencies | Scope and evidence gate | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-RPC-01 | P0; baseline Net inventory | Record transport and schema prerequisites; independent package/dependency fixture plan | sol_implementer |
|
||||
| S-RPC-02 | P1; Async/IO/Data/Binary contracts, S-RPC-01 | NEW envelope/status/schema manifest and deterministic codec; limits/fuzz/round-trip fixtures pass | astra_implementer |
|
||||
| S-RPC-03 | P2; S-RPC-02, Net HTTP server/client gate | Unary transport and ownership-safe dispatch; deadlines/errors/authorization and consumer checks | sol_implementer |
|
||||
| S-RPC-04 | P3; S-RPC-03, Net WebSocket gate | Streaming credit/half-close/cancel protocol; no memory growth under stalled consumers | astra_implementer |
|
||||
| S-RPC-05 | P3; S-RPC-03, Security/Observability gates | Host adapters, bounded observations and version migration; embedded and managed modes pass | sol_implementer |
|
||||
| S-RPC-06 | P4; S-RPC-05, Replication protocol fixtures | Consensus traffic adapter conformance, duplicate/reorder/lost-reply coverage; RPC remains independent of Coordination | astra_implementer |
|
||||
|
||||
## Validation and migration
|
||||
|
||||
CURRENT checks belong to the linked Net modules; no RPC tests or runner exist. PROPOSED
|
||||
codec property/fuzz tests, loopback client/server tests, independent language byte fixtures,
|
||||
handler-lifetime races, credit starvation and partition proxies precede implementation
|
||||
acceptance. Register future targets before using command templates in
|
||||
[VALIDATION](../VALIDATION.md) / [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
Measure unary small/large payload, persistent connection and concurrent streams; report
|
||||
p50/p95/p99, throughput, allocations, RSS/CPU and build cost via
|
||||
[PERFORMANCE](../PERFORMANCE.md), including overload and cancellation latency.
|
||||
|
||||
Rollout negotiates envelope/schema before methods become ready. Support old+new major
|
||||
listeners side by side during migration; never reinterpret frames after a failed decode.
|
||||
Rollback stops new-major admission, drains calls and preserves old schema readers. Handler
|
||||
side effects require domain-level forward/rollback policy. See [MIGRATION](../MIGRATION.md),
|
||||
[Replication](Replication.md) and [NetworkedApplications](../platforms/NetworkedApplications.md).
|
||||
@@ -0,0 +1,156 @@
|
||||
# Replication subsystem plan — NEW adapters and state-machine host
|
||||
|
||||
Status: NEW design; all tasks PLANNED. Baseline
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Authority: [requirements](../REQUIREMENTS.md) R-007–R-012, R-014–R-016;
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-05, C-08, C-11–C-13.
|
||||
|
||||
## Baseline and exclusive responsibility
|
||||
|
||||
No Replication target, durable replicated log or state-machine host exists. NEW proposed
|
||||
roots are `include/Void/Replication`, `src/Replication` and `tests/standalone/Replication`.
|
||||
Existing [Net client](../../../include/Void/Net/Http.hpp) is only a transport precursor;
|
||||
its graph gaps at 112/115 were read directly. No reliability claim follows from that API.
|
||||
|
||||
Replication depends on the pure [Coordination](Coordination.md) core, [RPC](RPC.md),
|
||||
[Storage](Storage.md), Async, Time and optional observation hooks. It owns stable-storage,
|
||||
transport, snapshot and deterministic application adapters. Coordination does not import
|
||||
Replication; RPC does not import Coordination; Storage does not import replication policy.
|
||||
Discovery integration is an upper adapter, with static bootstrap endpoints sufficient for
|
||||
initial groups. Choose native host logic and the original Storage engine as the first
|
||||
persistence implementation. SQLite may receive a separate later adapter with explicit
|
||||
transaction/durability evidence; it is not the native engine or distributed shared disk.
|
||||
|
||||
## NEW interface and operation identity
|
||||
|
||||
```cpp
|
||||
// NEW illustrative Void::Replication shapes; Result/Task/options follow C-02/C-03.
|
||||
struct RequestIdentity { SessionId session; std::uint64_t sequence; };
|
||||
struct CommitReceipt { GroupId group; LogIndex index; Term term; OwnedBytes result; };
|
||||
enum class ReadPolicy { quorum_consistent, stale_local };
|
||||
class Group {
|
||||
Task<Result<CommitReceipt>> submit(RequestIdentity, OwnedBytes command, OperationOptions);
|
||||
Task<Result<ReadView>> read(ReadPolicy, OperationOptions);
|
||||
Task<Result<RequestOutcome>> inspect(RequestIdentity, OperationOptions);
|
||||
Task<Result<void>> shutdown(OperationOptions);
|
||||
};
|
||||
class StateMachine {
|
||||
Result<ApplyBatch> prepare(CommandView, const ReadView&); // deterministic, no IO
|
||||
};
|
||||
```
|
||||
|
||||
State-machine preparation computes application mutations and a bounded result against
|
||||
the current version, without network, wall-clock or randomness. Needed time/random values
|
||||
are command fields validated before admission; replicas apply identical bytes. `ApplyBatch`
|
||||
uses Storage-owned batch types. Snapshot metadata includes group/cluster identity, format,
|
||||
fixed configuration, included index/term, application schema, checksums and dedup state.
|
||||
Group owns all protocol/transport tasks; handles keep context alive through join. No callback
|
||||
executes under group or storage mutexes, and a worker cannot synchronously wait on its own executor.
|
||||
|
||||
Session opening is itself committed and allocates a monotonically increasing session number
|
||||
from durable group state. IDs include cluster identity; numbers are never reused. Initial
|
||||
client contract allows one outstanding sequence/session; client sends acknowledged-result
|
||||
floor with its next command. Persist payload digest/result for duplicates. Same ID plus
|
||||
different command is identity_conflict. Duplicate retained ID returns original result;
|
||||
sequence at/below retired floor is result_expired, never re-executed. Closed/evicted session
|
||||
IDs below the durable allocation high-water mark remain invalid, without unbounded tombstones.
|
||||
Accept only the next sequence or a retained duplicate; reject gaps and floors beyond the
|
||||
last completed sequence before mutation. New sessions at capacity require explicit
|
||||
close/administrative expiry commands. Neither a
|
||||
retry nor a process restart opens a fresh session implicitly for an uncertain operation.
|
||||
|
||||
## Durable dataflow and crash boundaries
|
||||
|
||||
1. Bootstrap validates static cluster/group ID, voter list and node identity. Recover
|
||||
Storage, protocol state, snapshot and application applied position before serving.
|
||||
Reusing an existing node ID with empty storage is rejected. Peer authentication maps a
|
||||
certificate identity to the configured node ID; endpoint discovery cannot expand voters.
|
||||
2. Serialize Core events per group. A PersistBatch atomically changes term/vote and/or
|
||||
protocol log records in a reserved Storage keyspace, requesting durable persistence.
|
||||
Only a successful completion satisfies its barrier and releases dependent peer replies.
|
||||
Replication adapters must preserve this dependency even if the network is faster than disk.
|
||||
3. Leader appends a command, replicates, and waits for the core's committed range. Apply
|
||||
exactly the next index. One durable Storage batch includes application mutations,
|
||||
command/result dedup record, session floor updates and `applied_index`/term. This atomic
|
||||
batch is the only successful application commit boundary; no separate index file write.
|
||||
4. Notify Core Applied only after that batch's durable success. Complete the caller with
|
||||
its result only after majority commitment and local durable application. Losing a reply
|
||||
does not undo commit; inspect/retry by RequestIdentity. Cancellation stops caller interest
|
||||
and transport work where safe, not a committed entry. Followers may lag but apply in order.
|
||||
5. Recovery starts at persisted application applied index and replays only later committed
|
||||
entries; never double-apply an entry already included in the atomic batch. Conflicting
|
||||
protocol/application positions, malformed records or missing required log dependencies
|
||||
fault the group and require operator recovery, not silent truncation of committed state.
|
||||
6. Quorum-consistent read asks Core for a fresh current-term read context, waits for majority
|
||||
confirmation and for local applied index ≥ read barrier, then opens a pinned Storage view.
|
||||
Return its applied index/term. `stale_local` returns local position and explicit stale
|
||||
metadata; it cannot be advertised as a consistent read during partition.
|
||||
|
||||
The persistence-before-reply and read-quorum requirements follow
|
||||
[Raft's stable-state and client-interaction rules](https://raft.github.io/raft.pdf).
|
||||
The atomic application/dedup/applied batch above is the chosen integration contract.
|
||||
|
||||
## Snapshot, recovery and resource policy
|
||||
|
||||
Pin application state at applied index I; create a versioned snapshot containing all application
|
||||
and active session/dedup data through I, plus the included log term/configuration. Write chunks
|
||||
to an isolated candidate, verify checksums/lengths, sync data and required directory/manifest
|
||||
dependencies using Storage's durable publication protocol. Publish an atomic manifest tying
|
||||
the snapshot to its applied position before compacting log ≤I. Receiver verifies cluster,
|
||||
format, index/term, schema and quota, prepares an isolated Storage generation, then atomically
|
||||
publishes application+dedup+applied position. Crash recovery follows Storage's durably
|
||||
published CURRENT/generation pointer; a complete but unselected manifest is an orphan
|
||||
or candidate, never authority merely because its generation number is larger.
|
||||
An InstallSnapshot reply waits for durable publication. Never load partially replaced app
|
||||
state while reporting the previous applied index. Cross-file consistency is a Storage port
|
||||
obligation, not an assumption that rename alone persists everything. Fault methodology follows
|
||||
[SQLite's simulated crash tests](https://sqlite.org/atomiccommit.html#_testing_atomic_commit_behavior).
|
||||
|
||||
NEW defaults: 16 active groups/host; 1,024 admitted submissions/group, 64 MiB queued command
|
||||
bytes/group with a 256 MiB host aggregate; 1 MiB command and 64 KiB stored result; 10,000 active
|
||||
sessions/group and at most one unacknowledged result/session. Per-group disk starts at 1 GiB;
|
||||
snapshot triggers at 64 MiB log growth or 10,000 applied entries, whichever comes first.
|
||||
Snapshot chunks are 256 KiB, at most two transfers/host, 4 MiB transfer buffers and 16 MiB/s
|
||||
default transfer rate. A slow follower catches up from a snapshot after required log compaction;
|
||||
do not retain infinite history waiting for it. Reserve disk headroom for candidate+active
|
||||
snapshots; if insufficient, reject writes and report pressure. No eviction of active dedup
|
||||
results to gain space. Deadlines default to 10 seconds but include all admission/replication/
|
||||
apply work; a timeout may still have committed. Group shutdown stops proposals, drains durable
|
||||
barriers, cancels transport and joins before closing Storage.
|
||||
|
||||
| Fault | Required behavior | Evidence |
|
||||
| --- | --- | --- |
|
||||
| Sync fails before vote/append reply | Group pauses/faults; no dependent affirmative reply | Persist/network barrier instrumentation |
|
||||
| Crash after application batch before caller reply | Recovery retains result and applied position; duplicate returns it | Crash at every application boundary |
|
||||
| Leader loses quorum/term | Stop consistent reads/new successful writes; pending outcomes may be unknown | Isolated old leader history |
|
||||
| State-machine nondeterminism/unsupported schema | Fault before divergent application publication | Replica result/state digest comparison |
|
||||
| Snapshot transfer/install interrupted | Keep active generation; retry candidate safely | Chunk loss, full disk, crash at manifest switch |
|
||||
| Session ID reused/conflicting payload | Expired/conflict; no duplicate mutation | Session/floor/restart tests |
|
||||
| Disk corruption / impossible applied index | Quarantine group; surface recovery requirement | Truncation/checksum/position fixtures |
|
||||
| Shutdown during admitted write | Join ownership; durable outcome remains inspectable | Stop/persist/commit permutations |
|
||||
|
||||
## Task DAG and acceptance
|
||||
|
||||
| ID | Phase / dependencies | Scope and gate | Recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-REPLICATION-01 | P0; baseline | NEW adapter and crash-boundary specification, static bootstrap and schema ownership | astra_implementer |
|
||||
| S-REPLICATION-02 | P1; S-REPLICATION-01, Storage/Async/Binary contracts | Stable-storage port conformance and fake transport/clock harness; atomic state invariant fixtures | astra_implementer |
|
||||
| S-REPLICATION-03 | P4; S-REPLICATION-02, Coordination fixed-group gate, RPC unary | Real protocol storage/RPC adapters; durable-before-reply verified on three nodes | astra_implementer |
|
||||
| S-REPLICATION-04 | P4; S-REPLICATION-03, Coordination read gate | Application host, session dedup, atomic applied position and quorum reads; lost-reply/partition histories pass | astra_implementer |
|
||||
| S-REPLICATION-05 | P4; S-REPLICATION-04, S-COORDINATION-05 | Snapshot publish/install/recovery and rate limits; exhaustive selected crash points pass | astra_implementer |
|
||||
| S-REPLICATION-06 | P4; S-REPLICATION-05 | Resource/operations evidence, upper Discovery and Messaging adapters; deterministic restart and minority behavior | sol_implementer |
|
||||
|
||||
CURRENT: no Replication checks exist or ran. PROPOSED tests combine a deterministic core
|
||||
simulator, faulting Storage port, real-process kills, network loss/reordering, disk faults
|
||||
and a linearizability checker consuming complete invocation/response histories. Check durable
|
||||
reply order, not only final key values. Add targets before documenting commands in
|
||||
[VALIDATION](../VALIDATION.md) / [BUILD-AND-DISTRIBUTION](../BUILD-AND-DISTRIBUTION.md).
|
||||
Measure commit/read/snapshot p50/p95/p99, throughput, allocations, peak RSS/CPU, sync time,
|
||||
retained disk and build cost using [PERFORMANCE](../PERFORMANCE.md).
|
||||
|
||||
Migrations version wire, log, snapshot and application schemas independently. Enable a new
|
||||
command only after every voter can read/apply it. Keep old readers during a rolling phase;
|
||||
rollback stops admission of new commands and is permitted only when persisted formats remain
|
||||
readable. Restore into a new cluster identity after quorum loss requires explicit operator
|
||||
authorization; it cannot preserve an unsupported continuity claim. See [MIGRATION](../MIGRATION.md)
|
||||
and [DistributedStorage](DistributedStorage.md).
|
||||
@@ -0,0 +1,191 @@
|
||||
# Runtime explicit managed composition plan
|
||||
|
||||
Status: NEW subsystem; all feature work PLANNED. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
Requirements R-005, R-009, R-010, R-012 and R-014 apply.
|
||||
[Architecture](../ARCHITECTURE.md) C-01–C-05, C-09 and C-11 controls layering.
|
||||
NEW proposed roots are `include/Void/Runtime`, `src/Runtime` and
|
||||
`tests/standalone/Runtime`; no host or runtime is implemented in this planning package.
|
||||
|
||||
## Existing ingredients and boundary
|
||||
|
||||
There is no current managed Runtime module. Existing
|
||||
[Async ThreadPool](../../../include/Void/Async/ThreadPool.hpp),
|
||||
[EventBus](../../../include/Void/Async/EventBus.hpp), and
|
||||
[System FileWatcher](../../../include/Void/System/FileWatcher.hpp) create their own
|
||||
workers in their respective owning forms. [Fsm Engine](../../../include/Void/Fsm/Detail/Engine.hpp)
|
||||
can own a worker or be pumped. [ServiceRegistry](../../../include/Void/Service/Registry.hpp)
|
||||
has lifecycle callbacks but no managed execution composition. These source paths were
|
||||
coverage-checked and key behavior read directly; FileWatcher's partial declaration
|
||||
was directly inspected. Existing
|
||||
[executor](../../../tests/standalone/Async/Executor.cpp),
|
||||
[watcher](../../../tests/standalone/System/FileWatcher.cpp), and
|
||||
[orchestrator](../../../tests/standalone/Service/Orchestrator.cpp) tests are integration
|
||||
anchors, not Runtime tests.
|
||||
|
||||
Runtime depends on [Async](../modules/Async.md), [IO](IO.md), Time and Memory facilities.
|
||||
Async/IO/Time/Memory never depend on Runtime. Optional adapters compose Service,
|
||||
Configuration, Plugin, Scheduler, Log and Observability without making them mandatory
|
||||
runtime dependencies for small consumers. Foundation constructors do not acquire
|
||||
threads, sockets or a process-wide runtime. No singleton `Runtime::current()` fallback
|
||||
is part of this design.
|
||||
|
||||
## NEW public shape and embedded composition
|
||||
|
||||
Illustrative, not available declarations:
|
||||
|
||||
```cpp
|
||||
namespace Void::Runtime {
|
||||
struct Options {
|
||||
std::uint32_t cpu_workers;
|
||||
std::uint32_t file_workers;
|
||||
RuntimeLimits limits;
|
||||
ShutdownPolicy shutdown;
|
||||
};
|
||||
class Host { // owns managed resources
|
||||
public:
|
||||
static Result<Host> create(Options); // validates, starts no workers
|
||||
Result<void> start(); // explicit startup transaction
|
||||
Async::Executor& executor();
|
||||
IO::Driver& io();
|
||||
Coro::Task<Result<ShutdownReport>> shutdown(Async::OperationOptions);
|
||||
};
|
||||
// NEW EmbeddedResources borrows executor, IO driver, Time clock and Memory budget.
|
||||
}
|
||||
```
|
||||
|
||||
Runtime Options are resource policy, not a duplicate operation context. Every cancellable
|
||||
operation takes Async::OperationOptions. Time owns injected monotonic/civil clocks;
|
||||
Memory owns allocation/budget contracts; Observability supplies optional lightweight
|
||||
hooks. Runtime stores owners for managed resources and validated references for borrowed
|
||||
ones, with no implicit lifetime extension of arbitrary external objects.
|
||||
|
||||
An embedded application constructs Async scopes and an IO driver directly, then passes
|
||||
them to module factories. It may use NEW EmbeddedResources convenience views, but modules
|
||||
consume their own low-level ports, not a mandatory Runtime header. A managed Host exposes
|
||||
the same ports. A test host uses fake Time, ManualExecutor and a mock IO backend. Normal
|
||||
constructors remain inert; start is explicit and errors return before publication.
|
||||
|
||||
## Startup algorithm
|
||||
|
||||
Use a lifecycle graph of explicit resources, with required/optional dependencies and
|
||||
deterministic topological ordering. Default core order: validate limits/capabilities →
|
||||
establish signal handling on the designated owner thread → allocate budgets and queues →
|
||||
start CPU executor → start IO driver/file workers → start optional service/admission
|
||||
adapters → report ready. SignalWatcher is created before worker threads as required by
|
||||
[its contract](../../../include/Void/System/SignalWatcher.hpp), and is destroyed on
|
||||
the same creating thread after workers join.
|
||||
|
||||
Each start step returns a retained cleanup action. A failed step aborts its partial
|
||||
resources and unwinds previously successful starts in reverse dependency order.
|
||||
Callbacks and service readiness checks execute outside lifecycle graph locks; a
|
||||
serialized lifecycle strand prevents concurrent start/shutdown transactions. Start
|
||||
is valid once per Host instance; retries after failure use a fresh Host after cleanup,
|
||||
avoiding partially restarted resources. Host ready means all required admissions can
|
||||
work, not merely that worker threads were created.
|
||||
|
||||
Configuration integration prepares a complete immutable resource/settings generation
|
||||
before Host publication. A failed reload keeps current resources. Increasing pool
|
||||
size can be prepared; shrinking retires workers after their admitted tasks drain.
|
||||
Changes that cannot be staged reversibly require a controlled restart. Runtime never
|
||||
applies half of a Configuration transaction.
|
||||
|
||||
## Shutdown and failure ownership
|
||||
|
||||
States: constructed → starting → running → stopping_admission → draining → joining →
|
||||
stopped; failed_start and shutdown_incomplete retain cleanup ownership. Shutdown is
|
||||
idempotent; callers join one retained result rather than issue competing stop paths.
|
||||
|
||||
1. Close external admissions/listeners/schedule admission and freeze new lifecycle
|
||||
publication. Existing accepted calls retain their resources and generation pins.
|
||||
2. Ask high-level applications/services to drain for a default 5-second grace within
|
||||
the caller's total steady deadline. Observe dependency order: stop dependents first.
|
||||
3. Request stop on remaining application/module work scopes and their timers,
|
||||
subscriptions and queued IO. Shutdown-owned cleanup/export scopes are separate and
|
||||
retain bounded internal admission. Continue driving IO/executor completions so
|
||||
cancellation can finish; do not stop workers needed to join their children.
|
||||
4. Join drained business scopes and their IO/plugin activities. Retain reactor, CPU/file
|
||||
workers, clock, callbacks and provider generations needed by final cleanup/export.
|
||||
5. Stop remaining telemetry producers, collect final metrics, then flush, close and join
|
||||
observation/logging adapters in dependency order. A flush deadline reports unsent/lost
|
||||
data and requests cooperative cancellation, but all admitted backend activity must
|
||||
still quiesce. Expiry of the total shutdown budget returns shutdown_incomplete with
|
||||
exporter owners and their execution resources retained; a later join continues them.
|
||||
6. Only after cleanup/export callbacks and backend references retire, stop reactor and
|
||||
CPU/file workers and release budgets/descriptors/signal masks in reverse creation
|
||||
order. Observation failure cannot suppress cleanup or convert a failed operation
|
||||
into success. A timed-out flush is not evidence that its resources are releasable.
|
||||
|
||||
Default total shutdown observation budget is 30 seconds, shortened by caller options.
|
||||
Expiry produces `shutdown_incomplete` containing pending owner IDs/counts and phase;
|
||||
the Host remains in joining with resources retained. It can be waited again or the
|
||||
application can choose explicit process termination. There is no forced thread kill,
|
||||
buffer release or dlclose. Borrowed resources must outlive final cleanup, not merely
|
||||
the first timed-out shutdown call. Destruction blocks to join only on an allowed
|
||||
off-worker owner thread; on a runtime worker, callers must await shutdown before
|
||||
destroying Host. Self-join misuse is detected as a programmer error. Process-level
|
||||
hard-stop policy belongs to the application, not a hidden destructor timeout.
|
||||
|
||||
Uncaught task exceptions reach explicit scope/error sinks. Default failure policy
|
||||
requests stop for the owning component and marks it not-ready; it does not terminate
|
||||
all unrelated components unless the host's declared critical-resource policy requires
|
||||
that. Core driver failure closes admission and starts supervised shutdown. Error sinks
|
||||
cannot recursively allocate unbounded work to report overload.
|
||||
|
||||
## Default accounting and backend rationale
|
||||
|
||||
Use native standard threads plus the selected IO epoll/file-worker backend. Default one
|
||||
reactor, CPU workers = min(8, max(1, hardware_concurrency())), four file workers, 4,096
|
||||
admitted CPU tasks, 8,192 IO operations, 256 queued file requests, 1,024 timers, 256
|
||||
optional services and 256 MiB owned dynamic resource budget. Zero workers/limits are
|
||||
invalid unless a documented embedded mode supplies the corresponding resource.
|
||||
|
||||
Global budget permits are shared by submodules: adding their local caps never creates
|
||||
permission to exceed the host cap. Count running work, queued completions, prepared
|
||||
reload generations and retained buffers. Thread stacks, kernel buffers and borrowed
|
||||
memory are reported separately from allocator-controlled bytes; RSS is not falsely
|
||||
claimed to be capped by the 256 MiB allocator budget. Reserve terminal/control capacity
|
||||
when admitting work. Rejection is explicit; optional async waiting has bounded waiters
|
||||
and uses the same stop/deadline. Native affinity/priority tuning is P3 opt-in after
|
||||
measurements, not required for correctness.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
Every row is PLANNED.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-RUNTIME-01 | P1 / Async ownership, IO driver, Time/Memory ports | Inert Host options, borrowed/owned resource graph, dependency validation | No constructor starts workers; invalid bounds/cycles fail before external admission / sol_implementer |
|
||||
| S-RUNTIME-02 | P2 / S-RUNTIME-01; System signal gate | Explicit start, readiness and reverse failed-start cleanup | Failure at every creation/start step leaves no worker/descriptors; signal-mask ownership retained / astra_implementer |
|
||||
| S-RUNTIME-03 | P2 / S-RUNTIME-02 | Structured shutdown, repeated join, exporter-before-executor ordering and budget accounting | Full queues deliver completion; in-flight export retains IO/workers through flush expiry; stalled work reports incomplete without freeing resources / astra_implementer |
|
||||
| S-RUNTIME-04 | P3 / S-RUNTIME-03; Service/Configuration transaction gates | Optional managed adapters, transactional resize/reload and embedded examples | Same workload runs embedded/managed; failed resource prepare keeps active generation / sol_implementer |
|
||||
| S-RUNTIME-05 | P3 / S-RUNTIME-04; profile harness | Latency/throughput/footprint presets, inspection and tuning gates | Limits remain invariant per preset; measured p99/RSS/build cost reported with environment / astra_implementer |
|
||||
|
||||
## Validation and migration
|
||||
|
||||
CURRENT aggregate source-regression command:
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun here; no Runtime executable/target is present. PROPOSED tests require NEW
|
||||
Host: start failure at each node, stop during startup, concurrent repeated shutdown,
|
||||
task creating a child while admission closes, file syscall held past deadline, full
|
||||
completion queue, borrowed driver teardown ordering, observer throw, signal arrival
|
||||
during start, and held plugin pin at shutdown. Hold a remote export in flight while
|
||||
business admission closes, expire its flush and total shutdown deadlines, and assert
|
||||
shutdown_incomplete retains IO/workers/buffers. Release the backend, join again and
|
||||
assert exporter destruction precedes executor teardown, with no new business admission.
|
||||
Run tests with isolated process signals
|
||||
and deterministic clocks; avoid real sleeps for lifecycle ordering assertions.
|
||||
|
||||
Measure start/ready/shutdown p50/p95/p99, task and IO throughput, allocations, retained
|
||||
owners, peak RSS/CPU/thread count and build cost using [PERFORMANCE](../PERFORMANCE.md).
|
||||
The managed preset is accepted only after embedded equivalence and no implicit-thread
|
||||
consumer checks pass under [VALIDATION](../VALIDATION.md). No measurements ran here.
|
||||
|
||||
Migration is opt-in: existing thread-owning components keep versioned constructors;
|
||||
new factories accept explicit ports. A future reference host in
|
||||
[NetworkedApplications](../platforms/NetworkedApplications.md) or
|
||||
[ReloadableApplications](../platforms/ReloadableApplications.md) calls create/start,
|
||||
not a global bootstrap function. Rollback drains the managed host before restoring
|
||||
legacy ownership; two owners must never drive the same executor/descriptor. See
|
||||
[MIGRATION](../MIGRATION.md), [DEPENDENCIES](../DEPENDENCIES.md), and
|
||||
[DELIVERY](../DELIVERY.md).
|
||||
@@ -0,0 +1,181 @@
|
||||
# Scheduler timers, calendar jobs and persistence plan
|
||||
|
||||
Status: NEW subsystem; all feature work PLANNED. Baseline:
|
||||
`f1f9ba375b22abf1adcc7c550ec21ac20895c0a4`, inspected 2026-11-24.
|
||||
No current Scheduler source directory is part of this baseline. NEW proposed roots:
|
||||
`include/Void/Scheduler`, `src/Scheduler`, `tests/standalone/Scheduler`.
|
||||
Requirements R-009, R-011, R-014–R-016 apply. Follow
|
||||
[architecture](../ARCHITECTURE.md) C-02–C-05, C-08, C-10 and C-12.
|
||||
|
||||
## Baseline and subsystem boundary
|
||||
|
||||
[Fsm Engine](../../../include/Void/Fsm/Detail/Engine.hpp) already has local timer IDs,
|
||||
event-wait deadlines and a worker; [Engine.cpp](../../../src/Fsm/Engine.cpp) implements
|
||||
them. [Async Executor](../../../include/Void/Async/Executor.hpp) provides manual
|
||||
progress, while [Time Stopwatch](../../../include/Void/Time/Stopwatch.hpp) uses a
|
||||
steady clock. None supplies durable jobs, calendar recurrence or persisted occurrence
|
||||
acknowledgement. These paths were coverage-checked and relevant timer/executor source
|
||||
read directly. [Fsm event](../../../tests/standalone/Fsm/Events.cpp) and
|
||||
[executor](../../../tests/standalone/Async/Executor.cpp) fixtures are reuse anchors;
|
||||
there is no existing Scheduler test target.
|
||||
|
||||
[Time](../modules/Time.md) owns injected clocks and civil/calendar conversions;
|
||||
[Async](../modules/Async.md) owns timer-wait completion, scopes and OperationOptions;
|
||||
[Scheduler](Scheduler.md) owns job definitions, occurrence admission and dispatch;
|
||||
[Fsm](../modules/Fsm.md) owns workflow execution. Scheduler does not become Async's
|
||||
timer backend dependency. In-memory scheduling is usable without Storage/Runtime;
|
||||
durability is an explicit [Storage](Storage.md) adapter, with
|
||||
[Sqlite](../modules/Sqlite.md) an independently specified optional implementation of
|
||||
the same persistence port. It is never a hidden substitute for native Storage.
|
||||
|
||||
## NEW APIs and recurrence policies
|
||||
|
||||
Illustrative contracts, not delivered declarations:
|
||||
|
||||
```cpp
|
||||
namespace Void::Scheduler {
|
||||
struct OccurrenceId {
|
||||
JobId job; std::uint64_t revision; std::uint64_t sequence;
|
||||
};
|
||||
enum class Misfire { skip, coalesce_latest, catch_up_bounded };
|
||||
enum class Overlap { forbid, queue_one, allow_bounded };
|
||||
struct JobSpec {
|
||||
JobId id; std::uint64_t revision;
|
||||
Schedule schedule; // once, fixed-delay/rate, calendar
|
||||
HandlerId handler; std::vector<std::byte> payload;
|
||||
Misfire misfire; Overlap overlap; RetryPolicy retry;
|
||||
};
|
||||
// add(spec, options) -> Task<Result<JobRevision>>;
|
||||
// remove(job, options) -> Task<Result<void>>;
|
||||
// handler(OccurrenceId, payload, Async::OperationOptions) -> Task<Result<void>>;
|
||||
// close_and_join(options) -> Task<Result<ShutdownReport>>;
|
||||
}
|
||||
```
|
||||
|
||||
Async OperationOptions is the only operation cancellation/deadline type. JobSpec has
|
||||
separate persistent scheduling/retry policy, not a persisted std::stop_token. Time's
|
||||
injected clock drives a monotonic min-heap ordered by due time then occurrence sequence.
|
||||
Callbacks run on the injected executor outside heap/store locks. A root scope owns
|
||||
all dispatcher/handler children and their shutdown.
|
||||
|
||||
One-shot delay uses monotonic time in memory; durable one-shot stores an intended UTC
|
||||
instant plus its occurrence sequence. Fixed-rate recurrence advances from intended
|
||||
schedule time, not completion time; fixed-delay advances only after a completion record
|
||||
commits. Civil schedules store a timezone ID, timezone-data version policy and intended
|
||||
local slot, with Time resolving it to UTC. Default DST gap policy skips nonexistent
|
||||
local slots; fold policy chooses the first occurrence only. Explicit twice-fold policy
|
||||
includes the fold index in the persisted slot identity. Unknown zone or unavailable
|
||||
required timezone data is a configuration error, never silent UTC fallback.
|
||||
|
||||
Initial calendar grammar is five fields (minute/hour/day/month/weekday) with explicit
|
||||
lists/ranges/steps; day and weekday constraints both apply. This is a documented
|
||||
cron-like grammar, not a claim of compatibility with every cron implementation.
|
||||
Seconds, arbitrary scripts and natural-language schedules are later named extensions.
|
||||
Default misfire coalesces to the latest due occurrence; catch_up_bounded admits at most
|
||||
100 missed occurrences per job per recovery pass, preserving remaining cursor state.
|
||||
Default overlap forbids concurrent execution for one job; queue_one retains the latest
|
||||
pending slot. allow_bounded requires an explicit per-job concurrency cap.
|
||||
|
||||
## Durable state machine and at-least-once delivery
|
||||
|
||||
Initial persistent mode has one scheduler process owning the store namespace through
|
||||
an exclusive local ownership lock. A second process fails startup; there is no implied
|
||||
cross-host lease/election. Job envelopes contain format version, handler identity,
|
||||
payload schema, revision and recurrence policy. Occurrence records contain ID, intended
|
||||
slot/UTC time, pending/running/completed/dead status, attempt number, next retry instant
|
||||
and bounded diagnostic category. Store adapter operations are atomic conditional batches.
|
||||
|
||||
1. In one durable batch, create due occurrence records with unique IDs and advance the
|
||||
job's materialization cursor. Reserve occurrence capacity before moving the cursor.
|
||||
OccurrenceId sequence is allocated in that transaction; retries retain the same ID.
|
||||
A unique `(job, revision, civil-slot, fold)` index prevents duplicate materialization
|
||||
after wall-clock rollback. ID is never generated from current wall time alone.
|
||||
2. Atomically mark pending → running with attempt identity, then dispatch only after
|
||||
that record is durably acknowledged. Queue saturation keeps it pending; it does not
|
||||
falsely mark delivery complete. Handler admission options cover queue wait and run.
|
||||
3. Handler success writes completed durably before releasing durable occurrence state.
|
||||
Failure writes a retry/dead transition. Exponential backoff defaults 1 second to
|
||||
5 minutes, multiplier 2, injected full-jitter RNG, maximum five attempts. Stop during
|
||||
host shutdown preserves pending/running recovery intent and does not consume a retry
|
||||
merely because the process is stopping.
|
||||
4. After crash/restart, running records without a terminal acknowledgement return to
|
||||
pending with the same OccurrenceId. The handler may already have applied its effect.
|
||||
This is at-least-once execution, including successful effects whose acknowledgement
|
||||
was lost. Expose `unknown_outcome` for failed/lost persistence acknowledgement and
|
||||
inspect before automatic retry when the store outcome is unknown.
|
||||
|
||||
Exactly-once external effects are not promised. A handler passes OccurrenceId as an
|
||||
idempotency key, or atomically commits its application mutation and dedup record in
|
||||
the same Storage transaction/batch where supported. Network calls/email/process launches
|
||||
need downstream idempotency or compensation. A scheduler completion record alone cannot
|
||||
make those effects transactional. Storage mutation and scheduler applied state may share
|
||||
a batch only through an explicitly supported common-store adapter, never by assuming
|
||||
two unrelated databases commit atomically.
|
||||
|
||||
Editing a job increments revision; old running occurrences retain their handler/payload
|
||||
snapshot and policy. Default update atomically records an old-revision invalidation
|
||||
watermark with the new revision. This logically cancels unstarted old occurrences;
|
||||
bounded background batches reclaim them without exceeding the 1 MiB batch cap. Claim
|
||||
checks that watermark in the same conditional batch as pending → running, so an edit
|
||||
cannot race a stale dispatch. Remove records a job tombstone, closes new admission,
|
||||
requests stop for active handlers and optionally joins; a remove timeout does not claim
|
||||
active effects were undone. Calendar timezone-data changes require explicit reschedule policy and keep
|
||||
already materialized slot identities. Large wall-clock jumps trigger bounded rescan;
|
||||
monotonic handler deadlines do not jump with the civil clock.
|
||||
|
||||
## Bounds, shutdown and backend decisions
|
||||
|
||||
Defaults: 10,000 job definitions, 100,000 retained occurrence records, 64 KiB payload,
|
||||
16 MiB aggregate loaded payloads, 256 ready dispatches, 32 active handlers, one active
|
||||
handler/job, 100 catch-up slots/job/pass, 64 retries processed/turn and 1 MiB durable
|
||||
batch. Count running records against retention. Completed history retention is seven
|
||||
days within the count cap; when pending/running state fills the cap, reject new jobs
|
||||
and pause materialization without advancing cursors. Do not delete unacknowledged work.
|
||||
Dead records require explicit operator acknowledgement/export before pruning by policy.
|
||||
|
||||
Heap entries are lightweight IDs; payloads load under a separate byte budget. Persist
|
||||
next-due indices to avoid loading the entire store on each tick. Bound per-turn work
|
||||
and yield to other Async tasks. Errors distinguish invalid rule, unsupported timezone,
|
||||
overload, persistence failure, unknown outcome, handler failure and cancellation.
|
||||
Observation hooks report lag, duplicate attempts, retry/dead counts and retention pressure
|
||||
without labels per arbitrary job ID by default.
|
||||
|
||||
Shutdown stops materialization/dispatch, requests handler stop and joins the root scope
|
||||
before closing persistence. A deadline produces incomplete shutdown with live owner IDs;
|
||||
it never abandons frames or erases running records. Native heap/calendar composition is
|
||||
selected over an external scheduling framework. Distributed dispatch is P4 only: a
|
||||
Coordination/Replication adapter must provide committed ownership epochs/fencing and
|
||||
deduplication; local lock semantics are not stretched into distributed correctness.
|
||||
|
||||
## Ordered implementation backlog
|
||||
|
||||
All rows are PLANNED.
|
||||
|
||||
| ID | Phase / depends on | Intended scope | Acceptance / recommended role |
|
||||
| --- | --- | --- | --- |
|
||||
| S-SCHEDULER-01 | P1 / Async scopes/timers and Time clock gates | In-memory heap, one-shot/fixed schedules, explicit admission and joined handlers | Fake-clock tests prove ordering, overlap bounds and cancellation without sleeps / sol_implementer |
|
||||
| S-SCHEDULER-02 | P2 / S-SCHEDULER-01; Time calendar gate | Calendar grammar, DST/misfire/catch-up and stable occurrence identities | Gap/fold/backward/forward clock cases yield documented slot IDs with bounded work / sol_implementer |
|
||||
| S-SCHEDULER-03 | P2 / S-SCHEDULER-02; Storage durable conditional-batch gate | Persistence port, versioned records, exclusive ownership, recovery cursor and attempts | Crash at every acknowledgement boundary neither loses admitted occurrence nor claims exactly-once effects / astra_implementer |
|
||||
| S-SCHEDULER-04 | P3 / S-SCHEDULER-03; Fsm checkpoint/Runtime gates | Workflow handler adapter, updates/removal, retention and operator inspection | Restart retries same ID; failed revision update leaves old policy intact; cap pauses without cursor loss / astra_implementer |
|
||||
| S-SCHEDULER-05 | P4 / S-SCHEDULER-04; Coordination/Replication fencing gates | Separate distributed ownership/dispatch adapter | Partitioned former owner cannot commit current ownership work; duplicates remain explicitly deduplicated / astra_implementer |
|
||||
|
||||
## Validation, performance and migration
|
||||
|
||||
CURRENT aggregate regression command for reused modules:
|
||||
`ctest --test-dir /tmp/voidlibrary-discovery-f1f9ba3 --output-on-failure --timeout 60`;
|
||||
not rerun here. PROPOSED Scheduler checks need NEW targets and persistence fixtures:
|
||||
crash after cursor/claim/effect/completion sync, lost success reply, corrupted record,
|
||||
disk full, duplicate handler callback, delayed cancellation, full retention, job edit
|
||||
during running attempt, DST fold/gap, timezone revision, wall-clock reversal, and
|
||||
coalescing millions of missed slots under the per-pass cap. Use Time injection and
|
||||
crash subprocesses; do not infer persistence from in-memory tests.
|
||||
|
||||
Measure dispatch-lag and durable-admission p50/p95/p99, jobs/second, recovery throughput,
|
||||
allocations, peak RSS/CPU, store size and build cost under [PERFORMANCE](../PERFORMANCE.md).
|
||||
No measurements ran here. There is no old Scheduler API to preserve; retain Fsm's
|
||||
local timer adapters while adopting Async clocks. Persisted formats receive explicit
|
||||
version readers and offline validate/upgrade tooling before incompatible changes.
|
||||
Keep original store/checkpoint until upgraded validation succeeds; rollback after new
|
||||
handler effects follows application idempotency/compensation, not record deletion.
|
||||
See [MIGRATION](../MIGRATION.md), [VALIDATION](../VALIDATION.md),
|
||||
[DEPENDENCIES](../DEPENDENCIES.md) and [DELIVERY](../DELIVERY.md).
|
||||
Loaded 100 of 360 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user