180 Commits
Author SHA1 Message Date
faumaray b3c566ed4d Merge pull request 'Build containers, toolchains and portability fixes' (#35) from chore/toolchains-and-portability into main 2026-12-03 08:10:30 +00:00
faumaray d5cfd9cd7a chore(build): containers, toolchains and portability fixes 2026-12-03 08:10:22 +00:00
faumaray aebc38791a chore(build): containers, toolchains and portability fixes 2026-12-03 08:10:18 +00:00
faumaray c8f0113d48 chore(build): containers, toolchains and portability fixes 2026-12-03 08:10:14 +00:00
faumaray 12ba8d8e2c chore(build): containers, toolchains and portability fixes 2026-12-03 08:10:10 +00:00
faumaray 496d9fc582 chore(build): containers, toolchains and portability fixes 2026-12-03 08:10:07 +00:00
faumaray 5a74233a4d chore(build): containers, toolchains and portability fixes 2026-12-03 08:10:02 +00:00
faumaray 774df0fd1e chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:58 +00:00
faumaray f8e183b7ab chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:54 +00:00
faumaray 216a14e6fa chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:52 +00:00
faumaray 7686be1b23 chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:47 +00:00
faumaray 71fcad80d3 chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:44 +00:00
faumaray 905e44635e chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:42 +00:00
faumaray 5d5a8bf345 chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:40 +00:00
faumaray fe6e2124ad chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:36 +00:00
faumaray f9bde1d19f chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:34 +00:00
faumaray 65595362e2 chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:32 +00:00
faumaray 43d94e2837 chore(build): containers, toolchains and portability fixes 2026-12-03 08:09:30 +00:00
faumaray f6002c1996 Merge pull request 'Bounded PCM playback with owned samples and voice lifetimes (#18)' (#34) from issue/18-windows-pcm-playback into main 2026-12-03 08:08:41 +00:00
faumaray 706383e13f Merge pull request 'Bounded Lua evaluator with transactional host results (#17)' (#33) from issue/17-bounded-lua into main 2026-12-03 08:08:39 +00:00
faumaray 81e1d54ac3 Merge pull request 'Bounded admission gated on an exact retained publication (#16)' (#32) from issue/16-publication-gated-queue into main 2026-12-03 08:08:37 +00:00
faumaray f57b508b0a Merge pull request 'Deterministic completion-order helpers (#15)' (#31) from issue/15-completion-observer into main 2026-12-03 08:08:35 +00:00
faumaray b381d682c8 Merge pull request 'Bounded sparse 3D pages with atomic revision-checked batches (#14)' (#30) from issue/14-sparse-page-table into main 2026-12-03 08:08:33 +00:00
faumaray 8c576fdcbf Merge pull request 'Bounded epoch-qualified revision read sets (#13)' (#29) from issue/13-revision-read-set into main 2026-12-03 08:08:31 +00:00
faumaray 63eecc32c7 Merge pull request 'Bounded 3D grid-ray traversal with a documented tie policy (#12)' (#28) from issue/12-grid-ray into main 2026-12-03 08:08:29 +00:00
faumaray 86bde8b172 Merge pull request 'Checked Euclidean division for signed grid coordinates (#11)' (#27) from issue/11-euclidean-division into main 2026-12-03 08:08:26 +00:00
faumaray a0e4bfa941 Merge pull request 'Versioned deterministic random stream state and bounded draws (#10)' (#26) from issue/10-versioned-rng-state into main 2026-12-03 08:08:24 +00:00
faumaray 6c5c2dcd93 Merge pull request 'Atomic reservations and repeatable transfers in an account ledger (#8)' (#24) from issue/8-account-ledger into main 2026-12-03 08:08:22 +00:00
faumaray 86510f99f0 Merge pull request 'Instance-owned restorable id sequences with checked exhaustion (#7)' (#23) from issue/7-restorable-id-sequences into main 2026-12-03 08:08:21 +00:00
faumaray a5f21c6374 Merge pull request 'Epoch-scoped request ledger with conflicting-retry detection (#6)' (#22) from issue/6-request-ledger into main 2026-12-03 08:08:19 +00:00
faumaray 2474292462 Merge pull request 'Immutable snapshot publication with epoch/revision identity (#5)' (#21) from issue/5-immutable-publication into main 2026-12-03 08:08:17 +00:00
faumaray 34cfd9cb39 Merge pull request 'Deterministic package resolver with source diagnostics (#4)' (#20) from issue/4-package-resolver into main 2026-12-03 08:08:15 +00:00
faumaray 72733e2b93 Merge pull request 'Bounded Windows read coverage and sharing documentation (#9)' (#25) from issue/9-windows-bounded-read into main 2026-12-03 08:08:13 +00:00
faumaray dc18d64b18 Merge pull request 'Windows x64 transactional file replacement (#3)' (#19) from issue/3-windows-transactional-replace into main 2026-12-03 08:08:02 +00:00
faumaray caebb7f7f1 feat(System): bounded PCM playback with owned samples and voice lifetimes (#18) 2026-12-03 07:03:09 +00:00
faumaray df2ed107e2 feat(System): bounded PCM playback with owned samples and voice lifetimes (#18) 2026-12-03 07:03:05 +00:00
faumaray e8565c6857 feat(Script): bounded Lua evaluator with transactional host results (#17) 2026-12-03 07:02:57 +00:00
faumaray 2c6e4eab82 feat(Script): bounded Lua evaluator with transactional host results (#17) 2026-12-03 07:02:55 +00:00
faumaray 359e0630c7 feat(Script): bounded Lua evaluator with transactional host results (#17) 2026-12-03 07:02:53 +00:00
faumaray 025d97c6f6 feat(Script): bounded Lua evaluator with transactional host results (#17) 2026-12-03 07:02:50 +00:00
faumaray 08038000cc feat(Script): bounded Lua evaluator with transactional host results (#17) 2026-12-03 07:02:48 +00:00
faumaray ba49098798 feat(Script): bounded Lua evaluator with transactional host results (#17) 2026-12-03 07:02:45 +00:00
faumaray 60860d167a feat(Async): bounded admission gated on an exact retained publication (#16) 2026-12-03 07:02:35 +00:00
faumaray 5a076cd8f2 feat(Async): bounded admission gated on an exact retained publication (#16) 2026-12-03 07:02:33 +00:00
faumaray 82c3558524 feat(Testing): deterministic completion-order helpers (#15) 2026-12-03 07:02:26 +00:00
faumaray 3953891511 feat(Testing): deterministic completion-order helpers (#15) 2026-12-03 07:02:24 +00:00
faumaray ba3c5a6734 feat(Containers): bounded sparse 3D pages with atomic revision-checked batches (#14) 2026-12-03 06:53:44 +00:00
faumaray 00eefe0521 feat(Containers): bounded sparse 3D pages with atomic revision-checked batches (#14) 2026-12-03 06:53:42 +00:00
faumaray b062e759ba feat(Algorithms): bounded epoch-qualified revision read sets (#13) 2026-12-03 06:53:36 +00:00
faumaray dddcc2b2f0 feat(Algorithms): bounded epoch-qualified revision read sets (#13) 2026-12-03 06:53:34 +00:00
faumaray 7d0ed43f76 feat(Algorithms): bounded 3D grid-ray traversal with a documented tie policy (#12) 2026-12-03 06:53:29 +00:00
faumaray acd4ff40f0 feat(Algorithms): bounded 3D grid-ray traversal with a documented tie policy (#12) 2026-12-03 06:53:27 +00:00
faumaray f100b4c89e feat(Math): checked Euclidean division for signed grid coordinates (#11) 2026-12-03 06:53:21 +00:00
faumaray 4f67fd2b93 feat(Math): checked Euclidean division for signed grid coordinates (#11) 2026-12-03 06:53:17 +00:00
selikhov 2e8afc471b feat(Math): versioned Xoshiro state and portable bounded draws (#10)
- Public, versioned State (algorithm identity "xoshiro256**", schema
  version 1, four words in s0..s3 order) so consumers can define their
  own wire format.
- restore() validates version and rejects the absorbing all-zero state
  without touching the current stream; from_state() builds a generator
  from saved state.
- bounded(n): unbiased rejection sampling in [0, n). Documented
  zero-bound policy: n == 0 and n == 1 return 0 without consuming
  randomness.
- 7 new tests freeze raw/bounded/state outputs for seed 42 (portable
  across targets), verify save/restore suffix equality, invalid-state
  rejection, zero/one bounds, large non-power-of-two ranges,
  independent interleaved streams and discard equivalence.
2026-12-03 09:46:15 +03:00
selikhov f3176c2b54 feat(System): bounded Windows read through one handle, with coverage (#9)
The Windows read_file_bounded path was implemented together with #3 using
a single CreateFileW handle. This adds the #9 acceptance coverage and
documents the contract:

- The size is checked before allocation and every chunk is re-checked, so
  growth after the initial size check still fails with limit_exceeded and
  never returns partial contents.
- Windows shares read/write/delete, so another process may append,
  rename or replace the path while a background read is pending; the
  read continues from the opened handle and sees one coherent version.
- Tests: empty, binary, Unicode path, exact limit, over limit before
  reading, and (POSIX) a stream that grows past the limit mid-read.
2026-12-03 09:45:14 +03:00
selikhov a4851c2c20 feat(Containers): restorable account ledger with atomic reservations (#8)
- AccountLedger: caller-keyed accounts (owner, balance, capacity) with
  atomic multi-account reserve, release without ownership change and
  transfer to the destination (next) owner.
- Explicit outcomes for insufficient balance, capacity exhaustion,
  overflow, unknown account/operation, invalid phase and limits.
- Every committed phase is recorded by operation id, so repeated
  requests replay the recorded outcome instead of applying twice;
  failed attempts change nothing and remain retryable.
- State is a plain value: save()/restore() survive a partially completed
  transfer and replay applies exactly once after restore.
- 11 tests: conservation, last-unit contention, atomic multi-key failure,
  cancellation before pickup and during delivery, restore/replay,
  overflow, operation-id conflict, account/operation limits and invalid
  restore state.
2026-12-03 09:44:21 +03:00
selikhov f2b002eb26 feat(Core): instance-owned restorable id sequences with checked exhaustion (#7)
- IdSequence<Tag, Rep> is per-instance, copyable and restorable, so two
  worlds in one process allocate independently and a saved high-water
  mark replays exactly.
- next()/next_batch() check exhaustion before mutating; failed requests
  leave the sequence and application records untouched. Batches are
  all-or-nothing.
- High-water only moves forward: erased records keep their ids retired.
- Fixed-width Rep (default uint64_t) plus an explicit exhausted flag make
  saved state canonical and portable; restore() rejects impossible state.
- 10 standalone tests cover independence, erase/restore, copy replay,
  atomic batches, exhaustion, final-boundary batches and invalid state.
2026-12-03 09:41:50 +03:00
selikhov afd4d99a2d feat(Messaging): epoch-scoped request ledger with conflict detection (#6)
- RequestLedger<Payload, Result, PayloadEqual> keys idempotent host
  requests by (epoch, trusted client, request id).
- check() admits the first request, replays a recorded result for an
  exact repeat (including a rejected outcome), reports in_progress while
  the request is still running, rejects a changed payload and rejects
  keys from an obsolete/future epoch before side effects.
- record() stores the caller-defined result exactly once; results are
  never overwritten.
- Capacity/admission/archival is explicit: entries are never evicted
  within an epoch (capacity_exceeded instead), and advancing the epoch
  clears memory. An old request number therefore cannot execute a second
  time after cleanup.
- 8 tests: replay, rejected outcome, payload conflict, delayed retry
  after newer operations, epoch rollover, capacity pressure, in-flight
  state/immutable result and non-advancing epoch rejection.
2026-12-03 09:40:47 +03:00
selikhov 37c3cd4383 feat(Core): immutable snapshot publication with epoch/revision identity (#5)
- Publication<T>: single-writer, multi-reader publication of complete
  immutable values. acquire() returns a retainable Snapshot; a retained
  snapshot stays coherent across any number of later publishes and keeps
  the value alive until the last reader releases it.
- publish() is compare-and-publish over one atomic (value + version)
  state: an expected epoch must match, and the new version must advance
  (higher epoch, or same epoch with higher revision). Rejected publishes
  leave the last good publication untouched, so a failed preparation
  cannot corrupt readers.
- publish_next()/publish_epoch() convenience helpers.
- 7 tests: retained snapshots, stale-epoch rejection, non-advancing
  revision, epoch reset, last-reader resource release, failed
  preparation preservation and concurrent reader coherence.
2026-12-03 09:39:56 +03:00
selikhov d30384d981 feat(Update): deterministic package resolver with diagnostics (#4)
- resolve_packages() takes caller-supplied package descriptions (id,
  exact version, content digest, exclusive capabilities, dependency
  ranges) plus selected root ids and returns an exact dependency set.
- Deterministic: canonical input ordering, descending SemVer candidate
  order and canonical requirement order make the result invariant under
  permutation of installed/selected input.
- Frozen PackageIdentity compares build metadata and content digest in
  addition to SemVer precedence, so equal-precedence rebuilds are never
  conflated; ambiguous same-id/same-precedence inputs are rejected.
- Actionable diagnostics carry kind, input package, field
  (e.g. dependencies[1].range) and related id: missing dependency,
  incompatible version, cycle, ambiguity, competing exclusive providers.
- Bounded package/edge/search-node limits with backtracking search.
- 13 standalone tests cover closure, order invariance, diagnostics,
  backtracking, cycles, capabilities, frozen identity and limits.
2026-12-03 09:38:27 +03:00
selikhov 51ceb081ac feat(System): transactional file replacement on Windows x64 (#3)
- replace_file/atomic_write gain a Win32 implementation: exclusive
  CREATE_NEW staging in the destination directory, WriteFile loop,
  FlushFileBuffers for durable_sync, MoveFileExW(MOVEFILE_REPLACE_EXISTING
  [| MOVEFILE_WRITE_THROUGH]) for atomic publication and a parent-directory
  flush for durability.
- read_file_bounded/write_file implemented on Windows so the contract is
  usable and testable there.
- Documented Windows guarantees per durability level, including the
  application-crash vs power-loss distinction and post-rename failure
  reporting (sync_parent + visible_on_disk + durability_unknown).
- Added a portable contract test (first creation, replacement, Unicode
  name, pre-publication faults preserving old contents, post-publication
  fault reporting, no staging leftovers, live destination never deleted)
  and a concurrent-writer atomicity test.
2026-12-03 09:34:50 +03:00
faumaray 7b0fea6095 Merge branch 'feat/roadmap-p2-wave11' (Wave 11 Async, Time, IO, Runtime execution-path completion) 2026-12-01 22:33:50 +03:00
faumaray 3c018d6dad docs(workflow): record Wave 11 completion and verification evidence 2026-12-01 22:33:50 +03:00
faumaray c6de7842f7 fix(wave11): resolve adversarial review findings in EventBus, IO, and Runtime 2026-12-01 22:03:35 +03:00
faumaray 7bea7df46d feat(runtime): add 8-step Host start, SignalGate, and 11-phase structured shutdown (S-RUNTIME-02/03) 2026-12-01 16:58:29 +03:00
faumaray 50029e1f7b feat(io): add Driver::run, embedded pump_until, and shutdown conformance tests (S-IO-04) 2026-12-01 16:25:20 +03:00
faumaray ef85ce07b7 feat(async): add EventBus injected/joined lifecycle and Observable reentrancy queue (M-ASYNC-05) 2026-12-01 10:27:50 +03:00
faumaray 1e752da590 feat(io): add positional File workers, sync, bounded shutdown core, and epoll D1 fixes (S-IO-03) 2026-12-01 10:15:03 +03:00
faumaray b2c84114fe feat(async): add ThreadExecutor, FuturePool, AsyncChannel, bounded parallel_for, and spawn fix (M-ASYNC-04) 2026-12-01 10:15:03 +03:00
faumarayandClaude Opus 5.5 5c24f8e84f feat(async): add retry_async over TimerQueue and deadline-domain conformance (M-TIME-03 B1b)
- NEW Async/Retry.hpp: retry_async drives RetryState with the TimerQueue's
  injected clock, awaits backoff via sleep_until, resumes only after a clean
  sleep (any sleep error ends the retry), preserves success after stop,
  supports Task-returning and move-only callables
- Tests: AsyncRetry (15), DeadlineDomains blocking-retry manual-clock case

Review: W11-REVIEW-B1b READY (deviation accepted; doc fix applied by root)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 00:35:20 +03:00
faumarayandClaude Opus 5.5 3ce21be53a docs(wave11): record review/verification progress
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 00:34:21 +03:00
faumarayandClaude Opus 5.5 09789ae141 docs(wave11): S-IO-04 and combined S-RUNTIME-02/03 specs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 00:20:28 +03:00
faumarayandClaude Opus 5.5 7c1fd3cac1 docs(workflow): record merge-to-main requirement (D-043)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 00:07:35 +03:00
faumarayandClaude Opus 5.5 4ea63844f0 docs(wave11): record M-TIME-03 B1 verification
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 23:36:37 +03:00
faumarayandClaude Opus 5.5 99a1100bb1 feat(async,time): add injected-clock TimerQueue and clock saturation helpers (M-TIME-03 B1)
- NEW Async/Timer.hpp: TimerQueue (stable (deadline, seq) min-heap, bounded
  tombstones, explicit poll_expired, callbacks outside the lock, close/destroy
  deliver TimerEvent::closed), shared-state TimerHandle safe after queue
  destruction, sleep_until/sleep_for settling exactly once and resuming via
  post_completion; documented sleep-task lifetime and cancel-under-lock rules
- Time/Clock.hpp: saturating_add, deadline_after
- Tests: TimerQueue (15), DeadlineDomains (2), ClockSaturation (1); race loops
  count failures to stay under the runner's 1,000-assertion retention (X-QA-02)

Review: W11-REVIEW-B1 (CHANGES_REQUIRED F1-F3 fixed by root: test counters,
header lifetime/cancel docs)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 23:36:37 +03:00
faumarayandClaude Opus 5.5 95785ed47a docs(wave11): B1b and M-ASYNC-05 specs, STATE checkpoint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 23:32:39 +03:00
faumarayandClaude Opus 5.5 c6789e7dbf docs(wave11): S-IO-03 and M-ASYNC-04 specs with review amendments (D-042)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 19:45:03 +03:00
faumarayandClaude Opus 5.5 26edf653e3 feat(functional): add pure RetryState and named retry_blocking adapter (M-FUNCTIONAL-03)
- NEW std-only Functional/RetryState.hpp: RetrySpec/BackoffSpec validation,
  begin/next/resume/succeed decisions, saturating backoff, Full/Equal jitter,
  explicit no_deadline, random_device-seeded default engine, final stop decisions
- Retry.hpp: relocate JitterMode, add SteadyNow/ThreadSleep/BlockingRetryOptions
  and retry_blocking with injected now/sleep; saturating wait computation
- 1.x retry/retry_while/retry_or_throw unchanged (zero-attempt defect pinned)
- Tests: RetryState (13), RetryBlocking (10)

Review: W11-REVIEW-A1 READY (P3 fixes 1, 2, 5 applied by root)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 19:34:46 +03:00
faumarayandClaude Opus 5.5 99203ce1f3 docs(wave11): record PREFLIGHT-2 findings and contract amendment R2 (D-040)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 18:57:11 +03:00
faumarayandClaude Opus 5.5 a8a9249101 docs(wave11): add A1/B1 specs, VoidForge backlog items, push authorization (D-039)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 18:47:03 +03:00
faumarayandClaude Opus 5.5 7f95f89d52 chore(wave11): plan execution-path backfill, reserve error codes, update area plans
- Audit roadmap vs TASKS (D-033); scope Wave 11 to M-FUNCTIONAL-03, M-TIME-03,
  M-ASYNC-04/05, S-IO-03/04, S-RUNTIME-02/03 (D-034..D-036)
- Schedule VoidForge upstream requests after Wave 11 (D-037)
- Persist planner output, PREFLIGHT findings and contract addendum (D-038)
- Add AsyncErrorCode::closed, IoErrorCode::sync_failed,
  RuntimeErrorCode::{self_join, shutdown_incomplete}
- Update Functional/IO/Runtime area plans and MIGRATION per C-13

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 18:31:14 +03:00
faumaray 38436b18c8 update version
Release / release (push) Failing after 5m4s
Signed-off-by: faumaray <faumaray@gmail.com>
2026-11-29 07:06:52 +03:00
faumaray 7d7d23ec0a Merge branch 'feat/roadmap-p3-wave10' (P3 Discovery, Scheduler, Messaging) 2026-11-27 05:55:45 +03:00
faumaray f3f66e0c8c docs(workflow): record Wave 10 P3 Discovery, Scheduler, and Messaging verification 2026-11-27 05:55:45 +03:00
faumaray 60ee28e4ca feat(messaging): implement P3 S-MESSAGING-01..04 Messaging queue, StorageQueue/OutboxInbox, and MessagingRpc adapter 2026-11-27 05:45:43 +03:00
faumaray aaeab50758 feat(scheduler): implement P3 S-SCHEDULER-01..04 Scheduler engine, calendar/DST, and SchedulerStorage durable store 2026-11-27 05:38:06 +03:00
faumaray ec8c0bd40a feat(discovery): implement P3 S-DISCOVERY-01..04 Discovery catalog and optional DiscoveryRpc adapter 2026-11-27 05:25:43 +03:00
faumaray 0cf187d664 docs(wave10): add P3 Discovery, Scheduler, and Messaging specs and error domains 2026-11-27 05:14:52 +03:00
faumaray 65ad9b3f31 Merge branch 'feat/roadmap-p2-wave9' (P2 Net, TestingMock, ShortUrl, RPC) 2026-11-27 01:37:15 +03:00
faumaray 385a441b0b docs(workflow): record Wave 9 P2 Net, TestingMock, ShortUrl, and RPC verification 2026-11-27 01:37:15 +03:00
faumaray 5184d1cf8c feat(rpc): implement P2 S-RPC-01..03 Wire v1 binary codec and unary HTTP/1.1 RPC subsystem 2026-11-27 01:27:32 +03:00
faumaray 691808eab6 feat(shorturl): complete P2 M-SHORTURL-01..04 V2 local, storage, and remote providers with frozen V1 2026-11-27 01:27:32 +03:00
faumaray 658c21a2fa feat(testing-mock): complete P2 M-TESTINGMOCK-01..04 sessions, action-outside-lock, move-only, combinators 2026-11-27 01:15:36 +03:00
faumaray 86d777eae6 feat(net): complete P2 M-NET-01..05 codec, pool, safe static open, redirects, and RFC 6455 WebSocket 2026-11-27 01:15:36 +03:00
faumaray 700024a24d docs(wave9): add P2 Net, TestingMock, ShortUrl, and RPC task specs and error domains 2026-11-26 22:58:30 +03:00
faumaray 3e254055e0 Merge branch 'feat/upstream-vbs-requests' (VL-001..VL-013) 2026-11-26 22:01:33 +03:00
faumaray bb0b2e1701 docs(workflow): record VL-001..VL-013 verification and completion state 2026-11-26 22:01:33 +03:00
faumaray 9920bfdaac fix(net): scope GCC -Wno-tsan to Http.cpp and fix StallServer race 2026-11-26 22:00:17 +03:00
faumaray 66baae74a0 feat(net): implement VL-004 HttpServer and VL-005 streaming HttpClient with secure TLS 2026-11-26 21:47:15 +03:00
faumaray 22c8538754 feat(crypto,archive): implement VL-007 built-in hashes and VL-006 archive creation/gzip/tar fallback 2026-11-26 20:55:45 +03:00
faumaray b50131f52e feat(system,config,sqlite): implement VL-001, VL-003, VL-010, VL-011 2026-11-26 20:45:52 +03:00
faumaray adfc8548dc feat(data,text,testing): implement VL-002 TOML, VL-008 StrictJson UTF-8, VL-009 native tests, and VL-013 Semver shorthands 2026-11-26 20:27:42 +03:00
faumaray 53d42bda42 merge: Wave 8 P2 Service, Plugin, Configuration, and Fsm lifecycle hardening 2026-11-26 20:19:09 +03:00
faumaray 9be51134e8 docs(workflow): record Wave 8 Service, Plugin, Configuration, and Fsm verification 2026-11-26 20:19:09 +03:00
faumaray cb988fa985 fix(test): hold owning ServiceHandle across hot-reload calls in FsmServiceHotReload 2026-11-26 17:10:54 +03:00
faumaray 1a54f3857e fix(plugin): use POSIX pthreads in C11 test fixture for TSan compatibility 2026-11-26 17:10:54 +03:00
faumaray 40b579d683 fix(fsm): publish terminal status after exit hooks and join worker before derived teardown 2026-11-26 17:10:54 +03:00
faumaray ef5312c4b3 feat(fsm): structured scopes, race-loser join, boundary checkpoints, and bounded supervision 2026-11-26 16:51:35 +03:00
faumaray 1dc51d5c43 feat(configuration): bounded schemas, provenance/redaction, and async transactional ReloadController 2026-11-26 16:30:30 +03:00
faumaray a24e086e47 feat(plugin): add CAbi.h v1, CModuleHost quiesce/reload/pins, and unlocked PluginManager staging 2026-11-26 16:16:29 +03:00
faumaray 1474a69ab1 feat(service): immutable snapshots, owning ServiceHandle, DAG lifecycle, and ServicePlugin split 2026-11-26 16:03:31 +03:00
faumaray 6b3dededac chore(wave8): reserve lifecycle error domains, support .h headers, add task specs 2026-11-26 15:57:01 +03:00
faumaray d83d0f4533 merge: Wave 7 P2 Sqlite, SqliteAsync, and Storage engine 2026-11-26 15:48:13 +03:00
faumaray 76ad7d1b39 docs(workflow): record Wave 7 verification evidence and tasks 2026-11-26 15:48:13 +03:00
faumaray 84e6fe81ed fix(sqlite): eliminate lock-order inversion between progress trampoline and interrupt_mu 2026-11-26 15:43:02 +03:00
faumaray fdf0da5ca8 feat(storage): implement original V1 durable Storage engine, tools, and async adapter 2026-11-26 15:32:43 +03:00
faumaray 427cc9a843 feat(sqlite): harden Sqlite lifecycle/transactions/migrations/ops and add SqliteAsync pool 2026-11-26 15:17:59 +03:00
faumaray 9925ea1764 docs(workflow): add Wave 7 task specs for Sqlite, SqliteAsync, and Storage 2026-11-25 21:15:10 +03:00
faumaray 43922d1ad4 merge: Wave 6B P2 Crypto, Security, Archive, and Update hardening 2026-11-25 21:12:30 +03:00
faumaray 9ef425c36c docs(workflow): record Wave 6B verification evidence and tasks 2026-11-25 21:12:30 +03:00
faumaray 47736cb6ce feat(update): fix schema-3 verify-before-parse and add replay floor, TrustStore, pin pruning, and InstallCoordinator 2026-11-25 21:04:52 +03:00
faumaray 00d7478335 feat(archive): add streaming Reader, atomic StagedTree publication, reproducible creation, and isolated worker 2026-11-25 20:54:10 +03:00
faumaray 713d2dc656 feat(security): add SecureBuffer, VSEC envelopes, authorization, and SecurityAsync Authenticator 2026-11-25 20:44:31 +03:00
faumaray eb42228604 feat(crypto): harden Crypto primitives and add optional CryptoAsync adapter 2026-11-25 06:28:50 +03:00
faumaray 8a1c15f9c0 docs(workflow): add Wave 6B task specs for Crypto, Security, Archive, Update 2026-11-25 06:03:36 +03:00
faumaray acd77ee67a feat(data): support RFC 8259 decimal numbers in StrictJson 2026-11-25 05:59:21 +03:00
faumaray 9931c5ffc4 Merge feat/roadmap-p2-wave6a: P2 System, SystemAsync, and IPC 2026-11-24 15:37:17 +03:00
faumaray e43eee738c docs(workflow): record Wave 6A verification evidence and tasks 2026-11-24 15:36:45 +03:00
faumaray 39a48d5c0a feat(IPC): add V1 VDIP framed codec, quota reservations, local UDS/pipe transport, full-duplex Session, and IPCOnly consumer (S-IPC-01..03) 2026-11-24 15:27:40 +03:00
faumaray 9a3c5d86ef feat(SystemAsync): add async IO ProcessManager/communicate and shared WatcherService with WatchSubscription (M-SYSTEM-03, M-SYSTEM-04) 2026-11-24 14:46:46 +03:00
faumaray fcdbc063b2 feat(System): harden OwnedFd/Child process spawn, full-duplex bounds, durable replace_file, safe TempFile/TempDir, and SystemOnly consumer (M-SYSTEM-01, M-SYSTEM-02, M-SYSTEM-05) 2026-11-24 14:32:05 +03:00
faumaray 3f67b1ecb7 chore(wave6a): reserve P2 error domains, guard IO pipe SIGPIPE, extend ProcessHelper, and add Wave 6A specs 2026-11-24 10:56:39 +03:00
faumaray 44799602c9 Merge feat/roadmap-p2-wave5: P2 Observability, Resilience, Log, and Stacktrace 2026-11-24 10:39:26 +03:00
faumaray 1e2fb8b5c6 docs(workflow): record Wave 5 (P2 Observability, Resilience, Log, Stacktrace) verification evidence and D-032 2026-11-24 10:39:16 +03:00
faumaray 7b57b355cd feat(Stacktrace): split capture/resolve, add capabilities, bounded resolver cache, safe source snippets, and crash marker (M-STACKTRACE-01..04) 2026-11-24 10:26:24 +03:00
faumaray 3d8dfb0ea2 fix(cmake): check test header requirements against active module headers 2026-11-24 10:26:19 +03:00
faumaray a74a402938 feat(Log): harden LogState facade, bounded Logger delivery/tickets/quarantine, file sync/reopen, redaction, and separate LogConfig (M-LOG-01..05) 2026-11-24 10:16:35 +03:00
faumaray 18a623aa62 feat(Resilience): add validated configs, RAII breaker/resource permits, bounded keyed cleanup, ResilienceAsync composition, and reserve P2 error domains (M-RESILIENCE-01..04) 2026-11-24 10:06:35 +03:00
faumaray fe99051ded feat(Observability): add zero-dep hooks, HookLease, ContextSnapshot, bounded metrics/tracing, and snapshot exporter (S-OBSERVABILITY-01..04) 2026-11-24 09:57:48 +03:00
faumaray 809b6f548d docs(workflow): add Wave 5 (P2 Observability, Resilience, Log, Stacktrace) task specs and error domains 2026-11-24 09:51:55 +03:00
faumaray 1e901ce256 Merge feat/roadmap-p1-wave4b: P1 IO, Runtime, and Testing foundations 2026-11-24 09:42:32 +03:00
faumaray f6c359400a docs(workflow): record Wave 4B (P1 IO, Runtime, Testing) verification evidence 2026-11-24 09:42:23 +03:00
faumaray de8a981893 feat(Testing): add per-run owned reporters, strict config validation, FailureCapture, subprocess isolation, and deterministic property/schedule harness (M-TESTING-02, M-TESTING-03) 2026-11-24 09:36:59 +03:00
faumaray 1b3331e3a8 feat(Runtime): add inert Host, validated RuntimeLimits, EmbeddedResources, and topological ResourceGraph (S-RUNTIME-01) 2026-11-24 09:33:03 +03:00
faumaray 673bb7e8b4 feat(IO): add portable Driver/ByteStream/BufferLease, mock backend, and Linux epoll driver (S-IO-01, S-IO-02) 2026-11-24 09:31:13 +03:00
faumaray 9918ed4760 docs(workflow): add Wave 4B (P1 IO, Runtime, Testing) task specs 2026-11-24 03:57:29 +03:00
faumaray 2e5d1ef5e5 Merge feat/roadmap-p1-wave4a: P1 Algorithms, Unicode, and Async execution foundations 2026-11-24 03:53:02 +03:00
faumaray b0cb598aad docs(workflow): record Wave 4A (P1 Algorithms, Unicode, Async) verification evidence 2026-11-24 03:53:02 +03:00
faumaray c75056fe07 feat(Async): add OperationOptions, OperationState, ResumeTicket, TaskScope, and bounded executor tickets (M-ASYNC-02, M-ASYNC-03) 2026-11-24 03:48:55 +03:00
faumaray 4369fde867 feat(Unicode): add Unicode 17.0.0 manifest and strict/repair/streaming UTF codecs (S-UNICODE-01, S-UNICODE-02) 2026-11-24 03:38:53 +03:00
faumaray bfd6246d32 feat(Algorithms): add indexed graph views, work budgets, and iterative traversals/topology (S-ALGORITHMS-02) 2026-11-24 03:36:10 +03:00
faumaray 710a9c1833 docs(workflow): add Wave 4A (P1 Algorithms, Unicode, Async) task specs 2026-11-24 03:33:45 +03:00
faumaray 5754a7fd06 Merge feat/roadmap-p0-p1-foundations: P0 baseline and P1 foundation/data/containers/binary/text waves 2026-11-24 03:29:32 +03:00
faumaray 155b47d4d5 docs(workflow): record Wave 3 (P1 Text, Containers, Binary, Data) verification evidence 2026-11-24 03:29:32 +03:00
faumaray 692f5ba5b2 feat(Data): add exact 64-bit signed/unsigned JSON numbers and checked conversion (M-DATA-02) 2026-11-24 03:25:17 +03:00
faumaray eacb8a4602 feat(Binary): add Writer, ByteBuffer, DecodeBudget, and explicit endian codecs (M-BINARY-02, M-BINARY-03) 2026-11-24 03:21:02 +03:00
faumaray 9ac76bbcf9 feat(Containers): fix pool lease lifetimes/budgets and non-spinning MPSC ring (M-CONTAINERS-02, M-CONTAINERS-03) 2026-11-24 03:20:04 +03:00
faumaray 883bbdcf38 feat(Text): add ASCII-explicit helpers and bounded split/replace/repeat/join (M-TEXT-02) 2026-11-24 03:14:41 +03:00
faumaray 68963fcd1d docs(workflow): add Wave 3 (P1 Text, Containers, Binary, Data) task specs 2026-11-24 03:12:16 +03:00
faumaray 1d34a93a3f docs(workflow): record P1 Gate 1 verification evidence 2026-11-24 03:00:07 +03:00
faumaray 6cac781f3a fix(Math): guard 64-bit precision shift in checked_cast for long double 2026-11-24 02:55:35 +03:00
faumaray 91e2beb5d4 feat(Math): add span-safe parsers, checked_cast, and checked_mul_add (M-MATH-02) 2026-11-24 02:53:46 +03:00
faumaray 4d48f2a8f2 feat(Memory): add Memory subsystem with BudgetResource, Arena, and BlockPool (S-MEMORY-02..04) 2026-11-24 02:49:28 +03:00
faumaray 4227348051 feat(Time): add MonotonicClock/CivilClock/ManualClock and bounded Stopwatch (M-TIME-02) 2026-11-24 02:46:25 +03:00
faumaray 7f3395cb74 feat(Functional): add compact Status, ErrorKind/ErrorCode, bounded chains, and Adapters (M-FUNCTIONAL-02) 2026-11-24 02:45:17 +03:00
faumaray 284d9635b5 fix(Testing): prevent VoidTestScanner from dropping tests after unbalanced brackets 2026-11-24 02:44:47 +03:00
faumaray cbc900412b feat(Core): detach Uuid from Math, add CheckedBits and portable Hash (M-CORE-02, M-CORE-03) 2026-11-24 02:39:35 +03:00
faumaray 8d28c7e3c4 docs(workflow): add P1 Gate 1 foundation implementation task specs 2026-11-24 02:37:43 +03:00
faumaray 196ed251f9 bench: add reproducible foundation benchmark harness and record P0 baseline (X-BASE-05) 2026-11-24 02:35:43 +03:00
faumaray c64fa93373 build: add compiler, reflection, and sanitizer capability probes (X-BASE-04) 2026-11-24 02:34:11 +03:00
faumaray cd6fc7e5f5 build: reconcile module dependency closures, Log.hpp ownership, and consumer tests (X-BASE-03) 2026-11-24 02:28:33 +03:00
faumaray e385746b74 build: mark fetched Boost headers as SYSTEM for clean -Werror on GCC 16 (X-BASE-02) 2026-11-24 02:15:22 +03:00
faumaray 340acaec34 test(System): replace host /bin utility assumptions with VoidProcessHelper (X-BASE-01) 2026-11-24 02:10:06 +03:00
faumaray 563da02c0f docs(workflow): add P0 baseline implementation task specs (X-BASE-01..05) 2026-11-24 02:05:08 +03:00
faumaray faa8a5198d docs: add expansion roadmap and workflow baseline 2026-11-24 02:04:38 +03:00
faumaray f1f9ba375b log: snapshot scopes through the shared library boundary
Avoid consumer-inline access to DLL-owned thread-local storage by copying
the scope span returned by the existing out-of-line current_scopes function.
Keep the owned snapshot at its original initializer position and preserve
filtering, scope order and exception behavior.

Add direct-call regressions for nested buffered ownership, overlapping
producer scopes and immediate sink reentry. All 14 focused shared-library
tests pass on Linux and the two-file candidate passed independent review.
Native UCRT64 linking and runtime verification follow through Engine CI.
2026-11-15 03:25:25 +03:00
faumarayandClaude Opus 5.5 5464e9fa35 Testing: an exception that escapes a test fails it
execute_test and execute_test_parallel set Failed when the body threw,
then recomputed the state from the recorded assertions alone, so a test
whose body threw before any failed assertion was reported as passed.
The state now stays Failed when an unhandled exception was recorded.
Found by a Void Engine test that threw on its first line and passed;
it hid two failing engine tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:31:09 +03:00
faumarayandClaude Opus 5.5 cd237207d4 Log: one facade state per process, in a LogState library
Release / release (push) Failing after 5s
Void::Log::Detail::state() was a static in an inline function, which is
one object per DLL on Windows: a sink set from one DLL never saw events
from another (a plugin's log lines, or any module but the one that set
it). The state now lives in Void::LogState, a small compiled module with
no dependencies, linked by every module that includes the facade
(Async, System, Stacktrace, Testing; the rest through them), so
INTERFACE modules can still log and no dependency cycle appears.

Tests: VoidTests 1242 pass, 3 skip; run_with_args_builds_correct_argv
and run_stdin_forwarded_to_cat fail on NixOS, which has no
/bin/echo or /bin/cat (exit 127).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 05:43:45 +03:00
faumarayandClaude Opus 5.5 20893d1bf3 Module selection, and test signal handlers on Windows
VOID_ENABLED_MODULES (cache, empty for all) configures only the named
modules and their INTERNAL_DEPS, followed transitively; OPTIONAL_DEPS
are used when named too. A project embedding Void configures what it
links, so the packages of modules it never builds (LibArchive, OpenSSL,
SQLite, libsodium) need not exist, as in a mingw-w64 cross build.

Testing's crash handlers use the C runtime's signal() on Windows, which
has no sigaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 05:13:42 +03:00
653 changed files with 158784 additions and 5255 deletions

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
{
"name": "VoidLibrary (GCC 16, CMake 4, Ninja)",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
"workspaceFolder": "/src",
"workspaceMount": "source=${localWorkspaceFolder},target=/src,type=bind",
"remoteUser": "root",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"twxs.cmake"
],
"settings": {
"cmake.generator": "Ninja",
"cmake.configureSettings": {
"CMAKE_CXX_COMPILER": "g++-16",
"CMAKE_C_COMPILER": "gcc-16",
"CMAKE_BUILD_TYPE": "Debug"
},
"C_Cpp.default.cppStandard": "c++26"
}
}
},
"postCreateCommand": "cmake --version && g++-16 --version && ninja --version"
}
+64
View File
@@ -0,0 +1,64 @@
# Windows builds: MSYS2 (native) and MinGW-w64 (cross)
## MSYS2 (native Windows, recommended for a full build)
Install the MINGW64 toolchain and the optional libraries used by the modules:
```bash
pacman -S --needed base-devel \
mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-ninja \
mingw-w64-x86_64-boost \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-libsodium \
mingw-w64-x86_64-libarchive \
mingw-w64-x86_64-sqlite3 \
mingw-w64-x86_64-lua
```
Then, from a **MINGW64** shell (not the MSYS shell):
```bash
cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build
ctest --test-dir build --output-on-failure
```
Notes:
- C++26 reflection requires GCC 16 or newer (`-freflection`). The build
probes for it; on older GCC some reflection-only tests are skipped.
- `Void::IO` currently has a POSIX (epoll) backend only; select the modules
you need with `-DVOID_ENABLED_MODULES=...` if a module is not yet available
on Windows.
- The Windows branches of `Void::System` (paths, bounded reads, audio) are
compiled by this configuration.
## MinGW-w64 cross build (Linux container)
`Dockerfile.mingw` uses the LLVM-MinGW toolchain (Clang + libc++ + the
MinGW-w64 runtime) on top of Ubuntu, together with CMake 4 and Ninja. The
matching devcontainer is in `.devcontainer/mingw/`.
```bash
docker build -f Dockerfile.mingw -t voidlibrary-mingw .
docker run --rm -v "$PWD:/src" -w /src voidlibrary-mingw bash -lc '
cmake -B build-mingw -S . -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/mingw-w64.cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DVOID_ENABLE_TESTING=OFF \
-DVOID_ENABLED_MODULES="Core;Functional;Containers;Math;Text;Algorithms;Unicode;Time;LogState"
cmake --build build-mingw
'
```
Cross-compiling cannot use the host's Boost/OpenSSL/libsodium/libarchive/SQLite/
Lua libraries. Modules that need them (or the POSIX-only IO backend) are
therefore excluded from a cross build; use MSYS2 on Windows for those.
- The toolchain file accepts GCC- or Clang-based MinGW prefixes and picks
whichever compiler exists.
- `CMAKE_CXX_STANDARD` can be pinned for older toolchains
(`-DCMAKE_CXX_STANDARD=23`); the build probes capabilities against the
selected standard.
+28
View File
@@ -0,0 +1,28 @@
{
"name": "VoidLibrary (MinGW-w64 cross build)",
"build": {
"dockerfile": "../../Dockerfile.mingw",
"context": "../.."
},
"workspaceFolder": "/src",
"workspaceMount": "source=${localWorkspaceFolder},target=/src,type=bind",
"remoteUser": "root",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"twxs.cmake"
],
"settings": {
"cmake.generator": "Ninja",
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "cmake/toolchains/mingw-w64.cmake",
"CMAKE_BUILD_TYPE": "Debug"
},
"C_Cpp.default.cppStandard": "c++26"
}
}
},
"postCreateCommand": "cmake --version && x86_64-w64-mingw32-g++ --version && ninja --version"
}
+6
View File
@@ -0,0 +1,6 @@
build*
.git
.gitea
.github
.dockerignore
Dockerfile
+60 -3
View File
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 4.0.0) cmake_minimum_required(VERSION 4.0.0)
project(Void VERSION 1.2.1 LANGUAGES CXX) project(Void VERSION 1.2.3 LANGUAGES C CXX)
if(PROJECT_IS_TOP_LEVEL) if(PROJECT_IS_TOP_LEVEL)
option(BUILD_SHARED_LIBS "Build Void modules as shared libraries" ON) option(BUILD_SHARED_LIBS "Build Void modules as shared libraries" ON)
elseif(NOT DEFINED BUILD_SHARED_LIBS) elseif(NOT DEFINED BUILD_SHARED_LIBS)
@@ -8,15 +8,27 @@ elseif(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON) set(BUILD_SHARED_LIBS ON)
endif() endif()
option(VOID_ENABLE_TESTING "Build the test suite" ON) 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_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
option(VOID_ENABLE_ASAN "Enable AddressSanitizer (Clang/GCC)" OFF) option(VOID_ENABLE_ASAN "Enable AddressSanitizer (Clang/GCC)" OFF)
option(VOID_ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (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) option(VOID_ENABLE_COVERAGE "Enable code coverage instrumentation" OFF)
set(CMAKE_CXX_STANDARD 26) # C++26 is the default. Cross/toolchain-limited builds (e.g. MinGW-w64
# with an older GCC) may pin a lower standard explicitly.
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 26)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_MODULE_MAP_FORMAT "gcc") if(NOT DEFINED CMAKE_CXX_MODULE_MAP_FORMAT)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_MODULE_MAP_FORMAT "clang")
else()
set(CMAKE_CXX_MODULE_MAP_FORMAT "gcc")
endif()
endif()
set(CXX_SCAN_FOR_MODULES OFF) set(CXX_SCAN_FOR_MODULES OFF)
# <Void/Data/Reflect.hpp>, <Void/Configuration/Bind.hpp>, etc. # <Void/Data/Reflect.hpp>, <Void/Configuration/Bind.hpp>, etc.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16)
@@ -28,10 +40,51 @@ include(CMakePackageConfigHelpers)
set(EXPORT_SET_NAME ${PROJECT_NAME}Targets) set(EXPORT_SET_NAME ${PROJECT_NAME}Targets)
include(cmake/Capabilities.cmake)
void_probe_capabilities()
include(cmake/Module.cmake) include(cmake/Module.cmake)
# Modules to configure, with the modules they need (INTERNAL_DEPS, followed
# transitively); empty configures every module. OPTIONAL_DEPS are used only
# when named too. A project that embeds Void selects what it links, so the
# external packages of modules it never builds (LibArchive, OpenSSL, SQLite,
# libsodium) need not exist, as when cross-compiling.
set(VOID_ENABLED_MODULES "" CACHE STRING
"Void modules to configure (and their internal dependencies); empty for all")
set(_void_selected "")
if(VOID_ENABLED_MODULES)
set(_void_pending ${VOID_ENABLED_MODULES})
while(_void_pending)
list(POP_FRONT _void_pending _void_module)
if(_void_module IN_LIST _void_selected)
continue()
endif()
set(_void_module_file "${CMAKE_CURRENT_SOURCE_DIR}/src/${_void_module}/module.cmake")
if(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/${_void_module}")
message(FATAL_ERROR "[Void] VOID_ENABLED_MODULES names an unknown module '${_void_module}'")
endif()
list(APPEND _void_selected ${_void_module})
if(EXISTS "${_void_module_file}")
file(READ "${_void_module_file}" _void_text)
# The words after INTERNAL_DEPS up to the next keyword or ')'.
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 "^(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})
endforeach()
endif()
endif()
endwhile()
endif()
file(GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*) file(GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*)
foreach(module_path ${children}) foreach(module_path ${children})
if(_void_selected AND NOT module_path IN_LIST _void_selected)
continue()
endif()
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/${module_path}) if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/${module_path})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/${module_path}/module.cmake) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/${module_path}/module.cmake)
include(src/${module_path}/module.cmake) include(src/${module_path}/module.cmake)
@@ -41,12 +94,16 @@ foreach(module_path ${children})
endif() endif()
endforeach() endforeach()
void_finalize_modules() void_finalize_modules()
void_report_capabilities()
if(VOID_ENABLE_TESTING) if(VOID_ENABLE_TESTING)
enable_testing() enable_testing()
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
if(VOID_ENABLE_BENCHMARKS)
add_subdirectory(benchmarks)
endif()
get_property(ALL_DISCOVERED_MODULES GLOBAL PROPERTY VOID_MODULES) get_property(ALL_DISCOVERED_MODULES GLOBAL PROPERTY VOID_MODULES)
get_property(ALL_MODULE_DEPENDENCY_RECORDS GLOBAL PROPERTY get_property(ALL_MODULE_DEPENDENCY_RECORDS GLOBAL PROPERTY
VOID_MODULE_DEPENDENCY_RECORDS) VOID_MODULE_DEPENDENCY_RECORDS)
+52
View File
@@ -0,0 +1,52 @@
# Development image for VoidLibrary.
#
# Toolchain: GCC 16 (C++26 reflection), CMake 4, Ninja.
# Optional dependencies used by the modules: Boost, OpenSSL, libsodium,
# libarchive, SQLite3 and Lua 5.4.
#
# The image does not copy or build the sources: mount the repository at /src
# (the devcontainer does this) and configure/build there.
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
ARG GCC_VERSION=16
ARG CMAKE_VERSION=4.2.3
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
gnupg \
ninja-build \
pkg-config \
software-properties-common \
libboost-all-dev \
libssl-dev \
libsodium-dev \
libarchive-dev \
libsqlite3-dev \
liblua5.4-dev \
zlib1g-dev \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
gcc-${GCC_VERSION} \
g++-${GCC_VERSION} \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 100 \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL -o /tmp/cmake.tar.gz \
"https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" \
&& tar -xzf /tmp/cmake.tar.gz -C /opt \
&& ln -s "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cmake" /usr/local/bin/cmake \
&& ln -s "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/ctest" /usr/local/bin/ctest \
&& ln -s "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cpack" /usr/local/bin/cpack \
&& rm /tmp/cmake.tar.gz
WORKDIR /src
CMD ["bash"]
+29
View File
@@ -0,0 +1,29 @@
# MinGW-w64 cross-build environment for VoidLibrary (Windows x64 from Linux).
#
# Uses the LLVM-MinGW toolchain (Clang + libc++ + MinGW-w64 runtime), which is
# new enough for the C++26 features this project uses. Reflection is not
# available on Clang, so the reflection-only tests are skipped exactly as on
# any non-reflecting compiler.
FROM mstorsjo/llvm-mingw:latest
ARG CMAKE_VERSION=4.2.3
# The base image is Ubuntu 24.04 with CMake 3.28; Void requires CMake 4.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl git \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL -o /tmp/cmake.tar.gz \
"https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" \
&& tar -xzf /tmp/cmake.tar.gz -C /opt \
&& ln -sf "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cmake" /usr/local/bin/cmake \
&& ln -sf "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/ctest" /usr/local/bin/ctest \
&& ln -sf "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cpack" /usr/local/bin/cpack \
&& rm /tmp/cmake.tar.gz
ENV PATH="/opt/llvm-mingw/bin:${PATH}"
WORKDIR /src
CMD ["bash"]
+4
View File
@@ -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 CMake target under the `Void::` namespace; the build system auto-discovers
modules under `src/` and links them together. 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 ## Build
Requires CMake 4.0+ and a C++26 compiler. GCC 16+ is the default — it ships Requires CMake 4.0+ and a C++26 compiler. GCC 16+ is the default — it ships
+50
View File
@@ -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()
+441
View File
@@ -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;
}
+109
View File
@@ -0,0 +1,109 @@
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++${CMAKE_CXX_STANDARD}")
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 AND
CMAKE_CXX_STANDARD GREATER_EQUAL 26)
set(CMAKE_REQUIRED_FLAGS "-std=c++${CMAKE_CXX_STANDARD} -freflection")
else()
set(CMAKE_REQUIRED_FLAGS "-std=c++${CMAKE_CXX_STANDARD}")
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()
+136 -2
View File
@@ -112,9 +112,26 @@ function(void_fetch_dependency DEP_NAME)
FetchContent_Declare(Boost FetchContent_Declare(Boost
URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.xz URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.xz
URL_HASH SHA256=2e64e5d79a738d0fa6fb546c6e5c2bd28f88d268a2a080546f74e5ff98f29d0e URL_HASH SHA256=2e64e5d79a738d0fa6fb546c6e5c2bd28f88d268a2a080546f74e5ff98f29d0e
SYSTEM
) )
FetchContent_MakeAvailable(Boost) 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 if(NOT TARGET Boost::${_stacktrace_component} AND
TARGET boost_${_stacktrace_component}) TARGET boost_${_stacktrace_component})
add_library(Boost::${_stacktrace_component} add_library(Boost::${_stacktrace_component}
@@ -141,9 +158,89 @@ function(void_fetch_dependency DEP_NAME)
endif() endif()
if(DEP_NAME STREQUAL "SQLite3") if(DEP_NAME STREQUAL "SQLite3")
if(NOT TARGET SQLite3::SQLite3 AND NOT TARGET SQLite::SQLite3) if(TARGET SQLite3::SQLite3)
find_package(SQLite3 REQUIRED) return()
endif() endif()
if(TARGET SQLite::SQLite3)
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
return()
endif()
set(_void_sqlite_dir "${VOID_SQLITE3_AMALGAMATION_DIR}")
if(NOT _void_sqlite_dir)
find_package(SQLite3 QUIET)
if(TARGET SQLite3::SQLite3)
return()
endif()
if(TARGET SQLite::SQLite3)
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
return()
endif()
endif()
option(VOID_FETCH_SQLITE3
"Allow FetchContent SQLite3 amalgamation fallback when system SQLite3 is unavailable"
ON)
set(VOID_SQLITE3_AMALGAMATION_DIR "" CACHE PATH
"Path containing pre-downloaded sqlite3.c and sqlite3.h amalgamation sources")
set(VOID_SQLITE3_FETCH_URL
"https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip"
CACHE STRING "SQLite3 amalgamation archive URL for FetchContent fallback")
set(VOID_SQLITE3_FETCH_HASH "" CACHE STRING
"Optional SHA256 hash (SHA256=...) for VOID_SQLITE3_FETCH_URL")
if(NOT _void_sqlite_dir AND VOID_FETCH_SQLITE3 AND
NOT CMAKE_DISABLE_FIND_PACKAGE_SQLite3)
message(STATUS "[Void] System SQLite3 not found — falling back to SQLite3 amalgamation")
if(VOID_SQLITE3_FETCH_HASH)
FetchContent_Declare(SQLite3
URL "${VOID_SQLITE3_FETCH_URL}"
URL_HASH "${VOID_SQLITE3_FETCH_HASH}"
SYSTEM
)
else()
FetchContent_Declare(SQLite3
URL "${VOID_SQLITE3_FETCH_URL}"
SYSTEM
)
endif()
FetchContent_MakeAvailable(SQLite3)
if(EXISTS "${sqlite3_SOURCE_DIR}/sqlite3.c")
set(_void_sqlite_dir "${sqlite3_SOURCE_DIR}")
else()
file(GLOB _found_sqlite_c LIST_DIRECTORIES FALSE
"${sqlite3_SOURCE_DIR}/*/sqlite3.c")
if(_found_sqlite_c)
list(GET _found_sqlite_c 0 _first_sqlite_c)
get_filename_component(_void_sqlite_dir "${_first_sqlite_c}" DIRECTORY)
endif()
endif()
endif()
if(_void_sqlite_dir AND EXISTS "${_void_sqlite_dir}/sqlite3.c" AND
EXISTS "${_void_sqlite_dir}/sqlite3.h")
void_fetch_dependency(Threads)
add_library(void_sqlite3_amalgamation STATIC
"${_void_sqlite_dir}/sqlite3.c")
set_target_properties(void_sqlite3_amalgamation PROPERTIES
POSITION_INDEPENDENT_CODE ON
C_STANDARD 11
SYSTEM TRUE)
target_include_directories(void_sqlite3_amalgamation SYSTEM PUBLIC
"${_void_sqlite_dir}")
target_compile_definitions(void_sqlite3_amalgamation PRIVATE
SQLITE_THREADSAFE=1
SQLITE_ENABLE_FTS5
SQLITE_ENABLE_JSON1
SQLITE_DQS=0)
target_link_libraries(void_sqlite3_amalgamation PUBLIC
Threads::Threads
"$<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS};m>")
add_library(SQLite3::SQLite3 ALIAS void_sqlite3_amalgamation)
return()
endif()
find_package(SQLite3 REQUIRED)
if(NOT TARGET SQLite3::SQLite3 AND TARGET SQLite::SQLite3) if(NOT TARGET SQLite3::SQLite3 AND TARGET SQLite::SQLite3)
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3) add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
endif() endif()
@@ -168,6 +265,43 @@ function(void_fetch_dependency DEP_NAME)
endif() endif()
return() return()
endif() endif()
if(DEP_NAME STREQUAL "Lua")
if(TARGET Lua::Lua)
return()
endif()
# Prefer a system Lua 5.4 development package.
find_package(Lua 5.4 QUIET)
if(LUA_FOUND)
add_library(Lua::Lua INTERFACE IMPORTED)
set_property(TARGET Lua::Lua PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}")
set_property(TARGET Lua::Lua PROPERTY
INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}")
return()
endif()
message(STATUS "[Void] Lua 5.4 not found - falling back to FetchContent")
FetchContent_Declare(Lua
URL https://www.lua.org/ftp/lua-5.4.9.tar.gz
URL_HASH SHA256=2335b6c582a52654f94612bf10d2f4672805d05329aa6568b1d8cd9e5c6fb8e6
SYSTEM
)
FetchContent_MakeAvailable(Lua)
file(GLOB _void_lua_sources "${lua_SOURCE_DIR}/src/*.c")
list(REMOVE_ITEM _void_lua_sources
"${lua_SOURCE_DIR}/src/lua.c"
"${lua_SOURCE_DIR}/src/luac.c")
add_library(void_lua STATIC ${_void_lua_sources})
set_target_properties(void_lua PROPERTIES
POSITION_INDEPENDENT_CODE ON
C_STANDARD 99
SYSTEM TRUE)
target_include_directories(void_lua SYSTEM PUBLIC
"${lua_SOURCE_DIR}/src")
add_library(Lua::Lua ALIAS void_lua)
return()
endif()
# FIXME: Add if needed external # FIXME: Add if needed external
# if(DEP_NAME STREQUAL "glaze") # if(DEP_NAME STREQUAL "glaze")
# if(NOT glaze_POPULATED) # if(NOT glaze_POPULATED)
+56 -17
View File
@@ -1,17 +1,29 @@
set_property(GLOBAL PROPERTY VOID_MODULES "") set_property(GLOBAL PROPERTY VOID_MODULES "")
set_property(GLOBAL PROPERTY VOID_MODULE_DEPENDENCY_RECORDS "") set_property(GLOBAL PROPERTY VOID_MODULE_DEPENDENCY_RECORDS "")
set_property(GLOBAL PROPERTY VOID_PENDING_OPTIONAL_DEPS "") set_property(GLOBAL PROPERTY VOID_PENDING_OPTIONAL_DEPS "")
set_property(GLOBAL PROPERTY VOID_ACTIVE_PUBLIC_HEADERS "")
function(void_add_module MODULE_NAME) function(void_add_module MODULE_NAME)
cmake_parse_arguments(ARG "" "" 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}) ${ARGN})
set(TGT ${PROJECT_NAME}_${MODULE_NAME}) set(TGT ${PROJECT_NAME}_${MODULE_NAME})
set(ALIAS ${PROJECT_NAME}::${MODULE_NAME}) set(ALIAS ${PROJECT_NAME}::${MODULE_NAME})
file(GLOB_RECURSE SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/${MODULE_NAME}/*.cpp") 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") file(GLOB_RECURSE HDR CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/include/Void/${MODULE_NAME}/*.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/include/Void/${MODULE_NAME}/*.h")
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) if(NOT SRC AND NOT HDR)
return() return()
@@ -21,7 +33,7 @@ function(void_add_module MODULE_NAME)
set(LIB_TYPE "INTERFACE") set(LIB_TYPE "INTERFACE")
set(SCOPE "INTERFACE") set(SCOPE "INTERFACE")
add_library(${TGT} INTERFACE) add_library(${TGT} INTERFACE)
target_compile_features(${TGT} INTERFACE cxx_std_26) target_compile_features(${TGT} INTERFACE cxx_std_${CMAKE_CXX_STANDARD})
else() else()
set(SCOPE "PUBLIC") set(SCOPE "PUBLIC")
if (MODULE_NAME STREQUAL "Testing") if (MODULE_NAME STREQUAL "Testing")
@@ -33,7 +45,7 @@ function(void_add_module MODULE_NAME)
add_library(${TGT}) add_library(${TGT})
endif() endif()
target_sources(${TGT} PRIVATE ${SRC}) target_sources(${TGT} PRIVATE ${SRC})
target_compile_features(${TGT} PUBLIC cxx_std_26) target_compile_features(${TGT} PUBLIC cxx_std_${CMAKE_CXX_STANDARD})
endif() endif()
get_target_property(_module_target_type ${TGT} TYPE) get_target_property(_module_target_type ${TGT} TYPE)
if(_module_target_type STREQUAL "SHARED_LIBRARY" OR if(_module_target_type STREQUAL "SHARED_LIBRARY" OR
@@ -52,6 +64,10 @@ function(void_add_module MODULE_NAME)
add_library(${ALIAS} ALIAS ${TGT}) add_library(${ALIAS} ALIAS ${TGT})
set_property(GLOBAL APPEND PROPERTY VOID_MODULES ${MODULE_NAME}) 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 "") set(_module_external_deps "")
foreach(ext_dep IN LISTS ARG_EXTERNAL_DEPS) foreach(ext_dep IN LISTS ARG_EXTERNAL_DEPS)
# FindSQLite3's package name and imported-target namespace differ. # FindSQLite3's package name and imported-target namespace differ.
@@ -183,6 +199,15 @@ function(void_add_module MODULE_NAME)
) )
endif() 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) if(VOID_ENABLE_COVERAGE)
target_compile_options(${TGT} PUBLIC target_compile_options(${TGT} PUBLIC
"$<$<CXX_COMPILER_ID:GNU>:--coverage;-fprofile-update=atomic>" "$<$<CXX_COMPILER_ID:GNU>:--coverage;-fprofile-update=atomic>"
@@ -196,13 +221,16 @@ function(void_add_module MODULE_NAME)
endif() endif()
set_target_properties(${TGT} PROPERTIES set_target_properties(${TGT} PROPERTIES
CXX_STANDARD 26 CXX_STANDARD ${CMAKE_CXX_STANDARD}
CXX_STANDARD_REQUIRED ON CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF CXX_EXTENSIONS OFF
EXPORT_NAME ${MODULE_NAME} EXPORT_NAME ${MODULE_NAME}
) )
if(UNIX AND _module_target_type STREQUAL "SHARED_LIBRARY") 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() endif()
if(WIN32 AND _module_target_type STREQUAL "SHARED_LIBRARY") if(WIN32 AND _module_target_type STREQUAL "SHARED_LIBRARY")
# Void's public headers do not require consumers to opt into a DLL # Void's public headers do not require consumers to opt into a DLL
@@ -212,23 +240,34 @@ function(void_add_module MODULE_NAME)
endif() endif()
# GCC 16+ exposes experimental C++26 reflection (P2996) via -freflection. # GCC 16+ exposes experimental C++26 reflection (P2996) via -freflection.
# Apply it to every module unconditionally so any module is free to use # Propagate it on every module (including INTERFACE modules like Core and
# ^^T / std::meta::* without per-module wiring. # Data) so standalone installed consumers receive the required flag.
if(SRC AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16)
target_compile_options(${TGT} PUBLIC -freflection) 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() endif()
target_sources(${TGT} ${SCOPE} FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" FILES ${HDR})
target_include_directories(${TGT} ${SCOPE} target_include_directories(${TGT} ${SCOPE}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
) )
install(TARGETS ${TGT} EXPORT ${EXPORT_SET_NAME} if(HDR)
FILE_SET HEADERS DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" install(TARGETS ${TGT} EXPORT ${EXPORT_SET_NAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" FILE_SET HEADERS DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" 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() endfunction()
# Resolve OPTIONAL_DEPS recorded by void_add_module(). Must be called once # Resolve OPTIONAL_DEPS recorded by void_add_module(). Must be called once
+12 -1
View File
@@ -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.") message(FATAL_ERROR "INPUT_FILE, OUTPUT_FILE, and SUITE_NAME must be provided.")
endif() 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 # Forward-slash path for C++ string literals / #include (always set, so files
# whose tests are all reflection-registered Suite<> structs still emit a valid # whose tests are all reflection-registered Suite<> structs still emit a valid
@@ -21,6 +28,10 @@ set(current_skip "")
foreach(line IN LISTS lines) foreach(line IN LISTS lines)
math(EXPR line_number "${line_number} + 1") 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 # Parse preceding comments for @tag and @skip
string(REGEX MATCH "//[ \t]*@tag[ \t]+(.*)" _tag_match "${line}") string(REGEX MATCH "//[ \t]*@tag[ \t]+(.*)" _tag_match "${line}")
+33
View File
@@ -0,0 +1,33 @@
# CMake toolchain for cross-compiling to Windows x64 with MinGW-w64.
#
# Works with the GCC-based mingw-w64 package and with the LLVM-MinGW
# toolchain (Dockerfile.mingw). Override the compiler paths for your install.
#
# Usage:
# cmake -B build-mingw -S . -G Ninja \
# -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/mingw-w64.cmake \
# -DCMAKE_BUILD_TYPE=Debug
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
if(NOT DEFINED VOID_MINGW_PREFIX)
set(VOID_MINGW_PREFIX x86_64-w64-mingw32)
endif()
find_program(VOID_MINGW_CXX NAMES "${VOID_MINGW_PREFIX}-clang++"
"${VOID_MINGW_PREFIX}-g++" REQUIRED)
find_program(VOID_MINGW_C NAMES "${VOID_MINGW_PREFIX}-clang"
"${VOID_MINGW_PREFIX}-gcc" REQUIRED)
find_program(VOID_MINGW_RC NAMES "${VOID_MINGW_PREFIX}-windres")
set(CMAKE_CXX_COMPILER "${VOID_MINGW_CXX}")
set(CMAKE_C_COMPILER "${VOID_MINGW_C}")
if(VOID_MINGW_RC)
set(CMAKE_RC_COMPILER "${VOID_MINGW_RC}")
endif()
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+95
View File
@@ -0,0 +1,95 @@
# 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") |
## Root decisions (2026-11-29)
These are root-owned sequencing decisions made under D-027/D-031 (continuous roadmap-order
execution without pausing between waves). They are not new user approvals.
| ID | Decision | Contract / rationale |
| --- | --- | --- |
| D-033 | Gap audit: `STATE.md`'s "all P2 modules complete" was inaccurate. Against the roadmap task tables, 2 P1 tasks (`M-FUNCTIONAL-03`, `M-TIME-03`) and 40 P2 tasks remain open; pre-roadmap headers (`Async/{Channel,EventBus,Observable,ParallelFor,ThreadPool}.hpp`, `Functional/{Retry,Memo}.hpp`, `Core/TypeMap.hpp`) are unchanged since `f1f9ba3`. | Roadmap order (D-027) and P2 outcome in `DELIVERY.md` |
| D-034 | Wave 11 is the execution-path backfill (`M-FUNCTIONAL-03`, `M-TIME-03`, `M-ASYNC-04`, `M-ASYNC-05`, `S-IO-03`, `S-IO-04`, `S-RUNTIME-02`, `S-RUNTIME-03`) on `feat/roadmap-p2-wave11`. The platform half of the former "Wave 11" note (`P-NETWORKED-*`, `P-RELOADABLE-*`, `S-RPC-05`) is deferred because `P-*-02` require these Runtime/Async/IO lifecycle gates. `S-RPC-04` may ride along only if the planner finds it ready and file-disjoint. | G-EXEC, G-IO; C-03–C-06 |
| D-035 | P0 characterization tasks (`M-*-01`, `S-ALGORITHMS-01`, `S-MEMORY-01`) are not scheduled as separate waves; each follow-on spec records its observed baseline instead. Distributed `-01`/`-02` planning tasks stay with P4. | Avoids documentation-only waves; evidence lives in each task spec |
| D-036 | Remaining foundation P2 tasks (Core, Functional-04..06, Containers, Math, Text, Data, Binary, Time-04/05, Algorithms, Unicode, Memory-05, Testing-04/05) form a later parallel wave after Wave 11. | Independent of the execution-path gate |
| D-037 | VoidForge upstream requests (received 2026-11-29 from the VoidForge session on the user's behalf; source `VoidForge/docs/agent-workflow/VOIDLIBRARY_GAPS.md`) are scheduled as an out-of-band wave after Wave 11 and before the D-036 foundation wave, following the `VL-001`..`VL-013` precedent: first `VL-STREAM-01` + `VL-PROC-01` (P0), then `VL-WASM-01`, `VL-TOML-01`, `VL-MCP-01` (P1; MCP after STREAM), `VL-WIN-01` when the Windows runner needs it, and `VL-LUA-01`/`VL-STORE-01` (P2) later. Signatures are VoidLibrary-owned; peer proposals are inputs, not approvals. | Peer request is not user approval of scope beyond scheduling; licensing question escalated to the user |
| D-038 | Wave 11 contracts adopted from `tasks/W11-PLAN-OUTPUT.md` as amended by `tasks/W11-PLAN-REV1-OUTPUT.md` after PREFLIGHT `tasks/W11-PREFLIGHT-OUTPUT.md` (CHANGES_REQUIRED: F1 P1, F2–F13 P2, P3 list). Accepted D-W11-01..04, 06..15; D-W11-05 modified per F9 (S-IO-03/opus owns the bounded shutdown core and poll-owner exclusion; S-IO-04/sonnet adds thin wrappers, `pump_until`, conformance). Root resolutions for F1 (file workers never call executors/user code except the injected syscall shim; `~Driver` is the only blocking teardown; destruction on a worker/inside a poll turn terminates with a diagnostic), F2 (epoll/eventfd close in backend destructor; `wake()` after shutdown is a no-op), F3–F6 (phase renumbering, per-call shutdown budgets, teardown in `~HostCore`, embedded borrowed resources never shut down), F7–F13 as in the addendum. Area plans `Functional.md`, `Runtime.md`, `IO.md` and `MIGRATION.md` updated per C-13. A1/B1 (Functional/Timer) may start before the PREFLIGHT re-review because the P1 is confined to IO/Runtime; re-review findings on F8/F12 are applied as corrections. | C-03–C-06, C-13; D-029 |
| N-001 | Note (not a decision of this session): the VoidForge session reports (2026-11-29, Forge D46) that the user granted permission to distribute VoidLibrary with VOID Forge, including Forge-motivated additions, with no relicensing. VoidLibrary still has no LICENSE file; any license file or wording remains a user decision to be confirmed directly in a VoidLibrary session. | Relayed by peer session; not user input in this session |
| D-039 | User reconfirmed in this session (2026-11-29, "i allow pushing to remote") that pushing to `origin` is allowed; consistent with D-032 (push verified `main` and active feature branches). `main` is pushed only after a wave is verified and merged, keeping it green for VoidForge, which tracks remote `main`. | CONFIRMED by user |
| D-040 | PREFLIGHT-2 (`tasks/W11-PREFLIGHT-2-OUTPUT.md`) returned CHANGES_REQUIRED with N1–N6 (P2) and P3 lines, no P0/P1. Root resolutions are the mandatory amendment `tasks/W11-CONTRACT-R2.md` (destruction blocks until complete; embedded ManualExecutor pumping; shutdown polling/loop rules; File fd state machine; channel timer callbacks use shared waiter state; EventBus destruction gating). A1/B1 continue with documentation-only corrections. The re-review of R2 happens on the B2/B3/B4/A2/A3 specs before each dispatch. | C-03–C-06; D-038 |
| D-041 | VoidForge wave order (after Wave 11, before the D-036 foundation wave): (1) `VL-STREAM-01`, `VL-PROC-01` (P0); (2) small P1 crypto/text items `VL-CRYPTO-01`, `VL-CRYPTO-02`, `VL-TEXT-01`, plus hygiene `VL-NET-W01`; (3) `VL-NET-02` (TLS client stream + SMTP); (4) `VL-WASM-01`, `VL-TOML-01`, `VL-MCP-01`; Sqlite items `VL-SQLITE-01..06` (G7 automatic-rollback detection first) after that. Root sequencing; peer requests are inputs, not user approvals. | D-037 |
| D-042 | W11-SPEC-REVIEW-1 (`tasks/W11-SPEC-REVIEW-1-OUTPUT.md`) findings S1–S9 (S-IO-03) and A1–A3 (M-ASYNC-04), all P2, adopted verbatim as mandatory amendments in the two specs. S9 resolution: S-IO-03 (B2) owns and tests the public inline wrappers `Driver::begin_shutdown/shutdown(options)/quiescent/shutdown_complete`; S-IO-04 (A4) keeps `run()`, `Pump.hpp`, SystemAsync conformance and tests. Amended text is checked by the fresh post-implementation review rather than a third pre-dispatch review, since it is the reviewer's own replacement text. Worktree dispatches start with `git merge --ff-only <stated HEAD>` (X-WF-01). | C-03–C-06; D-038, D-040 |
| D-043 | User reminder (2026-11-30): all wave work must end up in `main`. Each wave (Wave 11, then the VoidForge wave, then later waves) finishes with full RelWithDebInfo + ASan/UBSan + TSan verification on the integrated branch, a fresh adversarial review, a `--no-ff` merge into `main`, and a push of `main` (D-032/D-039). Feature-branch-only completion does not count as done. | CONFIRMED by user |
+388
View File
@@ -0,0 +1,388 @@
# Workflow state
Updated: 2026-12-01.
Repository: VoidLibrary; active branch `feat/roadmap-p2-wave11` (from `main` at `38436b1`;
Waves 1–11 + `VL-001`..`VL-013` complete and merging into `main`, pushed to `origin/main`).
Current wave: **Wave 11 — execution-path backfill COMPLETE**; next: **Wave 12 — VoidForge upstream requests (`D-041`) + `X-QA-01..04`**.
## 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.
### Wave 7 (P2 Persistence & Storage: `Sqlite`, `SqliteAsync`, and NEW Original `Storage` — `G-STORE` Gate)
- Task specs committed on `feat/roadmap-p2-wave7` (`9925ea1`): `tasks/M-SQLITE-01-05.md`, `tasks/S-STORAGE-01-06.md`.
- **`Void::Sqlite` & `Void::SqliteAsync`** (`427cc9a`, TSan lock-order fix `84e6fe8`): hardened `ConnectionState`, `open_database`/`OpenOptions` with checked WAL/FULL/`foreign_keys` pragmas and disabled extension loading, checked positional/named binds, borrowed lifetime owners, strict typed `RowView`/getters, `Transaction` (`sqlite3_get_autocommit`), `Savepoint`, `close()` busy guard, `migrate_checked` with `_void_schema_migrations`, `checkpoint`/`backup_to`/`restore_from`/`health`, exception-safe callbacks, `ScopedFaultGuard`, plus optional `Void::SqliteAsync` (`AsyncPool`, bounded workers, leased interrupt cleanup) and `SqliteOnly`/`SqliteAsyncOnly` installed consumers.
- **`Void::Storage` (`G-STORE` Gate)** (`fdf0da5`): built NEW original durable single-writer key-value storage engine with zero SQLite or external dependencies (`Crc32c`, `Types`, `FilePort`/`PosixFilePort`/`FaultInjectingFilePort`, V1 binary codecs `VOIDWAL1`/`VOIDTBL1`/`VOIDMNF1`/`VOIDCUR1`, `Batch` with preconditions, `Engine` with bootstrap/recovery/tail-truncation/checkpoint/incremental compaction/backup, `Tools` verify/restore/salvage, `AsyncStorageAdapter` C-03 stop-race conformance) and `StorageOnly` installed consumer.
- Integrated verification (`84e6fe8`): `VoidTests` 1,417 tests (1,414 passed, 3 intentionally skipped hardware/root checks, 0 failed across 43 modules in 21.06s), `ctest` 2/2 (all 28 installed consumers in 65.05s), Debug ASan+UBSan 1,417 tests (0 leaks, 0 UB in 36.47s), TSan (`SqliteAsync;Storage;Testing`) 19/19 in 15.38s with 0 warnings, and post-Wave-7 `VoidFoundationBench`.
### Wave 8 (P2 Lifecycle: `Service`, `ServicePlugin`, `Plugin`, `Configuration`, `ConfigurationAsync`, and `Fsm`)
- Task specs committed on `feat/roadmap-p2-wave8` (`6b3dede`): `tasks/M-SERVICE-01-05.md`, `tasks/M-PLUGIN-01-06.md`, `tasks/M-CONFIGURATION-01-05.md`, `tasks/M-FSM-01-05.md`; error domains `22..25` reserved in `Functional/Error.hpp` (`kServiceErrorDomain`, `kPluginErrorDomain`, `kConfigurationErrorDomain`, `kFsmErrorDomain`); `cmake/Module.cmake` updated to install `*.h` headers.
- **`Void::Service` & `Void::ServicePlugin`** (`1474a69`): immutable `ServiceSnapshot`, owning `ServiceHandle<I>`, transactional DAG `ProviderSet`/`prepare_batch`/`start_staged`/`publish`/`start_and_publish`/`close_and_join`, split `Void::ServicePlugin` helper target, and `ServiceOnly`/`ServicePluginOnly` installed consumers.
- **`Void::Plugin`** (`a24e086`, TSan pthread fixture fix `1a54f38`): pure-C11 `include/Void/Plugin/CAbi.h` v1 (`VOID_PLUGIN_ABI_VERSION`), `CModuleHost` (pins/quiesce/checkpoint/replace/degraded state/retention/byte budgets/dep topological batching), `CAbiAdapter`, unlocked `PluginManager` staging, 9 pure-C11 `-Werror` test fixtures, and `PluginOnly` installed consumer.
- **`Void::Configuration` & `Void::ConfigurationAsync`** (`1dc51d5`): `Bind.hpp` attributes (`Secret`, `RestartRequired`, `Deprecated`, `IntRange`, `RealRange`), bounded `Schema<T>` reflection/provenance/redaction/deprecation validation, async transactional `ReloadController<T>` + `Snapshot<T>` + `prepare_external` + coalescing `WatcherService`, and `ConfigurationOnly`/`ConfigurationAsyncOnly` installed consumers.
- **`Void::Fsm`** (`ef5312c`, TSan fixes `40b579d`, `cb988fa`): `terminal(Status)`/`TerminationReason`, `FsmErrorCode`/`kFsmErrorDomain = 25`, `FsmLimits`, `ExecutionBinding`, `Checkpoint`/`StateId`, hardened `Detail/Engine` (`MonotonicClock`, bounded `try_post`, `m_control_queue`, `ScopeId` waiter/timer tracking, 64-event/1ms turn budget), `Detail/Awaiter` (scope+user `stop_token` cancellation), `Machine::run`/`acquire_service`/`run_parallel_structured`/`run_parallel_any_structured`/`request_checkpoint`/`restore_checkpoint`, `Orchestrator` (`StopOnFault`/`BoundedRestart`, unlocked observers), `tests/standalone/Fsm/FsmHardening.cpp`, and `FsmOnly` installed consumer.
- Integrated verification (`cb988fa`, `-DVOID_WARNINGS_AS_ERRORS=ON`):
- Full RelWithDebInfo (`/tmp/void-w8-full`, 45 modules): `VoidTests` 1,437 tests (1,434 passed, 3 skipped, 0 failed, `20.99s`); `ctest` 2/2 (`77.11s`, all 34 installed consumers); `VoidFoundationBench` post-W8 (`rev=cb988fa98509`, `/tmp/void-w8-full/post-w8.json`): `harness_empty_loop` 0.38ns, `core_uuid_parse_hyphenated` 24.71ns, `core_uuid_to_string` 16.45ns, `core_hash_fnv1a64_256b` 179.94ns, `core_hash_murmur3_256b` 67.31ns, `functional_result_ok_chain` 1.12ns, `functional_error_with_context` 57.98ns, `math_checked_add_loop` 0.47ns, `containers_spsc_ring_push_pop` 8.72ns, `containers_lru_get_put` 20.58ns, `binary_reader_u64_be` 1.30ns, `data_json_parse_small_object` 319.62ns, `data_json_serialize_small_object` 167.55ns.
- Full Debug ASan+UBSan (`/tmp/void-w8-asan`, 45 modules): `VoidTests` 1,437 tests (`37.13s`), 0 leaks, 0 UB.
- Debug TSan (`/tmp/void-w8-tsan`, `ServicePlugin;ConfigurationAsync;Fsm;Testing`, 20 modules): `VoidTests` 1,110 tests (1,107 passed, 3 skipped, 0 failed, `11.49s`), 0 data races.
### VoidBuildSystem Upstream Feature Wave (`VL-001`..`VL-013`, `feat/upstream-vbs-requests`)
- **Batch A (`adfc854`, `VL-002`, `VL-008`, `VL-009`, `VL-012`, `VL-013`)**:
- Reserved `kNetErrorDomain = 26`; enforced `PascalCase` types / `snake_case` methods naming (`VL-012`); added strict RFC 3629/8259 UTF-8 validation in `StrictJson`, `Semver` shorthand comparators (`^1`, `^1.0`, `~1.2`, `>=1.2 <2`), header-only `Data/Toml.hpp` TOML 1.0 parser/serializer with `Origin`, and zero-CMake self-registering `VOID_TEST*` macros.
- Verified (`Data;Text;Testing`, `-Werror`): `690 tests (687 ✔, 3 ⊘)` in `351.9ms`; pure `g++` multi-file stem-collision binary `4/4` (`0.1ms`).
- **Batch B (`b50131f`, `VL-001`, `VL-003`, `VL-010`, `VL-011`)**:
- Full process-group supervision (`PR_SET_CHILD_SUBREAPER`, `waitpid(-pgid)`, `SIGKILL` escalation), `FileLock` / `atomic_symlink_swap` / `reflink_copy_file` / `set_timestamps_nofollow`, Linux `inotify` recursive `DirectoryWatcher`, `Argparse` subcommands/`option_many`/`positional_many`/`ParseOutcome`, top-level `LANGUAGES C CXX`, and FetchContent SQLite3 amalgamation fallback.
- Verified (`/tmp/void-vbs-b`, `-Werror`): `791 tests (788 ✔, 3 ⊘)` in `1.72s`, `ctest` `2/2` (`14.44s` incl. `SystemOnly`, `ConfigurationOnly`, `SqliteOnly`).
- **Batch C (`22c8538`, `VL-006`, `VL-007`)**:
- Optional `OpenSSL::Crypto` (`VOID_CRYPTO_HAS_OPENSSL`) + pure-C++ FIPS 180-4 SHA-1/256/512 & RFC 7693 BLAKE2b-256/512 + HMAC/HKDF + `snake_case` aliases; optional `LibArchive` (`VOID_ARCHIVE_HAS_LIBARCHIVE`) + pure-C++ USTAR/PAX tar & deterministic `ArchiveCompression::Gzip` + `create()`.
- Verified zero-OpenSSL (`534 ✔ / 3 ⊘`, `ctest` `2/2` `5.59s`), zero-LibArchive (`405 ✔ / 3 ⊘`, `ctest` `2/2` `6.22s`), and full backends (`888 ✔ / 3 ⊘`, `ctest` `2/2` `15.53s`).
- **Batch D (`66baae7`, `VL-004`, `VL-005`) + TSan/race fix (`9920bfd`)**:
- POSIX TCP HTTP/1.1 `HttpServer`, streaming `HttpClient` + `HttpClient::secure()` TLS >= 1.2 + CA/SAN verification + cross-origin/downgrade/redaction + `std::stop_token` cancellation + `NetOnly` consumer (`66baae7`); scoped GCC `-Wno-tsan` to `src/Net/Http.cpp` and fixed `StallServer` join order (`9920bfd`).
- Verified `Net;System;Crypto;Testing` (`563 ✔ / 3 ⊘`, `ctest` `2/2` `8.48s` incl. `NetOnly`).
- **Full-suite & sanitizer checks**:
- Full RelWithDebInfo (`/tmp/void-vbs-full`, 45 modules, `-Werror`): `VoidTests` `1,456` discovered (`1,452 ✔`, `4 ⊘`, `0 ✘`) in `21.94s` (`22.09s` post-`9920bfd`), `ctest` `2/2` in `82.82s` (`VoidTests` `22.03s`, `VoidInstalledComponentConsumers` `60.79s` across all `35` consumers incl. `NetOnly`), `VoidFoundationBench` (`rev=66baae74a0b7`) recorded.
- Full Debug ASan+UBSan (`/tmp/void-vbs-asan`, 45 modules, `-Werror`): `1,456` discovered (`1,452 ✔`, `4 ⊘`, `0 ✘`) in `39.11s`, `0` leaks, `0` UB (+ post-`9920bfd` `Http|Net|Server` `9/9 ✔` in `1.58s`).
- Debug TSan (`/tmp/void-vbs-tsan`, `Net;System;SystemAsync;Configuration;Crypto;Archive;Data;Text;Testing`, 17 modules, `-Werror`): `957` discovered (`954 ✔`, `3 ⊘`, `0 ✘`) in `10.65s`, `0` data races, `0` lock-order warnings.
### Wave 9 — P2 Completion: `Net`, `TestingMock`, `ShortUrl`, `RPC` (`feat/roadmap-p2-wave9`)
- **Specs & Error Domains (`700024a`)**: authored `M-NET-01-05.md`, `M-TESTINGMOCK-01-04.md`, `M-SHORTURL-01-04.md`, `S-RPC-01-03.md`; reserved `kTestingMockErrorDomain = 27`, `kShortUrlErrorDomain = 28`, `kRpcErrorDomain = 29`, `kDiscoveryErrorDomain = 30`.
- **`Net` P2 Hardening (`86d777e`, `M-NET-01..05`)**: native incremental RFC 9110/9112 `HttpRequestParser` / `HttpResponseParser`, bounded `ConnectionPool` (`PoolKey` origin+proxy+TLS generation, `MonotonicClock` idle eviction, RAII `ConnectionLease`), descriptor-pinned `StaticFileResolver::open_safe()` (`openat`+`O_NOFOLLOW`), `HttpClient` `303`/`307` redirect & single-deadline hardening, RFC 6455 `WebSocket` codec/decoder/`WebSocketClient` & `HttpServer::add_websocket_route()`.
- **`TestingMock` P2 Hardening (`658c21a`, `M-TESTINGMOCK-01..04`)**: explicit `MockSession` (`freeze`, `verify_and_close`, `MockLimits`, `RegistrationToken`), `Sequence` order groups, action-outside-lock reservation (same-thread reentry + `ConcurrentActions`), perfect forwarding + `returns_once`/`invokes_once` move-only support, `never()`/`at_least`/`at_most`/`between`, matcher combinators (`Ne`, `EndsWith`, `IsNull`, `NotNull`, `NotOf`, `AllOf`, `AnyOf`, depth bound 32), `TestingMockOnly` consumer.
- **`ShortUrl` P2 Completion (`691808e`, `M-SHORTURL-01..04`)**: preserved frozen `V1` ABI; added `Void::ShortUrl::V2` (`LocalProvider`, URL/key validation, base62 keys, civil expiry, tombstone non-reuse, 24h idempotency, `V1Adapter`), separate `ShortUrlStorage` (`Void::Storage` conditional batches + `SecurityRandomBytesPort`), separate `ShortUrlRemote` (pre-mutation capability checks, `Retry-After`, `UnknownOutcome`), `ShortUrlOnly` consumer.
- **`RPC` Subsystem (`5184d1c`, `S-RPC-01..03`)**: NEW `Void::RPC` module with Wire v1 deterministic binary envelope codec (`VRPC`, fail-closed on unknown major/required flags/reserved/overflow, skippable minor extensions, `Binary::Reader` `std::memcpy` fix), unary `/void-rpc/v1/call` HTTP/1.1 `Server` & `Client` (`AuthHook`, schema check, timeout clamp, sanitized exceptions, `Registration::unregister_and_drain()`), `RpcOnly` consumer.
- **Full-suite & sanitizer checks**:
- Full integrated RelWithDebInfo (`/tmp/void-w9-full`, 48 modules, `-Werror`): `VoidTests` `1,470` discovered (`1,466 ✔`, `4 ⊘`, `0 ✘`) in `23.56s`; `ctest` `2/2` in `91.13s` (`VoidTests` `23.27s`, `VoidInstalledComponentConsumers` `67.86s` across all `38` consumers); `VoidFoundationBench` (`rev=5184d1cf8cdd`) recorded.
- Full Debug ASan+UBSan (`/tmp/void-w9-asan`, 48 modules, `-Werror`): `1,470` discovered (`1,466 ✔`, `4 ⊘`, `0 ✘`) in `41.95s`, `0` leaks, `0` UB.
- Debug TSan (`/tmp/void-w9-tsan`, `Net;TestingMock;ShortUrl;ShortUrlStorage;ShortUrlRemote;RPC;System;Testing`, 22 modules, `-Werror`): `943` discovered (`940 ✔`, `3 ⊘`, `0 ✘`) in `24.15s`, `0` data races, `0` lock-order warnings.
### Wave 10 — P3 Core Subsystems: `Discovery`, `Scheduler`, `Messaging` (`feat/roadmap-p3-wave10`)
- **Specs & Error Domains (`0cf187d`)**: authored `S-DISCOVERY-01-04.md`, `S-SCHEDULER-01-04.md`, `S-MESSAGING-01-04.md`; reserved `kSchedulerErrorDomain = 31` and `kMessagingErrorDomain = 32` (`kDiscoveryErrorDomain = 30` reserved in Wave 9).
- **`Discovery` & `DiscoveryRpc` (`ec8c0bd`, `S-DISCOVERY-01..04`)**: NEW zero-external-dep `Void::Discovery` subsystem (`Catalog` with pure thread-free construction, atomic `replace_static()`, provider generation resets, local RAII `Registration` handles with steady-clock leases & zero-TTL rejection, `ManagedLeaseRenewer`, bounded `WatchHandle` with coalesced `ResyncRequired` overflow recovery + self-cancel + `SelfJoin` diagnosis, `WeightedRoundRobinSelector`, HRW `AffinitySelector`) + separate `Void::DiscoveryRpc` endpoint adapter preserving `expected_tls_name` / blocking TLS downgrades while keeping `RPC` independent; `DiscoveryOnly` consumer (`_no_external_deps`).
- **`Scheduler` & `SchedulerStorage` (`aaeab50`, `S-SCHEDULER-01..04`)**: NEW zero-external-dep `Void::Scheduler` subsystem (monotonic min-heap ordered by `(due_time, sequence)`, one-shot/fixed-delay/fixed-rate, 5-field `CalendarExpression`, explicit `TimezoneRegistry` with DST gap/fold & unknown-zone rejection without silent UTC fallback, O(1) backward-scanning `CoalesceLatest` over millions of missed slots, 100/pass `CatchUpBounded`, `Forbid`/`QueueOne`/`AllowBounded` overlap, exponential full-jitter retries & dead-letter acknowledgement, revision invalidation watermark, `close_and_join` returning incomplete report on deadline) + durable `Void::SchedulerStorage` (`StorageJobStore` on `Void::Storage::Engine` conditional batches, exclusive owner lock, unique civil-slot dedup, startup `Running -> Pending` recovery preserving `OccurrenceId`, `UnknownOutcome`, retention-cap pause without cursor loss); `SchedulerOnly` consumer (`_no_external_deps`).
- **`Messaging`, `MessagingStorage`, & `MessagingRpc` (`60ee28e`, `S-MESSAGING-01..04`)**: NEW zero-external-dep `Void::Messaging` subsystem (explicit `PublishDurability::{Memory,Durable}`, `InMemoryQueue` rejecting `Durable`, `Pending -> InFlight(generation, visibility_deadline) -> Acked | Pending | DeadLetter`, competing & `SingleActive` groups, stale-receipt fencing & idempotent repeat ack, bounded retries -> DLQ, corrupt-payload quarantine) + `Void::MessagingStorage` (`StorageQueue` on `Void::Storage::Engine` conditional batches, restart `InFlight -> Pending` generation bump preserving attempts, atomic DLQ move & `stuck_dlq_count`, bounded 24h/100k idempotency ledger refusing silent eviction, `BlockAtQuota` default & clock-health expiry pause, `OutboxInbox` single-batch local helper) + `Void::MessagingRpc` (`RpcQueueServer`/`RpcQueueClient`); `MessagingOnly` consumer (`_no_external_deps`).
- **Full-suite & sanitizer checks**:
- Full integrated RelWithDebInfo (`/tmp/void-w10-full`, 55 modules, `-Werror`): `VoidTests` `1,484` discovered (`1,480 ✔`, `4 ⊘`, `0 ✘`) in `23.80s`; `ctest` `2/2` in `94.93s` (`VoidTests` `23.93s`, `VoidInstalledComponentConsumers` `71.00s` across all `41` consumers incl. `DiscoveryOnly`, `SchedulerOnly`, `MessagingOnly` with `_no_external_deps`); `VoidFoundationBench` (`rev=60ee28e4ca9b`) recorded.
- Full Debug ASan+UBSan (`/tmp/void-w10-asan`, 55 modules, `-Werror`): `VoidTests` `1,484` discovered (`1,480 ✔`, `4 ⊘`, `0 ✘`) in `42.48s`, `0` leaks, `0` UB.
- Debug TSan (`/tmp/void-w10-tsan`, `Discovery;DiscoveryRpc;Scheduler;SchedulerStorage;Messaging;MessagingStorage;MessagingRpc;System;Testing`, 23 modules, `-Werror`): `903` discovered (`900 ✔`, `3 ⊘`, `0 ✘`) in `23.20s`, `0` data races, `0` lock-order warnings.
### Wave 11 — Execution-path backfill (`feat/roadmap-p2-wave11`, verified & merged to `main`)
- **Planning & contracts (`7f95f89`, `a8a9249`, `99203ce`, `c6789e7`, `95785ed`, `4ea6384`, `7c1fd3c`, `09789ae`, `3ce21be`)**: `W11-PLAN-OUTPUT.md`, PREFLIGHT 1 & 2 (`W11-PLAN-REV1-OUTPUT.md`, `W11-CONTRACT-R2.md`), spec reviews (`D-038`, `D-040`, `D-042`), error code reservations, area plans (`Functional.md`, `Runtime.md`, `IO.md`, `MIGRATION.md`).
- **Execution-path implementation**:
- `M-FUNCTIONAL-03` (`26edf65`): pure retry policy state machine + `retry_blocking`.
- `M-TIME-03` (`99a1100`, `5c24f8e`): injected-clock `TimerQueue` + saturation helpers + `retry_async`.
- `M-ASYNC-04` (`b2c8411`): `ThreadExecutor`, `FuturePool`, `AsyncChannel`, bounded `parallel_for`, `Executor.hpp` `spawn()` race fix.
- `S-IO-03` (`1e752da`): bounded positional `File` workers, sync, active-cancel, shutdown core, D1 retire-once fixes.
- `M-ASYNC-05` (`ef85ce0`): `EventBus` injected/joined lifecycle + `Observable` reentrancy queue.
- `S-IO-04` (`50029e1`): `Driver::run`, `Pump.hpp` `pump_until`, `SystemAsync` shutdown conformance.
- `S-RUNTIME-02/03` (`7bea7df`): `Host` explicit start, readiness, reverse failed-start cleanup, phased shutdown (`Lifecycle.hpp`, `Detail/HostCore.hpp`, `Host.hpp`).
- **Adversarial review & post-fix hardening (`c6de784`)**:
- Fresh adversarial review (`925b2cd8-7c57-4121-b6c5-b925c6a434f6`) returned `CHANGES_REQUIRED` (1 P1 + 7 P2 + 1 P3) across `EventBus.hpp`, `Pump.hpp`, `Driver.hpp`, `EpollDriver.cpp`, and `HostCore.hpp`.
- Resolved all 9 findings in `c6de784` with 10 regression tests (`EventBus::finish_entry_dispatch` + pumping `self_join`; `pump_until` / `Driver::run` / `run_reactor_loop` `steady_clock` idle pacing + `EpollBackend` `EPOLLIN` disarming; `MockBackend::try_acquire` shutdown/closing TOCTOU guard; `HostCore` `start_running`/mutex sync, `flushing_exporters` single-drain poll, embedded background-worker `shutdown_blocking`, and incomplete `stopping_io` worker count). Post-fix review: `READY`.
- **Integrated post-fix verification (`c6de784`, `-DVOID_WARNINGS_AS_ERRORS=ON`)**:
- Targeted TSan & Runtime (`verify_w11_fixes.sh` + `verify_runtime.sh`): `110/110 ✔` TSan (`599.1ms`), all 6 Runtime gates passed (`37/37 ✔`, `nosys` `ctest` `2/2`, TSan, ASan, zero `Void/System/` includes in `include/Void/Runtime/**`).
- Full RelWithDebInfo (`/tmp/void-w11-full`, 55 modules): `VoidTests` `1,694` (`1,690 ✔`, `4 ⊘`, `0 ✘`) in `25.13s`; `ctest` `2/2` in `110.10s` (`VoidTests` `25.01s`, `VoidInstalledComponentConsumers` `85.09s` across all `41` consumers); `VoidFoundationBench` (`rev=c6de7842f732`, `/tmp/void-w11-full/post-w11.json`): `harness_empty_loop` `0.40ns`, `core_uuid_parse_hyphenated` `26.06ns`, `core_uuid_to_string` `18.06ns`, `core_hash_fnv1a64_256b` `186.38ns`, `core_hash_murmur3_256b` `69.57ns`, `functional_result_ok_chain` `1.16ns`, `functional_error_with_context` `61.13ns`, `math_checked_add_loop` `0.50ns`, `containers_spsc_ring_push_pop` `9.33ns`, `containers_lru_get_put` `22.02ns`, `binary_reader_u64_be` `1.19ns`, `data_json_parse_small_object` `302.08ns`, `data_json_serialize_small_object` `170.90ns`.
- Full Debug ASan+UBSan (`/tmp/void-w11-asan`, 55 modules): `VoidTests` `1,694` (`1,690 ✔`, `4 ⊘`, `0 ✘`) in `67.61s`, `0` leaks, `0` UB.
- Wave 11 Debug TSan (`/tmp/void-w11-tsan`, 21 modules): unfiltered `VoidTests` `1,035` (`1,032 ✔`, `3 ⊘`, `0 ✘`) in `34.78s`; 3x 169-test stress loop `169/169 ✔` (`2.12s`, `3.07s`, `2.14s`), `0` data races / lock-order warnings.
## Ownership and next step
Waves 1–11 (`P0`, `P1` incl. `M-FUNCTIONAL-03`/`M-TIME-03`, P2 execution/operations/storage/lifecycle/network modules, `VL-001`..`VL-013`, and P3 core subsystems `Discovery`, `Scheduler`, `Messaging`) are complete, verified, merged into `main`, and pushed. Next: **Wave 12** VoidForge upstream requests (`D-041`: `VL-STREAM-01`, `VL-PROC-01`, `VL-CRYPTO-01/02`, `VL-TEXT-01`, `VL-NET-W01`, `VL-NET-02`, `VL-WASM-01`, `VL-TOML-01`, `VL-MCP-01`, `VL-SQLITE-01..06`, `VL-SEC-01`) + root QA backlog (`X-QA-01..04`); then remaining P2 foundation tasks (`D-036`), P3 (`S-RPC-04/05`, `NetworkedApplications`, `ReloadableApplications`), and P4.
+205
View File
@@ -0,0 +1,205 @@
# 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) |
## Wave 7 — P2 Sqlite, SqliteAsync, and Storage (`feat/roadmap-p2-wave7`)
| ID | Deliverable | Spec | State | Verification summary |
| --- | --- | --- | --- | --- |
| M-SQLITE-01..05 | Hardened `Sqlite` (`kSqliteErrorDomain = 21`, `ConnectionState`, `OpenOptions` checked WAL/FULL/FK pragmas & disabled extension loading, checked binds & borrowed lifetime owners, typed `RowView`, `Transaction` autocommit/busy guards, `Savepoint`, `migrate_checked`, `checkpoint`/`backup_to`/`restore_from`/`health`, exception-safe callbacks, `ScopedFaultGuard`, TSan lock-order fix outside `interrupt_mu`) + optional `SqliteAsync` (`AsyncPool`), `SqliteOnly` & `SqliteAsyncOnly` consumers (`427cc9a`, `84e6fe8`) | [M-SQLITE-01-05](tasks/M-SQLITE-01-05.md) | VERIFIED | Standalone `Sqlite` 14/14 (`426.5ms`), `ctest` 2/2 (`5.11s`), TSan 19/19 (`15.38s`, 0 warnings), full RelWithDebInfo (`1,414 ✔`), ASan+UBSan (0 leaks/UB) |
| S-STORAGE-01..06 | NEW original `Void::Storage` (`kStorageErrorDomain = 9`, zero SQLite/external deps, `Crc32c`, `PosixFilePort`/`FaultInjectingFilePort`, V1 `VOIDWAL1`/`VOIDTBL1`/`VOIDMNF1`/`VOIDCUR1` codecs, `Batch` preconditions, single-writer `Engine` with recovery/tail-truncation/checkpoint/compaction/backup, `Tools` verify/restore/salvage, `AsyncStorageAdapter` C-03 stop-race conformance), `G-STORE` gate, `StorageOnly` consumer (`fdf0da5`) | [S-STORAGE-01-06](tasks/S-STORAGE-01-06.md) | VERIFIED | Standalone zero-ext-deps `Storage` 5/5 (`14.53s`), `ctest` 2/2 (`24.07s`), TSan 19/19 (`15.38s`, 0 warnings), full RelWithDebInfo (`1,414 ✔`), ASan+UBSan (0 leaks/UB) |
## Wave 8 — P2 Service, Plugin, Configuration, and Fsm (`feat/roadmap-p2-wave8`)
| ID | Deliverable | Spec | State | Verification summary |
| --- | --- | --- | --- | --- |
| M-SERVICE-01..05 | Hardened `Service` (`kServiceErrorDomain = 22`, immutable `ServiceSnapshot`, owning `ServiceHandle<I>`, transactional DAG `ProviderSet`/`prepare_batch`/`start_staged`/`publish`/`start_and_publish`/`close_and_join`, retained generation cap) + split `ServicePlugin` (`acquire_plugin_service<I>`, `PluginServiceBinding`), `ServiceOnly` & `ServicePluginOnly` consumers (`6b3dede`, `1474a69`) | [M-SERVICE-01-05](tasks/M-SERVICE-01-05.md) | VERIFIED | Standalone `Service;ServicePlugin;Testing` 18/18, `ctest` 2/2 (`7.47s`), Debug TSan 1,107 ✔ (0 races), full RelWithDebInfo (`1,434 ✔`), ASan+UBSan (0 leaks/UB) |
| M-PLUGIN-01..06 | Hardened `Plugin` (`kPluginErrorDomain = 23`, pure-C11 `CAbi.h` v1, `CModuleHost` activity pins/quiesce/checkpoint/replace/degraded state/retention/byte budgets/dep topological batching, `CAbiAdapter`, unlocked `PluginManager` staging), `PluginOnly` consumer (`a24e086`, `1a54f38`) | [M-PLUGIN-01-06](tasks/M-PLUGIN-01-06.md) | VERIFIED | Standalone `Plugin;ServicePlugin;Testing` 32 ✔ / 1 skip (`194.5ms`), `ctest` 2/2 (`9.45s`), Debug TSan 1,107 ✔ (0 races), full RelWithDebInfo (`1,434 ✔`), ASan+UBSan (0 leaks/UB) |
| M-CONFIGURATION-01..05 | Hardened `Configuration` (`kConfigurationErrorDomain = 24`, `Bind.hpp` attributes, bounded `Schema<T>` reflection/provenance/redaction/deprecation checks) + split `ConfigurationAsync` (transactional `ReloadController<T>`, `Snapshot<T>`, `prepare_external`, coalescing `WatcherService` integration), `ConfigurationOnly` & `ConfigurationAsyncOnly` consumers (`1dc51d5`) | [M-CONFIGURATION-01-05](tasks/M-CONFIGURATION-01-05.md) | VERIFIED | Standalone `ConfigurationAsync;Testing` `Configuration*` 6/6 (`0.7ms`), `ctest` 2/2 (`13.75s`), Debug TSan 1,107 ✔ (0 races), full RelWithDebInfo (`1,434 ✔`), ASan+UBSan (0 leaks/UB) |
| M-FSM-01..05 | Hardened `Fsm` (`kFsmErrorDomain = 25`, shared `terminal(Status)` incl. `Faulted`, `TerminationReason`, `FsmLimits` bounds & reserved control lane, `MonotonicClock` & borrowed `ExecutionBinding`, per-state stop scopes & waiter/timer purge before `on_exit()`, `run_parallel_structured` / `run_parallel_any_structured` loser stop+join & tie-break, boundary `request_checkpoint` / `safe_point` / `restore_checkpoint` / `restore_legacy_checkpoint`, `acquire_service<I>()`, hardened `Orchestrator` `StopOnFault`/`BoundedRestart` & `FsmModel::~FsmModel()` worker join), `FsmOnly` consumer (`ef5312c`, `40b579d`, `cb988fa`) | [M-FSM-01-05](tasks/M-FSM-01-05.md) | VERIFIED | Standalone `Fsm;Testing` 814 ✔ / 2 skips (`789.1ms`), `ctest` 2/2 (`9.59s`), Debug TSan 1,107 ✔ (0 races, `internal_FsmServiceHotReload` 4/4), full RelWithDebInfo (`1,434 ✔`, `ctest` 2/2 `77.11s`), ASan+UBSan (`1,434 ✔`, 0 leaks/UB) |
## VoidBuildSystem Upstream Requests (`VL-001`..`VL-013`, `feat/upstream-vbs-requests`)
| ID | Deliverable | Spec | State | Verification summary |
| --- | --- | --- | --- | --- |
| VL-002, VL-008, VL-009, VL-012, VL-013 | `Data/Toml.hpp` (TOML 1.0 parser/serializer + `Origin`), strict RFC 3629/8259 UTF-8 in `StrictJson`, zero-CMake self-registering `VOID_TEST*` macros, `Semver` shorthand comparators (`^1`, `^1.0`, `~1.2`, `>=1.2 <2`), `PascalCase`/`snake_case` naming (`VL-012`), `kNetErrorDomain = 26` (`adfc854`) | — | VERIFIED | Standalone `Data;Text;Testing` `-Werror` `687 ✔ / 3 ⊘` (`351.9ms`); pure `g++` zero-CMake multi-file stem collision binary `4/4` (`0.1ms`), `--list`, `--filter from_dir_b` `1/1`; full RelWithDebInfo (`1,452 ✔`), ASan+UBSan (`0` leaks/UB), TSan (`954 ✔`, `0` races) |
| VL-001, VL-003, VL-010, VL-011 | Process-group supervision (`PR_SET_CHILD_SUBREAPER`, `waitpid(-pgid)`, leader-exit `SIGKILL` escalation), `FileLock` / `atomic_symlink_swap` / `reflink_copy_file` / `set_timestamps_nofollow`, Linux `inotify` recursive `DirectoryWatcher`, `Argparse` subcommands/`option_many`/`positional_many`/`ParseOutcome`, top-level `LANGUAGES C CXX` & FetchContent SQLite3 amalgamation (`b50131f`) | — | VERIFIED | Standalone `/tmp/void-vbs-b` `-Werror` `788 ✔ / 3 ⊘` (`1.72s`), `ctest` `2/2` (`14.44s`, incl. `SystemOnly`, `ConfigurationOnly`, `SqliteOnly`); full RelWithDebInfo (`1,452 ✔`), ASan+UBSan (`0` leaks/UB), TSan (`954 ✔`, `0` races) |
| VL-006, VL-007 | Optional `OpenSSL::Crypto` (`VOID_CRYPTO_HAS_OPENSSL`) + pure-C++ FIPS 180-4 SHA-1/256/512 & RFC 7693 BLAKE2b-256/512 + HMAC/HKDF + `snake_case` hash aliases (`22c8538`); optional `LibArchive` (`VOID_ARCHIVE_HAS_LIBARCHIVE`) + pure-C++ USTAR/PAX tar & deterministic `ArchiveCompression::Gzip` + `create()` (`22c8538`) | — | VERIFIED | Zero-OpenSSL `534 ✔ / 3 ⊘` (`1.09s`, `ctest` `2/2` `5.59s`); zero-LibArchive `405 ✔ / 3 ⊘` (`1.45s`, `ctest` `2/2` `6.22s`); full-backend `888 ✔ / 3 ⊘` (`3.70s`, `ctest` `2/2` `15.53s`); full RelWithDebInfo (`1,452 ✔`), ASan+UBSan (`0` leaks/UB), TSan (`954 ✔`, `0` races) |
| VL-004, VL-005 | POSIX TCP HTTP/1.1 `HttpServer` (`query`, `file_body`/`from_file`, `Router::allowed_methods`, `bound_port`, `431`/`413`, TE+CL smuggling `400`, streaming `BodyReader`, `HEAD`->`GET`, `shutdown`), streaming `HttpClient` + `HttpClient::secure()` TLS >= 1.2 + CA/SAN + cross-origin/downgrade/redaction + `NetErrorCode` (`kNetErrorDomain = 26`) + `std::stop_token` + `NetOnly` consumer (`66baae7`) + TSan `-Wno-tsan` scope & `StallServer` fix (`9920bfd`) | — | VERIFIED | Standalone `Net;System;Crypto;Testing` `563 ✔ / 3 ⊘` (`2.36s`), `ctest` `2/2` (`8.48s` incl. `NetOnly`); Debug TSan `954 ✔ / 3 ⊘` (`10.65s`, `0` races); full RelWithDebInfo `1,452 ✔ / 4 ⊘` (`22.09s`), `ctest` `2/2` (`82.82s`, `35` consumers); ASan+UBSan `1,452 ✔` (`39.11s`) + `Http\|Net\|Server` `9/9` (`1.58s`, `0` leaks/UB) |
## Wave 9 — P2 Completion: Net, TestingMock, ShortUrl, RPC (`feat/roadmap-p2-wave9`)
| ID | Deliverable | Spec | State | Verification summary |
| --- | --- | --- | --- | --- |
| M-NET-01..05 | Native incremental RFC 9110/9112 `HttpRequestParser` / `HttpResponseParser` (smuggling rejection, 1xx/HEAD/chunked/trailers/EOF), bounded `ConnectionPool` (`PoolKey` origin+proxy+TLS generation, `MonotonicClock` idle eviction, RAII `ConnectionLease`), descriptor-pinned `StaticFileResolver::open_safe()` (`openat`+`O_NOFOLLOW`), `HttpClient` `303`/`307` redirect & single-deadline hardening, RFC 6455 `WebSocket` codec/decoder/`WebSocketClient` & `HttpServer::add_websocket_route()` (`86d777e`) | [M-NET-01-05](tasks/M-NET-01-05.md) | VERIFIED | Standalone `Net;System;Crypto;TestingMock;Testing` `44/44 ✔` (`1.31s`), `ctest` `2/2` (`10.96s` incl. `NetOnly`); Debug TSan `940 ✔ / 3 ⊘` (`24.15s`, `0` races); full RelWithDebInfo `1,466 ✔ / 4 ⊘` (`23.56s`, `ctest` `2/2` `91.13s`, `38` consumers); ASan+UBSan `1,466 ✔` (`41.95s`, `0` leaks/UB) |
| M-TESTINGMOCK-01..04 | Explicit `MockSession` (`kTestingMockErrorDomain = 27`, `freeze(SingleThread\|ConcurrentActions)`, `verify_and_close()`, `MockLimits`, `RegistrationToken`), `Sequence` order groups, action-outside-lock reservation (same-thread reentry + concurrent actions), perfect forwarding + `returns_once`/`invokes_once` move-only support, `never()`/`at_least`/`at_most`/`between`, matcher combinators (`Ne`, `EndsWith`, `IsNull`, `NotNull`, `NotOf`, `AllOf`, `AnyOf`, depth bound 32), `TestingMockOnly` consumer (`658c21a`) | [M-TESTINGMOCK-01-04](tasks/M-TESTINGMOCK-01-04.md) | VERIFIED | Standalone `TestingMock*` 18/18 ✔ + `ctest` `TestingMockOnly`; Debug TSan `940 ✔ / 3 ⊘` (`24.15s`, `0` races); full RelWithDebInfo `1,466 ✔` (`38` consumers); ASan+UBSan `1,466 ✔` (`0` leaks/UB) |
| M-SHORTURL-01..04 | Frozen `V1` ABI preserved + additive `Void::ShortUrl::V2` (`kShortUrlErrorDomain = 28`, URL/key validation, base62 rejection-sampled keys, civil expiry, tombstone non-reuse, 24h idempotency, `LocalProvider`, `V1Adapter`), separate `ShortUrlStorage` (`Void::Storage` conditional batches + `SecurityRandomBytesPort`), separate `ShortUrlRemote` (capability pre-checks, `Retry-After`, `UnknownOutcome`), `ShortUrlOnly` consumer (`691808e`) | [M-SHORTURL-01-04](tasks/M-SHORTURL-01-04.md) | VERIFIED | Standalone `ShortUrl;ShortUrlStorage;ShortUrlRemote;RPC;System;Testing` `ShortUrl*` 5/5 ✔, `ctest` `2/2` (`36.84s` incl. `ShortUrlOnly`); Debug TSan `940 ✔ / 3 ⊘` (`24.15s`, `0` races); full RelWithDebInfo `1,466 ✔` (`38` consumers); ASan+UBSan `1,466 ✔` (`0` leaks/UB) |
| S-RPC-01..03 | NEW `Void::RPC` subsystem (`kRpcErrorDomain = 29`), Wire v1 big-endian binary envelope codec (`VRPC`, fail-closed on unknown major/required flags/reserved/overflow, skippable minor extensions, `Binary::Reader` `std::memcpy` fix), unary `/void-rpc/v1/call` HTTP/1.1 `Server` & `Client` with `AuthHook`, schema negotiation, timeout clamping, sanitized handler exceptions, `Registration::unregister_and_drain()`, `RpcOnly` consumer (`5184d1c`) | [S-RPC-01-03](tasks/S-RPC-01-03.md) | VERIFIED | Standalone `Rpc` 2/2 ✔, `ctest` `2/2` (`36.84s` incl. `RpcOnly`); Debug TSan `940 ✔ / 3 ⊘` (`24.15s`, `0` races); full RelWithDebInfo `1,466 ✔` (`38` consumers); ASan+UBSan `1,466 ✔` (`0` leaks/UB) |
## Wave 10 — P3 Core Subsystems: Discovery, Scheduler, Messaging (`feat/roadmap-p3-wave10`)
| ID | Deliverable | Spec | State | Verification summary |
| --- | --- | --- | --- | --- |
| S-DISCOVERY-01..04 | NEW `Void::Discovery` (`kDiscoveryErrorDomain = 30`, pure `Catalog`, atomic `replace_static()`, provider generation resets, local RAII `Registration` + steady-clock leases & zero-TTL rejection, `ManagedLeaseRenewer`, bounded `WatchHandle` with coalesced `ResyncRequired` + self-cancel + `SelfJoin`, `WeightedRoundRobinSelector`, HRW `AffinitySelector`) + separate `Void::DiscoveryRpc` (identity-preserving TLS refresh; `RPC` remains Discovery-free), `DiscoveryOnly` consumer (`ec8c0bd`) | [S-DISCOVERY-01-04](tasks/S-DISCOVERY-01-04.md) | VERIFIED | Standalone `Discovery;DiscoveryRpc;Testing` `5/5 ✔` (`9.4ms`), `ctest` `2/2` (`11.26s` incl. `DiscoveryOnly` `_no_external_deps` & `RpcOnly`); Debug TSan `900 ✔ / 3 ⊘` (`23.20s`, `0` races); full RelWithDebInfo `1,480 ✔ / 4 ⊘` (`41` consumers); ASan+UBSan `1,480 ✔` (`0` leaks/UB) |
| S-SCHEDULER-01..04 | NEW `Void::Scheduler` (`kSchedulerErrorDomain = 31`, monotonic min-heap, one-shot/fixed-delay/fixed-rate, 5-field `CalendarExpression`, explicit `TimezoneRegistry` DST gap/fold & unknown-zone rejection, O(1) `CoalesceLatest` over >2.6M missed minutes, 100/pass `CatchUpBounded`, overlap policies, retries/dead-letter, revision invalidation watermark, `close_and_join`) + durable `Void::SchedulerStorage` (`StorageJobStore` exclusive owner lock, unique civil-slot dedup, crash `Running -> Pending` recovery preserving `OccurrenceId`, `UnknownOutcome`, retention-cap pause), `SchedulerOnly` consumer (`aaeab50`) | [S-SCHEDULER-01-04](tasks/S-SCHEDULER-01-04.md) | VERIFIED | Standalone `Scheduler;SchedulerStorage;System;Testing` `5/5 ✔` (`167.3ms`), `ctest` `2/2` (`30.06s` incl. `SchedulerOnly` `_no_external_deps`); Debug TSan `900 ✔ / 3 ⊘` (`23.20s`, `0` races); full RelWithDebInfo `1,480 ✔` (`41` consumers); ASan+UBSan `1,480 ✔` (`0` leaks/UB) |
| S-MESSAGING-01..04 | NEW `Void::Messaging` (`kMessagingErrorDomain = 32`, explicit `PublishDurability`, nondurable `InMemoryQueue`, `Pending -> InFlight(gen, visibility) -> Acked \| Pending \| DeadLetter`, competing/`SingleActive` groups, stale-receipt fencing, idempotent ack, retries/DLQ, corrupt quarantine) + `Void::MessagingStorage` (`StorageQueue` durable batches, restart generation bump preserving attempts, atomic DLQ move & `stuck_dlq_count`, bounded 24h/100k idempotency, `BlockAtQuota` & clock-health pause, `OutboxInbox` single-batch local helper) + `Void::MessagingRpc` (`RpcQueueServer`/`RpcQueueClient`), `MessagingOnly` consumer (`60ee28e`) | [S-MESSAGING-01-04](tasks/S-MESSAGING-01-04.md) | VERIFIED | Standalone `Messaging;MessagingStorage;MessagingRpc;System;Testing` `4/4 ✔` (`217.4ms`), `ctest` `2/2` (`31.73s` incl. `MessagingOnly` `_no_external_deps` & `RpcOnly`); Debug TSan `900 ✔ / 3 ⊘` (`23.20s`, `0` races); full RelWithDebInfo `1,480 ✔` (`41` consumers); ASan+UBSan `1,480 ✔` (`0` leaks/UB) |
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.
## Wave 11 — Execution-path backfill (`feat/roadmap-p2-wave11`)
Baseline: `main` at `38436b1`; full RelWithDebInfo `-Werror` (`/tmp/void-w11-base`, 55 modules):
`VoidTests` 1,484 discovered (1,480 ✔, 4 ⊘, 0 ✘) in 26.99 s; `ctest` 2/2 (111.68 s).
Post-fix integrated verification (`c6de784`): adversarial review (`CHANGES_REQUIRED`: 1 P1 + 7 P2 + 1 P3 on `7bea7df`) fixed in `c6de784` (+10 regression tests, post-fix review `READY`); full 55-module RelWithDebInfo `1,694` (`1,690 ✔`, `4 ⊘`, `0 ✘`), `ctest` `2/2` (`110.10s`, `41` consumers), Debug ASan+UBSan `1,694` (`0` leaks/UB), Debug TSan `1,035` (`1,032 ✔`, `3 ⊘`) + 3×`169/169 ✔` stress loop (`0` races).
Decisions: D-033..D-043.
| ID | Deliverable | Spec | State | Verification summary |
| --- | --- | --- | --- | --- |
| W11-PLAN | Architecture/task plan + REV1 addendum + R2 contract | [W11-PLAN](tasks/W11-PLAN.md), [output](tasks/W11-PLAN-OUTPUT.md), [REV1](tasks/W11-PLAN-REV1-OUTPUT.md), [R2](tasks/W11-CONTRACT-R2.md) | DONE | PREFLIGHT 1 & 2 resolved via REV1/D-038 & R2/D-040; spec review S1–S9, A1–A3 adopted via D-042 |
| M-FUNCTIONAL-03 | Pure retry decisions + named blocking adapter (A1) | [spec](tasks/M-FUNCTIONAL-03.md) | VERIFIED (`26edf65`) | Review W11-REVIEW-A1 READY; ResilienceAsync subset 475 (472 ✔, 3 ⊘), filtered 43/43, ctest 2/2, TSan 40/40 (0 races), ASan+UBSan 40/40; verified in post-W11 full suite (`c6de784`) |
| M-TIME-03 | Injected-deadline domains: TimerQueue + clock saturation (B1); `retry_async` (B1b) | [spec](tasks/M-TIME-03.md), [B1b](tasks/M-TIME-03-B1b.md) | VERIFIED (`99a1100`, `5c24f8e`) | W11-REVIEW-B1 & B1b READY; root 697 (694 ✔, 3 ⊘), TSan 33/33 + 5×15/15, ASan 468 ✔; verified in post-W11 full/TSan suites (`c6de784`) |
| M-ASYNC-04 | ThreadExecutor, FuturePool, AsyncChannel, bounded ParallelFor (A2) + `spawn()` race & ParallelFor last-ref fixes | [spec](tasks/M-ASYNC-04.md) | VERIFIED (`b2c8411`) | 109/109, TSan 6×47/47, ASan 46/46; verified in post-W11 full/ASan/TSan+3×stress suites (`c6de784`) |
| M-ASYNC-05 | EventBus/Observable snapshot dispatch, joined subscriptions (A3) + post-review capture-lifetime & pumping self-join fixes | [spec](tasks/M-ASYNC-05.md) | VERIFIED (`ef85ce0`, `c6de784`) | Targeted TSan 110/110 ✔; verified in post-W11 full/ASan (`1,690 ✔`) & TSan (`1,032 ✔` + 3×`169/169 ✔`) |
| S-IO-03 | Bounded positional file workers, sync, active-cancel, shutdown core, D1 fixes (B2) + `MockBackend::try_acquire` TOCTOU & epoll `EPOLLIN` fixes | [spec](tasks/S-IO-03.md) | VERIFIED (`1e752da`, `c6de784`) | IO 37/37, TSan 37/37 + 30 loops, ASan clean; post-fix `c6de784` full/ASan/TSan+3×stress (`1,690 ✔` / `1,032 ✔` + 3×`169/169 ✔`) |
| S-IO-04 | `Driver::run`, `Pump.hpp` `pump_until`, SystemAsync shutdown conformance (A4) + steady_clock idle pacing fixes | [spec](tasks/S-IO-04.md) | VERIFIED (`50029e1`, `c6de784`) | Targeted & integrated post-W11 RelWithDebInfo, `ctest` 2/2 (`41` consumers), ASan+UBSan, & TSan+3×stress (`0` races) |
| S-RUNTIME-02 | Explicit start, readiness, reverse failed-start cleanup + concurrent start/shutdown synchronization | [spec](tasks/S-RUNTIME-02-03.md) | VERIFIED (`7bea7df`, `c6de784`) | `verify_runtime.sh` 6/6 gates (incl. `nosys` & zero `Void/System/` includes), full/ASan/TSan+3×stress (`c6de784`) |
| S-RUNTIME-03 | Structured shutdown, repeated join, exporter-before-executor ordering + embedded background-worker & poll exporter fixes | [spec](tasks/S-RUNTIME-02-03.md) | VERIFIED (`7bea7df`, `c6de784`) | `RuntimeStart`/`RuntimeSignals`/`RuntimeShutdown`/`RuntimeHost` `37/37 ✔` (RelWithDebInfo, TSan, ASan) & post-W11 full/ASan/TSan (`c6de784`) |
P0 characterization tasks (`M-*-01`, `S-ALGORITHMS-01`, `S-MEMORY-01`): folded into follow-on
specs' observed baselines (D-035); not separately scheduled.
## VoidForge upstream requests (scheduled after Wave 11; D-037)
| ID | Priority | Request (VoidLibrary owns final signatures) | State |
| --- | --- | --- | --- |
| VL-STREAM-01 | P0 | Duplex HTTP response streaming: `HttpServer` duplex route + scoped response writer (begin/write_some/finish), per-exchange cancel/deadline, chunked/fixed/bodyless framing, pre-header error vs post-header abort | PLANNED |
| VL-PROC-01 | P0 | Binary subprocess session (argv-only, env allowlist, independent stdout/stderr drain, bounded buffering, NUL-safe, distinguishable EOF/exit/timeout/cancel/truncation) | PLANNED |
| VL-WIN-01 | P0 (later) | Windows HANDLE backend for VL-PROC-01 and HttpClient file transfer; client-only Net selection | PLANNED (deferred until requested) |
| VL-WASM-01 | P1 | Bounded `Text/Diff.hpp` (`DiffLimits`, checked sizes, work/memory caps, cancellation, explicit incomplete result, reflection-free build) | PLANNED |
| VL-MCP-01 | P1 | Generic MCP foundations (envelope, bounded JSON-RPC framing, Streamable HTTP + stdio bindings, auth callback); depends on VL-STREAM-01; RPC untouched | PLANNED |
| VL-TOML-01 | P1 | Qualify `Data/Toml` limits for dotted keys/table paths/inline tables; API change only with reproducer | PLANNED |
| VL-LUA-01 | P2 | Sandboxed Lua runtime (allocation/step budgets, no ambient IO) | PLANNED (backend decision needed) |
| VL-STORE-01 | P2 | Native Storage conformance support for Forge | PLANNED |
| VL-SQLITE-01 | P2 (non-blocking) | Structural SQLite primary/extended result codes (distinguish UNIQUE/CONSTRAINT vs BUSY/LOCKED) instead of message-only (`Sqlite/Types.hpp`, `Sqlite.cpp`) | PLANNED |
| VL-SQLITE-02 | P2 (non-blocking) | Documented `Unknown` commit outcome for failed COMMIT under WAL I/O error (like `Storage` `Outcome::Unknown`) | PLANNED |
| VL-SEC-01 | P2 (non-blocking) | Public CSPRNG bytes API (e.g. `Security::random_bytes(std::span<unsigned char>)`) | PLANNED |
| VL-SQLITE-03 | P3 (non-blocking) | Per-connection, phase-targetable `ScopedFaultGuard` (incl. "COMMIT succeeded but reported failure") | PLANNED |
| VL-SQLITE-04 | P3 (non-blocking) | Per-call busy-timeout override | PLANNED |
| VL-NET-W01 | P2 (hygiene) | `src/Net/HttpServer.cpp:1797,1871` ignore `read()`/`write()` results (`-Wunused-result` under consumer flags, likely `_FORTIFY_SOURCE`); VoidLibrary's own `-Werror` build at `38436b1` passes | PLANNED |
| VL-SQLITE-05 | P2 (non-blocking) | Write admission and `wal_checkpoint_recommended` use on-disk `-wal` size, which passive checkpoints never shrink, so `begin(Immediate)` stays `overloaded`; admit on un-checkpointed frames or truncate on admission failure (`Sqlite.cpp` ~:417-423, :1756-1762, :1918-1923) | PLANNED |
| VL-SQLITE-06 | P2 (non-blocking) | `Statement::step`/`exec` do not detect SQLite automatic rollback (FULL/IOERR/NOMEM/BUSY/INTERRUPT) via `sqlite3_get_autocommit`, so `Transaction` stays `Active` and later statements run in autocommit (`Sqlite.cpp` ~:884-910) | PLANNED |
## Quality findings surfaced during Wave 11 (backlog, root-owned)
| ID | Finding | Source | State |
| --- | --- | --- | --- |
| X-QA-01 | `VOID_WARNINGS_AS_ERRORS=ON` does not reach the generated `VoidTests` translation units, so test code is not compiled with `-Werror` | M-FUNCTIONAL-03 implementer report | PLANNED (verify, then fix in `tests/CMakeLists.txt`) |
| X-QA-02 | `src/Testing/Runner.cpp` recomputes pass/fail from only the first 1,000 retained assertions per test (`kMaxRetainedAssertionsPerTest`); later failures in one test can pass silently | M-FUNCTIONAL-03 implementer report | PLANNED (verify, then count failures independently of retention) |
| X-QA-03 | Test scanner is line-anchored; a wrapped test declaration is silently dropped | M-FUNCTIONAL-03 implementer report | PLANNED (scanner hardening or lint) |
| X-WF-01 | Agent `isolation: worktree` checkouts start at `main` (`38436b1`), not the wave branch tip; dispatches must fast-forward the worktree to the stated HEAD first | Observed in A1 | RECORDED (dispatch rule) |
## VoidForge upstream requests — M04 identity batch (received 2026-11-29; D-041)
| ID | Priority | Request | State |
| --- | --- | --- | --- |
| VL-CRYPTO-01 | P1 | Generic `Crypto::hmac(HashAlgorithm, key, message)` incl. HMAC-SHA1 (TOTP RFC 6238/4226); RFC 2202 vectors | PLANNED |
| VL-CRYPTO-02 | P1 | `pbkdf2_hmac_sha256(password, salt, iterations, out_len)` (RFC 8018 §5.2) on the builtin HMAC path; RFC 7914 §11 vectors; bounded iterations/output | PLANNED |
| VL-NET-02 | P1 (blocks Forge production email) | Public TLS client stream (TCP+TLS, CA + hostname verification, STARTTLS upgrade) + minimal SMTP submission client (EHLO, STARTTLS-required or implicit TLS, AUTH PLAIN over TLS only, MAIL/RCPT/DATA with dot-stuffing, bounded size, deadlines) | PLANNED |
| VL-TEXT-01 | P2 | RFC 4648 base32 + Crockford base32 encode/decode | PLANNED |
| X-QA-04 | AsyncRetry follow-ups from W11-REVIEW-B1b: race test only exercises the late-stop interleaving (add handshake/alternation); add direct checks of `detail::retry_backoff_stop_reason`; add a throwing-classifier test | W11-REVIEW-B1b P3-1/2/4 | PLANNED |
+311
View File
@@ -0,0 +1,311 @@
# 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 |
| Wave 7 `Sqlite` & `SqliteAsync` standalone (`84e6fe8`) | `dev cpp-gcc -p sqlite` RelWithDebInfo (`-Werror`, `/tmp/void-w7-sqlite`), 8 modules, `VoidTests --filter 'Sqlite*\|...'` + `ctest` | **PASSED**: `SqliteTests` 8 + `SqliteHardening` 4 + `SqliteAsync` 2 = 14/14 in `426.5ms`; `ctest` 2/2 in `5.11s` (`VoidTests` 0.87s, `VoidInstalledComponentConsumers` including `SqliteOnly` & `SqliteAsyncOnly` 4.23s) |
| Wave 7 `Storage` standalone (`fdf0da5`, `G-STORE`) | `dev cpp-gcc` zero `-p` external deps RelWithDebInfo (`-Werror`, `/tmp/void-w7-storage`), 10 modules, `VoidTests --filter '^storage_'` + `ctest` | **PASSED**: `Storage` 5/5 in `14.53s`; `ctest` 2/2 in `24.07s` (`StorageOnly` verified with Boost/LibArchive/OpenSSL/PkgConfig/SQLite3/Threads disabled) |
| Wave 7 TSan (`84e6fe8`) | `dev cpp-gcc -p sqlite` Debug TSan (`-Werror`, `/tmp/void-w7-tsan`, `TSAN_OPTIONS=halt_on_error=1:second_deadlock_stack=1`), 12 modules (`SqliteAsync;Storage;Testing`) | **PASSED**: 19/19 in `15.38s` (`SqliteTests` 8, `SqliteHardening` 4, `SqliteAsync` 2, `Storage` 5), exit 0, 0 TSan data races / lock-order warnings |
| Wave 7 integrated RelWithDebInfo + consumers (`84e6fe8`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` RelWithDebInfo (`-Werror`, `/tmp/void-w7-full`), 43 modules, `VoidTests` + `ctest` | **PASSED**: `1,417` discovered (`1,414 ✔`, `3 ⊘` skipped, `0 ✘`) in `21.06s`; `ctest` 2/2 in `65.05s` (`VoidTests` 20.95s, all 28 installed consumers 44.10s) |
| Wave 7 full Debug ASan+UBSan (`84e6fe8`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug ASan+UBSan (`-Werror`, `/tmp/void-w7-asan`, `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1`, `UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1`), 43 modules | **PASSED**: `1,417` discovered (`1,414 ✔`, `3 ⊘` skipped, `0 ✘`) in `36.47s`, 0 leaks, 0 UB |
| Post-W7 Benchmark (`84e6fe8`, `VOID_GIT_REV=fdf0da5ca883`) | `/tmp/void-w7-full/benchmarks/VoidFoundationBench --json /tmp/void-w7-full/post-w7.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.40ns, `core_uuid_parse_hyphenated` 25.06ns, `core_uuid_to_string` 16.69ns, `core_hash_fnv1a64_256b` 181.03ns, `core_hash_murmur3_256b` 67.90ns, `functional_result_ok_chain` 1.13ns, `functional_error_with_context` 58.24ns, `math_checked_add_loop` 0.47ns, `containers_spsc_ring_push_pop` 8.80ns, `containers_lru_get_put` 20.62ns, `binary_reader_u64_be` 1.31ns, `data_json_parse_small_object` 310.70ns, `data_json_serialize_small_object` 160.98ns |
| Wave 8 `Service` & `ServicePlugin` standalone (`1474a69`) | `dev cpp-gcc` RelWithDebInfo (`-Werror`, `/tmp/void-w8-service`, `Service;ServicePlugin;Testing`), `VoidTests` + `ctest` | **PASSED**: `18/18` in `0.4ms`; `ctest` `2/2` in `7.47s` (`ServiceOnly` & `ServicePluginOnly` consumers) |
| Wave 8 `Plugin` standalone (`a24e086`) | `dev cpp-gcc` RelWithDebInfo (`-Werror`, `/tmp/void-w8-plugin`, `Plugin;ServicePlugin;Testing`), 9 pure-C11 `-Werror` fixtures + `VoidTests` + `ctest` | **PASSED**: `33 tests` (`32 ✔`, `1 ⊘` `plugin_load_and_query_skipped`, `0 ✘`) in `194.5ms`; `ctest` `2/2` in `9.45s` (`PluginOnly` consumer) |
| Wave 8 `Configuration` & `ConfigurationAsync` standalone (`1dc51d5`) | `dev cpp-gcc` RelWithDebInfo (`-Werror`, `/tmp/void-w8-config`, `ConfigurationAsync;Testing`), `VoidTests --filter 'Configuration'` + `ctest` | **PASSED**: `ConfigurationHardening` 3/3 + `ConfigurationAsync` 3/3 = `6/6` in `0.7ms`; `ctest` `2/2` in `13.75s` (`ConfigurationOnly` & `ConfigurationAsyncOnly` consumers) |
| Wave 8 `Fsm` standalone (`ef5312c`) | `dev cpp-gcc` RelWithDebInfo (`-Werror`, `/tmp/void-w8-fsm`, `Fsm;Testing`), `VoidTests` + `ctest` | **PASSED**: `816 tests` (`814 ✔`, `2 ⊘`, `0 ✘`) in `789.1ms`; `ctest` `2/2` in `9.59s` (`FsmOnly` consumer) |
| Wave 8 TSan (`cb988fa`) | `dev cpp-gcc` Debug TSan (`-Werror`, `/tmp/void-w8-tsan`, `TSAN_OPTIONS=halt_on_error=1:second_deadlock_stack=1`), 20 modules (`ServicePlugin;ConfigurationAsync;Fsm;Testing`), `VoidTests` | **PASSED**: `1,110 tests` (`1,107 ✔`, `3 ⊘` skipped, `0 ✘`) in `11.49s` (incl. `ServiceHardening` 5/5, `PluginHardening` 5/5, `Configuration*` 6/6, `FsmHardening` 4/4, `internal_FsmServiceHotReload` 4/4), exit `0`, `0` TSan warnings |
| Wave 8 integrated RelWithDebInfo + consumers (`cb988fa`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` RelWithDebInfo (`-Werror`, `/tmp/void-w8-full`), 45 modules, `VoidTests` + `ctest` | **PASSED**: `1,437` discovered (`1,434 ✔`, `3 ⊘` skipped, `0 ✘`) in `20.99s`; `ctest` `2/2` in `77.11s` (`VoidTests` `20.97s`, all `34` installed consumers `56.13s`) |
| Wave 8 full Debug ASan+UBSan (`cb988fa`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug ASan+UBSan (`-Werror`, `/tmp/void-w8-asan`, `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1`, `UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1`), 45 modules | **PASSED**: `1,437` discovered (`1,434 ✔`, `3 ⊘` skipped, `0 ✘`) in `37.13s`, `0` leaks, `0` UB |
| Post-W8 Benchmark (`cb988fa`, `rev=cb988fa98509`) | `/tmp/void-w8-full/benchmarks/VoidFoundationBench --json /tmp/void-w8-full/post-w8.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.38ns, `core_uuid_parse_hyphenated` 24.71ns, `core_uuid_to_string` 16.45ns, `core_hash_fnv1a64_256b` 179.94ns, `core_hash_murmur3_256b` 67.31ns, `functional_result_ok_chain` 1.12ns, `functional_error_with_context` 57.98ns, `math_checked_add_loop` 0.47ns, `containers_spsc_ring_push_pop` 8.72ns, `containers_lru_get_put` 20.58ns, `binary_reader_u64_be` 1.30ns, `data_json_parse_small_object` 319.62ns, `data_json_serialize_small_object` 167.55ns |
| Batch A `VL-002`/`008`/`009`/`012`/`013` (`adfc854`) | `dev cpp-gcc -c` RelWithDebInfo (`-Werror`, `/tmp/void-vbs-a`, `Data;Text;Testing`) + pure `g++` zero-CMake multi-file stem collision binary (`tests/package/TestingNativeGxx/{dir_a,dir_b}/dup.cpp`) | **PASSED**: `VoidTests` `690 tests` (`687 ✔`, `3 ⊘`, `0 ✘`) in `351.9ms`; pure `g++` `4/4` (`0.1ms`), `--list`, `--filter from_dir_b` `1/1` |
| Batch B `VL-001`/`003`/`010`/`011` (`b50131f`) | `dev cpp-gcc -c` RelWithDebInfo (`-Werror`, `/tmp/void-vbs-b`, FetchContent SQLite3 amalgamation), `VoidTests` + `ctest` | **PASSED**: `VoidTests` `791 tests` (`788 ✔`, `3 ⊘`, `0 ✘`) in `1.72s`; `ctest` `2/2` in `14.44s` (`VoidTests` `1.76s`, `VoidInstalledComponentConsumers` `12.68s` incl. `SystemOnly`, `ConfigurationOnly`, `SqliteOnly`) |
| Batch C zero-OpenSSL `VL-007` (`22c8538`) | `dev cpp-gcc -c` RelWithDebInfo (`-Werror`, `/tmp/void-vbs-no-openssl`, `-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=TRUE`, `Crypto;System;Text;Testing`) | **PASSED**: `VoidTests` `537 tests` (`534 ✔`, `3 ⊘`, `0 ✘`) in `1.09s`; `ctest` `2/2` in `5.59s` incl. `CryptoOnly` |
| Batch C zero-LibArchive `VL-006` (`22c8538`) | `dev cpp-gcc -c` RelWithDebInfo (`-Werror`, `/tmp/void-vbs-no-libarchive`, `-DCMAKE_DISABLE_FIND_PACKAGE_LibArchive=TRUE`, `Archive;Testing`) | **PASSED**: `VoidTests` `408 tests` (`405 ✔`, `3 ⊘`, `0 ✘`) in `1.45s`; `ctest` `2/2` in `6.22s` incl. `ArchiveOnly` |
| Batch C full backends `VL-006`/`007` (`22c8538`) | `dev cpp-gcc -p libarchive -p openssl -c` RelWithDebInfo (`-Werror`, `/tmp/void-vbs-c`, `Crypto;CryptoAsync;Archive;Update;Testing`) | **PASSED**: `VoidTests` `891 tests` (`888 ✔`, `3 ⊘`, `0 ✘`) in `3.70s`; `ctest` `2/2` in `15.53s` incl. `CryptoOnly`, `CryptoAsyncOnly`, `ArchiveOnly`, `UpdateOnly`, `Audited` |
| Batch D `VL-004`/`005` (`66baae7`) | `dev cpp-gcc -p openssl -c` RelWithDebInfo (`-Werror`, `/tmp/void-vbs-d`, `Net;System;Crypto;Testing`) | **PASSED**: `VoidTests` `566 tests` (`563 ✔`, `3 ⊘`, `0 ✘`) in `2.36s`; `ctest` `2/2` in `8.48s` (`VoidTests` `2.39s`, `VoidInstalledComponentConsumers` `6.09s` incl. `NetOnly`) |
| Integrated RelWithDebInfo + consumers (`66baae7`, `9920bfd`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` RelWithDebInfo (`-Werror`, `/tmp/void-vbs-full`), 45 modules, `VoidTests` + `ctest` | **PASSED**: `1,456` discovered (`1,452 ✔`, `4 ⊘`, `0 ✘`) in `21.94s`; `ctest` `2/2` in `82.82s` (`VoidTests` `22.03s`, `VoidInstalledComponentConsumers` `60.79s` across all `35` consumers incl. `NetOnly`); post-`9920bfd` rebuild `VoidTests` `1,456` (`1,452 ✔`, `4 ⊘`) in `22.09s` |
| Full Debug ASan+UBSan (`66baae7`, `9920bfd`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug ASan+UBSan (`-Werror`, `/tmp/void-vbs-asan`, `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1`, `UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1`), 45 modules | **PASSED**: `1,456` discovered (`1,452 ✔`, `4 ⊘`, `0 ✘`) in `39.11s`, `0` leaks, `0` UB; post-`9920bfd` incremental `--filter 'Http\|Net\|Server'` `9/9 ✔` in `1.58s` |
| Debug TSan (`9920bfd`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug TSan (`-Werror`, `/tmp/void-vbs-tsan`, `TSAN_OPTIONS=halt_on_error=1:second_deadlock_stack=1`), 17 modules (`Net;System;SystemAsync;Configuration;Crypto;Archive;Data;Text;Testing`) | **PASSED**: `957` discovered (`954 ✔`, `3 ⊘`, `0 ✘`) in `10.65s`, `0` data races, `0` lock-order warnings |
| Post-VBS Benchmark (`66baae7`, `rev=66baae74a0b7`) | `/tmp/void-vbs-full/benchmarks/VoidFoundationBench --json /tmp/void-vbs-full/post-vbs.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.40ns, `core_uuid_parse_hyphenated` 26.35ns, `core_uuid_to_string` 18.33ns, `core_hash_fnv1a64_256b` 185.86ns, `core_hash_murmur3_256b` 69.58ns, `functional_result_ok_chain` 1.16ns, `functional_error_with_context` 59.59ns, `math_checked_add_loop` 0.48ns, `containers_spsc_ring_push_pop` 8.97ns, `containers_lru_get_put` 21.17ns, `binary_reader_u64_be` 1.34ns, `data_json_parse_small_object` 316.05ns, `data_json_serialize_small_object` 174.83ns |
| Wave 9 `Net` & `TestingMock` standalone (`86d777e`, `658c21a`) | `dev cpp-gcc -p openssl -c` RelWithDebInfo (`-Werror`, `/tmp/void-w9-net`, `Net;System;Crypto;TestingMock;Testing`), filtered `VoidTests` + `ctest` | **PASSED**: `44/44 ✔` in `1.31s` (`NetHardening` 5/5, `SessionHardening` 4/4, all legacy Net/TestingMock suites); `ctest` `2/2` in `10.96s` (`VoidTests` `2.46s`, `VoidInstalledComponentConsumers` `8.50s` incl. `NetOnly` & `TestingMockOnly`) |
| Wave 9 `ShortUrl` & `RPC` standalone (`691808e`, `5184d1c`) | `dev cpp-gcc -p openssl -p libsodium -c` RelWithDebInfo (`-Werror`, `/tmp/void-w9-shorturl-rpc`, `ShortUrl;ShortUrlStorage;ShortUrlRemote;RPC;System;Testing`), filtered `VoidTests` + `ctest` | **PASSED**: `7/7 ✔` in `1.20s` (`Rpc` 2/2, `ShortUrl` 2/2, `ShortUrlV2` 1/1, `StorageRepository` 1/1, `RemoteProvider` 1/1); `ctest` `2/2` in `36.84s` (`VoidTests` `17.31s`, `VoidInstalledComponentConsumers` `19.54s` incl. `ShortUrlOnly` & `RpcOnly`) |
| Wave 9 integrated RelWithDebInfo + consumers (`5184d1c`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` RelWithDebInfo (`-Werror`, `/tmp/void-w9-full`), 48 modules, `VoidTests` + `ctest` | **PASSED**: `1,470` discovered (`1,466 ✔`, `4 ⊘`, `0 ✘`) in `23.56s`; `ctest` `2/2` in `91.13s` (`VoidTests` `23.27s`, `VoidInstalledComponentConsumers` `67.86s` across all `38` consumers incl. `NetOnly`, `TestingMockOnly`, `ShortUrlOnly`, `RpcOnly`) |
| Wave 9 full Debug ASan+UBSan (`5184d1c`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug ASan+UBSan (`-Werror`, `/tmp/void-w9-asan`, `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1`, `UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1`), 48 modules | **PASSED**: `1,470` discovered (`1,466 ✔`, `4 ⊘`, `0 ✘`) in `41.95s`, `0` leaks, `0` UB |
| Wave 9 Debug TSan (`5184d1c`) | `dev cpp-gcc -p openssl -p libsodium` Debug TSan (`-Werror`, `/tmp/void-w9-tsan`, `TSAN_OPTIONS=halt_on_error=1:second_deadlock_stack=1`), 22 modules (`Net;TestingMock;ShortUrl;ShortUrlStorage;ShortUrlRemote;RPC;System;Testing`) | **PASSED**: `943` discovered (`940 ✔`, `3 ⊘`, `0 ✘`) in `24.15s`, `0` data races, `0` lock-order warnings |
| Post-W9 Benchmark (`5184d1c`, `rev=5184d1cf8cdd`) | `/tmp/void-w9-full/benchmarks/VoidFoundationBench --json /tmp/void-w9-full/post-w9.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.49ns, `core_uuid_parse_hyphenated` 25.02ns, `core_uuid_to_string` 16.55ns, `core_hash_fnv1a64_256b` 183.63ns, `core_hash_murmur3_256b` 69.12ns, `functional_result_ok_chain` 1.15ns, `functional_error_with_context` 59.06ns, `math_checked_add_loop` 0.48ns, `containers_spsc_ring_push_pop` 8.93ns, `containers_lru_get_put` 21.47ns, `binary_reader_u64_be` 1.15ns, `data_json_parse_small_object` 297.72ns, `data_json_serialize_small_object` 172.85ns |
| Wave 10 `Discovery` & `DiscoveryRpc` standalone (`ec8c0bd`) | `dev cpp-gcc -p openssl -c` RelWithDebInfo (`-Werror`, `/tmp/void-w10-m1`, `Discovery;DiscoveryRpc;Testing`), filtered `VoidTests` + `ctest` | **PASSED**: `5/5 ✔` in `9.4ms` (`Catalog` 4/4, `EndpointAdapter` 1/1); `ctest` `2/2` in `11.26s` (`VoidTests` `0.60s`, `VoidInstalledComponentConsumers` `10.66s` incl. `DiscoveryOnly` `_no_external_deps` & `RpcOnly`) |
| Wave 10 `Scheduler` & `SchedulerStorage` standalone (`aaeab50`) | `dev cpp-gcc -c` zero external deps RelWithDebInfo (`-Werror`, `/tmp/void-w10-m2`, `Scheduler;SchedulerStorage;System;Testing`), filtered `VoidTests` + `ctest` | **PASSED**: `5/5 ✔` in `167.3ms` (`Scheduler` 3/3, `StorageJobStore` 2/2); `ctest` `2/2` in `30.06s` (`VoidTests` `16.51s`, `VoidInstalledComponentConsumers` `13.54s` incl. `SchedulerOnly` `_no_external_deps`) |
| Wave 10 `Messaging`, `MessagingStorage`, & `MessagingRpc` standalone (`60ee28e`) | `dev cpp-gcc -p openssl -c` RelWithDebInfo (`-Werror`, `/tmp/void-w10-m3`, `Messaging;MessagingStorage;MessagingRpc;System;Testing`), filtered `VoidTests` + `ctest` | **PASSED**: `4/4 ✔` in `217.4ms` (`Messaging` 1/1, `StorageQueue` 2/2, `RpcAdapter` 1/1); `ctest` `2/2` in `31.73s` (`VoidTests` `16.09s`, `VoidInstalledComponentConsumers` `15.63s` incl. `MessagingOnly` `_no_external_deps` & `RpcOnly`) |
| Wave 10 integrated RelWithDebInfo + consumers (`60ee28e`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` RelWithDebInfo (`-Werror`, `/tmp/void-w10-full`), 55 modules, `VoidTests` + `ctest` | **PASSED**: `1,484` discovered (`1,480 ✔`, `4 ⊘`, `0 ✘`) in `23.80s`; `ctest` `2/2` in `94.93s` (`VoidTests` `23.93s`, `VoidInstalledComponentConsumers` `71.00s` across all `41` consumers incl. `DiscoveryOnly`, `SchedulerOnly`, `MessagingOnly`) |
| Wave 10 full Debug ASan+UBSan (`60ee28e`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug ASan+UBSan (`-Werror`, `/tmp/void-w10-asan`), 55 modules | **PASSED**: `1,484` discovered (`1,480 ✔`, `4 ⊘`, `0 ✘`) in `42.48s`, `0` leaks, `0` UB |
| Wave 10 Debug TSan (`60ee28e`) | `dev cpp-gcc -p openssl` Debug TSan (`-Werror`, `/tmp/void-w10-tsan`), 23 modules (`Discovery;DiscoveryRpc;Scheduler;SchedulerStorage;Messaging;MessagingStorage;MessagingRpc;System;Testing`) | **PASSED**: `903` discovered (`900 ✔`, `3 ⊘`, `0 ✘`) in `23.20s`, `0` data races, `0` lock-order warnings |
| Post-W10 Benchmark (`60ee28e`, `rev=60ee28e4ca9b`) | `/tmp/void-w10-full/benchmarks/VoidFoundationBench --json /tmp/void-w10-full/post-w10.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.39ns, `core_uuid_parse_hyphenated` 25.18ns, `core_uuid_to_string` 16.66ns, `core_hash_fnv1a64_256b` 182.46ns, `core_hash_murmur3_256b` 68.53ns, `functional_result_ok_chain` 1.14ns, `functional_error_with_context` 59.10ns, `math_checked_add_loop` 0.47ns, `containers_spsc_ring_push_pop` 8.85ns, `containers_lru_get_put` 20.87ns, `binary_reader_u64_be` 1.14ns, `data_json_parse_small_object` 287.18ns, `data_json_serialize_small_object` 164.76ns |
| Wave 11 adversarial review & targeted fixes (`c6de784`) | Fresh adversarial review (`925b2cd8-7c57-4121-b6c5-b925c6a434f6`) on `7bea7df` -> `c6de784` (`verify_w11_fixes.sh` + `verify_runtime.sh`: Debug TSan `Async;IO;Runtime;System;Testing` + 6 Runtime gates, `-Werror`) | Review `CHANGES_REQUIRED` (1 P1 + 7 P2 + 1 P3) resolved in `c6de784` (+10 regression tests); post-fix review `READY`. Targeted TSan `110/110 ✔` in `599.1ms`; `verify_runtime.sh` 6/6 gates passed (`37/37 ✔` RelWithDebInfo, `nosys` `ctest` 2/2, TSan, ASan `224.8ms`, zero `Void/System/` includes in `include/Void/Runtime/**`) |
| Wave 11 integrated RelWithDebInfo + consumers (`c6de784`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` RelWithDebInfo (`-Werror`, `/tmp/void-w11-full`), 55 modules, `VoidTests` + `ctest` | **PASSED**: `1,694` discovered (`1,690 ✔`, `4 ⊘` skipped, `0 ✘`) in `25.13s`; `ctest` `2/2` in `110.10s` (`VoidTests` `25.01s`, `VoidInstalledComponentConsumers` `85.09s` across all `41` consumers) |
| Wave 11 full Debug ASan+UBSan (`c6de784`) | `dev cpp-gcc -p libarchive -p openssl -p sqlite -p libsodium` Debug ASan+UBSan (`-Werror`, `/tmp/void-w11-asan`, `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1`, `UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1`), 55 modules | **PASSED**: `1,694` discovered (`1,690 ✔`, `4 ⊘` skipped, `0 ✘`) in `67.61s`, `0` leaks, `0` UB |
| Wave 11 Debug TSan + 3x stress loop (`c6de784`) | `dev cpp-gcc` Debug TSan (`-Werror`, `/tmp/void-w11-tsan`, `TSAN_OPTIONS=halt_on_error=1:second_deadlock_stack=1`), 21 modules (`Async;IO;IPC;SystemAsync;Storage;Runtime;ConfigurationAsync;System;Testing`) | **PASSED**: unfiltered `1,035` (`1,032 ✔`, `3 ⊘` skipped, `0 ✘`) in `34.78s`; 3x Wave 11 stress loop `169/169 ✔` (`2.12s`, `3.07s`, `2.14s`), `0` data races / lock-order warnings |
| Post-W11 Benchmark (`c6de784`, `rev=c6de7842f732`) | `/tmp/void-w11-full/benchmarks/VoidFoundationBench --json /tmp/void-w11-full/post-w11.json` (RelWithDebInfo, warmup=5, reps=20, ops=10000) | Medians: `harness_empty_loop` 0.40ns, `core_uuid_parse_hyphenated` 26.06ns, `core_uuid_to_string` 18.06ns, `core_hash_fnv1a64_256b` 186.38ns, `core_hash_murmur3_256b` 69.57ns, `functional_result_ok_chain` 1.16ns, `functional_error_with_context` 61.13ns, `math_checked_add_loop` 0.50ns, `containers_spsc_ring_push_pop` 9.33ns, `containers_lru_get_put` 22.02ns, `binary_reader_u64_be` 1.19ns, `data_json_parse_small_object` 302.08ns, `data_json_serialize_small_object` 170.90ns |
@@ -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*"'
```
+228
View File
@@ -0,0 +1,228 @@
# M-ASYNC-04 — Bounded ThreadExecutor, FuturePool, cancellable AsyncChannel, bounded ParallelFor
Task ID: M-ASYNC-04
Role: sonnet-implementer
Status: READY
## 1. Context and baseline
- Wave 11 package step A2. Repo VoidLibrary, branch `feat/roadmap-p2-wave11`. You work in an isolated
git worktree of the HEAD given in your prompt (it includes M-FUNCTIONAL-03 and the M-TIME-03
`Async/Timer.hpp`); cwd = worktree root. Never read the user's untracked files in the main checkout.
- Baseline: full suite at `38436b1` = 1,484 tests, 1,480 passed, 4 skipped, 0 failed.
- Observed source (M-ASYNC-01 characterization folded in, D-035):
- `include/Void/Async/Executor.hpp:58-113`: `Executor` base (`post`, `try_post`, `post_completion`,
reservation API `supports_reservation/try_reserve_slot/commit_reserved/release_reserved`,
`has_background_workers`, `is_executor_thread` via `detail::ExecutorThreadGuard` ~:86-96).
`ManualExecutor` (:120-254) is the only executor; its bound excludes running work (:216-228) and
`post()` bypasses the bound (:128-135). No thread-backed executor exists.
- `include/Void/Async/ThreadPool.hpp` (`Void::Concurrency::ThreadPool`): `max_queue == 0` unbounded,
bound counts only the queue, `submit` throws after stop, `try_submit` returns `nullopt` for both
full and stopped; includes Log.
- `include/Void/Async/Channel.hpp` (`Concurrency::Channel`): blocking only; out of scope (capacity-0
deadlock is a recorded residual).
- `include/Void/Async/ParallelFor.hpp` (`Void::Concurrency::parallel_for`): one future per index;
on the first throwing `fut.get()` returns without joining the rest (lifetime hazard).
- Root prep `7f95f89` added `AsyncErrorCode::closed = 9` (→ `ErrorKind::cancelled`).
- M-TIME-03 provides `include/Void/Async/Timer.hpp` (`TimerQueue`, `TimerHandle`, `TimerEvent`,
`schedule_at(when, callback(TimerEvent) noexcept)`; `cancel()==false` means fired-or-firing).
- Requirements: roadmap row M-ASYNC-04 ("Bounded executors, cancellable channels, future pool adapter,
ParallelFor | Bounds include running work; producer stop and close-drain deterministic; chunk
errors join"); C-03..C-05; decisions D-038, D-040, D-W11-10, D-W11-13.
- MANDATORY design sources: `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md` §M-ASYNC-04,
`W11-PLAN-REV1-OUTPUT.md` F7, F11, F12, P3 (ThreadExecutor), `W11-CONTRACT-R2.md` N5.
Precedence R2 > REV1 > PLAN.
## 2. Objective and deliverables
NEW `include/Void/Async/ThreadExecutor.hpp`, `include/Void/Async/FuturePool.hpp`,
`include/Void/Async/AsyncChannel.hpp`; EDIT `include/Void/Async/ParallelFor.hpp` (NEW bounded overload
+ legacy overload joins all futures before rethrowing); NEW tests
`tests/standalone/Async/{ThreadExecutor,FuturePool,AsyncChannel,ParallelForBounded}.cpp`.
## 3. Scope and non-goals
Out: `Executor.hpp`, `Operation.hpp`, `TaskScope.hpp`, `ThreadPool.hpp`, `Channel.hpp` changes;
`async_wait_for_capacity` and channel byte budget (D-W11-13); EventBus/Observable (M-ASYNC-05);
build files.
## 4. Files to inspect
`include/Void/Async/{Executor,Operation,TaskScope,Task,ThreadPool,ParallelFor,Timer}.hpp`,
`include/Void/Async/Detail/Types.hpp`, `tests/standalone/Async/{OperationScope,Executor,ParallelFor,ThreadPool}.cpp`,
and the design sources in §1.
## 5. Write ownership and coordination
Write scope: `include/Void/Async/ThreadExecutor.hpp` (NEW), `include/Void/Async/FuturePool.hpp` (NEW),
`include/Void/Async/AsyncChannel.hpp` (NEW), `include/Void/Async/ParallelFor.hpp`,
`tests/standalone/Async/ThreadExecutor.cpp`, `tests/standalone/Async/FuturePool.cpp`,
`tests/standalone/Async/AsyncChannel.cpp`, `tests/standalone/Async/ParallelForBounded.cpp` (all NEW tests).
Forbidden: every other path. An IO worker may run concurrently in another worktree. No git
commit/branch/stash/reset.
## 6. Implementation or investigation approach
MANDATORY:
- ThreadExecutor: `create` starts no threads; `start()` once; a `before_worker_start(i)` hook error or
a caught `std::system_error` from `std::thread` joins started workers and returns an error (shared
path). Bound = queued + running normal-lane work (`max_admitted >= 1`); `try_post` → `overloaded`
at the bound; a slot is released only after the resumed handle returns. Every resume runs inside
`detail::ExecutorThreadGuard`. Legacy `post()` never rejects (counted; may exceed the bound); after
`close()` legacy `post()` goes to the completion lane (counted). `post_completion` uses a reserved,
prioritized lane that drains after `close()`. `join()` = close + drain both lanes until empty and
nothing running + join; on a worker returns `self_join`. After join, posts resume inline on the
caller (counted `inline_after_join`), never dropped. No drain cap (C-03); a self-reposting handle
that prevents join is a documented caller error. `~ThreadExecutor` without join = close()+join();
on its own worker → stderr diagnostic + `std::terminate`. NEW `idle()` (both lanes empty, nothing
running). Reservation API implemented and compatible with `TaskScope`.
- FuturePool: reserve-then-transfer; on rejection the callable is NOT moved; exceptions go to the
future; bound includes running work.
- AsyncChannel (F7 + N5): one mutex for buffer and both waiter lists; waiter nodes with state
`{linked, claimed, cancelled, timed_out, closed}`; pairing sender/receiver happens in one critical
section (unlink+claim the waiter, then move the value) so a value is always in exactly one place
(sender node, buffer, or receiver slot). Stop callbacks and timer callbacks take the same lock:
if still `linked` → unlink + `cancelled`/`timed_out` (sender keeps/gets back its value); if
`claimed` → no-op. Timer callbacks capture shared waiter state (`shared_ptr` control block) or a
`weak_ptr` to the channel + waiter id looked up under the lock — NEVER a raw pointer into a
coroutine frame (N5). Every resume via `post_completion` after unlock. A wait with a deadline but
no `timers` → `invalid_argument`. `close()` gives waiting senders `closed` + their value; receivers
drain the buffer FIFO then get `closed`. `capacity == 0` → `invalid_argument` at create.
- Bounded parallel_for: shared `detail::PForState` (decay-copied `F`, chunk counter, error slots);
runners submitted with `try_submit`; if rejected the caller runs chunks inline; no new chunk after
stop or (with `stop_on_error`) an error; the caller waits for EVERY submitted runner future
(including never-started ones); reported error = lowest-indexed failed chunk; nested use on the
same pool from a pool worker is documented unsupported. Legacy overload waits for all futures
before rethrowing the first exception (D-W11-10).
### Amendments from W11-SPEC-REVIEW-1 (MANDATORY; override earlier text where they differ)
Source: `docs/agent-workflow/tasks/W11-SPEC-REVIEW-1-OUTPUT.md` A1–A3 + P3 (decision D-042).
- A2 no-worker join: admission before `start()` queues normally. When no worker is running,
`join()` and the destructor drain both lanes inline on the caller under `ExecutorThreadGuard`
(counted as `inline_after_join`) and never wait. `start()` after `close()` or after a successful
`start()` → `invalid_argument`; after a failed `start()` it may be retried.
- A3 reservations: a reserved slot counts in `admitted()` and in the bound; `try_reserve_slot` after
`close()` → `stopped`; a reservation taken before `close()` stays binding (`commit_reserved` after
`close()` enqueues normally); `join()` also waits until no reservation is outstanding.
- P3: `make_async_error(ChannelError, ...)` is `inline`. AsyncChannel deadlines are judged by
`timers->clock()`; check stop, then deadline, then "deadline without timers" → `invalid_argument`,
before any state change (value returned in `SendFailure`); `TimerEvent::closed` → `cancelled`;
`schedule_at` failure `overloaded` → `ChannelError::overloaded`, `stopped` → `cancelled`;
`max_waiters` applies per direction, 0 → `invalid_argument`; frames hold `shared_from_this()`;
never construct or destroy a `std::stop_callback` while holding the channel mutex; destroying a
suspended Task is a caller error; the resume executor must outlive every pending resume; FIFO means
per-producer order. TimerQueue facts (from the M-TIME-03 implementation): `cancel() == true`
destroys the callback on the caller's thread before returning — so never call `TimerHandle::cancel()`
while holding the channel mutex if the callback's destructor could take it; `cancel() == false`
means fired-or-firing. parallel_for: at most `max_concurrency` chunks run at once (counting the
caller when it runs inline); `Kind::rejected` is not produced in this wave; precedence
`invalid_argument` > `failed` > `stopped`; `first >= last` → success; compute the range in the
unsigned type of `I`. ThreadExecutor: `idle()`/`stats()` are snapshots; the switch to inline mode
happens under the executor mutex; `admitted()` = queued + running + reserved. FuturePool: if
creating the frame throws, release the slot and rethrow. `ExecutorThreadGuard` is at
`Executor.hpp:32-51`. Stop and report if `Async/Timer.hpp` is missing or differs from M-TIME-03 §7.
## 7. Interfaces and data contracts
```cpp
namespace Void::Async {
struct ThreadExecutorOptions { std::size_t workers{1}; std::size_t max_admitted{4096};
std::function<Void::Result::Result<void>(std::size_t)> before_worker_start{}; };
struct ThreadExecutorStats { std::size_t queued, running, completion_queued;
std::uint64_t rejected, legacy_posts, inline_after_join; };
class ThreadExecutor final : public Executor { public:
[[nodiscard]] static Void::Result::Result<std::unique_ptr<ThreadExecutor>> create(ThreadExecutorOptions = {});
[[nodiscard]] Void::Result::Result<void> start();
void post(std::coroutine_handle<>) override;
[[nodiscard]] std::expected<void, AdmissionError> try_post(std::coroutine_handle<>) override;
void post_completion(std::coroutine_handle<>) override;
[[nodiscard]] bool supports_reservation() const noexcept override;
[[nodiscard]] std::expected<void, AdmissionError> try_reserve_slot() override;
void commit_reserved(std::coroutine_handle<>) override; void release_reserved() noexcept override;
[[nodiscard]] bool has_background_workers() const noexcept override;
void close() noexcept; [[nodiscard]] Void::Result::Result<void> join();
[[nodiscard]] bool idle() const noexcept; [[nodiscard]] std::size_t admitted() const noexcept;
[[nodiscard]] ThreadExecutorStats stats() const noexcept; ~ThreadExecutor() override; };
class FuturePool { public: explicit FuturePool(ThreadExecutor&) noexcept;
template <std::invocable F> [[nodiscard]] std::expected<std::future<std::invoke_result_t<F>>, AdmissionError>
try_submit(F&& f); };
enum class ChannelError : std::uint8_t { closed, empty, full, cancelled, timed_out, overloaded, invalid_argument };
struct ChannelOptions { std::size_t capacity{1024}; std::size_t max_waiters{1024}; TimerQueue* timers{nullptr}; };
template <class T> struct SendFailure { ChannelError error; T value; };
template <class T> class AsyncChannel : public std::enable_shared_from_this<AsyncChannel<T>> { public:
[[nodiscard]] static Void::Result::Result<std::shared_ptr<AsyncChannel>> create(Executor& resume, ChannelOptions = {});
[[nodiscard]] std::expected<void, SendFailure<T>> try_send(T);
[[nodiscard]] Coro::Task<std::expected<void, SendFailure<T>>> send(T, OperationOptions = {});
[[nodiscard]] std::expected<T, ChannelError> try_receive();
[[nodiscard]] Coro::Task<std::expected<T, ChannelError>> receive(OperationOptions = {});
void close() noexcept; [[nodiscard]] std::size_t size() const; [[nodiscard]] bool is_closed() const; };
[[nodiscard]] inline Void::Result::Error make_async_error(ChannelError, std::string message = {});
}
namespace Void::Concurrency { // ParallelFor.hpp (NEW overload)
struct ParallelForOptions { std::size_t grain{1}; std::size_t max_concurrency{0}; std::stop_token stop{}; bool stop_on_error{true}; };
struct ParallelForError { enum class Kind : std::uint8_t { invalid_argument, rejected, stopped, failed } kind;
std::size_t chunks_total{0}, chunks_started{0}, chunks_failed{0};
std::optional<std::size_t> first_failed_chunk{}; std::exception_ptr first_exception{}; };
template <std::integral I, std::invocable<I> F>
[[nodiscard]] std::expected<void, ParallelForError> parallel_for(I first, I last, F&& f, ThreadPool&, ParallelForOptions);
}
```
`ChannelError` maps into `kAsyncErrorDomain` via existing codes (`closed`→`AsyncErrorCode::closed`,
`cancelled`→`cancelled`, `timed_out`→`timeout`, `overloaded`/`full`→`overloaded`, `empty`/`invalid_argument`→
`invalid_argument`); the overload must not collide with existing `make_async_error` overloads.
`max_concurrency == 0` = the pool's thread count; `grain == 0` → `invalid_argument`. Unchanged 1.x:
`ManualExecutor`, `ThreadPool`, `Channel`, legacy `parallel_for` signatures, `spawn`, `schedule_on`.
## 8. Dependencies and integration
Upstream: M-ASYNC-03 (done), M-TIME-03 Timer (gate G2, present in your base). Downstream:
S-RUNTIME-02 uses `ThreadExecutor` (`create/start/close/join/idle/admitted/stats`), M-ASYNC-05 may use
`ThreadExecutor` in tests. Keep §7 exactly. Root integrates and commits.
## 9. Edge cases security and performance
Stop vs send vs receive vs close vs timer races (TSan); move-only `T`; exceptions thrown by `T`'s move
constructor (document strong guarantee where possible); bounded waiters; no busy-waiting in join;
no user code under locks; hook throwing; zero workers rejected at create.
## 10. Acceptance criteria
Tests (all pass; TSan 0 races; ASan+UBSan 0 errors):
- `ThreadExecutor.cpp`: `thread_executor_create_starts_no_threads`, `thread_executor_bound_includes_running_work`,
`thread_executor_reservation_with_task_scope_preserves_task`, `thread_executor_completion_lane_bypasses_full_normal_lane`,
`thread_executor_close_rejects_normal_drains_completion`, `thread_executor_join_self_join_on_worker`,
`thread_executor_partial_start_failure_joins_started`, `thread_executor_system_error_path_shared_with_hook`,
`thread_executor_legacy_post_spawn_schedule_on_compat`, `thread_executor_inline_after_join_counted`,
`thread_executor_stress_tsan`.
- `FuturePool.cpp`: `future_pool_overloaded_does_not_consume_callable`, `future_pool_stopped_after_close`,
`future_pool_exception_in_future`, `future_pool_bound_includes_running`.
- `AsyncChannel.cpp`: `channel_zero_capacity_invalid`, `channel_try_send_full_returns_value`,
`channel_send_waits_resumes_on_receive`, `channel_producer_stop_returns_value_cancelled_once`,
`channel_receiver_stop_after_claim_delivers_value_no_loss`, `channel_sender_stop_vs_receive_race_exactly_once_tsan`
(10,000 iterations; multiset sent == received ∪ returned), `channel_close_wakes_senders_with_value_and_drains_receivers`,
`channel_deadline_requires_timers`, `channel_deadline_times_out_once_manual_clock_poll`,
`channel_timer_close_settles_waiter_cancelled`, `channel_timer_fire_after_waiter_destroyed_safe`,
`channel_waiter_bound_overloaded`, `channel_move_only_values`, `channel_mpmc_fifo_tsan`,
`channel_deadline_check_order_returns_value`.
- Additional ThreadExecutor tests: `thread_executor_join_without_start_drains_inline`,
`thread_executor_start_twice_and_after_close_invalid`, `thread_executor_reservation_across_close_binding`.
- `ParallelForBounded.cpp`: `parallel_for_bounded_grain_and_concurrency_limit`,
`parallel_for_bounded_stop_joins_started_no_new_chunks`, `parallel_for_bounded_errors_join_all_lowest_index_reported`,
`parallel_for_bounded_zero_grain_invalid`, `parallel_for_bounded_rejected_pool_runs_inline`,
`parallel_for_bounded_waits_all_submitted_runners`, `legacy_parallel_for_exception_joins_all`.
- Existing `ParallelFor`, `ThreadPool`, `ThreadPoolBackpressure`, `Channel`, `OperationScope`, `Executor`,
`Coro`, `TimerQueue` tests pass unchanged. `-Werror` clean.
## 11. Verification commands and evidence
Cwd = worktree root; `dev` with the sandbox disabled. Confirm new suites appear in output.
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async4 -G Ninja -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-async4 --parallel 8 && /tmp/void-w11-async4/tests/VoidTests --filter "^(ThreadExecutor|FuturePool|AsyncChannel|ParallelForBounded|ParallelFor|ThreadPool|ThreadPoolBackpressure|Channel|OperationScope|Executor|Coro|TimerQueue)\." && ctest --test-dir /tmp/void-w11-async4 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async4-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-w11-async4-tsan --parallel 8 && /tmp/void-w11-async4-tsan/tests/VoidTests --filter "^(ThreadExecutor|FuturePool|AsyncChannel|ParallelForBounded|ParallelFor)\."'
dev cpp-gcc -c bash -lc 'for f in ThreadExecutor FuturePool AsyncChannel ParallelForBounded; do g++ -std=c++26 -freflection -fsyntax-only -Iinclude -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers tests/standalone/Async/$f.cpp || exit 1; done'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async4-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-async4-asan --parallel 8 && /tmp/void-w11-async4-asan/tests/VoidTests --filter "^(ThreadExecutor|FuturePool|AsyncChannel|ParallelForBounded|ParallelFor)\."'
```
## 12. Constraints and stop conditions
No edits outside write scope; no weakened assertions; no disabled warnings; no change to 1.x
semantics other than D-W11-10. Stop and report BLOCKED if the contract needs a forbidden-file edit,
the reservation API cannot be satisfied as specified, or two repair attempts at one check fail.
## 13. Authorization and decisions
Root decisions D-034, D-038, D-040 under user decisions D-027/D-029/D-031. Listed files only; no
commits, pushes or other side effects.
## 14. Return format
Task ID; DONE/BLOCKED/PARTIAL; summary; files changed; decisions/deviations; evidence per acceptance
criterion; commands with cwd/results (counts, TSan/ASan); checks not run; residual risks; integration
notes (worktree path). Do not spawn children.
+151
View File
@@ -0,0 +1,151 @@
# M-ASYNC-05 — EventBus/Observable snapshot dispatch, joined subscriptions, injected scheduling
Task ID: M-ASYNC-05
Role: sonnet-implementer
Status: READY
## 1. Context and baseline
- Wave 11 package step A3 (after A2 M-ASYNC-04 is committed). Repo VoidLibrary, branch
`feat/roadmap-p2-wave11`. Isolated worktree; first fast-forward it to the HEAD stated in your prompt.
- Baseline: full suite at `38436b1` = 1,484 tests (1,480 ✔, 4 ⊘).
- Observed source (M-ASYNC-01 characterization folded in):
- `include/Void/Async/EventBus.hpp` (`Void::EventBus`): sync `publish` iterates the live vector without
the lock (~:156-164) so subscribe/unsubscribe during dispatch is UB; Async mode starts a private
thread in the constructor (~:43-48); the async snapshot copies `std::function`s so `unsubscribe`
cannot retract queued copies (~:167-169); a handler exception escapes the worker loop and terminates
(~:248-269); task queue and handler list unbounded (~:272-278); `Subscription::reset` does not join
(~:115-121); `Subscription` holds a raw `EventBus*` (~:137-146); `flush()` returns void (~:193-201).
- `include/Void/Async/Observable.hpp`: `Observable`/`Signal` iterate live vectors (~:74-77, :116-119);
reentrant use is UB; no threading policy; on throw the value stays new (~:40-42).
- Existing tests: `tests/standalone/Async/{EventBus,EventBusAsync,Observable}.cpp` (12/4/14).
- Available from A2: `Async::ThreadExecutor` (bounded, `join`, `is_executor_thread`), `ManualExecutor`.
- Requirements: roadmap row M-ASYNC-05 ("EventBus/Observable snapshot dispatch, joined subscriptions,
injected scheduling | Reentrancy, callback throw and unsubscribe races leave no captured state in use
after join"); C-03/C-05; decisions D-W11-06 (accepted with conditions), D-038, D-040 (N6, P3-8).
- MANDATORY design sources: `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md` §M-ASYNC-05,
`W11-PLAN-REV1-OUTPUT.md` F12 + P3 (Observable/Signal, captured-state tests), `W11-CONTRACT-R2.md` N6.
Precedence R2 > REV1 > PLAN.
## 2. Objective and deliverables
EDIT `include/Void/Async/EventBus.hpp` and `include/Void/Async/Observable.hpp`; NEW tests
`tests/standalone/Async/EventBusJoin.cpp`, `tests/standalone/Async/ObservableReentrancy.cpp`.
## 3. Scope and non-goals
Out: Executor/Operation/TaskScope/ThreadExecutor changes, build files, other modules.
## 4. Files to inspect
`include/Void/Async/{EventBus,Observable,Executor,TaskScope,ThreadExecutor}.hpp`, the three existing
tests, and the design sources in §1.
## 5. Write ownership and coordination
Write scope: `include/Void/Async/EventBus.hpp`, `include/Void/Async/Observable.hpp`,
`tests/standalone/Async/EventBusJoin.cpp` (NEW), `tests/standalone/Async/ObservableReentrancy.cpp` (NEW).
Forbidden: every other path, including the existing EventBus/Observable test files. Other implementers
work concurrently in other worktrees (IO; Runtime). No git operations except the authorized fast-forward.
## 6. Implementation or investigation approach
MANDATORY:
- Subscription state in shared ownership; every dispatch (all modes) iterates a snapshot of entries and
checks a per-entry live flag before invoking; callbacks run outside locks.
- NEW `Mode::Injected` + `EventBus(Async::Executor&, BusOptions)`: no private thread; dispatch frames
capture `shared_ptr<detail::BusCore>`; bounded subscriptions/admitted dispatches → `overloaded`;
Injected and Async modes catch handler exceptions and route them to `error_sink` (outside locks),
counting `callback_failures`; a throwing `error_sink` is caught and counted (D-W11-06 condition).
Sync `publish` keeps 1.x exception propagation.
- `Subscription::close_and_join()`: suppresses admitted-but-not-started deliveries, waits for in-flight
callbacks on other threads, resets the handler (releasing captured state) before returning; on its own
callback thread → `self_join` (self-unsubscribe via legacy `unsubscribe`/`reset` still works).
- 1.x `unsubscribe` in `Mode::Async` still delivers already-queued copies (pinned test).
- `EventBus::close_and_join()` / `close_and_join_pumping(ManualExecutor&)`; `flush_blocking()`
(`self_join` on an executor thread or inside a bus callback; `invalid_argument` on a ManualExecutor);
`flush_pumping(ManualExecutor&)`; legacy `flush()` in Injected mode calls `flush_blocking()` and
discards the error (never deadlocks).
- `~EventBus` (N6): gates every admitted-but-not-started delivery on every thread before returning
(core `closed` flag checked under the core lock before each delivery starts); waits for callbacks
running on OTHER threads, excluding the current thread's own in-progress callback (thread-local
dispatch depth); documented residual: destroying a bus from inside a callback that another thread's
callback waits on can deadlock (caller error). On a ManualExecutor it pumps (TaskScope pattern).
- Observable/Signal (REV1 P3): documented single-threaded, not thread-safe, reentrancy-safe. For
copyable `T` (`std::copy_constructible`): nested `set` updates the value immediately and queues
`(old, new)` copies delivered FIFO after the current pass, bounded at
`kMaxPendingNotifications = 1024`; overflow keeps the new value and counts a dropped notification;
`try_set(T)` (copyable only) → `overloaded` without changing the value; `dropped_notifications()`.
Move-only `T`: 1.x immediate recursive notification over a listener snapshot, no queue, no `try_set`.
Unsubscribe during a pass skips that listener for the rest of the pass; subscribe during a pass is not
in the current pass. On a throw: the value stays new, dispatch depth restored, that pass's queued
notifications dropped and counted, exception propagates from the outermost `set`/`emit`.
`Signal<Args...>` follows the same rule when all decayed `Args` are copyable (queue is `mutable`).
## 7. Interfaces and data contracts
```cpp
namespace Void::EventBus {
enum class Mode { Sync, Async, Injected }; // NEW enumerator appended
struct BusOptions { std::size_t max_subscriptions{1024}; std::size_t max_admitted_dispatches{1024};
std::function<void(std::exception_ptr)> error_sink{}; };
// EventBus additions (existing API unchanged):
explicit EventBus(Void::Async::Executor& executor, BusOptions = {});
template <class Event> [[nodiscard]] Void::Result::Result<Subscription> try_subscribe(std::function<void(const Event&)>);
template <class Event> [[nodiscard]] Void::Result::Result<void> try_publish(const Event&); // overloaded / closed
[[nodiscard]] Void::Result::Result<void> close_and_join();
[[nodiscard]] Void::Result::Result<void> close_and_join_pumping(Void::Async::ManualExecutor&);
[[nodiscard]] Void::Result::Result<void> flush_blocking();
[[nodiscard]] Void::Result::Result<void> flush_pumping(Void::Async::ManualExecutor&);
[[nodiscard]] std::uint64_t callback_failures() const noexcept;
// Subscription addition: [[nodiscard]] Void::Result::Result<void> close_and_join();
}
// Observable.hpp: inline constexpr std::size_t kMaxPendingNotifications = 1024;
// Observable<T>: Void::Result::Result<void> try_set(T) requires std::copy_constructible<T>;
// std::size_t dropped_notifications() const noexcept;
```
Errors use `Void::Async::make_async_error` codes (`overloaded`, `closed`, `self_join`, `invalid_argument`).
If EventBus.hpp currently includes no Async headers, adding `Void/Async/Executor.hpp` is allowed (same
module). Unchanged 1.x: every existing EventBus/Observable/Signal signature and their existing tests.
## 8. Dependencies and integration
Upstream: A2 (ThreadExecutor) in your base. Downstream: none in this wave. Root integrates and commits.
## 9. Edge cases security and performance
Reentrant subscribe/unsubscribe/publish inside callbacks (ASan); unsubscribe vs dispatch races (TSan);
callback throw in every mode; destruction on executor thread; captured-state release verified by a
sentinel `shared_ptr` `use_count() == 1` after join; bounded queues; no user code under locks.
## 10. Acceptance criteria
- `EventBusJoin.cpp`: `bus_injected_no_private_thread_manual_pumping`, `bus_injected_subscription_limit_overloaded`,
`bus_injected_dispatch_limit_overloaded`, `bus_close_and_join_waits_inflight_releases_capture_tsan`,
`bus_unsubscribe_during_dispatch_prevents_later_admission`, `bus_self_unsubscribe_ok_self_join_rejected`,
`bus_callback_throw_to_error_sink_others_run`, `bus_error_sink_throw_caught_and_counted`,
`bus_legacy_async_unsubscribe_keeps_queued_copy`, `bus_sync_reentrant_subscribe_unsubscribe_asan`,
`bus_publish_after_close_closed`, `bus_sync_unsubscribe_releases_captured_state`,
`bus_legacy_async_unsubscribe_then_flush_releases_captured_state`,
`bus_legacy_async_close_and_join_releases_capture_with_queued_copies`,
`bus_destructor_gates_admitted_deliveries`, `bus_flush_blocking_self_join_and_manual_invalid`.
- `ObservableReentrancy.cpp`: `observable_nested_set_fifo`, `observable_unsubscribe_in_listener_skips_rest`,
`observable_subscribe_in_listener_not_current_pass`, `observable_try_set_overloaded_when_pending_full`,
`observable_listener_throw_restores_state`, `observable_self_unsubscribe_releases_capture`,
`observable_move_only_immediate_notification_compat`, `signal_reentrant_connect_disconnect_during_emit`.
- Existing `EventBus`, `EventBusAsync`, `Observable` tests pass unchanged; TSan 0 races; ASan+UBSan 0
errors; `-Werror` syntax checks clean.
## 11. Verification commands and evidence
Cwd = worktree root; `dev` with the sandbox disabled. Confirm the new suites appear in the output.
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async5 -G Ninja -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-async5 --parallel 8 && /tmp/void-w11-async5/tests/VoidTests --filter "^(EventBusJoin|ObservableReentrancy|EventBus|EventBusAsync|Observable)\." && ctest --test-dir /tmp/void-w11-async5 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async5-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_ENABLE_TSAN=ON && cmake --build /tmp/void-w11-async5-tsan --parallel 8 && /tmp/void-w11-async5-tsan/tests/VoidTests --filter "^(EventBusJoin|ObservableReentrancy|EventBus|EventBusAsync|Observable)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async5-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON && cmake --build /tmp/void-w11-async5-asan --parallel 8 && /tmp/void-w11-async5-asan/tests/VoidTests --filter "^(EventBusJoin|ObservableReentrancy|EventBus|EventBusAsync|Observable)\."'
dev cpp-gcc -c bash -lc 'for f in EventBusJoin ObservableReentrancy; do g++ -std=c++26 -freflection -fsyntax-only -Iinclude -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers tests/standalone/Async/$f.cpp || exit 1; done'
```
Also run the full `Async;Testing` VoidTests binary unfiltered once to catch regressions in other Async
users (Fsm is not selected; root runs the full suite at integration).
## 12. Constraints and stop conditions
No edits outside write scope; no weakened assertions; 1.x behavior changes limited to those recorded in
MIGRATION (snapshot dispatch, nested FIFO for copyable, Async-mode exceptions counted). Stop and report
BLOCKED if an existing EventBus/Observable test must change, or two repair attempts at one check fail.
## 13. Authorization and decisions
Root decisions D-034, D-038, D-040, D-042 under user decisions D-027/D-029/D-031. Listed files only; no
commits, pushes or other side effects.
## 14. Return format
Task ID; DONE/BLOCKED/PARTIAL; summary; files changed; decisions/deviations; evidence per acceptance
criterion; commands with cwd/results; checks not run; residual risks; worktree path. Do not spawn children.
@@ -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,21 @@
# M-CONFIGURATION-01..05 — Bounded Schemas, Provenance Redaction & Transactional Async Reload
- **Wave**: Wave 8 (`feat/roadmap-p2-wave8`, branched from `main` at `d83d0f4`)
- **Roadmap reference**: `docs/roadmap/modules/Configuration.md`, `docs/roadmap/DEPENDENCIES.md`
## Scope & Ownership
- `src/Configuration/module.cmake`: `INTERNAL_DEPS Core Functional System Data Time LogState`, `EXCLUDE_HEADERS Void/Configuration/ReloadController.hpp`.
- `src/ConfigurationAsync/module.cmake`: `INTERNAL_DEPS Configuration SystemAsync Async Time Functional LogState`, `EXTRA_HEADERS Void/Configuration/ReloadController.hpp`.
- `include/Void/Configuration/Bind.hpp`: non-breaking field annotations `Secret{}`, `RestartRequired{}`, `Deprecated{}`, `IntRange{}`, `RealRange{}` while keeping `bind<T>` intact.
- `include/Void/Configuration/Schema.hpp` + `src/Configuration/Schema.cpp`:
- `kConfigurationErrorDomain = 24`, `ConfigErrorCode`, `ConfigLimits` (1 MiB/source, 8 sources, 4 MiB merged, 10,000 keys, 4 KiB key, 64 KiB scalar, depth 32, 1,024 vector items, 100 diagnostics, 64 participants, 4 retained generations, 128 notifications, 5s prepare timeout).
- `SourceKind`, `SourceId`, `SourceLocation`, `ValueState` (`Missing`, `Empty`, `Null`, `Present`, `Removed`), `KeyProvenance`, `Provenance`, `SourceSpec`, `SourceSet`, `MergedConfig`.
- `load_sources(...)`: deterministic precedence (defaults < files in order < allowlisted/prefixed env < explicit CLI), rejects literal-dot vs nested JSON collisions, enforces byte/key/depth/vector caps, redacts secrets in diagnostics.
- `Schema<T>`, `validate<T>(...)` (rejects unknown keys by default, rejects vector gaps, no malformed-to-default fallback, cross-field constraints, up to 100 diagnostics with redacted secrets), `detect_restart_required_changes(...)`.
- `include/Void/Configuration/ReloadController.hpp` + `src/ConfigurationAsync/ReloadController.cpp`:
- Immutable `Snapshot<T>`, `PreparedChange`, `ReloadParticipant<T>`, `ReloadReport`, serialized `ReloadController<T>` with fallible `create(...)`, participant prepare/reverse-rollback/join on unregister, 4-generation retention cap, single atomic pointer swap, post-commit stop observation (`committed = true, stop_observed_after_commit = true`), bounded notification queue + exception isolation, external coordinator prepare port, `WatcherService` coalescing adapter.
- Tests & consumers: `tests/standalone/Configuration/ConfigurationHardening.cpp`, `tests/standalone/ConfigurationAsync/ConfigurationAsync.cpp`, `tests/package/ConfigurationOnly/*`, `tests/package/ConfigurationAsyncOnly/*`, `tests/package/InstalledComponents.cmake`.
## Verification Criteria
- Standalone `ConfigurationAsync;Testing` RelWithDebInfo `-Werror`: `Configuration*` tests + `ctest` 2/2 (`ConfigurationOnly`, `ConfigurationAsyncOnly`).
- Full Wave 8 RelWithDebInfo `-Werror`, ASan+UBSan `-Werror`, and Wave 8 TSan.
@@ -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*"'
```
+37
View File
@@ -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'
```
+34
View File
@@ -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*"'
```
+24
View File
@@ -0,0 +1,24 @@
# M-FSM-01..05 — Structured Scopes, Race-Loser Joins, Boundary Checkpoints & Bounded Supervision
- **Wave**: Wave 8 (`feat/roadmap-p2-wave8`, branched from `main` at `d83d0f4`)
- **Roadmap reference**: `docs/roadmap/modules/Fsm.md`, `docs/roadmap/DEPENDENCIES.md`
## Scope & Ownership
- `src/Fsm/module.cmake`: `INTERNAL_DEPS Async Core Data Functional Time Log Service`.
- `include/Void/Fsm/StateKey.hpp`: `kFsmErrorDomain = 25`, `FsmErrorCode`, `make_fsm_error`, shared `constexpr bool terminal(Status)` including `Faulted`, `TerminationReason`, `FsmLimits` (1,024 mailbox events / 4 MiB, 256 deferred, 1,024 timers, 128 child regions, depth 32, 256 retained transitions, 4 MiB checkpoint, 64 events / 1ms per turn), `Checkpoint`, `ExecutionBinding`, `StateId`.
- `include/Void/Fsm/Detail/Engine.hpp` + `src/Fsm/Engine.cpp`:
- Injected `Time::MonotonicClock` and `FsmLimits` for timers and turn budgeting.
- Bounded `try_post` enforcing mailbox event & byte limits (`overloaded`) alongside a bounded control lane so stop/checkpoint/jump always progress.
- Scope-tracked waiters & timers (`cancel_scope_waiters`) cancelled prior to state destruction.
- `include/Void/Fsm/Machine.hpp`:
- Preserve 100% of existing API (`start`, `wait`, `run_blocking`, `run_parallel`, `run_parallel_any`, `serialize`, `restore`).
- Add `acquire_service<I>()` returning owning `Service::ServiceHandle<I>`, `try_post`, `termination_reason`, bounded `transition_history`, `observer_errors`, `state_stop_token()`, `await_event_cancellable`, `safe_point`.
- Add `run(ExecutionBinding, Async::OperationOptions)` with root + per-state stop scopes, waiter/timer cleanup before `on_exit`, `on_exit` exception faulting, observer error isolation.
- Add `run_parallel_structured` (sibling fault stop/join) and `run_parallel_any_structured` (deterministic tie-break + stop/join all losers).
- Add boundary `request_checkpoint` / `restore_checkpoint` / `restore_legacy_checkpoint`.
- `include/Void/Fsm/Orchestrator.hpp`: fix `FsmHandle::finished()` via `terminal(status())`, clarify `shared_ptr` ownership docs, add `SupervisionPolicy` (`StopOnFault`, `BoundedRestart` 3/60s on injected clock, 1,024 max supervised), unlocked observers, `try_launch`.
- Tests & consumers: `tests/standalone/Fsm/FsmHardening.cpp`, `tests/package/FsmOnly/*`, `tests/package/InstalledComponents.cmake`.
## Verification Criteria
- Standalone `Fsm;Testing` RelWithDebInfo `-Werror`: `Fsm*` tests + `ctest` 2/2 (`FsmOnly`).
- Full Wave 8 RelWithDebInfo `-Werror`, ASan+UBSan `-Werror`, and Wave 8 TSan.
@@ -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,202 @@
# M-FUNCTIONAL-03 — Pure retry decisions and named blocking adapter
Task ID: M-FUNCTIONAL-03
Role: sonnet-implementer
Status: READY
## 1. Context and baseline
- Wave 11 package step A1.
- Repo: `/home/faumaray/Projects/VoidLibrary`, branch `feat/roadmap-p2-wave11`, HEAD `7f95f89`
(root prep on `main` `38436b1`). You work in an isolated git worktree of `7f95f89`; your cwd is
that worktree root. Do not touch the user's untracked files (`.env`, `WG.conf`, `keys`, `jev_token`).
- Baseline: full suite at `38436b1` = 1,484 tests, 1,480 passed, 4 skipped, 0 failed.
- Observed source (M-FUNCTIONAL-01 characterization folded in, D-035):
- `include/Void/Functional/Retry.hpp` (tabs for indentation): backoff structs in milliseconds
(`NoDelay`, `ConstantDelay`, `LinearBackoff`, `ExponentialBackoff`), `JitterMode` + `Jittered`
(thread_local `mt19937_64` seeded from `std::random_device`, ~:76-95), `Policy{max_attempts=3,
max_elapsed=0 → unlimited}` (~:100-110), `Detail::backoff_sleep` hard-wired to
`steady_clock::now()`/`sleep_for` (~:117-142), `retry`/`retry_or_throw`/`retry_while`; with
`max_attempts == 0` legacy `retry` returns a default-constructed (successful) `expected` without
calling `fn` (~:150-211).
- `src/Functional/module.cmake` declares no `INTERNAL_DEPS` (D-015: standard-library-only).
- Consumers: `include/Void/Resilience/AsyncPolicy.hpp` uses `Void::Retry::ExponentialBackoff`,
`JitterMode` (lines ~6, 486, 533) — must stay source-compatible.
- Tests: `tests/standalone/Functional/Retry.cpp` (14), `RetryJitter.cpp` (4).
- Requirements: roadmap row M-FUNCTIONAL-03 (`docs/roadmap/modules/Functional.md` "Pure retry and
callable ownership", updated in `7f95f89`); decisions D-029, D-038; contracts C-02, C-04.
## 2. Objective and deliverables
Roadmap acceptance: "Extract pure retry decisions and retain named blocking adapter; fake-time
tests prove exact attempt counts, deadlines, jitter bounds and no zero-attempt success."
Deliver:
1. NEW `include/Void/Functional/RetryState.hpp` — pure, standard-library-only decision engine.
2. EDIT `include/Void/Functional/Retry.hpp` — include `RetryState.hpp`, relocate `JitterMode`
definition into it (same name/namespace), add `SteadyNow`, `ThreadSleep`,
`BlockingRetryOptions`, `retry_blocking`. All 1.x symbols keep identical behavior.
3. NEW tests `tests/standalone/Functional/RetryState.cpp`, `tests/standalone/Functional/RetryBlocking.cpp`.
## 3. Scope and non-goals
In: the above. Out: Time/Async adapters (`Async::retry_async` is M-TIME-03), changing any 1.x
retry behavior (including the zero-attempt defect — pin it with a characterization test),
Resilience changes, any build-file edit.
## 4. Files to inspect
`include/Void/Functional/Retry.hpp` (all), `include/Void/Resilience/AsyncPolicy.hpp` (Retry uses),
`tests/standalone/Functional/{Retry,RetryJitter}.cpp` (test style: `VOID_TEST`/assert macros,
file stem = suite name), `src/Testing/Runner.cpp:209-225` (`--filter` is a regex over
`suite.name`), `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md` §M-FUNCTIONAL-03 and
`W11-PLAN-REV1-OUTPUT.md` F8/P3 (design source).
## 5. Write ownership and coordination
Write scope: `include/Void/Functional/RetryState.hpp` (NEW), `include/Void/Functional/Retry.hpp`,
`tests/standalone/Functional/RetryState.cpp` (NEW), `tests/standalone/Functional/RetryBlocking.cpp` (NEW).
Forbidden: every other path (build files, other modules, docs). Another worker (M-TIME-03) runs
concurrently in a different worktree and will later include `RetryState.hpp`; keep the interface
exactly as specified. No git commit/branch/stash/reset; root integrates your diff.
## 6. Implementation or investigation approach
1. Create `RetryState.hpp` (namespace `Void::Retry`, includes only `<chrono> <cstdint> <expected>
<optional> <random> <variant> <concepts> <limits> <cmath> <type_traits>` as needed; NO `<thread>`,
NO `Void/...` include). Move `enum class JitterMode { Full, Equal };` here verbatim; remove it
from `Retry.hpp` and `#include "Void/Functional/RetryState.hpp"` (match existing include style).
2. Implement the interface in §7 with the fixed semantics below.
3. Add the blocking adapter to `Retry.hpp` after the 1.x API, without touching 1.x bodies.
4. Write the tests (§10). Build/run per §11 (configure/build in your worktree; build dir under
`/tmp/void-w11-fn3*`).
Fixed semantics (mandatory):
- `create` validates via `validate`; deadline = `min(saturating_add(start, budget), admission_deadline)`
when budget is a duration; with `no_deadline` deadline is `admission_deadline` (may be none).
- `begin(now, stop)`: stop → `{stop, reason=stop_requested}`; `now >= deadline` →
`deadline_exceeded`; else `{attempt}` and `attempts_started` becomes 1.
- `next(now, outcome, stop)` checks in order: permanent → `not_retryable`; `attempts_started ==
max_attempts` → `attempts_exhausted`; stop → `stop_requested`; else
`at = saturating_add(now, jitter(backoff_delay(spec.backoff, attempts_started - 1)))`;
`at >= deadline` → `deadline_exceeded`; else `{wait_until, at}`. `next` never returns `attempt`.
- `resume(now, stop)`: re-checks stop and deadline, then `{attempt}` and increments `attempts_started`.
- `succeed()` → `{stop, succeeded}`.
- `backoff_delay(b, k)` = `initial * multiplier^k` saturated at `cap` before any integer conversion
(compute in `long double`/`double`, clamp, then convert); never overflows; unjittered.
- Full jitter: uniform integer ns in `[0, d]`; Equal: `d/2 + uniform[0, d - d/2]`.
- Validation errors: `zero_attempts` (max_attempts == 0), `negative_duration` (initial/cap/budget
< 0), `zero_budget` (budget duration == 0), `nonfinite_multiplier`, `multiplier_below_one`,
`cap_below_initial`.
- Default engine is seeded from `std::random_device` (F8): use `detail::seeded_engine<URBG>()`.
- `retry_blocking`: invalid spec → `RetryError{config=err, attempts=0}` without calling `fn`;
waits are `decision.at - options.now()` passed to `options.sleep(wait, options.stop)`; a `false`
return (stopped) ends with `stop_requested` and no further attempt; the adapter never calls
`sleep_until`. `last_error` holds the most recent `E` (empty iff no attempt ran). Value type may
be move-only.
## 7. Interfaces and data contracts
```cpp
namespace Void::Retry { // RetryState.hpp (NEW)
using SteadyTimePoint = std::chrono::steady_clock::time_point;
enum class JitterMode { Full, Equal }; // EXISTING, relocated verbatim
struct NoDeadline { constexpr bool operator==(const NoDeadline&) const noexcept = default; };
inline constexpr NoDeadline no_deadline{};
struct BackoffSpec { std::chrono::nanoseconds initial{std::chrono::milliseconds{100}};
std::chrono::nanoseconds cap{std::chrono::seconds{30}}; double multiplier{2.0};
std::optional<JitterMode> jitter{}; };
struct RetrySpec { std::uint32_t max_attempts{3}; // total, including the first
std::variant<std::chrono::nanoseconds, NoDeadline> budget{std::chrono::seconds{30}};
BackoffSpec backoff{}; };
enum class RetryConfigError : std::uint8_t { zero_attempts, negative_duration, zero_budget,
nonfinite_multiplier, multiplier_below_one, cap_below_initial };
enum class RetryAction : std::uint8_t { attempt, wait_until, stop };
enum class RetryStopReason : std::uint8_t { none, succeeded, attempts_exhausted, deadline_exceeded,
not_retryable, stop_requested };
enum class AttemptOutcome : std::uint8_t { retryable_failure, permanent_failure };
struct RetryDecision { RetryAction action{RetryAction::stop}; SteadyTimePoint at{};
RetryStopReason reason{RetryStopReason::none}; std::uint32_t attempts_started{0}; };
[[nodiscard]] std::expected<void, RetryConfigError> validate(const RetrySpec&) noexcept;
[[nodiscard]] std::chrono::nanoseconds backoff_delay(const BackoffSpec&, std::uint32_t retry_index) noexcept;
[[nodiscard]] constexpr SteadyTimePoint saturating_add(SteadyTimePoint, std::chrono::nanoseconds) noexcept;
namespace detail { template <class G> G seeded_engine(); } // random_device seed if constructible
template <std::uniform_random_bit_generator URBG = std::mt19937_64>
class RetryState { public:
[[nodiscard]] static std::expected<RetryState, RetryConfigError> create(const RetrySpec&,
SteadyTimePoint start, URBG urbg = detail::seeded_engine<URBG>(),
std::optional<SteadyTimePoint> admission_deadline = std::nullopt);
[[nodiscard]] RetryDecision begin(SteadyTimePoint now, bool stop_requested = false) noexcept;
[[nodiscard]] RetryDecision next(SteadyTimePoint now, AttemptOutcome, bool stop_requested = false) noexcept;
[[nodiscard]] RetryDecision resume(SteadyTimePoint now, bool stop_requested = false) noexcept;
[[nodiscard]] RetryDecision succeed() noexcept;
[[nodiscard]] std::uint32_t attempts_started() const noexcept;
[[nodiscard]] std::optional<SteadyTimePoint> deadline() const noexcept; };
template <class E> struct RetryError { RetryStopReason reason{}; std::uint32_t attempts{0};
std::optional<E> last_error{}; std::optional<RetryConfigError> config{}; };
struct RetryEveryError { template <class E> constexpr AttemptOutcome operator()(const E&) const noexcept
{ return AttemptOutcome::retryable_failure; } };
}
namespace Void::Retry { // Retry.hpp additions (NEW)
struct SteadyNow { SteadyTimePoint operator()() const noexcept { return std::chrono::steady_clock::now(); } };
struct ThreadSleep { bool operator()(std::chrono::nanoseconds wait, std::stop_token) const; }; // condition_variable_any + stop; false if stopped
template <class NowFn = SteadyNow, class SleepFn = ThreadSleep, class Classify = RetryEveryError,
class URBG = std::mt19937_64>
struct BlockingRetryOptions { NowFn now{}; SleepFn sleep{}; Classify classify{};
URBG urbg = detail::seeded_engine<URBG>(); std::stop_token stop{};
std::optional<SteadyTimePoint> deadline{}; };
template <class F, class NowFn = SteadyNow, class SleepFn = ThreadSleep,
class Classify = RetryEveryError, class URBG = std::mt19937_64> // F() -> std::expected<T,E>
[[nodiscard]] auto retry_blocking(const RetrySpec&, F&& fn,
BlockingRetryOptions<NowFn, SleepFn, Classify, URBG> options = {})
-> std::expected<T, RetryError<E>>; // T,E deduced from F's result
}
```
`ThreadSleep` may live inline in `Retry.hpp` (which already includes `<thread>`). Unchanged 1.x:
`NoDelay`, `ConstantDelay`, `LinearBackoff`, `ExponentialBackoff`, `Jittered`, `JitterMode`, `Policy`,
`Detail::backoff_sleep`, `retry`, `retry_or_throw`, `retry_while`.
## 8. Dependencies and integration
Upstream: M-FUNCTIONAL-02 (done). Downstream: M-TIME-03 `Async::retry_async` consumes `RetryState`,
`RetrySpec`, `RetryError`, `RetryEveryError`, `AttemptOutcome` exactly as above (gate G1). Root
integrates and commits.
## 9. Edge cases security and performance
Saturating arithmetic near `time_point::max()`; multiplier 1e300 and `initial` near max; NaN/inf
multiplier; negative durations; `max_attempts = UINT32_MAX` does not overflow counters; jitter on
`d = 0`; deadline exactly equal to `at` counts as exceeded; no allocation in `RetryState`.
## 10. Acceptance criteria
1. `RetryState.cpp` tests: `retry_state_rejects_invalid_specs` (one check per `RetryConfigError`),
`retry_state_exact_three_attempts_default`, `retry_state_deadline_at_admission_prevents_first_attempt`,
`retry_state_backoff_overshooting_deadline_stops`, `retry_state_no_deadline_explicit_marker`,
`retry_state_backoff_saturates_without_overflow`, `retry_state_full_equal_jitter_bounds_and_seed_reproducibility`
(seeded `mt19937_64{42}`; bounds + same-seed equality, not exact values),
`retry_state_default_engine_jitter_in_bounds`, `retry_state_stop_prevents_next_attempt`,
`retry_state_permanent_failure_stops`, `retry_state_saturating_add_near_max` — all pass.
2. `RetryBlocking.cpp` tests (fake clock struct local to the test, no Time include, zero real sleeps):
`retry_blocking_fake_clock_exact_waits_and_attempts`, `retry_blocking_zero_attempts_config_error_no_call`,
`retry_blocking_expired_deadline_no_call_no_success`, `retry_blocking_last_error_and_attempt_count`,
`retry_blocking_stop_during_sleep_no_extra_attempt`, `retry_blocking_permanent_failure_single_attempt`,
`retry_blocking_move_only_value`, `legacy_retry_zero_attempts_behavior_pinned` (characterizes the
1.x defect; comment says it is recorded for Wave C) — all pass.
3. Existing `Retry`, `RetryJitter`, `AsyncPolicy` tests pass unchanged.
4. `RetryState.hpp` contains no `<thread>` and no `Void/` include; `src/Functional/module.cmake` unchanged.
5. `-DVOID_WARNINGS_AS_ERRORS=ON` clean.
## 11. Verification commands and evidence
Run from your worktree root (`$PWD`). `dev` must run with the sandbox disabled (the nix fetcher
lock fails inside it). Expected: build exit 0, filtered tests all pass, ctest 2/2.
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-fn3 -G Ninja -DVOID_ENABLED_MODULES="Functional;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-fn3 --parallel 8 && /tmp/void-w11-fn3/tests/VoidTests --filter "^(RetryState|RetryBlocking|Retry|RetryJitter)\." && ctest --test-dir /tmp/void-w11-fn3 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-fn3-res -G Ninja -DVOID_ENABLED_MODULES="ResilienceAsync;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-fn3-res --parallel 8 && /tmp/void-w11-fn3-res/tests/VoidTests --filter "^(AsyncPolicy|Retry|RetryJitter|RetryState|RetryBlocking)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-fn3-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Functional;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-fn3-asan --parallel 8 && /tmp/void-w11-fn3-asan/tests/VoidTests --filter "^(RetryState|RetryBlocking|Retry|RetryJitter)\."'
rg -n "#include <thread>|Void/" include/Void/Functional/RetryState.hpp # expect no output
```
If a cmake option name differs (e.g. sanitizer flags), discover it in `CMakeLists.txt`/`cmake/Capabilities.cmake`
and report the exact command used.
## 12. Constraints and stop conditions
Do not edit outside write scope, weaken assertions, disable warnings, or change 1.x behavior. Stop
and report BLOCKED if: the interface cannot compile as specified; a 1.x test needs changing; a
build failure originates outside your files; the sanitizer option names cannot be found.
## 13. Authorization and decisions
Root decisions D-034, D-038 under user decisions D-027/D-029/D-031. Implementation of the listed
files only; no commits, pushes or other side effects.
## 14. Return format
Return task ID; DONE/BLOCKED/PARTIAL; summary; files changed; decisions/deviations; evidence per
acceptance criterion; commands with cwd/results (test counts); checks not run; residual risks;
integration notes (worktree path). Do not spawn children.
+28
View File
@@ -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'
```
+35
View File
@@ -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*"
```
+29
View File
@@ -0,0 +1,29 @@
# Task Spec: `M-NET-01..05` — P2 Network Hardening, Native HTTP/1.1 Codec, Connection Pool, Safe Static Open & RFC 6455 WebSockets
- **Branch**: `feat/roadmap-p2-wave9` (baseline `main` at `3e25405`, building on `VL-004`/`VL-005` in `66baae7` + `9920bfd`).
- **Roadmap authority**: `docs/roadmap/modules/Net.md` (`M-NET-01`..`M-NET-05`), `ARCHITECTURE.md` C-02..C-06, C-11, C-13.
- **Error domain**: `Void::Result::kNetErrorDomain = 26` (`NetErrorCode` in `include/Void/Net/Http.hpp`).
## Scope & Deliverables
1. **Native Incremental HTTP/1.1 Codec (`include/Void/Net/HttpCodec.hpp`, `src/Net/HttpCodec.cpp`)**:
- `HttpCodecLimits` (defaults: `max_start_line_bytes = 8 KiB`, `max_header_bytes = 32 KiB`, `max_headers = 100`, `max_body_bytes = 8 MiB`, `max_chunk_ext_bytes = 1 KiB`, `max_trailer_bytes = 8 KiB`).
- `HttpRequestParser` and `HttpResponseParser`: byte-by-byte / arbitrary-split incremental RFC 9110/9112 state machines.
- Strict CRLF framing, header field-name token validation, rejection of duplicate/conflicting `Content-Length`, rejection of `Transfer-Encoding` + `Content-Length` smuggling ambiguity, handling of `1xx` informational responses, `HEAD`/`204`/`304` no-body responses, chunked transfer encoding with chunk extensions and trailers, close-delimited response bodies (`finish_eof()`), and explicit `connection_reusable()` check.
2. **Bounded HTTP/1.1 Connection Pool (`include/Void/Net/Pool.hpp`, `src/Net/Pool.cpp`)**:
- `PoolLimits` (defaults: `max_total_connections = 256`, `max_per_origin = 8`, `max_idle_connections = 128`, `idle_timeout = 30s`).
- `PoolKey` keyed by `{scheme, host, port, proxy_identity, tls_policy_generation}` (so changing proxy or trust generation never reuses stale connections).
- `ConnectionPool` using injectable `Void::Time::MonotonicClock` for deterministic idle eviction, returning RAII `ConnectionLease` handles that only return clean, reusable connections to the pool (`mark_reusable(true)`); abandoned/unmarked/dirty/expired leases close cleanly.
3. **Descriptor-Pinned Static File Opening (`include/Void/Net/Server.hpp`, `src/Net/Server.cpp`)**:
- `OpenedStaticFile` (move-only RAII descriptor + `content_type` + `size`, `read_all()`, `native_handle()`).
- `StaticFileResolver::open_safe(std::string_view request_path)` walking components beneath a retained root directory fd (`O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC`), rejecting symlinks/traversal/non-regular files without pathname TOCTOU.
4. **Redirect Compliance in `HttpClient` (`src/Net/Http.cpp`)**:
- Follow only `301`, `302`, `303`, `307`, `308`; `303` converts non-HEAD to `GET` and strips body + `Content-Length`/`Content-Type`; `307`/`308` preserve method/body; resolve relative `Location` references against current URL; reject HTTPS->HTTP downgrade unless `allow_insecure_redirects`; strip `Authorization`, `Cookie`, `Proxy-Authorization`, `X-Api-Key` on cross-origin hops; enforce single absolute steady deadline across redirect hops.
5. **Native RFC 6455 WebSocket Wire Framing & Loopback Transport (`include/Void/Net/WebSocket.hpp`, `src/Net/WebSocket.cpp`, `include/Void/Net/HttpServer.hpp`, `src/Net/HttpServer.cpp`)**:
- `compute_websocket_accept(key)` (RFC 6455 SHA-1 + Base64), `validate_websocket_upgrade_request()` (version 13, `Upgrade: websocket`, `Connection: Upgrade`, 16-byte base64 key, optional origin/subprotocol policy).
- `WebSocketOpcode`, `WebSocketLimits` (`max_message_bytes = 1 MiB`, `max_output_messages = 64`, `max_output_bytes = 4 MiB`), `WebSocketFrame`, `encode_websocket_frame()`, `WebSocketFrameDecoder` enforcing client masking / server non-masking, fragmentation, control-frame rules (<= 125 bytes, FIN=1), strict RFC 3629 UTF-8 validation for text frames & close reasons, ping/pong, and single close handshake.
- `HttpServer::add_websocket_route(pattern, WebSocketSessions&, WebSocketUpgradeOptions)` upgrading incoming HTTP/1.1 requests into live RFC 6455 connections integrated with `WebSocketSessions`, plus loopback `WebSocketClient` for full client/server wire verification.
## Verification
- Standalone `Net;Testing` (`-DVOID_WARNINGS_AS_ERRORS=ON`): split-byte smuggling & chunked/trailer/1xx/HEAD codec corpus, pool eviction & key isolation, `open_safe` symlink-swap rejection, redirect `303`/`307`/relative/cross-origin tests, RFC 6455 wire & loopback `WebSocketClient`/`HttpServer` ping/pong/fragmented/UTF-8/close/shutdown tests.
- `ctest` `NetOnly` installed consumer, full `RelWithDebInfo`, Debug `ASan+UBSan`, Debug `TSan`.
@@ -0,0 +1,19 @@
# M-PLUGIN-01..06 — Pure C11 ABI (`CAbi.h`), Generation Pins, Quiesce/Reload & Unlocked Staging
- **Wave**: Wave 8 (`feat/roadmap-p2-wave8`, branched from `main` at `d83d0f4`)
- **Roadmap reference**: `docs/roadmap/modules/Plugin.md`, `docs/roadmap/DEPENDENCIES.md` (`G-HOST`)
## Scope & Ownership
- `src/Plugin/module.cmake`: `INTERNAL_DEPS Core Functional System Data Time Async LogState Text Service`, `DEPS_UNIX dl`.
- `include/Void/Plugin/CAbi.h`: strict ISO C11 public ABI (`VOID_STATUS_*`, `VOID_CABI_MAJOR_V1 = 1`, `VOID_CAP_*`, `void_module_query_v1`, `void_bytes_v1`, `void_owned_bytes_v1`, `void_interface_id_v1`, `void_module_info_v1`, `void_op_options_v1`, `void_error_detail_v1`, `void_host_api_v1`, `void_module_api_v1`, `VOID_MODULE_API_V1_MIN_SIZE`) with zero C++/STL types or exceptions.
- `include/Void/Plugin/Host.hpp` + `src/Plugin/Host.cpp` + `include/Void/Plugin/CAbiAdapter.hpp`:
- `kPluginErrorDomain = 23`, `PluginErrorCode`, `PluginHostLimits` (64 modules, 256 interfaces/module, 4 retained generations/module, 64 MiB mapped image file accounting/module, 4 MiB checkpoint, 1 MiB config, 1,024 async ops/gen, 256 pending callbacks, 5s prepare / 5s quiesce / 10s readiness / 30s total reload timeout, `allow_safe_dlclose = false` default).
- Independent `external_refs` and `activity_pins`; host-owned retirement queue executing `deactivate -> destroy -> optional dlclose` only when both reach 0 and never on a plugin callback's stack; uncooperative generations stay mapped and remain visible via `retained_generations()`.
- `CModuleHost`: validates `void_module_query_v1` against truncation/unknown major/non-zero reserved/oversized lengths; per-module unlocked staged reload coordinator (`quiesce -> checkpoint -> restore -> activate -> readiness` sharing one absolute deadline on injected `Time::MonotonicClock`, rollback + `resume` on pre-publication failure or `Degraded` on resume failure, atomic epoch-checked publication + coherent `ServiceRegistry` swap); topological dependency `load_batch` rejecting cycles and `RestartRequired` conflicts.
- `CAbiAdapter.hpp`: exception-safe C++ `IModule` to `void_module_api_v1` shim.
- `src/Plugin/Manager.cpp`: per-entry `reload_mutex` so candidate staging/validators/config/activation run outside `m_mutex` without deadlocking reentrant lookups.
- Tests & consumers: `tests/plugins/CAbiPluginV{1,2}.c`, `tests/standalone/Plugin/PluginHardening.cpp`, `tests/package/PluginOnly/*`, `tests/CMakeLists.txt`, `tests/package/InstalledComponents.cmake`.
## Verification Criteria
- Standalone `Plugin;ServicePlugin;Testing` RelWithDebInfo `-Werror`: `Plugin*` tests + `ctest` 2/2 (`PluginOnly`, `ServicePluginOnly`).
- Full Wave 8 RelWithDebInfo `-Werror`, ASan+UBSan `-Werror`, and Wave 8 TSan.
@@ -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,22 @@
# M-SERVICE-01..05 — Owning ServiceHandles, Immutable Snapshots, DAG Lifecycle & ServicePlugin Split
- **Wave**: Wave 8 (`feat/roadmap-p2-wave8`, branched from `main` at `d83d0f4`)
- **Roadmap reference**: `docs/roadmap/modules/Service.md`, `docs/roadmap/DEPENDENCIES.md` (Rule #3, `G-HOST`)
## Scope & Ownership
- `src/Service/module.cmake`: `INTERNAL_DEPS Core Functional Time Async LogState`, `EXCLUDE_HEADERS Void/Service/PluginService.hpp` (zero external deps, zero `Plugin` dependency).
- `src/ServicePlugin/module.cmake`: `INTERNAL_DEPS Service Plugin LogState`, `EXTRA_HEADERS Void/Service/PluginService.hpp`.
- `include/Void/Service/Types.hpp`: `kServiceErrorDomain = 22`, `ServiceErrorCode`, `make_service_error`, `ServiceLimits` (256 providers, 16 parent levels, 1,024 edges, 64 staged changes, 128 lifecycle requests, 4 retained generations), `PublicationEpoch`, `ExpectedEpoch`, `ServicePin`, `ServiceHealth`, `ServiceObservation`, `ShutdownReport`, `IManagedService`, `ServiceHandle<I>`.
- `include/Void/Service/Registry.hpp` + `src/Service/Registry.cpp`:
- Preserve 100% of existing `ServiceRegistry` API (`provide<I>`, `remove<I>`, `get<I>`, `require<I>`, `has<I>`, `start_all`, `stop_all`, `size`).
- Immutable `SnapshotData` swapped atomically under a short guard; old snapshots, destructors, and observers released/invoked outside locks.
- `start_all()`/`stop_all()` copy retained lifecycle list under short lock and invoke callbacks outside locks.
- `ServiceSnapshot` retaining `parent_snapshot` `shared_ptr` so child snapshots outlive parent registries; `snapshot()`, `from_parent_snapshot()`, `refresh_parent()`.
- `acquire<I>() -> Result<ServiceHandle<I>>` returning `service_stopping` when closed or `missing_service` when absent, pinning generation lifetime until handle drop.
- `ProviderSet` (`add`, `add_alias` sharing one lifecycle node per object pointer), `PreparedPublication`, `prepare_batch` (topological sort + cycle/duplicate/missing-dep/limit validation), `start_staged` (topological start + `abort_start()` + reverse rollback preserving active snapshot), `publish` (epoch check + retention cap + atomic swap), `start`, `close_and_join` (dependent-first stop + `incomplete_owners` reporting without freeing live providers), `retained_generation_count()`.
- `include/Void/Service/PluginService.hpp`: preserved `PluginServiceBinding<I>` + `acquire_plugin_service<I>` pinning exact `PluginHandle` via `ServicePin`.
- Tests & consumers: `tests/standalone/Service/ServiceHardening.cpp`, `tests/package/ServiceOnly/*`, `tests/package/ServicePluginOnly/*`, updated `tests/package/InstalledComponents.cmake`.
## Verification Criteria
- Standalone `Service;ServicePlugin;Testing` RelWithDebInfo `-Werror`: `Service*` tests + `ctest` 2/2 (`ServiceOnly`, `ServicePluginOnly`).
- Full Wave 8 RelWithDebInfo `-Werror`, ASan+UBSan `-Werror`, and Wave 8 TSan.
@@ -0,0 +1,27 @@
# Task Spec: `M-SHORTURL-01..04` — Frozen V1, Additive V2 Local/Durable/Remote Providers & V1 Adapter
- **Branch**: `feat/roadmap-p2-wave9` (baseline `main` at `3e25405`).
- **Roadmap authority**: `docs/roadmap/modules/ShortUrl.md` (`M-SHORTURL-01`..`M-SHORTURL-04`), `ARCHITECTURE.md` C-02..C-05, C-09, C-13.
- **Error domain**: `Void::Result::kShortUrlErrorDomain = 28`.
## Scope & Deliverables
1. **Frozen `V1` Contract (`include/Void/ShortUrl/ShortUrl.hpp`, `docs/short-url.md`)**:
- Zero changes to `Void::ShortUrl::V1` layout, enum ordinals, virtual table order, or `docs/short-url.md`.
- Keep `ShortUrl` module's internal dependencies lightweight (`Service Time`), with zero `Storage`, `Net`, or `Security` dependencies.
2. **Additive `Void::ShortUrl::V2` Core & Local Provider (`include/Void/ShortUrl/V2.hpp`)**:
- `V2ErrorCode` mapped via `kShortUrlErrorDomain = 28` (`InvalidUrl`, `InvalidKey`, `InvalidExpiry`, `Conflict`, `NotFound`, `Expired`, `Revoked`, `Unsupported`, `RateLimited`, `QuotaExceeded`, `IdentityExpired`, `StorageError`, `UnknownOutcome`, `ProviderError`, `Timeout`, `Unavailable`).
- `CreateLink`, `ShortenOptions` (`operation_id`, `idempotency_ttl = 24h`), `Link`, `LinkRecord`, `LinkState::{Active, Revoked}`, `LocalProviderLimits` (`max_url_bytes = 8192`, `max_key_bytes = 64`, `generated_key_length = 16`, `max_collision_retries = 8`, `max_retained_identities = 10000`, `max_entries = 100000`, `max_concurrent_ops = 128`).
- Strict target URL validation (absolute `http`/`https`, no userinfo, no control chars, <= 8 KiB, optional host deny predicate) and custom key validation (1..64 `[A-Za-z0-9_-]`, case-sensitive, reserved route rejection).
- Abstract `LinkRepositoryPort` + `RandomBytesPort`, explicitly nondurable `InMemoryLinkRepository` (for unit/semantics tests), rejection-sampled base62 key generation, atomic conditional insert + idempotency record, civil expiry via injected `Void::Time::CivilClock`, tombstone `revoke()` (never reusing revoked keys), `V1Adapter` implementing `V1::IShortener` without modifying `V1`.
3. **Durable Storage Provider (`src/ShortUrlStorage/module.cmake`, `include/Void/ShortUrlStorage/StorageRepository.hpp`, `src/ShortUrlStorage/StorageRepository.cpp`)**:
- Separate module (`INTERNAL_DEPS ShortUrl Storage Security`) keeping `ShortUrl` free of `Storage`/`libsodium`.
- `StorageLinkRepository` backed by `Void::Storage::Engine` conditional `WriteBatch` (versioned records, atomic link + idempotency commit, tombstone persistence, byte quota enforcement, full recovery across engine reopen) + `SecurityRandomBytesPort` backed by `Void::Security::random_bytes`.
4. **Remote Provider SPI (`src/ShortUrlRemote/module.cmake`, `include/Void/ShortUrlRemote/RemoteProvider.hpp`, `src/ShortUrlRemote/RemoteProvider.cpp`)**:
- Separate module (`INTERNAL_DEPS ShortUrl Net Data`) keeping `ShortUrl` free of `Net`/Boost/OpenSSL.
- `RemoteCapabilities`, `RemoteProviderOptions` (explicit origin, secure `HttpClient`, max 1 MiB response, 10s deadline), `RemoteProvider` checking capability flags before network mutation, preserving `Retry-After` and classifying transport failures after send as `UnknownOutcome` without blind replay, plus loopback fixture tests.
5. **Installed Consumers**:
- `tests/package/ShortUrlOnly/` (`ShortUrl` with zero external packages) + `ShortUrlProviders` in `tests/package/InstalledComponents.cmake`.
## Verification
- Standalone `ShortUrl;ShortUrlStorage;ShortUrlRemote;Testing` (`-DVOID_WARNINGS_AS_ERRORS=ON`), `ctest` (`ShortUrlOnly`, `ShortUrlProviders`), full `RelWithDebInfo`, Debug `ASan+UBSan`, Debug `TSan`.
@@ -0,0 +1,26 @@
# M-SQLITE-01..05 — Hardened Sqlite C API Integration & Optional SqliteAsync Pool
- **Wave**: Wave 7 (`feat/roadmap-p2-wave7`, branched from `main` at `43922d1`)
- **Roadmap reference**: `docs/roadmap/modules/Sqlite.md`, `docs/roadmap/DEPENDENCIES.md`
- **Supported runtime observed**: SQLite 3.54.0 via Nix `sqlite` package
## Scope & Ownership
- `src/Sqlite/module.cmake`: `INTERNAL_DEPS Functional Time`, `EXTERNAL_DEPS SQLite3::SQLite3`, `EXCLUDE_HEADERS Void/Sqlite/AsyncPool.hpp`.
- `include/Void/Sqlite/Types.hpp`: `kSqliteErrorDomain = 21`, `SqliteErrorCode`, `JournalMode`, `SyncMode`, `BeginMode`, `CheckpointMode`, `TransactionState`, `SqliteLimits`, `OpenOptions`, `EffectiveCapabilities`, `ColumnType`, `ValueView`, `OwnedValue`, `OwnedRow`, `CheckpointReport`, `BackupOptions`, `BackupReport`, `CheckedMigration`, `ConnectionHealth`, `ScopedFaultGuard`.
- `include/Void/Sqlite/Sqlite.hpp` + `src/Sqlite/Sqlite.cpp`:
- Shared `ConnectionState` held by `Database`, `Statement`, `Transaction`, and `Savepoint` so moving/destroying `Database` never leaves dangling pointers.
- Preserve 1.x APIs (`Database::open`, `exec`, `prepare`, `begin`, `last_insert_rowid`, `changes`, `user_version`, `migrate`, `Statement::bind`/`step`/`reset`/`clear_bindings`/column getters, `Transaction::commit`/`rollback`, `Migration`, `OpenMode`).
- Add `open_database(path, OpenOptions)` validating limits/pragmas (`WAL`, `FULL`, `foreign_keys`, disabling extension loading by default, querying effective pragma results).
- Add checked `bind_checked` (positional & named, `ValueView`, `max_value_bytes` cap), borrowed lifetime-owned bindings, `reset_checked`, `clear_bindings_checked`, `finalize_checked`, strict single-statement `prepare` (rejecting non-whitespace trailing SQL), `RowView` with expiration generation, strict typed column reads rejecting coercion, `query_all` with row/byte caps.
- Transaction state machine (`Active`, `Committed`, `RolledBack`, `RecoveryRequired`): never mark `Committed` before `COMMIT` succeeds; inspect `sqlite3_get_autocommit` on error; reject nested `begin`; add RAII `Savepoint`.
- Checked `Database::close()` rejecting with `busy` while statements/transactions/savepoints remain open; deferred close in destructor reports errors to optional diagnostic hook.
- Validate migration lists before any SQL; add `migrate_checked` recording `id`+`checksum` in `_void_schema_migrations` in the same transaction as `PRAGMA user_version` and rejecting newer schemas and checksum drift.
- Operational methods: `checkpoint()`, `backup_to()`, `restore_from()`, `health()`, WAL write-admission threshold gating, and exception-safe `create_scalar_function` / `set_authorizer` adapters.
- `src/SqliteAsync/module.cmake` + `include/Void/Sqlite/AsyncPool.hpp` + `src/SqliteAsync/AsyncPool.cpp`:
- Optional async leased connection pool (default 4 readers + 1 writer, bounded blocking workers, `max_queued_jobs = 1024`, `max_pending_input_bytes = 64 MiB`).
- Leases one connection for the complete read/write/transaction with serialized progress/interrupt cleanup so cancellation never leaks to the next borrower.
- Tests & consumers: `tests/standalone/Sqlite/SqliteHardening.cpp`, `tests/standalone/SqliteAsync/SqliteAsync.cpp`, `tests/package/SqliteOnly/*`, `tests/package/SqliteAsyncOnly/*`, updated `tests/package/InstalledComponents.cmake`.
## Verification Criteria
- Standalone `Sqlite;SqliteAsync;Testing` RelWithDebInfo `-Werror` (`-p sqlite`): all `Sqlite*` tests + `ctest` 2/2 (`SqliteOnly`, `SqliteAsyncOnly`).
- Full Wave 7 integrated RelWithDebInfo `-Werror`, full Debug ASan+UBSan `-Werror`, and Wave 7 Debug TSan subset.
@@ -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,28 @@
# Task Spec: `M-TESTINGMOCK-01..04` — Deterministic Sessions, Action-Outside-Lock, Move-Only Forwarding & Matcher Combinators
- **Branch**: `feat/roadmap-p2-wave9` (baseline `main` at `3e25405`).
- **Roadmap authority**: `docs/roadmap/modules/TestingMock.md` (`M-TESTINGMOCK-01`..`M-TESTINGMOCK-04`), `ARCHITECTURE.md` C-02..C-05.
- **Error domain**: `Void::Result::kTestingMockErrorDomain = 27`.
## Scope & Deliverables
1. **Preserve 1.x API & Existing Tests**:
- Existing `Mock<Derived>`, `MockBase`, `MockFunction<R(Args...)>`, `Matcher<T>`, `Eq`, `_`, `Lt`, `Le`, `Gt`, `Ge`, `Range`, `Pred`, `StartsWith`, `Contains`, and all existing tests under `tests/standalone/TestingMock/` continue compiling and passing unchanged.
2. **Matcher Combinators (`include/Void/TestingMock/Matcher.hpp`)**:
- Add `Ne`, `EndsWith`, `Not`, `AllOf`, `AnyOf`, `IsNull`, `NotNull`, with bounded description/nesting depth (`kMaxMatcherDepth = 32`).
3. **Explicit Session, Sequences, Limits & Tokens (`include/Void/TestingMock/Session.hpp`)**:
- `Concurrency::{SingleThread, ConcurrentActions}`.
- `MockLimits{max_expectations = 1024, max_matchers = 64, max_events = 4096, max_diagnostic_bytes = 4 MiB, max_arg_render_bytes = 4 KiB}` (zero means zero capacity, never unlimited).
- `Sequence`: explicit per-group call ordering independent of global registration order.
- `Verification`: structured report (`ok()`, `unmet`, `excess`, `unmatched`, `prohibited`, `matcher_errors`, `threading_errors`, `events_truncated`, `total_events`, `format()`), idempotent across repeated calls.
- `MockSession`: `freeze(Concurrency)` (mutating a frozen session returns `ErrorKind::invalid_argument` / `InvalidState`), `verify_and_close()` (drains/joins active calls; returns `WouldDeadlock` if called from inside an active action), bounded event log with truncation tracking, RAII `RegistrationToken` stopping admission and waiting for admitted calls on unregister.
4. **Hardened `Expectation` & `SessionMockFunction` (`include/Void/TestingMock/Expectation.hpp`, `include/Void/TestingMock/MockFunction.hpp`)**:
- Action-outside-lock reservation protocol: snapshot immutable candidates under short lock -> evaluate matchers outside lock (catching matcher exceptions as `MatcherFailure`) -> reacquire lock to reserve matching unsaturated expectation & sequence slot -> release lock -> execute action -> decrement in-flight counter & record completion.
- Same-thread reentrant calls succeed in `SingleThread`; cross-thread concurrent entry in `SingleThread` reports deterministic threading violation; `ConcurrentActions` permits concurrent action execution safely.
- Perfect argument forwarding (`Args&&...`) to actions; `returns_once(U&&)` for move-only return types (`std::unique_ptr`), `invokes_once(F&&)` for one-shot move-only callables, `at_least(n)`, `at_most(n)`, `between(min, max)`, `never()` (checked before ordinary candidates), `in_sequence(Sequence&)`.
- Non-default-constructible return type on unmatched call records failure and throws TestingMock's invocation-abort exception (never `R{}` fallback).
5. **Installed Consumer (`tests/package/TestingMockOnly/`)**:
- Register `TestingMockOnly` in `tests/package/InstalledComponents.cmake` with `_no_external_deps`.
## Verification
- Standalone `TestingMock;Testing` (`-DVOID_WARNINGS_AS_ERRORS=ON`), `ctest` `TestingMockOnly`, Debug `ASan+UBSan`, Debug `TSan` (concurrent action reservation & dynamic unregister races).
+29
View File
@@ -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'
```
+32
View File
@@ -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*"
```
+118
View File
@@ -0,0 +1,118 @@
# M-TIME-03 (step B1b) — Async::retry_async over TimerQueue and deadline-domain conformance
Task ID: M-TIME-03
Role: opus-implementer
Status: READY
## 1. Context and baseline
- Wave 11 package step B1b (gate G1 satisfied: M-FUNCTIONAL-03 committed `26edf65`; M-TIME-03 B1
TimerQueue committed on the branch). Repo VoidLibrary, branch `feat/roadmap-p2-wave11`. You work
in an isolated worktree; first fast-forward it to the HEAD stated in your prompt.
- Baseline: full suite at `38436b1` = 1,484 tests (1,480 ✔, 4 ⊘). Since then: A1 adds RetryState (23
tests), B1 adds TimerQueue (15), DeadlineDomains (2), ClockSaturation (1).
- Observed source:
- `include/Void/Functional/RetryState.hpp`: `RetrySpec`, `RetryState<URBG>::create(spec, start, urbg,
admission_deadline)`, `begin/next/resume/succeed` (stop decisions are final), `RetryError<E>{reason,
attempts, last_error, config}`, `RetryEveryError`, `AttemptOutcome`, `detail::seeded_engine<G>()`.
- `include/Void/Functional/Retry.hpp`: `retry_blocking` (reference shape for error mapping).
- `include/Void/Async/Timer.hpp`: `TimerQueue::sleep_until(when, OperationOptions)` → `{}` on expiry
after poll, `cancelled` on stop (only if the stop wins the timer cancel race; a stop after poll or
close claimed the timer yields `{}`/`stopped`), `timeout` when `options.deadline < when`, `stopped`
after close; resumes via `executor().post_completion`; `clock()` is the injected clock.
- Requirements: roadmap row M-TIME-03 ("Validate injected-deadline domains with Async and blocking retry
adapters; advancing manual time plus explicit polling expires an operation once"); C-03/C-04; D-038.
## 2. Objective and deliverables
1. NEW `include/Void/Async/Retry.hpp`: `Void::Async::retry_async`.
2. NEW `tests/standalone/Async/AsyncRetry.cpp`.
3. EDIT `tests/standalone/Async/DeadlineDomains.cpp`: add `deadline_domain_blocking_retry_manual_clock`.
## 3. Scope and non-goals
Out: changes to Timer.hpp, RetryState.hpp, Retry.hpp, Executor/Operation/TaskScope, build files.
## 4. Files to inspect
The three headers above, `include/Void/Async/{Task,Executor,TaskScope}.hpp`, `include/Void/Async/Detail/Types.hpp`,
`tests/standalone/Async/{TimerQueue,DeadlineDomains}.cpp`, `tests/standalone/Functional/RetryBlocking.cpp`,
`docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md` §M-TIME-03.
## 5. Write ownership and coordination
Write scope: `include/Void/Async/Retry.hpp` (NEW), `tests/standalone/Async/AsyncRetry.cpp` (NEW),
`tests/standalone/Async/DeadlineDomains.cpp`.
Forbidden: every other path. Other implementers work concurrently in other worktrees (IO files; Async
ThreadExecutor/FuturePool/AsyncChannel/ParallelFor). No git operations except the root-authorized
fast-forward in your prompt.
## 6. Implementation or investigation approach
MANDATORY semantics:
- "now" is always `timers.clock().now()`; admission deadline = `options.deadline`; stop = `options.stop`.
- Invalid spec → `RetryError{config=err, attempts=0}` without calling `fn`.
- Loop: `begin(now, stop_requested)` → on `attempt` call `fn`; `fn` may return `std::expected<T,E>` or
`Coro::Task<std::expected<T,E>>` (co_await it). Success → return `T` (also when stop was requested
during the attempt). Failure → `next(now, classify(error), stop_requested)`.
- On `wait_until(at)`: `co_await timers.sleep_until(at, OperationOptions{options.stop, options.deadline})`.
After a `{}` sleep, ALWAYS call `resume(now, options.stop.stop_requested())` — it re-checks stop itself,
which covers the TimerQueue choice where a late stop yields `{}`. Any sleep error ends the retry without
calling `resume()` (amended after W11-REVIEW-B1b: resuming after `stopped`/`overloaded` would start
attempts with no wait). Sleep result mapping: `{}` → resume;
`cancelled` → stop with `stop_requested`; `timeout` → stop with `deadline_exceeded`; `stopped` (queue
closed) → stop with `stop_requested` (documented: queue closure aborts the retry; no further attempt);
`overloaded` → stop with `stop_requested` and document (no silent busy retry).
- Never sleep with the host clock; never spin; no attempt after any stop decision; `last_error` holds
the most recent `E` (empty iff no attempt ran).
- Default URBG seeded via `Void::Retry::detail::seeded_engine<URBG>()`.
## 7. Interfaces and data contracts
```cpp
namespace Void::Async {
template <class F, class Classify = Void::Retry::RetryEveryError, class URBG = std::mt19937_64>
requires std::invocable<F&>
[[nodiscard]] auto retry_async(Void::Retry::RetrySpec spec, F fn, TimerQueue& timers,
OperationOptions options = {}, Classify classify = {},
URBG urbg = Void::Retry::detail::seeded_engine<URBG>())
-> Coro::Task<std::expected<T, Void::Retry::RetryError<E>>>; // T,E deduced from fn's (awaited) result
}
```
The coroutine owns `fn`, `classify`, `urbg` and `spec` by value. `timers` (and its executor) must outlive
the returned task (document).
## 8. Dependencies and integration
Upstream: A1 (`26edf65`), B1 (TimerQueue). Downstream: none in this wave beyond conformance. Root
integrates and commits.
## 9. Edge cases security and performance
Stop before first attempt; stop during `fn` (success preserved, no retry); stop during backoff; queue
closed during backoff; deadline between attempts; zero attempts; move-only `T`/`E`/`F`; Task-returning
`fn` that throws (exception propagates out of the retry task — document); manual clock far-future start.
## 10. Acceptance criteria
1. `AsyncRetry.cpp`: `async_retry_manual_clock_attempts_only_after_advance_and_poll`,
`async_retry_total_deadline_expires_once`, `async_retry_stop_during_backoff_no_further_attempt`,
`async_retry_success_after_stop_preserved`, `async_retry_zero_attempts_no_call`,
`async_retry_task_returning_callable`, `async_retry_queue_closed_during_backoff_stops`,
`async_retry_late_stop_after_timer_fired_no_further_attempt`, `async_retry_move_only_value` — all pass.
2. `DeadlineDomains.cpp`: `deadline_domain_blocking_retry_manual_clock` (`retry_blocking` with
`now = manual.now`, a sleep callable that advances the ManualClock) passes; existing 2 tests pass.
3. Existing `TimerQueue`, `RetryState`, `RetryBlocking`, `OperationScope`, `Executor`, `Coro` pass.
4. TSan 0 races and ASan+UBSan 0 errors on `AsyncRetry|DeadlineDomains|TimerQueue`.
5. `-Werror` syntax check of the new/edited test files and `Async/Retry.hpp` clean.
## 11. Verification commands and evidence
Cwd = worktree root; `dev` with the sandbox disabled. Confirm the new suite appears in the output.
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-time3b -G Ninja -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-time3b --parallel 8 && /tmp/void-w11-time3b/tests/VoidTests --filter "^(AsyncRetry|DeadlineDomains|TimerQueue|RetryState|RetryBlocking|OperationScope|Executor|Coro)\." && ctest --test-dir /tmp/void-w11-time3b --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-time3b-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_ENABLE_TSAN=ON && cmake --build /tmp/void-w11-time3b-tsan --parallel 8 && /tmp/void-w11-time3b-tsan/tests/VoidTests --filter "^(AsyncRetry|DeadlineDomains|TimerQueue)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-time3b-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON && cmake --build /tmp/void-w11-time3b-asan --parallel 8 && /tmp/void-w11-time3b-asan/tests/VoidTests --filter "^(AsyncRetry|DeadlineDomains|TimerQueue)\."'
dev cpp-gcc -c bash -lc 'for f in Async/AsyncRetry Async/DeadlineDomains; do g++ -std=c++26 -freflection -fsyntax-only -Iinclude -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers tests/standalone/$f.cpp || exit 1; done'
```
## 12. Constraints and stop conditions
No edits outside write scope; no weakened assertions. Stop and report BLOCKED if the TimerQueue or
RetryState contract is insufficient (needs a forbidden edit), or two repair attempts at one check fail.
## 13. Authorization and decisions
Root decisions D-034, D-038, D-040, D-042 under user decisions D-027/D-029/D-031. Listed files only;
no commits, pushes or other side effects.
## 14. Return format
Task ID; DONE/BLOCKED/PARTIAL; summary; files changed; decisions/deviations; evidence per acceptance
criterion; commands with cwd/results; checks not run; residual risks; worktree path. Do not spawn children.
+166
View File
@@ -0,0 +1,166 @@
# M-TIME-03 — Injected-deadline domains: Async TimerQueue and clock saturation (step B1)
Task ID: M-TIME-03
Role: opus-implementer
Status: READY
## 1. Context and baseline
- Wave 11 package step B1 (TimerQueue part). The `Async::retry_async` part of M-TIME-03 is a
separate later step (B1b) after M-FUNCTIONAL-03 integrates (gate G1); it is OUT of this assignment.
- Repo: VoidLibrary, branch `feat/roadmap-p2-wave11`, HEAD `7f95f89`. You work in an isolated git
worktree of `7f95f89`; cwd = worktree root. Never read the user's untracked files in the main checkout.
- Baseline: full suite at `38436b1` = 1,484 tests, 1,480 passed, 4 skipped, 0 failed.
- Observed source:
- `include/Void/Time/Clock.hpp`: `MonotonicClock{ using time_point = steady_clock::time_point; now() }`
(:19-26), `ManualClock` starts at epoch 0 and is atomic (~:69-130), `remaining_until` (~:188-208).
`src/Time/module.cmake` has no deps.
- `include/Void/Async/Detail/Types.hpp`: `AdmissionError{overloaded, stopped, deadline_expired,
invalid_argument, self_join}` (:15-21), `AsyncErrorCode` incl. NEW `closed = 9` (→cancelled, added
in `7f95f89`), `OperationOptions{stop_token stop; optional<MonotonicClock::time_point> deadline}`
(:45-48), `is_deadline_expired(options, clock = System)` (:50-56), `make_async_error`.
- `include/Void/Async/Operation.hpp` (`OperationState`, `ResumeTicket`, backend refs, terminal
state machine), `Executor.hpp` (`Executor::post_completion`, `ManualExecutor`, `ScheduleStatusAwaiter`
checks deadline only in `await_ready/await_resume` ~:304-359), `Task.hpp` (`Coro::Task`),
`TaskScope.hpp`. No timer primitive exists in `include/Void/Async`.
- `src/Async/module.cmake`: `INTERNAL_DEPS Functional Time LogState` (unchanged by this task).
- Requirements: roadmap row M-TIME-03 ("Validate injected-deadline domains with Async and blocking
retry adapters; advancing manual time plus explicit polling expires an operation once"); C-03/C-04
(one terminal result, injected clocks); decisions D-038 (F12), D-W11-01, D-W11-14.
## 2. Objective and deliverables
1. NEW `include/Void/Async/Timer.hpp`: `TimerQueue`, `TimerHandle`, `TimerEvent`, `TimerCallback`,
`TimerQueueOptions` (header-only, like the rest of Async).
2. EDIT `include/Void/Time/Clock.hpp`: NEW `saturating_add`, `deadline_after` helpers.
3. NEW tests `tests/standalone/Async/TimerQueue.cpp`, `tests/standalone/Async/DeadlineDomains.cpp`
(schedule_on/scope admission part only), `tests/standalone/Time/ClockSaturation.cpp`.
## 3. Scope and non-goals
In: the above. Out: `Async/Retry.hpp`/`retry_async` and `AsyncRetry.cpp` (step B1b), any change to
existing Async/Time symbols or their default-argument clocks, Runtime-managed timer polling
(D-W11-14), build files.
## 4. Files to inspect
`include/Void/Async/{Operation,Executor,Task,TaskScope}.hpp`, `include/Void/Async/Detail/Types.hpp`,
`include/Void/Time/Clock.hpp`, `tests/standalone/Async/{OperationScope,Executor}.cpp` (test style and
ManualExecutor/ManualClock usage), `src/IO/EpollDriver.cpp:739-834` (how IO settles deadline expiry via
an injected clock on poll — pattern to mirror), `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md`
§M-TIME-03 and `W11-PLAN-REV1-OUTPUT.md` F12 (design source).
## 5. Write ownership and coordination
Write scope: `include/Void/Async/Timer.hpp` (NEW), `include/Void/Time/Clock.hpp`,
`tests/standalone/Async/TimerQueue.cpp` (NEW), `tests/standalone/Async/DeadlineDomains.cpp` (NEW),
`tests/standalone/Time/ClockSaturation.cpp` (NEW).
Forbidden: everything else, notably `Executor.hpp`, `Operation.hpp`, `TaskScope.hpp`,
`Detail/Types.hpp`, Functional headers (M-FUNCTIONAL-03 is concurrently adding
`Functional/RetryState.hpp` in another worktree), build files, docs. No git commit/branch/stash/reset.
## 6. Implementation or investigation approach
1. Add Clock helpers (overflow-safe; `saturating_add` clamps to `time_point::max()`/`min()`;
`deadline_after(clock, d)` = `saturating_add(clock.now(), d)`; negative `d` allowed and saturates low).
2. Implement `TimerQueue` as a stable min-heap of `(deadline, seq)` entries holding
`shared_ptr<detail::TimerEntry>`; cancelled entries become tombstones; compact when tombstones
exceed `max_timers` so heap size never exceeds `2 × max_timers`.
3. `poll_expired()` reads `clock().now()` once, pops all due live entries in `(deadline, seq)` order
under the lock, transitions each entry pending→fired atomically, then invokes callbacks OUTSIDE
the lock. Nothing fires without an explicit `poll_expired()` call; no background thread.
4. `sleep_until`/`sleep_for` awaitables: register a timer and a stop callback; settle through
`OperationState` (or an equivalent single-terminal-result guard) so exactly one of
{expired → `{}`, stop → `cancelled`, `options.deadline` earlier → `timeout`, `close` → `stopped`}
wins; the continuation is always resumed via `executor().post_completion(handle)`, never inline
from a stop callback or from `poll_expired` itself. Stop/deadline checks before admission return
immediately (still via the awaitable's result, no suspension needed).
5. `close()`: marks closed; every pending entry's callback runs once with `TimerEvent::closed`
(sleepers settle `stopped`); later `schedule_at`/`sleep_*` return `stopped`. Destructor = close.
The executor must outlive the queue (document).
6. Tests per §10; build/run per §11.
## 7. Interfaces and data contracts
```cpp
namespace Void::Time { // Clock.hpp additions (NEW)
[[nodiscard]] MonotonicClock::time_point saturating_add(MonotonicClock::time_point, std::chrono::nanoseconds) noexcept;
[[nodiscard]] MonotonicClock::time_point deadline_after(const MonotonicClock&, std::chrono::nanoseconds) noexcept;
}
namespace Void::Async { // Timer.hpp (NEW)
struct TimerQueueOptions { std::size_t max_timers{1024}; }; // 0 → invalid_argument
enum class TimerEvent : std::uint8_t { expired, closed };
using TimerCallback = std::move_only_function<void(TimerEvent) noexcept>;
class TimerHandle { // move-only; holds shared_ptr<detail::TimerEntry>
public: TimerHandle() noexcept = default;
bool cancel() noexcept; // true ⇒ callback never runs; safe after queue destroyed
[[nodiscard]] bool valid() const noexcept; };
class TimerQueue { // non-copyable, non-movable
public:
using time_point = Void::Time::MonotonicClock::time_point;
[[nodiscard]] static Void::Result::Result<std::unique_ptr<TimerQueue>>
create(Executor& completion_executor, const Void::Time::MonotonicClock& clock, TimerQueueOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<void>> sleep_until(time_point when, OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<void>> sleep_for(std::chrono::nanoseconds, OperationOptions = {});
[[nodiscard]] std::expected<TimerHandle, AdmissionError> schedule_at(time_point when, TimerCallback on_event);
[[nodiscard]] std::size_t poll_expired(); // returns callbacks fired
[[nodiscard]] std::optional<time_point> next_deadline() const;
[[nodiscard]] std::chrono::nanoseconds wait_duration(std::chrono::nanoseconds max_wait) const noexcept; // 0 if due; uses injected now
[[nodiscard]] std::size_t active_timers() const noexcept;
void close() noexcept;
[[nodiscard]] const Void::Time::MonotonicClock& clock() const noexcept;
[[nodiscard]] Executor& executor() noexcept;
~TimerQueue(); // = close()
};
}
```
Result errors use `make_async_error`: `overloaded` (at `max_timers` live timers), `stopped` (after
close), `cancelled` (stop token), `timeout` (`options.deadline` reached first), `invalid_argument`.
`schedule_at` returns `AdmissionError::{overloaded, stopped, invalid_argument}`. Callback exactly-once
rule: runs exactly once with `expired` or `closed`, or never if `cancel()` returned true. If
`std::move_only_function` is unavailable in the toolchain, report it (do not substitute silently).
## 8. Dependencies and integration
Upstream: M-TIME-02, M-ASYNC-02/03 (done). Downstream consumers (later steps): `AsyncChannel`
deadlines (M-ASYNC-04, gate G2), `retry_async` (B1b), `IO::PumpOptions::timers` (S-IO-04). Keep the
interface exactly as written. Root integrates and commits.
## 9. Edge cases security and performance
Stop vs poll vs close races (TSan), equal deadlines FIFO by seq, `when` in the past (fires on next
poll), ManualClock starting at epoch 0 and at a far-future point, never compare manual-domain
deadlines with the host clock, cancel during callback dispatch, callback that schedules a new timer
(must not deadlock: callbacks run outside the lock), destruction with pending sleepers, tombstone
growth bounded, no busy loops, no allocation per poll beyond the due batch.
## 10. Acceptance criteria
1. `TimerQueue.cpp`: `timer_manual_advance_and_poll_fires_exactly_once`,
`timer_equal_deadlines_fire_in_submission_order`, `timer_not_fired_without_explicit_poll`,
`timer_manual_epoch_deadline_not_compared_with_host_clock`, `timer_manual_clock_far_future_initial_point`,
`timer_stop_before_admission_and_pending_cancelled_once`, `timer_stop_vs_poll_race_single_result_tsan`,
`timer_capacity_overloaded_and_tombstone_bounded`, `timer_schedule_at_cancel_vs_fire_exclusive`,
`timer_close_settles_pending_stopped`, `timer_wait_duration_uses_injected_now`,
`timer_sleep_for_saturates`, `timer_handle_cancel_after_queue_destroyed_safe`,
`timer_callback_schedules_new_timer_no_deadlock` — all pass.
2. `DeadlineDomains.cpp`: `deadline_domain_schedule_on_and_scope_admission_injected_clock` and
`deadline_domain_timer_and_operation_deadline_same_manual_clock` (an `OperationOptions.deadline` in
the ManualClock domain expires a `sleep_until` once only after advance + poll) — pass.
3. `ClockSaturation.cpp`: `clock_saturating_add_and_deadline_after_bounds` — passes.
4. Existing `Clock`, `Stopwatch`, `OperationScope`, `Executor`, `Coro` tests pass unchanged.
5. `-Werror` clean; Debug TSan run of the new suites reports 0 races; ASan+UBSan 0 errors.
## 11. Verification commands and evidence
Cwd = your worktree root. Run `dev` with the sandbox disabled (dangerouslyDisableSandbox) — nix
fetcher lock fails inside it. Confirm the new suites appear in output (tests needing unselected
modules are silently skipped).
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-time3 -G Ninja -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-time3 --parallel 8 && /tmp/void-w11-time3/tests/VoidTests --filter "^(TimerQueue|DeadlineDomains|ClockSaturation|Clock|Stopwatch|OperationScope|Executor|Coro)\." && ctest --test-dir /tmp/void-w11-time3 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-time3-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-w11-time3-tsan --parallel 8 && /tmp/void-w11-time3-tsan/tests/VoidTests --filter "^(TimerQueue|DeadlineDomains)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-time3-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-time3-asan --parallel 8 && /tmp/void-w11-time3-asan/tests/VoidTests --filter "^(TimerQueue|DeadlineDomains|ClockSaturation)\."'
```
## 12. Constraints and stop conditions
No edits outside write scope; no weakened assertions or disabled warnings; no changes to existing
Async/Time semantics. Stop and report BLOCKED if the contract needs an edit to a forbidden file (e.g.
`Operation.hpp`), if `std::move_only_function` is unavailable, or a failure originates outside your files.
## 13. Authorization and decisions
Root decisions D-034, D-038 under user decisions D-027/D-029/D-031. Listed files only; no commits,
pushes or other side effects.
## 14. Return format
Task ID; DONE/BLOCKED/PARTIAL; summary; files changed; decisions/deviations; evidence per acceptance
criterion; commands with cwd/results (test counts, TSan/ASan outcome); checks not run; residual
risks; integration notes (worktree path). Do not spawn children.
@@ -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,39 @@
# S-DISCOVERY-01..04 — Discovery Subsystem (Catalog, Leases, Watches, Selectors, Optional RPC Adapter)
## Scope
Implement the P1–P3 native `Void::Discovery` subsystem per `docs/roadmap/subsystems/Discovery.md` and `docs/roadmap/DEPENDENCIES.md`, plus the optional `Void::DiscoveryRpc` endpoint adapter living strictly above `RPC` and `Discovery`:
1. **`S-DISCOVERY-01` — Boundary, Error Domain, and Immutable Value Contracts**:
- Module `src/Discovery/module.cmake` (`INTERNAL_DEPS Core Functional Time Async`) with zero network, storage, or consensus dependencies.
- Error domain `kDiscoveryErrorDomain = 30` with `DiscoveryErrorCode` covering validation, conflict, cap exhaustion, expiry, stale/unavailable freshness, cancellation, and self-join diagnosis.
- Strict endpoint/attribute validation before publication (valid scheme/host/port, `weight > 0`, `max_attributes_per_record = 16`, `max_metadata_bytes_per_record = 4096`, `max_services = 1024`, `max_endpoints_per_service = 256`, `max_total_records = 10000`).
2. **`S-DISCOVERY-02` — Pure Catalog, Atomic Static Snapshots, and Local RAII Registrations**:
- Pure `Catalog` construction creating zero hidden threads.
- Atomic candidate `replace_static()` rejecting invalid/conflicting candidates while preserving the active revision; explicit `provider_generation` bump resets revision domain and emits `ResyncRequired`.
- Local move-only RAII `Registration` handles with explicit `LeasePolicy` (default 30s TTL / 10s renew interval via injected `MonotonicClock`; zero TTL rejected as `InvalidArgument`; unleased explicit mode valid until release; static entries never expire).
- Duplicate `(service, instance)` returns `Conflict` without stealing existing handles.
- Deterministic `resolve()` sorted by `instance`, filtering logically expired records before cleanup runs, respecting `ResolvePolicy::allow_stale` and `Freshness`.
3. **`S-DISCOVERY-03` — Bounded Watches, Resync, Client Selectors, and Managed Renewal**:
- Bounded `watch()` (`max_watches = 1024`, `max_events_per_watch = 64`, shared `16 MiB` event budget) emitting `InitialSnapshot`, serialized per-watch `Delta`, and explicit `ResyncRequired` + full latest `Snapshot` on overflow or provider-generation reset.
- Callbacks run outside catalog and watch locks; `cancel()` stops new admission (including self-cancel inside a callback); `join()` drains admitted callbacks and diagnoses synchronous self-join (`SelfJoin`) instead of deadlocking.
- `Catalog::shutdown_and_join()` removes local entries, cancels watches, and joins admitted callbacks; destructor only requests stop.
- `WeightedRoundRobinSelector`, stable HRW `AffinitySelector`, and deterministic `ManagedLeaseRenewer`.
4. **`S-DISCOVERY-04` — Optional RPC Integration (`DiscoveryRpc`)**:
- Separate module `src/DiscoveryRpc/module.cmake` (`INTERNAL_DEPS Discovery RPC`) so `RPC` remains completely independent of `Discovery`.
- `EndpointResolverClient` resolves endpoints from `Discovery::Catalog`, selects via client selector, preserves configured `expected_tls_name` / identity across IP/address refreshes (rejecting TLS scheme/identity downgrade), and executes unary calls via `Void::RPC::Client`.
## File Ownership
- `include/Void/Discovery/{Types,Catalog}.hpp`
- `src/Discovery/{module.cmake,Catalog.cpp}`
- `include/Void/DiscoveryRpc/EndpointAdapter.hpp`
- `src/DiscoveryRpc/{module.cmake,EndpointAdapter.cpp}`
- `tests/standalone/Discovery/Catalog.cpp`
- `tests/standalone/DiscoveryRpc/EndpointAdapter.cpp`
- `tests/package/DiscoveryOnly/{CMakeLists.txt,main.cpp}`
- `tests/package/InstalledComponents.cmake`
## Acceptance & Verification
- Standalone `Discovery;Testing` (`-DVOID_WARNINGS_AS_ERRORS=ON`) + `DiscoveryOnly` consumer with `_no_external_deps`.
- `DiscoveryRpc` identity-preserving refresh + RPC round-trip tests; `RpcOnly` remains Discovery-free.
- Deterministic fake-clock lease expiry/renewal, atomic bad/good config replacement, duplicate registration conflict, watch overflow -> `ResyncRequired`, self-cancel/self-join, and selector determinism.
- Full `RelWithDebInfo`, `Debug` `ASan+UBSan`, and `Debug` `TSan` with 0 leaks, 0 UB, 0 races.
+37
View File
@@ -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'
```
+318
View File
@@ -0,0 +1,318 @@
# S-IO-03 — Bounded positional file workers, sync, active cancel, safe shutdown core, epoll D1 fixes
Task ID: S-IO-03
Role: opus-implementer
Status: READY
## 1. Context and baseline
- Wave 11 package step B2 (critical path). Repo VoidLibrary, branch `feat/roadmap-p2-wave11`.
You work in an isolated git worktree of the HEAD given in your prompt; cwd = worktree root.
Never read the user's untracked files (`.env`, `WG.conf`, `keys`, `jev_token`) in the main checkout.
- Baseline: full suite at `38436b1` = 1,484 tests, 1,480 passed, 4 skipped, 0 failed.
- Observed source (cite-checked by planner and two PREFLIGHT reviews):
- `include/Void/IO/Driver.hpp:59-105`: `Driver` (non-movable; `create(executor, BackendOptions,
clock, pmr resource)`, `poll_once(max_wait)`, `wake`, `request_stop`, `shutdown_and_join`), no
thread, no run loop, no file API. `~Driver` at `src/IO/EpollDriver.cpp:1737-1742` and
`~EpollBackend` at `:953-963` both call `shutdown_and_join()` and ignore the result.
- `include/Void/IO/Types.hpp`: `IoErrorCode` (incl. root-added `sync_failed = 12` → `ErrorKind::io`),
`IoLimits{max_descriptors 4096, max_operations 8192, ..., file_workers 4, max_file_queue 256}`
(:100-110), `validate_limits` ignores file fields (:112-124), `BackendOptions`, `DriverTelemetry`.
- `include/Void/IO/Detail/Backend.hpp`: `DriverBackend` virtual interface; streams hold `weak_ptr`
to the backend (:85-125); stop forwarders lock briefly (:279-285).
- Epoll defects D1 (all CONFIRMED): (a) `complete_op_and_collect_tickets` releases the backend ref
unconditionally (`EpollDriver.cpp:448`) though `retire_op_locked` is idempotent (:391-394);
(b) cancel path (:1332-1351) doesn't skip retired ops (mock does, :770-781) — stop after the
start-of-turn drain (:1053) while `drive_read/write` completes the op double-releases at the
end-of-turn drain (:1173); (c) `::read`/`::send`/`::write` at :1466/:1549/:1560 run outside `mu_`
without `in_execution` (mock-only, :653-671); (d) cross-thread `shutdown_and_join` (:1179-1238)
completes ops mid-syscall and closes fds (:1221→:363) while a poller holds the integer (:1151).
- `poll_once` early-returns once stopping (`:1056-1059`); mock `poll_once` ignores `max_wait`
(:739-741); `IoErrorCode::busy` already means "concurrent op not allowed" (:533-540).
- Consumers of `Driver`: IPC (`src/IPC/Session.cpp:1118-1129` bounded poll loop ignoring result),
SystemAsync, CryptoAsync, Storage, ConfigurationAsync, Runtime tests.
- Requirements: roadmap row S-IO-03 ("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"); `docs/roadmap/subsystems/IO.md`
(updated in `7f95f89`); contracts C-03..C-06; decisions D-038, D-040.
- MANDATORY design sources (read fully): `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md` §S-IO-03,
`W11-PLAN-REV1-OUTPUT.md` F1, F2, F9, F11, F13 and P3 (D1 seam), and `W11-CONTRACT-R2.md` N3, N4,
P3-5, P3-9. Precedence: R2 > REV1 > PLAN. This spec restates the mandatory points.
## 2. Objective and deliverables
1. NEW `include/Void/IO/File.hpp`: `FileOpenOptions`, `SyncMode`, `FileSyscallResult`,
`FileSyscalls` (injectable shim with `native()`), move-only `File`, `read_exact_at`, `write_all_at`.
2. EDIT `include/Void/IO/Driver.hpp`: `open_file`, `adopt_file_fd`, `start_file_workers`,
`run_file_work`, NEW free `is_io_worker_thread()`; `~Driver` becomes the only blocking teardown;
public inline shutdown wrappers `begin_shutdown()`, `shutdown(Async::OperationOptions)`,
`quiescent()`, `shutdown_complete()` (moved from S-IO-04 by D-042 so B2 can test its primitive).
3. EDIT `include/Void/IO/Types.hpp`: append `BackendOptions::file_syscalls{nullptr}` (borrowed),
`BackendOptions::before_file_worker_start{}`, `DriverTelemetry::{queued_file_requests,
active_file_requests, file_workers_running, duplicate_completions_ignored}`, NEW
`DriverShutdownReport`; `validate_limits` rejects `max_file_queue == 0`.
4. EDIT `include/Void/IO/Detail/Backend.hpp`: file-submit virtuals + shutdown primitives
(`begin_shutdown`, `advance_shutdown`, `shutdown_complete`, `quiescent`, `teardown_blocking`).
5. EDIT `src/IO/EpollDriver.cpp`: D1 fixes, poll-owner exclusion, file completion lane, bounded
shutdown core, F2 wake/close rules; NEW private `src/IO/FileWorkers.{hpp,cpp}`.
6. NEW `tests/standalone/IO/IoFile.cpp`.
## 3. Scope and non-goals
In: the above, for both mock and epoll backends (file pool shared via the base backend).
Out: `Driver::run` and `Pump.hpp`/`pump_until` (S-IO-04, step A4); Net
adapter; io_uring; Runtime; any build-file edit; `Threads::Threads` (D-W11-08: IO already uses
pthread calls without it; IOOnly consumer disables Threads lookup).
## 4. Files to inspect
`include/Void/IO/{Types,Driver,Stream}.hpp`, `include/Void/IO/Detail/Backend.hpp`,
`src/IO/EpollDriver.cpp` (all), `include/Void/Async/{Operation,Executor,TaskScope}.hpp`,
`include/Void/Async/Detail/Types.hpp`, `tests/standalone/IO/IoDriver.cpp`,
`tests/package/InstalledComponents.cmake:74-80` (IOOnly flags), `src/IPC/Session.cpp:1118-1129`,
and the three design documents in §1.
## 5. Write ownership and coordination
Write scope: `include/Void/IO/File.hpp` (NEW), `include/Void/IO/Driver.hpp`, `include/Void/IO/Types.hpp`,
`include/Void/IO/Detail/Backend.hpp`, `src/IO/EpollDriver.cpp`, `src/IO/FileWorkers.hpp` (NEW),
`src/IO/FileWorkers.cpp` (NEW), `tests/standalone/IO/IoFile.cpp` (NEW).
Forbidden: all other paths, including `src/IO/module.cmake`, Async headers, Runtime, SystemAsync,
IPC, tests other than `IoFile.cpp`, build files, docs. Other workers may run concurrently in other
worktrees on Async files. No git commit/branch/stash/reset.
## 6. Implementation or investigation approach
Order: (1) D1 fixes + regression test first; (2) poll-owner exclusion; (3) file pool + File API;
(4) bounded shutdown core + teardown; (5) remaining tests; (6) downstream builds.
MANDATORY invariants:
- D1: release the backend ref only if this call retired the op; cancel/expire paths skip retired
ops; epoll marks an op `in_execution` under `mu_` before its syscall and shutdown/cancel never
completes an op that is in execution (it records stop intent; the syscall's real result settles
it). NEW `duplicate_completions_ignored` counts suppressed double retirements.
- Poll owner: a dedicated `std::mutex poll_mu_`; `poll_once` first checks the thread-local
polling marker (reentrant call → `busy`), then `try_lock`; failure → `IoErrorCode::busy`
without touching any fd. Every turn drains cancels, control messages and file completions
BEFORE any stop-flag early return. While stopping (not yet shut down) a turn with no work waits
in `epoll_wait` up to `max_wait` (no spin). After shutdown completes `poll_once` returns 0
without touching any fd.
- File workers (F1): a worker performs exactly one syscall (native or the injected shim — the
single documented exception allowed to run on workers; it must not call Driver/Executor/File
APIs), then pushes `{request, result}` onto the shared completion queue under the pool mutex and
wakes. Resume tickets are produced only by a poll turn via the existing
`complete_op_and_collect_tickets` path. `run_file_work(n)` runs syscalls on the caller and only
queues results. Workers hold `shared_ptr<detail::FileWorkerShared>`, never the backend.
Thread-local `tl_io_worker_owner` set on workers; `is_io_worker_thread()` reads it.
- Admission: closed driver / stopped / expired → rejected before queueing; `max_file_queue` bounds
queued requests, `max_operations` bounds queued+active; either → `overloaded`; zero-length →
`{0,false}` without a syscall; offset+length overflow → `invalid_argument`. Files count against
`max_descriptors`.
- Ordering: writes and syncs on one file run in admission order, one active at a time; reads may
run concurrently. One syscall per request; EINTR retried; short transfer returns actual bytes;
0-byte read of nonzero length = EOF.
- Queued stop/expiry: removed, completes `cancelled`/`timeout`; writes/syncs carry
`DomainOutcomeKind::not_committed`. Expiry checked by the driver clock in `poll_once` and again at
worker dequeue.
- Active stop/expiry: intent only; span/lease and telemetry retained; result = the syscall's actual
outcome. Sync success after stop = success; sync failure → `sync_failed` + native errno +
`DomainOutcomeKind::unknown`.
- `start_file_workers()` explicit, once; the `before_file_worker_start(index)` hook error or a
caught `std::system_error` joins already-started workers, returns `os_error` (system code when
present), and allows retry.
- File fd state (N4/F13): `detail::FileState` shared-owned, `enum {open, closing, closed}` under
the pool mutex; handle drop / in-flight / `close_pending` transitions under that mutex; exactly
one close enqueued (preallocated node inside `FileState`, reserved capacity bounded by
`max_descriptors`); close executes on a worker or in `run_file_work`. `~File` wakes only via a
weak→strong backend lock or the worker condvar, never a raw waker. Teardown closes remaining file
fds after joining workers and marks them `closed`; afterwards File ops return `closed` without a
syscall, `~File` does nothing, `close_and_join` returns success. `File::close_and_join(options)`
is always admitted; deadline/stop expiry → `incomplete_shutdown`, File stays valid with fd and
buffers retained; close syscall failure → `os_error`, fd treated as closed.
- Shutdown core (F9/N3): backend `begin_shutdown()` (idempotent: sets the stopping flag, closes
admission, cancels queued, stops active); `advance_shutdown(deadline, stop)` waits in ≤1 ms real
slices re-reading the injected clock, releases `poll_mu_` between slices, runs its own turns only
while holding poll ownership, wakes the current poller, returns the current
`DriverShutdownReport` with `complete=false` on deadline or stop (not an error), returns
`Async::make_async_error(AdmissionError::self_join)`-equivalent error if called on this backend's
worker or inside its poll turn; dispatches resume tickets only after releasing poll ownership
(P3-9). On completion: workers joined, op/descriptor fds closed, `wake_closed_` set (release).
1.x `shutdown_and_join()` = `advance_shutdown(nullopt, {})` mapped to `Result<void>`.
- F2: epoll fd and eventfd close only in `~EpollBackend`; `wake()` returns early if
`wake_closed_` (acquire).
- F1 teardown: `~EpollBackend`/`~MockBackend`/`~FileWorkers` never block; `~FileWorkers` finding
a joinable thread prints a one-line stderr diagnostic and `std::terminate`s. `Driver::~Driver`
calls `backend_->teardown_blocking()` (begin + advance to completion). `~Driver` on a file-worker
thread or inside a poll turn of that backend → stderr diagnostic + `std::terminate`.
### Amendments from W11-SPEC-REVIEW-1 (MANDATORY; override earlier text where they differ)
Source: `docs/agent-workflow/tasks/W11-SPEC-REVIEW-1-OUTPUT.md` S1–S9 + P3 (decision D-042).
- S1 ownership handoff: before each slice `advance_shutdown` sets atomic `shutdown_waiting_` and
calls `wake()`. While it is set, `poll_once` on any other thread returns `busy` before `try_lock`,
touching no fd and not incrementing `turns`. It is cleared once `advance_shutdown` holds
`poll_mu_`. Between slices, after `advance_shutdown` releases `poll_mu_`, other pollers may run turns.
- S2 shutdown order (replaces the order implied above): (1) `begin_shutdown()` — `advance_shutdown`
calls it itself; (2) wait until no queued or active file request and no op `in_execution`;
(3) under `poll_mu_`, final drain of cancels, controls, file completions and close waiters;
(4) join workers; (5) still under `poll_mu_`, close remaining file fds (mark `closed`, complete
pending `close_and_join` waiters with success), then close op/descriptor fds; (6) set `shut_down_`
(release), then `wake_closed_`; (7) release `poll_mu_`, then dispatch tickets. `self_join` misuse
(`Async::make_async_error(Async::AdmissionError::self_join)`) is detected before any state change.
`begin_shutdown` only records intent and wakes the poller; it never completes or dispatches.
Document: the executor must outlive the Driver; an owned executor must not be joined before
Driver teardown (P3-9).
- S3 (replaces "Expiry checked ... again at worker dequeue"): expiry is checked with the driver
clock in `poll_once`; the epoll wait bound includes the earliest queued-file deadline. At dequeue a
worker checks, under the pool mutex and WITHOUT calling the clock, the request's stop flag and the
expired mark set by the last turn; such a request completes `cancelled`/`timeout` with no syscall.
- S4 observable contract: queued stop → `IoErrorCode::cancelled`, queued expiry →
`IoErrorCode::timeout` (kIoErrorDomain), zero shim calls, unchanged file bytes; sync failure →
`IoErrorCode::sync_failed` with `system_code() == std::error_code{errno, std::generic_category()}`.
Internally settle with `try_commit_error(err, not_committed|unknown)`; tests do not assert the
outcome kind. Retirement uses a retire-once path equivalent to `complete_op_and_collect_tickets`,
generalized for `OperationState<void>` and the file outcome kinds.
- S5 slots: a File occupies a `DescriptorSlot`, counts in `active_descriptors_`, bounded by
`max_descriptors`; `File::id()` is that slot's `DescriptorId`. The slot has `fd = -1` and a
file-kind flag; socket paths (interest updates, `close_fd` controls, stale-event checks, shutdown
sweep) skip it. The file fd lives only in `FileState`.
- S6 lifetimes: `FileState` holds `shared_ptr<detail::FileWorkerShared>` and `weak_ptr<DriverBackend>`,
never raw pool/backend pointers. The raw-context waker is called only by workers, which are joined
before the backend is destroyed.
- S7 stop flag: `request_stop()` == `begin_shutdown()`, with idempotence on a separate
`shutdown_begun_` flag. On mock, requests held by a token never block `advance_shutdown`;
`finish_*` still completes them, and `teardown_blocking` completes any still held with
`IoErrorCode::closed`.
- S8 D1 counter: increment `duplicate_completions_ignored` each time a cancel, expiry or shutdown
path meets an already-retired op and skips it. Retired ops are not purged from the cancel queue
early. A turn's first `clock_.now()` comes after the start-of-turn cancel/control/file drain; the
queued-file expiry scan reads the clock only when queued file requests have deadlines.
- S9 (D-042): B2 owns and tests the public wrappers `begin_shutdown`, `shutdown(options)`,
`quiescent`, `shutdown_complete` (inline in `Driver.hpp`). A4 adds only `run()`, `Pump.hpp`,
SystemAsync conformance and its tests.
- P3 clarifications: busy only if the polling marker equals THIS backend (save/restore it for nested
turns of other drivers); mock `poll_once` still ignores `max_wait`; the only worker-side Driver call
is detected (`shutdown_and_join`/`shutdown` → `self_join`); closed → `closed`, stop → `cancelled`,
expired → `timeout` (as `submit_io`); `offset > OFF_MAX` or `offset+len > OFF_MAX` →
`invalid_argument`; file requests count in the shared `active_operations_` until poll-turn
retirement; reads are unordered relative to writes; a second `start_file_workers` →
`invalid_argument`, `file_workers == 0` → success with no threads, after shutdown begins →
`closed`, `run_file_work` while workers run → `busy`; `close_and_join` waits for (does not cancel)
the file's queued/active requests, success invalidates the File, after an expired call the File is
`valid()` but closing (new ops → `closed`, a repeat call waits); document the difference from
`ByteStream::close_and_join`; `read_exact_at`/`write_all_at` mirror `Stream.hpp` composed transfers
with the offset advancing and one deadline, a 0-byte pwrite with bytes remaining is an error (no
loop); open flags: RDWR/WRONLY/RDONLY, neither read nor write → `invalid_argument`, `truncate`
requires write, `exclusive` requires create, always `O_CLOEXEC`, runs on the caller's thread;
`adopt_file_fd` takes ownership only on success; the injected shim must outlive Driver teardown.
- Test file includes: `IoFile.cpp` may include only Void/{IO, Async, Time, Memory, Functional, Core,
Testing} headers (otherwise it is silently skipped); write a local temp-dir helper.
## 7. Interfaces and data contracts
```cpp
namespace Void::IO { // File.hpp (NEW)
struct FileOpenOptions { bool read{true}, write{false}, create{false}, truncate{false}, exclusive{false};
std::uint32_t mode{0600}; };
enum class SyncMode : std::uint8_t { data, full };
struct FileSyscallResult { std::int64_t value{0}; int error{0}; };
class FileSyscalls { public: virtual ~FileSyscalls() = default;
[[nodiscard]] virtual FileSyscallResult pread(int, std::span<std::byte>, std::uint64_t) noexcept;
[[nodiscard]] virtual FileSyscallResult pwrite(int, std::span<const std::byte>, std::uint64_t) noexcept;
[[nodiscard]] virtual FileSyscallResult sync(int, SyncMode) noexcept;
[[nodiscard]] virtual FileSyscallResult close(int) noexcept;
[[nodiscard]] static FileSyscalls& native() noexcept; };
class File { public: File() noexcept; File(File&&) noexcept; File& operator=(File&&) noexcept; ~File();
[[nodiscard]] bool valid() const noexcept; [[nodiscard]] DescriptorId id() const noexcept;
[[nodiscard]] Coro::Task<Void::Result::Result<Transfer>> read_at(std::uint64_t, std::span<std::byte>, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<Transfer>> write_at(std::uint64_t, std::span<const std::byte>, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<Transfer>> read_at_owned(std::uint64_t, BufferLease&, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<Transfer>> write_at_owned(std::uint64_t, const BufferLease&, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<void>> sync(SyncMode = SyncMode::full, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<void>> close_and_join(Async::OperationOptions = {}); };
[[nodiscard]] Coro::Task<std::expected<std::size_t, ComposedTransferError>> read_exact_at(File&, std::uint64_t, std::span<std::byte>, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<std::expected<std::size_t, ComposedTransferError>> write_all_at(File&, std::uint64_t, std::span<const std::byte>, Async::OperationOptions = {});
}
// Driver.hpp additions
[[nodiscard]] Void::Result::Result<File> Driver::open_file(const std::filesystem::path&, FileOpenOptions = {});
[[nodiscard]] Void::Result::Result<File> Driver::adopt_file_fd(int fd);
[[nodiscard]] Void::Result::Result<void> Driver::start_file_workers();
[[nodiscard]] Void::Result::Result<std::size_t> Driver::run_file_work(std::size_t max_requests = 1);
[[nodiscard]] bool Void::IO::is_io_worker_thread() noexcept;
void Driver::begin_shutdown() noexcept; // -> backend_->begin_shutdown()
[[nodiscard]] Void::Result::Result<DriverShutdownReport> Driver::shutdown(Async::OperationOptions); // -> advance_shutdown(o.deadline, o.stop)
[[nodiscard]] bool Driver::quiescent() const noexcept;
[[nodiscard]] bool Driver::shutdown_complete() const noexcept;
// Types.hpp additions
struct DriverShutdownReport { bool complete{false}; std::size_t pending_operations{0},
active_file_requests{0}, open_descriptors{0}, retained_buffer_bytes{0}; };
// BackendOptions (append): FileSyscalls* file_syscalls{nullptr};
// std::function<Void::Result::Result<void>(std::size_t)> before_file_worker_start{};
// DriverTelemetry (append): queued_file_requests, active_file_requests, file_workers_running,
// duplicate_completions_ignored (std::size_t / std::uint64_t as fits existing fields)
// detail::DriverBackend (append, pure virtual or with base impl):
virtual void begin_shutdown() noexcept;
[[nodiscard]] virtual Void::Result::Result<DriverShutdownReport> advance_shutdown(
std::optional<Void::Time::MonotonicClock::time_point> deadline, std::stop_token stop);
[[nodiscard]] virtual bool shutdown_complete() const noexcept;
[[nodiscard]] virtual bool quiescent() const noexcept;
virtual void teardown_blocking() noexcept;
```
`ComposedTransferError`, `Transfer`, `DescriptorId`, `BufferLease` are existing IO types — reuse.
Use existing namespace aliases/spellings for `Coro::Task` and `Void::Result::Result` as in `Stream.hpp`.
Unchanged 1.x: every existing `Driver`/`ByteStream`/`BufferLease` signature and the IoDriver tests.
## 8. Dependencies and integration
Upstream: S-IO-01/02 (done), root prep `7f95f89` (`sync_failed`). Downstream: S-IO-04 (A4) adds
public wrappers over your backend primitives (gate G4); S-RUNTIME-02 (B3) uses
`start_file_workers`, `is_io_worker_thread`. Keep §7 exactly. Root integrates and commits.
## 9. Edge cases security and performance
fd reuse after close during concurrent poll; buffer retention on active timeout; `open_file` uses
`O_CLOEXEC` with ordinary `open(2)` path semantics (no new symlink policy); EINTR; ENOSPC/EIO surfaced as `os_error`; partial start; teardown with
stalled worker (shim gated by a latch); no busy loops; no allocation in `~File`; TSan-clean.
## 10. Acceptance criteria
`IoFile.cpp` (isolated temp dir per test, no fixed paths): `io_file_native_roundtrip_isolated_tmpdir`,
`io_file_short_write_preserves_progress_write_all_at`, `io_file_writes_syncs_serialized_admission_order`,
`io_file_reads_concurrent_explicit_offsets`, `io_file_queue_and_ops_quota_overloaded`,
`io_file_queued_cancel_not_committed_zero_effects`, `io_file_queued_deadline_expires_once_manual_clock_poll`,
`io_file_active_timeout_retains_buffer_until_syscall_returns`, `io_file_sync_success_after_stop_is_success`,
`io_file_sync_failure_after_stop_sync_failed_unknown_errno`, `io_file_manual_stepping_without_workers`,
`io_file_shutdown_joins_stalled_worker_then_delivers`, `io_file_shutdown_from_worker_self_join`,
`io_file_workers_partial_start_failure_joins_started`, `io_file_drop_with_inflight_defers_close_until_drained`,
`io_file_close_and_join_expiry_incomplete_retains_then_completes`, `io_file_ops_after_teardown_closed_no_syscall`,
`io_driver_destroyed_from_coroutine_resumed_after_poll_dispatch_same_thread`,
`io_worker_thread_marker_only_on_file_workers`, `io_concurrent_poll_once_second_caller_busy_no_fd_touch_tsan`,
`io_epoll_shutdown_concurrent_with_poller_no_uaf_tsan`, `io_stop_after_completion_releases_backend_ref_once`,
`io_epoll_stop_requested_at_deadline_scan_completes_once` (D1 seam: clock armed after submission,
asserts single delivery and `duplicate_completions_ignored >= 1`), `io_file_eintr_retried_via_shim`,
`io_file_zero_length_overflow_and_zero_queue_limit`, `io_file_counts_against_max_descriptors`,
`io_file_workers_second_start_invalid`, `io_poll_once_after_shutdown_returns_zero`,
`io_poll_once_reentrant_inline_resume_busy`, `io_shutdown_bounded_deadline_incomplete_then_complete`,
`io_shutdown_stop_token_returns_incomplete_report`, `io_request_stop_then_shutdown_cancels_queued_files`,
`io_mock_held_request_does_not_block_teardown`. All pass; existing `IoDriver` tests
pass unchanged; downstream suites pass unfiltered; `-Werror`, TSan 0 races, ASan+UBSan 0 errors.
## 11. Verification commands and evidence
Cwd = worktree root; run `dev` with the sandbox disabled. Confirm new suites appear in output.
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io3 -G Ninja -DVOID_ENABLED_MODULES="IO;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-io3 --parallel 8 && /tmp/void-w11-io3/tests/VoidTests --filter "^(IoFile|IoDriver)\." && ctest --test-dir /tmp/void-w11-io3 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io3-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="IO;Testing" -DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-io3-tsan --parallel 8 && /tmp/void-w11-io3-tsan/tests/VoidTests --filter "^(IoFile|IoDriver)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io3-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="IO;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-io3-asan --parallel 8 && /tmp/void-w11-io3-asan/tests/VoidTests --filter "^(IoFile|IoDriver)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io3-users -G Ninja -DVOID_ENABLED_MODULES="IO;IPC;SystemAsync;Storage;CryptoAsync;Runtime;ConfigurationAsync;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-io3-users --parallel 8 && /tmp/void-w11-io3-users/tests/VoidTests && ctest --test-dir /tmp/void-w11-io3-users --output-on-failure --timeout 180'
```
Warnings check (VOID_WARNINGS_AS_ERRORS does not reach VoidTests TUs, X-QA-01):
```sh
dev cpp-gcc -c bash -lc 'g++ -std=c++26 -freflection -fsyntax-only -Iinclude -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers tests/standalone/IO/IoFile.cpp && for h in File Driver Types; do echo "#include <Void/IO/$h.hpp>" | g++ -std=c++26 -freflection -x c++ -fsyntax-only -Iinclude -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers - || exit 1; done'
```
CryptoAsync may need `-p openssl` on the `dev` line (`dev cpp-gcc -p openssl -c ...`); report the
exact command used.
## 12. Constraints and stop conditions
No edits outside write scope; no weakened assertions; no disabled warnings; no Threads link. Stop
and report BLOCKED if: a forbidden file must change; a downstream suite fails for reasons rooted in
the new blocking `shutdown_and_join` semantics that need a consumer edit; any D1 fix cannot be made
without changing a public 1.x signature; or two repair attempts at the same failing check fail.
## 13. Authorization and decisions
Root decisions D-034, D-038, D-040 under user decisions D-027/D-029/D-031. Listed files only; no
commits, pushes or other side effects.
## 14. Return format
Task ID; DONE/BLOCKED/PARTIAL; summary; files changed; decisions/deviations (esp. any choice the
design docs left to you); evidence per acceptance criterion; commands with cwd/results (test counts,
TSan/ASan); checks not run; residual risks; integration notes (worktree path, primitives A4 should
wrap). Do not spawn children.
+134
View File
@@ -0,0 +1,134 @@
# S-IO-04 — Embedded pumping (`Driver::run`, `pump_until`), joined-shutdown conformance
Task ID: S-IO-04
Role: sonnet-implementer
Status: READY
## 1. Context and baseline
- Wave 11 package step A4 (gate G4: S-IO-03 committed). Repo VoidLibrary, branch
`feat/roadmap-p2-wave11`. Isolated worktree; first fast-forward it to the HEAD stated in your prompt.
- Baseline: full suite at `38436b1` = 1,484 tests (1,480 ✔, 4 ⊘); the branch adds RetryState, TimerQueue,
retry_async and S-IO-03 (IoFile 33 tests).
- Observed source after S-IO-03 (see `docs/agent-workflow/tasks/S-IO-03.md` and its implementer notes):
- `include/Void/IO/Driver.hpp`: `poll_once(max_wait)` returns `IoErrorCode::busy` for three causes
(reentrant call on this backend, concurrent poller, shutdown taking over poll ownership) without
touching fds; after shutdown completes it returns 0 immediately. Public inline wrappers
`begin_shutdown()`, `shutdown(Async::OperationOptions)` → `DriverShutdownReport`, `quiescent()`,
`shutdown_complete()`; `request_stop()` == `begin_shutdown()`. Shutdown dispatches resume tickets on the
thread that called `shutdown()`, after releasing poll ownership; the executor must outlive the Driver.
- Mock backend: `poll_once` ignores `max_wait` (never blocks); requests held by a `MockController`
token keep `pending_operations > 0` even when the report says `complete == true`.
- `include/Void/Async/Timer.hpp`: `TimerQueue::{poll_expired, wait_duration(max_wait), next_deadline}`.
- `include/Void/Async/TaskScope.hpp`: `join_pumping` drains the executor but never polls IO.
- SystemAsync `ProcessManager` borrows a `Driver` (`include/Void/System/AsyncProcess.hpp`,
`src/SystemAsync/AsyncProcess.cpp`). Net does not use IO (Net adapter deferred, D-W11-07).
- Requirements: roadmap row S-IO-04 ("Embedded pumping, joined shutdown, SystemAsync conformance (Net
adapter deferred) | Shutdown during pending socket/file work retains resources; no IO→Runtime/Net
dependency"); C-03..C-06; decisions D-038, D-040 (N3 loop rules), D-042 (S9 split).
## 2. Objective and deliverables
1. EDIT `include/Void/IO/Driver.hpp`: NEW inline `Driver::run(std::stop_token, std::chrono::nanoseconds max_wait = 5ms)`.
2. NEW `include/Void/IO/Pump.hpp`: `PumpOptions`, `pump_until`.
3. NEW tests `tests/standalone/IO/IoShutdown.cpp`, `tests/standalone/IO/IoPump.cpp`,
`tests/standalone/SystemAsync/SystemAsyncShutdown.cpp`.
## 3. Scope and non-goals
Out: any change to `src/IO/*`, `include/Void/IO/{Types,File}.hpp`, `include/Void/IO/Detail/*`, Async
headers, SystemAsync sources, Runtime, Net adapter, build files. If a defect in the S-IO-03 primitives is
found, STOP and report it with a reproducer (root owns the fix).
## 4. Files to inspect
`include/Void/IO/{Driver,Types,File,Stream}.hpp`, `include/Void/IO/Detail/Backend.hpp` (read-only),
`include/Void/Async/{Timer,Executor,TaskScope}.hpp`, `include/Void/System/AsyncProcess.hpp`,
`tests/standalone/IO/{IoDriver,IoFile}.cpp`, `tests/standalone/SystemAsync/*.cpp`,
`docs/agent-workflow/tasks/W11-CONTRACT-R2.md` N3, `W11-PLAN-OUTPUT.md` §S-IO-04.
## 5. Write ownership and coordination
Write scope: `include/Void/IO/Driver.hpp` (only the NEW `run` declaration/definition), `include/Void/IO/Pump.hpp` (NEW),
`tests/standalone/IO/IoShutdown.cpp` (NEW), `tests/standalone/IO/IoPump.cpp` (NEW),
`tests/standalone/SystemAsync/SystemAsyncShutdown.cpp` (NEW).
Forbidden: every other path. Other implementers work concurrently in other worktrees (Async EventBus/
Observable; Runtime). No git operations except the authorized fast-forward.
## 6. Implementation or investigation approach
MANDATORY:
- `run(stop, max_wait)`: loop until `stop.stop_requested()` or `shutdown_complete()`; each iteration calls
`poll_once(max_wait)`; on `busy` wait up to `max_wait` in ≤1 ms stop-aware slices and retry; on a mock
backend (or any turn that did no work and returned immediately) wait up to `max_wait` stop-aware so the
loop never busy-spins; propagate any other error; return the accumulated work count. Never closes,
frees or joins anything.
- `pump_until(driver, manual, done, options)`: loop: `done()` → return count; `options.operation.stop`
requested → `cancelled`; `options.operation.deadline` reached per `driver.clock()` → `timeout`;
`max_turns` exceeded → `IoErrorCode::exhausted`; otherwise one turn = `poll_once(wait)` with
`wait = timers ? timers->wait_duration(max_wait) : max_wait` (0 when work is runnable), then
`timers->poll_expired()` if set, then drain `manual`; `busy` handled as in `run`; exits when
`shutdown_complete()` and `done()` still false → returns the current count (caller decides). Never frees
work; all waits re-read the injected clock.
- Shutdown conformance tests use the public S-IO-03 API only: an expired `shutdown(options)` returns
`complete=false` and retains fds/buffers/workers; a repeat call completes after release; concurrent
`run()` loop + `shutdown()` is TSan-clean and the run loop exits on `shutdown_complete()`.
- Layering: no `Void/Runtime`, `Void/Net`, `Void/System` include in `include/Void/IO` or `src/IO`
(SystemAsync test lives under `tests/standalone/SystemAsync/`).
## 7. Interfaces and data contracts
```cpp
namespace Void::IO {
// Driver.hpp (NEW member, inline)
[[nodiscard]] Void::Result::Result<std::size_t> Driver::run(std::stop_token stop,
std::chrono::nanoseconds max_wait = std::chrono::milliseconds{5});
// Pump.hpp (NEW)
struct PumpOptions { std::chrono::nanoseconds max_wait{0}; std::size_t max_turns{1u << 20};
Async::OperationOptions operation{}; Async::TimerQueue* timers{nullptr}; };
template <class Done> requires std::predicate<Done&>
[[nodiscard]] Void::Result::Result<std::size_t> pump_until(Driver&, Async::ManualExecutor&, Done&& done,
PumpOptions = {});
}
```
Errors: `IoErrorCode::{cancelled, timeout, exhausted}` via `make_io_error`; `busy` is never returned by
`run`/`pump_until`. Unchanged: every existing Driver member.
## 8. Dependencies and integration
Upstream: S-IO-03, M-TIME-03 (TimerQueue). Downstream: S-RUNTIME-03 `shutdown_pumping` uses `pump_until`
(gate G5); the Runtime reactor follows the same `busy`/mock wait rules. Root integrates and commits.
## 9. Edge cases security and performance
Spurious `busy` during shutdown handoff; mock never blocks; `max_wait == 0`; stop already requested;
deadline already expired; timers with nothing due; `done()` true initially; executor work that posts more
work; no allocation per turn; no busy loops (assert bounded iteration counts with a fake/injected clock).
## 10. Acceptance criteria
- `IoShutdown.cpp`: `io_shutdown_expired_budget_incomplete_retains_stalled_file_worker`,
`io_shutdown_pending_socket_read_retains_buffer_until_delivery`, `io_shutdown_repeated_idempotent_after_complete`,
`io_shutdown_concurrent_with_run_loop_tsan`, `io_run_stops_on_token_and_on_shutdown`,
`io_begin_shutdown_rejects_new_admission`, `io_run_busy_and_mock_wait_does_not_spin`.
- `IoPump.cpp`: `io_pump_until_scope_join_mock`, `io_pump_until_deadline_injected_clock`,
`io_pump_until_max_turns_exhausted`, `io_pump_until_drives_timer_queue`, `io_pump_until_stop_cancelled`,
`io_pump_until_exits_after_shutdown_complete`.
- `SystemAsyncShutdown.cpp`: `systemasync_driver_shutdown_pending_pipe_read_retains_and_delivers_once`.
- Existing `IoDriver`, `IoFile`, `SystemAsync` tests pass; TSan 0 races; ASan+UBSan 0 errors; `-Werror`
syntax checks clean; layering `rg` empty; `git diff --stat -- src/IO/module.cmake` empty.
- Test caveats: keep each test well under 1,000 assertions (X-QA-02; count in loops, assert once) and keep
each test declaration on ONE line (X-QA-03).
## 11. Verification commands and evidence
Cwd = worktree root; `dev` with the sandbox disabled. Confirm new suites appear in the output.
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io4 -G Ninja -DVOID_ENABLED_MODULES="IO;SystemAsync;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-io4 --parallel 8 && /tmp/void-w11-io4/tests/VoidTests --filter "^(IoShutdown|IoPump|IoFile|IoDriver|SystemAsyncShutdown|SystemAsync)\." && ctest --test-dir /tmp/void-w11-io4 --output-on-failure --timeout 120'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io4-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="IO;SystemAsync;Testing" -DVOID_ENABLE_TSAN=ON && cmake --build /tmp/void-w11-io4-tsan --parallel 8 && /tmp/void-w11-io4-tsan/tests/VoidTests --filter "^(IoShutdown|IoPump|SystemAsyncShutdown|IoFile)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io4-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="IO;SystemAsync;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON && cmake --build /tmp/void-w11-io4-asan --parallel 8 && /tmp/void-w11-io4-asan/tests/VoidTests --filter "^(IoShutdown|IoPump|SystemAsyncShutdown)\."'
dev cpp-gcc -c bash -lc 'for f in IO/IoShutdown IO/IoPump SystemAsync/SystemAsyncShutdown; do g++ -std=c++26 -freflection -fsyntax-only -Iinclude -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers tests/standalone/$f.cpp || exit 1; done'
rg -n "Void/(Runtime|Net|System)/" include/Void/IO src/IO # expect no output
```
## 12. Constraints and stop conditions
No edits outside write scope; no weakened assertions. Stop and report BLOCKED with a reproducer if an
S-IO-03 primitive misbehaves (deadlock, spin, wrong report), if SystemAsync needs a source change, or two
repair attempts at one check fail.
## 13. Authorization and decisions
Root decisions D-034, D-038, D-040, D-042 under user decisions D-027/D-029/D-031. Listed files only; no
commits, pushes or other side effects.
## 14. Return format
Task ID; DONE/BLOCKED/PARTIAL; summary; files changed; decisions/deviations; evidence per acceptance
criterion; commands with cwd/results; checks not run; residual risks; worktree path. Do not spawn children.
+27
View File
@@ -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,41 @@
# S-MESSAGING-01..04 — Messaging Subsystem (Delivery Model, Ephemeral Queue, Durable Storage Queue, Outbox/Inbox, RPC Adapter)
## Scope
Implement the P1–P3 native `Void::Messaging` subsystem, `Void::MessagingStorage` durable adapter + outbox/inbox helper, and `Void::MessagingRpc` remote adapter per `docs/roadmap/subsystems/Messaging.md` and `docs/roadmap/DEPENDENCIES.md`:
1. **`S-MESSAGING-01..02` — Delivery Model, Receipts, State Machine, and Bounded Ephemeral Queue**:
- Module `src/Messaging/module.cmake` (`INTERNAL_DEPS Core Functional Binary Time Async`) with zero `Storage`, `Net`, or `RPC` dependency.
- Error domain `kMessagingErrorDomain = 32` (`MessagingErrorCode`).
- Explicit `PublishDurability::{Memory, Durable}`: `InMemoryQueue` strictly rejects `PublishDurability::Durable` (`UnsupportedDurability`) and `PublishReceipt` records exact durability so nondurable channels never claim durable success.
- Native state machine `Pending -> InFlight(generation, visibility_deadline) -> Acked | Pending | DeadLetter`.
- FIFO per-queue competing consumers and `ConsumerMode::SingleActive` (blocking group head on retry until ack).
- Visibility timeout (default 30s, explicit extension up to 5m via injected `MonotonicClock`), stale-receipt fencing (`StaleReceipt`), idempotent repeat ack, retry bound (default 5 attempts, full jitter 1s..60s via injectable RNG), corrupt-payload quarantine, and bounded caps (768 KiB message, 8 KiB / 32 headers, 1024 queues, 32 groups/queue, 64 in-flight/group, 1024 waiting receives, 64 MiB transient payload budget).
- Clean `close_and_join()` stopping admission, waking/cancelling waiting receives, and draining active deliveries.
2. **`S-MESSAGING-03` — Durable Storage Queue (`MessagingStorage`)**:
- Module `src/MessagingStorage/module.cmake` (`INTERNAL_DEPS Messaging Storage`).
- `StorageQueue` persists payload, sequence, group state, delivery generation/attempt, DLQ records, and bounded 24h / 100k publish idempotency ledger via `Void::Storage::Engine` conditional batches (`Durability::Sync`).
- At idempotency capacity, rejects new publish (`IdempotencyCapacityExceeded`) instead of silently evicting live contracts.
- On restart/reopen, promotes all prior `InFlight` records to `Pending` with bumped generation so stale worker receipts fail with `StaleReceipt`, preserving attempt counters across restarts.
- Atomic DLQ move (DLQ insert + source group removal in one `Storage::Batch`); when DLQ or persistent quota is full, keeps the message durable, drops zero data, blocks affected admission, and exposes `stuck_dlq_count()`.
- Explicit `RetentionPolicy::BlockAtQuota` default (unread work never silently expired) vs opt-in `DropOldestLossy`, pausing expiry when civil clock health fails; `UnknownOutcome` surfaced on uncertain storage commit.
3. **`S-MESSAGING-04` — Outbox/Inbox Local-Batch Helper and Remote RPC Adapter (`MessagingRpc`)**:
- `OutboxInbox` helper in `MessagingStorage` enabling single-batch local business mutation + outbox insert and single-batch local effect + inbox dedup insert, with explicit documentation that external effects remain outside the local batch boundary.
- Separate module `src/MessagingRpc/module.cmake` (`INTERNAL_DEPS Messaging RPC`) exposing `RpcQueueServer` and `RpcQueueClient` for remote `publish`, `receive`, `ack`, `nack`, and `query_receipt` over Wire v1 unary RPC.
## File Ownership
- `include/Void/Messaging/{Types,Queue}.hpp`
- `src/Messaging/{module.cmake,Queue.cpp}`
- `include/Void/MessagingStorage/{StorageQueue,OutboxInbox}.hpp`
- `src/MessagingStorage/{module.cmake,StorageQueue.cpp}`
- `include/Void/MessagingRpc/RpcAdapter.hpp`
- `src/MessagingRpc/{module.cmake,RpcAdapter.cpp}`
- `tests/standalone/Messaging/Messaging.cpp`
- `tests/standalone/MessagingStorage/StorageQueue.cpp`
- `tests/standalone/MessagingRpc/RpcAdapter.cpp`
- `tests/package/MessagingOnly/{CMakeLists.txt,main.cpp}`
- `tests/package/InstalledComponents.cmake`
## Acceptance & Verification
- Standalone `Messaging;MessagingStorage;MessagingRpc;Testing` (`-DVOID_WARNINGS_AS_ERRORS=ON`) + `MessagingOnly` consumer with `_no_external_deps`.
- Deterministic tests for ephemeral/durable separation, competing vs single-active ordering, visibility expiry & stale receipt fencing, idempotent ack/publish, restart recovery preserving attempts, poison -> atomic DLQ move, DLQ/quota/idempotency cap pressure, clock-health pause, outbox/inbox single-batch atomicity, and remote RPC round-trip.
- Full `RelWithDebInfo`, `Debug` `ASan+UBSan`, and `Debug` `TSan` with 0 leaks, 0 UB, 0 races.
@@ -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'
```
+30
View File
@@ -0,0 +1,30 @@
# Task Spec: `S-RPC-01..03` — NEW `Void::RPC` Subsystem (Wire v1 Binary Codec & Unary HTTP/1.1 Transport)
- **Branch**: `feat/roadmap-p2-wave9` (baseline `main` at `3e25405`).
- **Roadmap authority**: `docs/roadmap/subsystems/RPC.md` (`S-RPC-01`..`S-RPC-03`), `ARCHITECTURE.md` C-02..C-07, C-11..C-13.
- **Error domain**: `Void::Result::kRpcErrorDomain = 29`.
## Scope & Deliverables
1. **Module Boundary (`src/RPC/module.cmake`)**:
- `void_add_module(RPC INTERNAL_DEPS Core Functional Binary Data Time Async Net)`.
- Zero dependency on `Coordination`, `Discovery`, `Replication`, `Security`, or platform hosts.
2. **Types & Limits (`include/Void/RPC/Types.hpp`)**:
- `RpcStatusCode` (`Ok`, `Cancelled`, `InvalidArgument`, `DeadlineExceeded`, `NotFound`, `PermissionDenied`, `Unauthenticated`, `ResourceExhausted`, `FailedPrecondition`, `Unimplemented`, `Unavailable`, `Internal`, `DataLoss`, `UnknownOutcome`, `ProtocolError`, `IncompatibleVersion`).
- `MethodId{service, method}`, `PrincipalView` (immutable authenticated principal attributes), `MetadataEntry`, `MethodDescriptor{id, service_name, method_name, schema_version, replay_safe}`.
- `RpcLimits`: `max_header_bytes = 16 KiB`, `max_metadata_entries = 64`, `max_payload_bytes = 4 MiB`, `max_client_calls = 1024`, `max_server_executing = 256`, `max_server_queued_bytes = 64 MiB`, `max_server_timeout = 30s`.
3. **Wire v1 Binary Envelope Codec (`include/Void/RPC/Codec.hpp`, `src/RPC/Codec.cpp`)**:
- Explicit network byte order via `Void::Binary::Writer`/`Reader`:
- 4-byte magic `VRPC`, `u16 major (1)`, `u16 minor (0)`, `u32 header_length`, `u32 total_length`, `u8 frame_kind`, `u8 flags`, `u16 reserved (0)`, 128-bit `call_id` (`Uuid`), `u64 service_id`, `u32 method_id`, `u32 schema_version`, `u32 remaining_timeout_ms`, `u16 status_code`, `u16 metadata_count`, length-delimited metadata pairs, payload bytes.
- Strict bounds/overflow checks BEFORE allocating metadata/payload; rejects bad magic, unsupported major, non-zero reserved field, unknown required flags, truncated/extra bytes, oversized header/metadata/payload; skips unknown optional minor trailing header extensions cleanly.
4. **Unary HTTP/1.1 Server & Client (`include/Void/RPC/Rpc.hpp`, `src/RPC/Rpc.cpp`)**:
- `CallContext` (`call_id`, `principal`, local steady `deadline`, `remaining_timeout()`, `metadata`, `stop`).
- `AuthHook` (`authenticate(headers, metadata) -> Result<PrincipalView>` and `authorize(MethodDescriptor, PrincipalView) -> Result<void>`) executed outside dispatch locks before handler admission.
- `Server`: binds methods returning move-only RAII `Registration` (destructor/explicit `unregister_and_drain()` stops admission and waits for in-flight calls), mounts `/void-rpc/v1/call` on `Void::Net::HttpServer`, validates wire v1 envelope, schema version, auth/authz, concurrency/payload budgets, clamps relative timeout to `limits.max_server_timeout`, executes handlers outside locks, and translates handler errors/exceptions into sanitized `RpcStatus`.
- `Client`: encodes wire v1 unary request envelope, sends HTTP/1.1 POST to `/void-rpc/v1/call` via `Void::Net::HttpClient`, propagates remaining relative timeout and `std::stop_token`, separates HTTP transport failures from RPC domain status, enforces client concurrency & payload limits, never implicitly retries non-`replay_safe` methods.
5. **Installed Consumer (`tests/package/RpcOnly/`)**:
- Register `RpcOnly` in `tests/package/InstalledComponents.cmake` proving `Void::RPC` links cleanly without `LibArchive`, `PkgConfig`, or `SQLite3`.
## Verification
- Standalone `RPC;Testing` (`-DVOID_WARNINGS_AS_ERRORS=ON`): wire v1 round-trip, overflow/truncation/unknown-major/reserved-flag rejection, loopback unary calls, schema mismatch, auth/authz denial, deadline clamping, handler exception sanitization, unregister drain under concurrent load.
- `ctest` (`RpcOnly`), full `RelWithDebInfo`, Debug `ASan+UBSan`, Debug `TSan`.
+35
View File
@@ -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,224 @@
# S-RUNTIME-02/03 — Host start, readiness, failed-start cleanup, structured shutdown, joined teardown
Task ID: S-RUNTIME-02-03
Role: opus-implementer
Status: READY
## 1. Context and baseline
- Wave 11 package steps B3+B4 combined (same files, shared teardown core). Dispatched after M-ASYNC-04
(ThreadExecutor), S-IO-03 and S-IO-04 (`pump_until`) are committed (gates G3, G5). Repo VoidLibrary,
branch `feat/roadmap-p2-wave11`. Isolated worktree; first fast-forward it to the HEAD stated in your prompt.
- Baseline: full suite at `38436b1` = 1,484 tests (1,480 ✔, 4 ⊘).
- Observed source:
- `include/Void/Runtime/Host.hpp`: inert `Host` (movable, `~Host() = default`, header-only; `HostState`
has no moved-from value; `started_worker_count()` always 0; `memory_budget()` dereferences
`owned_budget_` which is null after a move — pre-existing hazard), `EmbeddedResources` (borrowed
executor/io/clock), `ShutdownReport`, `HostBuilder`. `include/Void/Runtime/Options.hpp`:
`RuntimeLimits`, `Options` (`file_workers`, `cpu_workers`, `total_timeout`, `drain_grace`,
`export_flush_timeout`, …), `validate_options` (rejects `total_timeout <= 0`), `RuntimeErrorCode` incl.
root-added `self_join = 8`, `shutdown_incomplete = 9` (both → `ErrorKind::conflict`).
`include/Void/Runtime/ResourceGraph.hpp`: `ResourceKind` incl. `service`, `exporter`; `LifecyclePlan`
with `startup_order`. Existing tests `tests/standalone/Runtime/RuntimeHost.cpp` pin `started_worker_count()
== 0` after create and inert `add_resource` nodes.
- Available after upstream steps: `Async::ThreadExecutor` (`create/start/close/join/idle/admitted/stats`,
`before_worker_start` hook, `is_executor_thread`), `Async::TaskScope` (`stop_on_first_error` option),
`Async::TimerQueue`; `IO::Driver` (`start_file_workers`, `run_file_work`, `poll_once` → `busy` rules,
`shutdown(options)` → `DriverShutdownReport`, `shutdown_complete`, `quiescent`, `is_io_worker_thread()`,
`BackendOptions::before_file_worker_start`, mock `poll_once` ignores `max_wait`), `IO::pump_until`.
- System signal gate: `Void::Process::SignalWatcher` (`include/Void/System/SignalWatcher.hpp`; create before
worker threads, destroy on the creating thread; off-thread destruction closes the fd but skips the mask
restore, `src/System/SignalWatcher.cpp:27-37`). Runtime has NO System dependency (D-W11-04).
- Requirements: roadmap rows S-RUNTIME-02 ("Explicit start, readiness and reverse failed-start cleanup |
Failure at every creation/start step leaves no worker/descriptors; signal-mask ownership retained") and
S-RUNTIME-03 ("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"); `docs/roadmap/subsystems/Runtime.md` (updated in W11);
C-03..C-06, C-09; decisions D-038, D-040, D-042.
- MANDATORY design sources (precedence R2 > REV1 > PLAN): `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md`
§S-RUNTIME-02 and §S-RUNTIME-03; `W11-PLAN-REV1-OUTPUT.md` F3, F4, F5, F6, F11 and P3 (business scope,
mock reactor spin, budget accounting test); `W11-CONTRACT-R2.md` N1, N2, N3, P3-1, P3-2, P3-3, P3-7, P3-8.
## 2. Objective and deliverables
1. NEW `include/Void/Runtime/Lifecycle.hpp`: `StartStep`, `SignalGate`, `HostContext`, `Component`,
`StartOptions`, `ShutdownPhase`.
2. NEW `include/Void/Runtime/Detail/HostCore.hpp`: all lifecycle state and teardown (Runtime stays header-only).
3. EDIT `include/Void/Runtime/Host.hpp`: start/readiness/shutdown API, appended `ShutdownReport` fields,
`HostBuilder::add_component`, moved-from rules.
4. NEW tests `tests/standalone/Runtime/{RuntimeStart,RuntimeSignals,RuntimeShutdown}.cpp`.
## 3. Scope and non-goals
Out: Runtime→System edge or production signal bridge (S-RUNTIME-04), managed resize/reload, host-managed
TimerQueue polling (D-W11-14), any IO/Async/System source change, build files.
## 4. Files to inspect
`include/Void/Runtime/*.hpp`, `src/Runtime/module.cmake`, `tests/standalone/Runtime/RuntimeHost.cpp`,
`tests/package/RuntimeOnly/*`, `tests/package/InstalledComponents.cmake` (RuntimeOnly runs with
`-DCMAKE_DISABLE_FIND_PACKAGE_Threads=TRUE`), `include/Void/Async/{ThreadExecutor,TaskScope,Executor,Timer}.hpp`,
`include/Void/IO/{Driver,Pump,Types}.hpp`, `include/Void/Memory/BudgetResource.hpp`,
`include/Void/System/SignalWatcher.hpp`, and the design sources in §1.
## 5. Write ownership and coordination
Write scope: `include/Void/Runtime/Host.hpp`, `include/Void/Runtime/Lifecycle.hpp` (NEW),
`include/Void/Runtime/Detail/HostCore.hpp` (NEW), `tests/standalone/Runtime/RuntimeStart.cpp` (NEW),
`tests/standalone/Runtime/RuntimeSignals.cpp` (NEW), `tests/standalone/Runtime/RuntimeShutdown.cpp` (NEW),
`tests/package/RuntimeOnly/main.cpp` (optional smoke only).
Forbidden: every other path, including `Options.hpp`, `ResourceGraph.hpp`, IO/Async/System files and
`RuntimeHost.cpp` (stop and report if a change there is needed, P3-8). No git operations except the
authorized fast-forward.
## 6. Implementation or investigation approach
MANDATORY start (S-RUNTIME-02):
- `start(StartOptions)` once: `constructed → starting → running | failed_start`; records the owner thread.
Steps in order, each pushing a cleanup action: (1) `signal_gate->install()` (track `gate_installed_`;
borrowed gate must outlive the Host); (2) memory budget; (3) owned `ThreadExecutor{workers = cpu_workers,
max_admitted = limits.max_cpu_tasks}` create + `start()` (forward `before_thread_start(cpu_executor, i)`
into `before_worker_start`); (4) `IO::Driver::create` with `io.limits.file_workers = Options::file_workers`
(Runtime is authoritative) and the memory budget as its pmr resource; (5) `start_file_workers()` (forward
hook into `BackendOptions::before_file_worker_start`); (6) Runtime-owned reactor `std::thread` (catch
`std::system_error`; `before_thread_start(reactor, 0)` hook; thread-local `tl_reactor` marker) looping
`poll_once(5ms)`; on `busy`, or on a mock backend / a turn that did no work, wait up to 5 ms stop-aware
(never spin); exits on reactor stop or `shutdown_complete()`; (7) components in `plan_.startup_order`, `start`
called outside Host locks; (8) readiness: executor `try_post` probe plus one reactor turn within
`readiness_timeout` → `running`, `is_ready() == true`. `before_step(step)` hook errors inject failure
between steps; thread hooks inject failure within threaded steps.
- Failure at any point: pop cleanups in reverse on the starting thread, bounded by `cleanup_timeout`
(injected clock); state `failed_start`; return the error wrapped with context preserving the root
`Status`. If cleanup does not finish in budget, resources are retained and the next `shutdown_blocking`
or `~HostCore` continues. No thread or descriptor may remain after a completed cleanup.
- Embedded mode (`create_embedded`): steps 3–6 are skipped (borrowed executor/driver/clock); no threads.
- `started_worker_count()` reports real CPU + reactor + file threads.
- Business work: `spawn(Task, OperationOptions)` into a business `TaskScope` with
`TaskScopeOptions{.max_tasks = limits.max_cpu_tasks, .stop_on_first_error = false}`.
MANDATORY shutdown (S-RUNTIME-03; REV1 F3/F4 phase list, R2 N1–N3):
- Phases: 1 closing_admission, 2 draining (drain deadline fixed at first entry = min(total, start +
drain_grace)), 3 cancelling, 4 joining_business, 5 stopping_components (non-exporters, dependents first),
6 flushing_exporters (flush deadline fixed at first entry; expiry requests stop on exporter operations,
sets `export_flush_expired`, keeps waiting), 7 releasing_components (drop every component `shared_ptr`, so
exporters are destroyed here), 8 stopping_io (request reactor stop and JOIN the reactor, then
`driver->shutdown(remaining)` from the shutdown thread; retain if incomplete), 9 stopping_workers (wait for
`ThreadExecutor::idle()` within budget, then `join()`), 10 releasing (budgets, descriptors; signal gate
`uninstall(on_owner_thread)` at most once), 11 stopped. Assert ordering
`exporter_stopped < exporter_destroyed < executor_joined`.
- Every entry point (`shutdown_blocking`, `poll_shutdown`, `shutdown_pumping`) computes its own budget
`min(options.deadline, deadline_after(clock, total_timeout))`. In waiting phases 2, 4, 5, 6, 8, 9 a
call-deadline expiry stops the sequence and returns `complete=false`, state `shutdown_incomplete`, phase
recorded, all resources retained; the next call resumes at that phase. Drain expiry moves on to phase 3 and
sets `drain_grace_expired`.
- Component `stop()` tasks are launched through `post_completion` (never normal-lane admission), so a full
queue cannot block them. Concurrent callers get the same final report; exactly one teardown.
- `shutdown_blocking` on a Runtime worker/reactor/IO worker → `RuntimeErrorCode::self_join`;
`shutdown_blocking` when the executor has no background workers (embedded) → `invalid_argument`;
`shutdown_pumping` in managed mode → `invalid_argument`. Off-owner shutdown completes every phase except
the gate release (`owner_release_pending = true`); a later owner-thread call or `~HostCore` calls
`uninstall(this_thread == owner)`.
- Embedded `shutdown_pumping(manual, options, timers)` drains business scope and components using
`IO::pump_until(*io, manual, done, PumpOptions{.operation = call_budget, .timers = timers})`; borrowed
executor, driver, clock and memory are NEVER shut down, closed or joined.
- `~HostCore` (teardown lives here so default move-assign is safe): managed — loop shutdown with no
deadline cap until `complete` ("destruction blocks until complete"); embedded with a borrowed
`ManualExecutor` (dynamic_cast) — loop `shutdown_pumping(manual)` until complete; embedded otherwise and
incomplete — stderr diagnostic + `std::terminate`. On an OWNED Runtime worker/reactor/IO worker thread —
stderr diagnostic + `std::terminate` (detection via owned executor `is_executor_thread()`, `tl_reactor`,
`IO::is_io_worker_thread()`; never for a borrowed executor).
- Moved-from Host: `valid() == false`; `state()` returns `stopped`; `is_running/is_ready` false;
`started_worker_count()` 0; `executor()/io()` nullptr; `owner_thread()/last_shutdown_report()` nullopt;
`start/shutdown_*/poll_shutdown` → `invalid_state`; `spawn` → `AdmissionError::stopped`; reference accessors
(`options`, `lifecycle_plan`, `embedded_resources`, `memory_budget`) have precondition `valid()` (document,
assert in debug). `HostCore` holds no pointers into `Host` members. Owned BudgetResource/executor/driver live
until `~HostCore`.
## 7. Interfaces and data contracts
```cpp
namespace Void::Runtime {
enum class StartStep : std::uint8_t { signal_gate, memory_budget, cpu_executor, io_driver, file_workers, reactor, components, readiness };
enum class ShutdownPhase : std::uint8_t { not_started, closing_admission, draining, cancelling, joining_business,
stopping_components, flushing_exporters, releasing_components, stopping_io, stopping_workers, releasing, stopped };
class SignalGate { public: virtual ~SignalGate() = default;
[[nodiscard]] virtual Void::Result::Result<void> install() = 0;
virtual void uninstall(bool on_owner_thread) noexcept = 0; };
class HostContext { public: Async::Executor& executor(); IO::Driver* io(); const Void::Time::MonotonicClock& clock();
Void::Memory::BudgetResource& memory_budget(); std::stop_token business_stop() const; };
class Component { public: virtual ~Component() = default;
[[nodiscard]] virtual Void::Result::Result<void> start(HostContext&) = 0;
[[nodiscard]] virtual Coro::Task<Void::Result::Result<void>> stop(Async::OperationOptions) = 0; };
struct StartOptions { SignalGate* signal_gate{nullptr};
std::function<Void::Result::Result<void>(StartStep)> before_step{};
std::function<Void::Result::Result<void>(StartStep, std::size_t thread_index)> before_thread_start{};
std::function<void(ShutdownPhase)> on_phase{};
std::chrono::milliseconds readiness_timeout{5000}; std::chrono::milliseconds cleanup_timeout{5000}; };
}
// Host (EDIT): [[nodiscard]] Result<void> start(StartOptions = {}); bool is_ready() const noexcept; bool valid() const noexcept;
// Async::Executor* executor() noexcept; IO::Driver* io() noexcept; std::optional<std::thread::id> owner_thread() const noexcept;
// std::expected<Async::JoinHandle, Async::AdmissionError> spawn(Coro::Task<void>&&, Async::OperationOptions = {});
// void begin_shutdown() noexcept; Result<ShutdownReport> poll_shutdown(Async::OperationOptions = {});
// Result<ShutdownReport> shutdown_blocking(Async::OperationOptions = {});
// Result<ShutdownReport> shutdown_pumping(Async::ManualExecutor&, Async::OperationOptions = {}, Async::TimerQueue* timers = nullptr);
// std::optional<ShutdownReport> last_shutdown_report() const; std::size_t cpu_admitted() const noexcept;
// lifecycle state in std::unique_ptr<detail::HostCore>.
// ShutdownReport (EXISTING fields kept) + appended: ShutdownPhase phase; std::size_t pending_business_tasks,
// pending_cpu_admitted, pending_io_operations, retained_buffer_bytes; bool drain_grace_expired,
// export_flush_expired, owner_release_pending; bool complete (if not already present).
// HostBuilder (EDIT): [[nodiscard]] Result<void> add_component(std::string id, ResourceKind,
// std::shared_ptr<Component>, std::vector<std::string> deps = {}, bool critical = true);
```
Use existing `Result`/`make_runtime_error` spellings. Existing 1.x Host/HostBuilder API and `RuntimeHost` tests unchanged.
## 8. Dependencies and integration
Upstream: M-ASYNC-04, S-IO-03, S-IO-04, M-TIME-03 (all in your base). Downstream: P-NETWORKED-02 /
P-RELOADABLE-02 (later waves). Root integrates and commits.
## 9. Edge cases security and performance
Failure at every step and inside threaded steps (index 0 and last); thread-creation exceptions; pending
SIGUSR2 must be drained before uninstall (otherwise default action kills VoidTests); `/proc/self/task` and
`/proc/self/fd` deltas measured within a single test, Host telemetry primary; ManualClock + blocking waits
re-read the injected clock in short slices; deterministic tests use `poll_shutdown` or expired deadlines
rather than sleeps; full normal queue during shutdown; exporter waiting on a held mock read; RuntimeOnly
consumer has Threads lookup disabled (libc with integrated pthreads assumed, as IO already does).
## 10. Acceptance criteria
- `RuntimeStart.cpp`: `runtime_start_spawns_workers_only_on_start_ready`, `runtime_start_twice_invalid_state`,
`runtime_failed_start_each_step_reverse_cleanup_no_threads_no_fds`, `runtime_failed_start_thread_fault_each_threaded_step_reverse_cleanup`,
`runtime_failed_start_component_cleanup_timeout_retains_then_completes`, `runtime_component_start_failure_unwinds_reverse`,
`runtime_signal_gate_before_threads_uninstall_on_owner`, `runtime_signal_gate_uninstalled_at_most_once`,
`runtime_embedded_start_no_threads`, `runtime_move_after_start_keeps_resources_valid`, `runtime_moved_from_host_safe_defaults`.
- `RuntimeSignals.cpp` (includes `Void/System/SignalWatcher.hpp`; silently skipped without System; test-local
SignalGate adapter over `Process::SignalWatcher`, SIGUSR2): `runtime_system_gate_mask_inherited_by_workers`,
`runtime_system_gate_mask_restored_on_owner_after_failed_start_and_teardown`,
`runtime_signal_during_start_stays_pending_and_is_drained`, `runtime_offowner_destroy_closes_gate_fd_mask_not_restored`
(restores the owner mask and drains SIGUSR2 before finishing).
- `RuntimeShutdown.cpp`: `runtime_shutdown_concurrent_callers_single_teardown_tsan`,
`runtime_shutdown_full_normal_queue_still_delivers_completion`,
`runtime_shutdown_inflight_export_retains_io_workers_through_flush_expiry_then_completes` (ordering log),
`runtime_shutdown_stalled_business_task_incomplete_retains`, `runtime_shutdown_child_spawn_during_close_rejected`,
`runtime_shutdown_budget_expired_caller_deadline_incomplete_then_resumes`,
`runtime_shutdown_budget_bytes_retained_while_incomplete_zero_after_complete`,
`runtime_shutdown_on_worker_self_join`, `runtime_shutdown_non_owner_defers_gate_release`,
`runtime_shutdown_embedded_pumping`, `runtime_embedded_shutdown_never_shuts_borrowed_driver_or_executor`,
`runtime_embedded_shutdown_blocking_invalid_argument`, `runtime_managed_shutdown_pumping_invalid_argument`,
`runtime_destructor_joins_after_start`, `runtime_destructor_blocks_until_complete_after_incomplete_shutdown`.
- Existing `RuntimeHost` tests pass; `RuntimeOnly` consumer passes (ctest); TSan 0 races; ASan+UBSan 0 errors;
`-Werror` syntax checks clean. Keep each test well under 1,000 assertions (X-QA-02) and each test declaration
on ONE line (X-QA-03).
## 11. Verification commands and evidence
Cwd = worktree root; `dev` with the sandbox disabled. Confirm new suites appear in the output.
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-rt -G Ninja -DVOID_ENABLED_MODULES="Runtime;System;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-rt --parallel 8 && /tmp/void-w11-rt/tests/VoidTests --filter "^(RuntimeStart|RuntimeSignals|RuntimeShutdown|RuntimeHost)\." && ctest --test-dir /tmp/void-w11-rt --output-on-failure --timeout 180'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-rt-nosys -G Ninja -DVOID_ENABLED_MODULES="Runtime;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-rt-nosys --parallel 8 && /tmp/void-w11-rt-nosys/tests/VoidTests --filter "^(RuntimeStart|RuntimeShutdown|RuntimeHost)\." && ctest --test-dir /tmp/void-w11-rt-nosys --output-on-failure --timeout 180'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-rt-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Runtime;System;Testing" -DVOID_ENABLE_TSAN=ON && cmake --build /tmp/void-w11-rt-tsan --parallel 8 && /tmp/void-w11-rt-tsan/tests/VoidTests --filter "^(RuntimeStart|RuntimeSignals|RuntimeShutdown)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-rt-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Runtime;System;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON && cmake --build /tmp/void-w11-rt-asan --parallel 8 && /tmp/void-w11-rt-asan/tests/VoidTests --filter "^(RuntimeStart|RuntimeSignals|RuntimeShutdown|RuntimeHost)\."'
dev cpp-gcc -c bash -lc 'for f in RuntimeStart RuntimeSignals RuntimeShutdown; do g++ -std=c++26 -freflection -fsyntax-only -Iinclude -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers tests/standalone/Runtime/$f.cpp || exit 1; done'
```
## 12. Constraints and stop conditions
No edits outside write scope; no weakened assertions; no Runtime→System edge; no Threads link. Stop and report
BLOCKED if an IO/Async primitive misbehaves (give a reproducer), a forbidden file must change, RuntimeHost tests
must change, or two repair attempts at one check fail.
## 13. Authorization and decisions
Root decisions D-034, D-038, D-040, D-042 under user decisions D-027/D-029/D-031. Listed files only; no
commits, pushes or other side effects.
## 14. Return format
Task ID; DONE/BLOCKED/PARTIAL; summary; files changed; decisions/deviations; evidence per acceptance criterion;
commands with cwd/results; checks not run; residual risks; worktree path. Do not spawn children.
@@ -0,0 +1,40 @@
# S-SCHEDULER-01..04 — Scheduler Subsystem (Timers, Calendar, Durable Storage Store, Operator Controls)
## Scope
Implement the P1–P3 native `Void::Scheduler` subsystem and `Void::SchedulerStorage` durable adapter per `docs/roadmap/subsystems/Scheduler.md` and `docs/roadmap/DEPENDENCIES.md`:
1. **`S-SCHEDULER-01` — In-Memory Heap, Recurrence, Overlap, Cancellation & Shutdown**:
- Module `src/Scheduler/module.cmake` (`INTERNAL_DEPS Core Functional Time Async`) with zero `Storage` dependency.
- Error domain `kSchedulerErrorDomain = 31` (`SchedulerErrorCode`).
- Monotonic min-heap ordered by `(due_time, sequence)` using injected `MonotonicClock` and `CivilClock`, pure construction (no hidden background threads), and `Async::OperationOptions` for deadlines/cancellation.
- One-shot, fixed-delay (advances from durable completion), and fixed-rate (advances from intended schedule time) schedules; `OverlapPolicy` (`Forbid`, `QueueOne`, `AllowBounded`); `RetryPolicy` (default 5 attempts, exponential backoff 1s..5m, x2, injectable full-jitter RNG); callbacks run outside scheduler/store locks.
- `close_and_join()` stops materialization/dispatch, signals active handlers, joins within deadline, and returns `ShutdownReport` preserving running records on timeout.
2. **`S-SCHEDULER-02` — Calendar Grammar, Explicit Timezones/DST, and Bounded Misfire**:
- 5-field cron-like grammar (`minute hour day month weekday` with `*`, lists, ranges, steps; both day-of-month and weekday constraints apply).
- Explicit `TimezoneRegistry` supporting `"UTC"`, fixed offsets (`+HH:MM`/`-HH:MM`), and explicit DST transition rules (`DstGapPolicy::Skip`/`NextValid`, `DstFoldPolicy::First`/`Second`/`Twice` with persisted `fold_index`). Unknown timezone fails with `UnsupportedTimezone` (never silent UTC fallback).
- `MisfirePolicy` (`Skip`, `CoalesceLatest`, `CatchUpBounded` capped at `100` slots/job/pass while preserving remaining cursor state even across millions of missed slots).
3. **`S-SCHEDULER-03` — Durable Persistence Port and `SchedulerStorage` Adapter**:
- `JobStore` port + `InMemoryJobStore` (in `Scheduler`) and `StorageJobStore` (in `src/SchedulerStorage/module.cmake`, `INTERNAL_DEPS Scheduler Storage`) backed by `Void::Storage::Engine` conditional batches (`Durability::Sync`, 1 MiB batch cap).
- Exclusive ownership lock rejecting second concurrent scheduler owner (`OwnershipLocked`).
- Atomic occurrence materialization + cursor advance with unique `(job, revision, civil_slot, fold)` dedup key preventing duplicate materialization on wall-clock rollback.
- Atomic `Pending -> Running` claim checking job tombstone and revision invalidation watermark in the same conditional batch; `Running -> Completed` / `Pending` / `Dead` transitions; `UnknownOutcome` surfaced faithfully on unknown storage write outcome.
- Startup crash recovery returning `Running` occurrences to `Pending` with the exact same `OccurrenceId` (explicit at-least-once semantics).
4. **`S-SCHEDULER-04` — Revision Updates, Tombstone Removal, Retention Caps, and Operator Inspection**:
- `update_job()` bumps revision and atomically writes old-revision invalidation watermark so unstarted old occurrences are cancelled without racing active claims; failed updates leave prior policy intact.
- `remove_job()` writes tombstone, stops admission, and requests stop for active handlers.
- Retention count cap pauses materialization without advancing cursors or deleting unacknowledged work; dead occurrences require explicit `acknowledge_dead()` before pruning; bounded `prune_completed()` / `reclaim_invalidated()` and inspection APIs.
## File Ownership
- `include/Void/Scheduler/{Types,Calendar,Store,Scheduler}.hpp`
- `src/Scheduler/{module.cmake,Calendar.cpp,Scheduler.cpp}`
- `include/Void/SchedulerStorage/StorageJobStore.hpp`
- `src/SchedulerStorage/{module.cmake,StorageJobStore.cpp}`
- `tests/standalone/Scheduler/Scheduler.cpp`
- `tests/standalone/SchedulerStorage/StorageJobStore.cpp`
- `tests/package/SchedulerOnly/{CMakeLists.txt,main.cpp}`
- `tests/package/InstalledComponents.cmake`
## Acceptance & Verification
- Standalone `Scheduler;SchedulerStorage;Testing` (`-DVOID_WARNINGS_AS_ERRORS=ON`) + `SchedulerOnly` consumer with `_no_external_deps`.
- Deterministic fake-clock ordering, overlap, retry/dead-letter, DST gap/fold/unknown-tz, millions-of-missed-slots coalesce/catch-up cap, crash/reopen recovery preserving `OccurrenceId`, revision watermark race, unknown outcome, and retention-cap cursor preservation tests.
- Full `RelWithDebInfo`, `Debug` `ASan+UBSan`, and `Debug` `TSan` with 0 leaks, 0 UB, 0 races.
@@ -0,0 +1,27 @@
# S-STORAGE-01..06 — Original Durable Key-Value Storage Engine (`G-STORE`)
- **Wave**: Wave 7 (`feat/roadmap-p2-wave7`, branched from `main` at `43922d1`)
- **Roadmap reference**: `docs/roadmap/subsystems/Storage.md`, `docs/roadmap/DEPENDENCIES.md`
## Scope & Ownership
- Zero SQLite dependency (`src/Storage/module.cmake`: `INTERNAL_DEPS Core Functional Time Memory Binary IO Async`, zero external deps).
- `include/Void/Storage/Crc32c.hpp`: native Castagnoli CRC32C (`0x1EDC6F41` / reflected `0x82F63B78`, golden `"123456789"` == `0xE3069283`).
- `include/Void/Storage/Types.hpp`: `kStorageErrorDomain = 9`, `StorageErrorCode`, `Sequence`, `ByteView`, `OwnedBytes`, `OwnedValue`, `Durability::{Sync,Buffered}`, `Outcome::{NotCommitted,Committed,Unknown}`, `Limits` (all roadmap defaults + non-zero validation), `CommitReceipt`, `WriteFailure`, `ScanBounds` (with `prefix`), `ScanEntry`, `ScanPage`, `EngineState`, `EngineStats`, unsigned-byte lexicographic comparator.
- `include/Void/Storage/FilePort.hpp` + `src/Storage/FilePort.cpp`: `FilePort`, `FileHandle`, `PosixFilePort` (exclusive `flock`, `EINTR`/short-write loops, file & dir `fsync`, atomic same-dir rename capability check), and `FaultInjectingFilePort` for deterministic power-loss / short-write / sync-failure / rename-failure / unsynced-discard simulation.
- `include/Void/Storage/Format.hpp` + `src/Storage/Format.cpp`:
- V1 WAL (`VOIDWAL1` 64B segment header with CRC32C, 36B `VWR1` record header with header CRC32C checked before allocating payload, 8B trailer with record CRC32C + repeated length, `BEGIN`/`PUT`/`ERASE`/`COMMIT` payloads with aggregate CRC32C).
- V1 Immutable Sorted Table (`VOIDTBL1` header, 32 KiB target sorted blocks with per-block CRC32C, sparse block index, checksummed `VOIDTBF1` footer).
- V1 Immutable Manifest (`VOIDMNF1`) and atomic `CURRENT` (`VOIDCUR1`).
- `include/Void/Storage/Batch.hpp`, `include/Void/Storage/Engine.hpp`, `src/Storage/Engine.cpp`:
- Conditional atomic `Batch` (`put`, `erase`, `require_absent`, `require_version`, `require_value`; rejects duplicate keys/conditions; sequence-based versioning prevents ABA).
- Exclusive directory lock, minimal `CURRENT`/manifest bootstrap & WAL segment rotation publication before write admission, deterministic recovery with tail-only truncation of final active segment and fail-closed `corrupt` on damaged complete records or earlier closed segments.
- Single serialized writer, pre-append reservation/encoding, infallible visibility publication, `RecoveryRequired` + `Outcome::Unknown` on post-append failure, pinned `Snapshot`/`Cursor` with continuation scans and `page_too_small` enforcement.
- `checkpoint()` freezing memtable -> immutable table -> manifest -> `CURRENT` -> deferred retirement after snapshot pins release; bounded incremental `compact()` merging <= 4 overlapping runs while preserving versions needed by live snapshots.
- `include/Void/Storage/Tools.hpp` + `src/Storage/Tools.cpp`: `verify_directory` (full block-level read-only verification), pinned `export_backup` / `restore_backup`, offline `salvage_directory` into a separate destination.
- `include/Void/Storage/AsyncAdapter.hpp` + `src/Storage/AsyncAdapter.cpp`: bounded blocking async adapter following C-03 domain-result classification (`stop before append -> NotCommitted`, `stop during sync -> retain until settled`, `sync succeeds after stop -> CommitReceipt`, `sync fails after append -> Unknown + RecoveryRequired`, single delivery).
- `include/Void/Storage/Storage.hpp`: umbrella header.
- Tests & consumer: `tests/standalone/Storage/Storage.cpp` (CRC32C golden, format/overflow, model checker vs reference map, byte-offset truncation, corruption, fault-injected creation/rotation/sync/checkpoint/compaction crashes, retention under slow snapshots, async stop-race conformance, verify/backup/salvage), `tests/package/StorageOnly/*`, updated `tests/package/InstalledComponents.cmake`.
## Verification Criteria
- Standalone `Storage;Testing` RelWithDebInfo `-Werror` (zero external deps!): `storage_*` tests + `ctest` 2/2 (`StorageOnly`).
- Full Wave 7 integrated RelWithDebInfo `-Werror`, full Debug ASan+UBSan `-Werror`, and Wave 7 Debug TSan subset.
@@ -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'
```
+62
View File
@@ -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.
+62
View File
@@ -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.
+62
View File
@@ -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.
+62
View File
@@ -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.
+101
View File
@@ -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,95 @@
# Wave 11 contract amendment R2 (root resolutions of PREFLIGHT-2)
Source findings: [W11-PREFLIGHT-2-OUTPUT](W11-PREFLIGHT-2-OUTPUT.md). Base contracts:
[W11-PLAN-OUTPUT](W11-PLAN-OUTPUT.md) amended by [W11-PLAN-REV1-OUTPUT](W11-PLAN-REV1-OUTPUT.md).
These rules are MANDATORY text for the B2, B3, B4, A2, A3, A4 specs (decision D-040). Where this
file and earlier documents disagree, this file wins.
## N1 — Host destruction and shutdown budgets (B3/B4)
- `~HostCore` blocks until shutdown is complete: it loops an internal no-deadline shutdown
(equivalent to repeated `shutdown_blocking({})` ignoring the total-timeout cap) until
`complete == true`. Documented: "destruction blocks until complete".
- `poll_shutdown(Async::OperationOptions = {})` takes options; every shutdown entry point
(`shutdown_blocking`, `poll_shutdown`, `shutdown_pumping`) uses the same per-call budget
`min(options.deadline, deadline_after(clock, total_timeout))`.
- The budget test uses an already-expired caller deadline (or manual-clock deadline) with
`shutdown_blocking`/`poll_shutdown`, so expiry is observable.
- Waiting phases that return `complete=false` on call-deadline expiry: 2, 4, 5, 6, 8, 9 (P3-1).
## N2 — Embedded mode (B3/B4)
- `shutdown_blocking` returns `RuntimeErrorCode::invalid_argument` when the Host's executor has
no background workers (`!has_background_workers()`); `shutdown_pumping` in managed (owned
executor) mode returns `invalid_argument` (the reactor owns polling).
- `~HostCore` in embedded mode: if the borrowed executor is a `ManualExecutor`
(`dynamic_cast`), it loops `shutdown_pumping(manual)` until complete; otherwise, if shutdown is
not already complete, it prints a diagnostic and calls `std::terminate` (documented
programmer error: embedded Host destroyed before shutdown completed).
- The "destroyed on a Runtime worker" terminate check applies only to OWNED executors/reactor/
IO workers; never to a borrowed executor's `is_executor_thread()`.
## N3 — Who polls during shutdown (B2, A4, B3/B4)
- B2: every poll turn drains cancels, control messages and file completions BEFORE any
stop-flag early return. `begin_shutdown` sets the existing stopping flag (admission closed).
While stopping (but not yet shut down), a turn with no work waits in `epoll_wait` up to
`max_wait` (wake fd stays registered) instead of returning immediately; it must not spin.
- B2: after shutdown completes, `poll_once` returns 0 without touching any fd (F2), and
`shutdown_complete()` is true; library loops must exit on it (below).
- B2: `poll_once` checks the thread-local polling marker before `try_lock(poll_mu_)`; a
reentrant call from inside a turn returns `busy` (no recursive try_lock UB).
- B2: `advance_shutdown` releases `poll_mu_` between its ≤1 ms slices; other pollers may run
turns in between (they only drain/dispatch). If its stop token fires it returns the current
report with `complete=false` (not an error).
- B2: when `advance_shutdown`/teardown dispatches resume tickets, it does so after releasing
poll ownership (P3-9). Document: an owned executor must not be joined before the Driver is
torn down.
- A4: `Driver::run` and `pump_until` on `busy` wait up to `max_wait` (stop-aware, at most 1 ms
slices) and retry; they exit when `shutdown_complete()` is true.
- B3/B4: Runtime phase 8 first requests reactor stop and JOINS the reactor thread, then drives
`driver->shutdown(remaining)` from the shutdown thread. The reactor loop also exits on
`shutdown_complete()`; on `busy` it waits as A4's loops do.
## N4 — File descriptor state machine (B2)
- `detail::FileState` has `enum { open, closing, closed }` guarded by the pool mutex; the
handle-drop / in-flight count / `close_pending` transitions happen under that mutex, so
exactly one close is enqueued and whoever closes the fd sets `closed`.
- Driver teardown closes any still-open file fds after joining workers and marks them
`closed`. Afterwards File reads/writes/syncs return `IoErrorCode::closed` without a syscall,
`~File` does nothing, and `close_and_join` returns success immediately (idempotent).
- Files count against `IoLimits::max_descriptors`; that bounds the reserved close capacity.
The close request node is preallocated inside `FileState`, so `~File` (noexcept) never
allocates.
- `~File` wakes the poller only through a weak→strong backend lock or the worker condition
variable, never through the raw waker pointer.
## N5 — Channel timer callbacks (A2; B1 documents)
- B1 documents: `TimerHandle::cancel() == false` means the callback fired or is firing, not
that it finished.
- A2: an AsyncChannel timer callback captures shared waiter state (`shared_ptr` control block
for the waiter) or a `weak_ptr` to the channel plus a waiter id looked up under the channel
lock. It never holds a raw pointer into a coroutine frame.
## N6 — EventBus destruction (A3)
- `~EventBus` gates every admitted-but-not-started delivery on every thread before returning
(shared core `closed` flag checked under the core lock before each delivery starts).
- It waits for callbacks running on OTHER threads to finish, excluding the current thread's own
in-progress callback (thread-local dispatch depth). Residual documented: destroying a bus from
inside a callback that another thread's callback waits on can deadlock (caller error).
- A throwing `error_sink` is caught and counted (D-W11-06 condition, P3-8).
## P3 lines
- P3-2 (B3/B4): owned `BudgetResource`, executor and driver objects live until `~HostCore`;
NEW `[[nodiscard]] std::size_t Host::cpu_admitted() const noexcept` (0 when not started or
embedded) for the budget test; a `BufferLease` must not outlive its resource.
- P3-3 (B3/B4): the borrowed `SignalGate` must outlive the Host; Host tracks `gate_installed_`
so `uninstall` runs at most once (failed-start cleanup and teardown cannot double-uninstall);
the off-owner signal test restores the owner mask and drains SIGUSR2 before finishing.
- P3-4 (root): MIGRATION records "concurrent `poll_once` returns `busy`" and "`~Driver` on a
file worker or inside a poll turn terminates"; `Runtime.md` shows the `TimerQueue*` parameter
on `shutdown_pumping`.
- P3-5 (B2): the D1 seam clock is armed only after submission (`submit_io` reads the clock at
`EpollDriver.cpp:503`).
- P3-6 (A1): `seeded_engine` constructs with parentheses `G(std::random_device{}())` (sent).
- P3-7 (B3): moved-from Host reference accessors (`options`, `lifecycle_plan`,
`embedded_resources`) have precondition `valid()` (documented, asserted in debug); `HostCore`
holds no pointers into `Host` members.
- P3-8 (B3): stop-and-report if an IO edit is needed (IO files are owned elsewhere).
@@ -0,0 +1,906 @@
# W11-PLAN output (opus-planner, 2026-11-29)
Verbatim planner return for [W11-PLAN](W11-PLAN.md). Advisory input; root decisions are recorded in `DECISIONS.md`.
# W11-PLAN: execution-path backfill plan (opus-planner)
**Status: DONE.** The plan is ready for opus-reviewer PREFLIGHT. It is not approved, and I don't approve it myself. Nothing was written to the repository.
## Summary
- All eight tasks can be done without a forbidden dependency edge. **No `INTERNAL_DEPS` change is needed.**
- The roadmap rows leave out four real dependencies:
- The library has no thread-backed `Async::Executor`, so S-RUNTIME-02 depends on M-ASYNC-04.
- The IO `Driver` has no file workers and no run loop, so S-RUNTIME-02 depends on S-IO-03 and S-RUNTIME-03 depends on S-IO-04.
- Async has no timer primitive. M-TIME-03 adds one, and M-ASYNC-04's timed channel waits then depend on M-TIME-03.
- **Existing IO defect.** The epoll backend can release one operation's backend reference twice. A cross-thread `shutdown_and_join` can also finish an operation and close its fd while another thread's `poll_once` is inside `::read`/`::write` on it. Both fixes are assigned to S-IO-03 (opus).
- **Signal gate exists.** It is `Void::Process::SignalWatcher` in System. The plan uses it through a new Runtime port (`SignalGate`), so Runtime does not gain a System dependency.
- **S-RPC-04: defer.** It is file-disjoint, but it is not a good ride-along (reasons below).
- **Partition:** two packages by role. Package A is sonnet with the sol rows; package B is opus with the astra rows. A small root "contracts pre-commit" adds the new enumerators first, and five gates sequence the hand-offs between packages.
---
## 0. Cross-cutting evidence
- **Builds and consumers**
- The selected-module list expands to its dependencies (`CMakeLists.txt:45-71`).
- A test whose includes need an unselected header is skipped silently (`tests/CMakeLists.txt:12-41`). Every command below therefore enables all modules a new test includes.
- `--filter` is a regex search over the test name or `suite.name`, where the suite is the file stem (`src/Testing/Runner.cpp:209-225`). Filters below use `^(Stem1|Stem2)\.`.
- Warnings are `-Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers` (`cmake/Module.cmake:178`). Appending members to aggregates is therefore safe. Every enum switch must be completed; the only switches over the extended enums are the `make_*_error` mappers (`Async/Detail/Types.hpp:65-91,103-134`, `IO/Types.hpp:46-77`, `Runtime/Options.hpp:39-60`).
- The installed consumers IOOnly and RuntimeOnly run with `-DCMAKE_DISABLE_FIND_PACKAGE_Threads=TRUE` (`tests/package/InstalledComponents.cmake:74-80,109-117`). Adding `Threads::Threads` to IO or Runtime would break them, so the plan doesn't (D-W11-08). IO already calls `pthread_sigmask` without it (`EpollDriver.cpp:47`).
- **Executors**
- The only executor in the library is `ManualExecutor` (`Async/Executor.hpp:120-254`).
- Thread-backed executors exist only inside one test file (`tests/standalone/Async/OperationScope.cpp:25,135`).
- `ManualExecutor` releases its slot before resuming (`Executor.hpp:226-228`), so its bound excludes running work. Its `post()` bypasses the bound (`:128-135`).
- **IO**
- No thread, no run loop, no file API (`IO/Driver.hpp:59-105`). The embedder drives it with `poll_once` (`EpollDriver.cpp:1843-1847`).
- `IoLimits::file_workers` and `max_file_queue` (`IO/Types.hpp:106-107`) and `IoErrorCode::incomplete_shutdown` (`:32`) are declared but unused in `src/IO`.
- **Epoll defects (D1)**
- `complete_op_and_collect_tickets` releases the backend reference unconditionally (`EpollDriver.cpp:448`).
- The cancel path does not skip operations that already finished (`:1332-1351`).
- `drive_read`/`drive_write` call `::read` on `op->read_ptr` outside `mu_`, without marking the operation as executing (`:1462-1474`). `in_execution` is used only by the mock (`:653-671`).
- Cross-thread `EpollBackend::shutdown_and_join` finishes unretired operations and closes their fds (`:1179-1238`, close at `:1221`).
- Result: a stop arriving just after completion can double-release the reference, and shutdown racing a concurrent poller risks use-after-free or fd reuse. No test covers this; `io_epoll_cross_thread_wake_poll_and_stop_tsan` (`tests/standalone/IO/IoDriver.cpp:458-508`) stops the poller before teardown.
- **Host**
- Movable and returned by value, with `~Host() = default` (`Runtime/Host.hpp:88-94`).
- Header-only (`src/Runtime/` holds only `module.cmake`).
- `started_workers_` is always 0 (`:173`).
- **Retry consumers:** ResilienceAsync uses `Void::Retry::ExponentialBackoff` and `JitterMode` (`Resilience/AsyncPolicy.hpp:6,486,533`), so these must stay source-compatible. Its `wait_with_stop` really sleeps in 5 ms slices while reading the injected clock (`:553-575`). That is out of scope and nothing here builds on it.
---
## 1. Per-task plans
### M-FUNCTIONAL-03: pure retry decisions and a named blocking adapter (sol → sonnet)
**Baseline**
- `Functional/Retry.hpp` holds:
- backoff types in milliseconds (`:18-68`)
- `Jittered`, which uses a `thread_local mt19937_64` seeded from `random_device`, so results are not reproducible (`:76-95`)
- `Policy{max_attempts=3, max_elapsed=0 meaning unlimited}` (`:100-110`)
- `backoff_sleep`, hard-wired to `steady_clock::now()` and `sleep_for` (`:117-142`)
- `retry`/`retry_while`, which start from a default-constructed result (`:156,197`). With `max_attempts == 0` they return a default-constructed `expected`, i.e. a success, without ever calling `fn` (`:150-170,190-211`).
- `src/Functional/module.cmake` declares no dependencies.
- Existing tests: `Retry.cpp` (14 tests) and `RetryJitter.cpp` (4 tests).
**Gap:** no pure decision engine, no injected time or URBG, no validation or saturation, no explicit `no_deadline`, zero attempts can succeed, and the blocking path is unnamed.
**Minimal scope**
- A standard-library-only `RetryState`.
- A `retry_blocking` that takes injected `now` and `sleep` callables. Using callables means no Time dependency (D-W11-02).
- Every 1.x symbol keeps its behavior.
**NEW: `include/Void/Functional/RetryState.hpp`** (no `<thread>`, no Void includes). The 1.x `JitterMode` definition moves here, keeping its name and namespace.
```cpp
namespace Void::Retry {
using SteadyTimePoint = std::chrono::steady_clock::time_point;
enum class JitterMode { Full, Equal }; // EXISTING, relocated
struct NoDeadline { constexpr bool operator==(const NoDeadline&) const noexcept = default; };
inline constexpr NoDeadline no_deadline{};
struct BackoffSpec { std::chrono::nanoseconds initial{std::chrono::milliseconds{100}};
std::chrono::nanoseconds cap{std::chrono::seconds{30}};
double multiplier{2.0}; std::optional<JitterMode> jitter{}; };
struct RetrySpec { std::uint32_t max_attempts{3}; // total incl. first
std::variant<std::chrono::nanoseconds, NoDeadline> budget{std::chrono::seconds{30}};
BackoffSpec backoff{}; };
enum class RetryConfigError : std::uint8_t { zero_attempts, negative_duration, zero_budget,
nonfinite_multiplier, multiplier_below_one, cap_below_initial };
enum class RetryAction : std::uint8_t { attempt, wait_until, stop };
enum class RetryStopReason : std::uint8_t { none, succeeded, attempts_exhausted, deadline_exceeded,
not_retryable, stop_requested };
enum class AttemptOutcome : std::uint8_t { retryable_failure, permanent_failure };
struct RetryDecision { RetryAction action{RetryAction::stop}; SteadyTimePoint at{};
RetryStopReason reason{RetryStopReason::none}; std::uint32_t attempts_started{0}; };
[[nodiscard]] std::expected<void, RetryConfigError> validate(const RetrySpec&) noexcept;
[[nodiscard]] std::chrono::nanoseconds backoff_delay(const BackoffSpec&, std::uint32_t retry_index) noexcept; // saturating, unjittered
[[nodiscard]] constexpr SteadyTimePoint saturating_add(SteadyTimePoint, std::chrono::nanoseconds) noexcept;
template <std::uniform_random_bit_generator URBG = std::mt19937_64>
class RetryState {
public:
[[nodiscard]] static std::expected<RetryState, RetryConfigError>
create(const RetrySpec&, SteadyTimePoint start, URBG urbg = URBG{},
std::optional<SteadyTimePoint> admission_deadline = std::nullopt); // deadline = min(start+budget, admission)
[[nodiscard]] RetryDecision begin(SteadyTimePoint now, bool stop_requested = false) noexcept;
[[nodiscard]] RetryDecision next(SteadyTimePoint now, AttemptOutcome, bool stop_requested = false) noexcept;
[[nodiscard]] RetryDecision resume(SteadyTimePoint now, bool stop_requested = false) noexcept;
[[nodiscard]] RetryDecision succeed() noexcept;
[[nodiscard]] std::uint32_t attempts_started() const noexcept;
[[nodiscard]] std::optional<SteadyTimePoint> deadline() const noexcept;
};
template <class E> struct RetryError { RetryStopReason reason{}; std::uint32_t attempts{0};
std::optional<E> last_error{}; // empty iff no attempt ran
std::optional<RetryConfigError> config{}; };
struct RetryEveryError { template <class E> constexpr AttemptOutcome operator()(const E&) const noexcept
{ return AttemptOutcome::retryable_failure; } };
}
```
**Fixed semantics**
- `begin` returns `stop` for a stop request or `now >= deadline`; otherwise `attempt`.
- `next` checks, in order:
1. permanent failure → `not_retryable`
2. `attempts == max` → `attempts_exhausted`
3. stop requested → `stop_requested`
4. Otherwise it computes `at = saturating_add(now, jitter(backoff_delay(k)))`. If `at >= deadline` it returns `deadline_exceeded`; else `wait_until(at)`.
- `next` never returns `attempt` directly. `resume` re-checks stop and deadline and then returns `attempt`.
- Full jitter draws uniformly from [0, d] ns. Equal jitter is d/2 plus a uniform draw from [0, d − d/2].
- Backoff saturates at `cap` before conversion. Negative or non-finite inputs and `multiplier < 1` fail `create`.
**EDIT: `include/Void/Functional/Retry.hpp`** (add the include and these declarations; leave every 1.x body untouched)
```cpp
struct SteadyNow { SteadyTimePoint operator()() const noexcept { return std::chrono::steady_clock::now(); } };
struct ThreadSleep{ bool operator()(std::chrono::nanoseconds wait, std::stop_token) const; }; // cv_any+stop; false if stopped
template <class NowFn = SteadyNow, class SleepFn = ThreadSleep, class Classify = RetryEveryError,
class URBG = std::mt19937_64>
struct BlockingRetryOptions { NowFn now{}; SleepFn sleep{}; Classify classify{}; URBG urbg{};
std::stop_token stop{}; std::optional<SteadyTimePoint> deadline{}; };
template <class F, class NowFn, class SleepFn, class Classify, class URBG> // F() -> std::expected<T,E>
[[nodiscard]] auto retry_blocking(const RetrySpec&, F&& fn, BlockingRetryOptions<NowFn,SleepFn,Classify,URBG> = {})
-> std::expected<T, RetryError<E>>;
```
- Waits are always `decision.at - options.now()`, measured in the injected domain. The adapter never calls `sleep_until(at)`.
**Unchanged 1.x:** `NoDelay`, `ConstantDelay`, `LinearBackoff`, `ExponentialBackoff`, `Jittered`, `JitterMode`, `Policy`, `Detail::backoff_sleep`, `retry`, `retry_or_throw`, `retry_while`. The zero-attempt defect stays as it is (D-W11-03).
**Tests**
- **NEW `tests/standalone/Functional/RetryState.cpp`:**
- `retry_state_rejects_invalid_specs` (one check per `RetryConfigError`)
- `retry_state_exact_three_attempts_default`
- `retry_state_deadline_at_admission_prevents_first_attempt`
- `retry_state_backoff_overshooting_deadline_stops`
- `retry_state_no_deadline_explicit_marker`
- `retry_state_backoff_saturates_without_overflow` (multiplier 1e300, initial near max)
- `retry_state_full_equal_jitter_bounds_and_seed_reproducibility` (bounds and same-seed equality only; no exact draws)
- `retry_state_stop_prevents_next_attempt`
- `retry_state_permanent_failure_stops`
- `retry_state_saturating_add_near_max`
- **NEW `tests/standalone/Functional/RetryBlocking.cpp`.** It uses a fake clock struct local to the test, with no Time include.
- `retry_blocking_fake_clock_exact_waits_and_attempts` (zero real sleeps; recorded waits equal the backoff)
- `retry_blocking_zero_attempts_config_error_no_call`
- `retry_blocking_expired_deadline_no_call_no_success`
- `retry_blocking_last_error_and_attempt_count`
- `retry_blocking_stop_during_sleep_no_extra_attempt`
- `retry_blocking_permanent_failure_single_attempt`
- `retry_blocking_move_only_value`
- `legacy_retry_zero_attempts_behavior_pinned`
- Existing `Retry`, `RetryJitter` and `AsyncPolicy` tests must keep passing.
**Commands**
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-fn3 -G Ninja -DVOID_ENABLED_MODULES="Functional;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-fn3 && /tmp/void-w11-fn3/tests/VoidTests --filter "^(RetryState|RetryBlocking|Retry|RetryJitter)\." && ctest --test-dir /tmp/void-w11-fn3 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-fn3-res -G Ninja -DVOID_ENABLED_MODULES="ResilienceAsync;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-fn3-res && /tmp/void-w11-fn3-res/tests/VoidTests --filter "^AsyncPolicy\."'
rg -n "#include <thread>|Void/Time" include/Void/Functional/RetryState.hpp # expect no output
```
### M-TIME-03: injected-deadline domains with Async and blocking retry adapters (astra → opus)
**Baseline**
- Time: `ManualClock` starts at epoch 0 (`Time/Clock.hpp:69-130`); `remaining_until` is at `:188-208`; `src/Time/module.cmake` has no dependencies.
- Async: `is_deadline_expired(options, clock = System)` (`Async/Detail/Types.hpp:49-55`) and `OperationState::is_deadline_expired` (`Operation.hpp:160-165`) default to the host clock. `ScheduleStatusAwaiter` checks the deadline only in `await_ready`/`await_resume` and never wakes on expiry (`Executor.hpp:304-359`). `include/Void/Async` has no timer.
- IO already expires operations via the injected `clock_` on poll (`EpollDriver.cpp:739-834,1395-1443`), covered by `io_mock_stop_completion_races_and_clock_timeout`.
**Gap:** no awaitable timed wait that expires only through explicit polling, no Async retry adapter, and no conformance tests that manual-domain deadlines are never compared with the host clock.
**Minimal scope:**
- An Async `TimerQueue` (a stable min-heap ordered by `(deadline, seq)`).
- `Async::retry_async` built on `RetryState`.
- Time saturation helpers.
- Cross-adapter conformance tests.
**NEW: `include/Void/Async/Timer.hpp`**
```cpp
namespace Void::Async {
struct TimerQueueOptions { std::size_t max_timers{1024}; }; // 0 invalid
using TimerCallback = std::move_only_function<void() noexcept>;
class TimerHandle { public: bool cancel() noexcept; /* move-only; true => callback never runs */ };
class TimerQueue { // non-movable
public:
using time_point = Void::Time::MonotonicClock::time_point;
[[nodiscard]] static Void::Result::Result<std::unique_ptr<TimerQueue>>
create(Executor& completion_executor, const Void::Time::MonotonicClock& clock, TimerQueueOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<void>> sleep_until(time_point when, OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<void>> sleep_for(std::chrono::nanoseconds, OperationOptions = {});
[[nodiscard]] std::expected<TimerHandle, AdmissionError> schedule_at(time_point when, TimerCallback on_expire);
[[nodiscard]] std::size_t poll_expired(); // fires due timers once, (deadline,seq) order, outside locks
[[nodiscard]] std::optional<time_point> next_deadline() const;
[[nodiscard]] std::chrono::nanoseconds wait_duration(std::chrono::nanoseconds max_wait) const noexcept;
[[nodiscard]] std::size_t active_timers() const noexcept;
void close() noexcept; // pending -> stopped; new -> stopped
[[nodiscard]] const Void::Time::MonotonicClock& clock() const noexcept;
[[nodiscard]] Executor& executor() noexcept;
};
}
```
**Fixed semantics for `sleep_until`**
- Results: `{}` when `when` is reached and polled; `cancelled` on stop; `timeout` if `options.deadline` comes first; `overloaded` at `max_timers`; `stopped` after `close`.
- Stop or expiry settles through `OperationState`, and the continuation is dispatched through `post_completion`. A stop callback never resumes inline.
- Cancelled timers are tombstoned, and the heap is compacted so it never exceeds 2 × `max_timers`.
- Destroying the queue settles pending sleeps with `stopped`. The executor must outlive the queue.
**NEW: `include/Void/Async/Retry.hpp`** (needs gate G1, i.e. A1 integrated)
```cpp
template <class F, class Classify = Void::Retry::RetryEveryError, class URBG = std::mt19937_64>
[[nodiscard]] auto retry_async(Void::Retry::RetrySpec, F fn /* ()->expected<T,E> | Task<expected<T,E>> */,
TimerQueue& timers, OperationOptions = {}, Classify = {}, URBG = URBG{})
-> Coro::Task<std::expected<T, Void::Retry::RetryError<E>>>;
```
- "Now" comes from `timers.clock()`. The admission deadline is `options.deadline`.
- If an attempt succeeds after stop was requested, the success is returned. After stop, nothing is retried.
**EDIT: `include/Void/Time/Clock.hpp`** (NEW helpers)
```cpp
[[nodiscard]] MonotonicClock::time_point saturating_add(MonotonicClock::time_point, std::chrono::nanoseconds) noexcept;
[[nodiscard]] MonotonicClock::time_point deadline_after(const MonotonicClock&, std::chrono::nanoseconds) noexcept;
```
**Unchanged:** every existing Time and Async symbol, including the default-argument clock parameters.
**Tests**
- **NEW `tests/standalone/Async/TimerQueue.cpp`:**
- `timer_manual_advance_and_poll_fires_exactly_once`
- `timer_equal_deadlines_fire_in_submission_order`
- `timer_not_fired_without_explicit_poll`
- `timer_manual_epoch_deadline_not_compared_with_host_clock`
- `timer_manual_clock_far_future_initial_point`
- `timer_stop_before_admission_and_pending_cancelled_once`
- `timer_stop_vs_poll_race_single_result_tsan`
- `timer_capacity_overloaded_and_tombstone_bounded`
- `timer_schedule_at_cancel_vs_fire_exclusive`
- `timer_close_settles_pending_stopped`
- `timer_wait_duration_uses_injected_now`
- `timer_sleep_for_saturates`
- **NEW `tests/standalone/Async/AsyncRetry.cpp`:**
- `async_retry_manual_clock_attempts_only_after_advance_and_poll`
- `async_retry_total_deadline_expires_once`
- `async_retry_stop_during_backoff_no_further_attempt`
- `async_retry_success_after_stop_preserved`
- `async_retry_zero_attempts_no_call`
- `async_retry_task_returning_callable`
- **NEW `tests/standalone/Async/DeadlineDomains.cpp`:**
- `deadline_domain_blocking_retry_manual_clock` (`now = manual.now`; the sleep callable advances the manual clock)
- `deadline_domain_schedule_on_and_scope_admission_injected_clock`
- **NEW `tests/standalone/Time/ClockSaturation.cpp`:** `clock_saturating_add_and_deadline_after_bounds`.
**Commands**
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-time3 -G Ninja -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-time3 && /tmp/void-w11-time3/tests/VoidTests --filter "^(TimerQueue|AsyncRetry|DeadlineDomains|ClockSaturation|Clock|Stopwatch|OperationScope|Executor)\." && ctest --test-dir /tmp/void-w11-time3 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-time3-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-w11-time3-tsan && /tmp/void-w11-time3-tsan/tests/VoidTests --filter "^(TimerQueue|AsyncRetry|DeadlineDomains)\."'
```
### M-ASYNC-04: bounded executors, cancellable channels, future pool adapter, ParallelFor (sol → sonnet)
**Baseline**
- `Executor` base: `try_post`, `post_completion` and the reservation API (`Executor.hpp:58-113`). `ManualExecutor`'s bound excludes running work (`:226-228`). No threaded executor exists.
- `Concurrency::ThreadPool` (`ThreadPool.hpp:20-187`):
- `max_queue == 0` means unbounded (`:33-38`).
- Its bound counts only the queue, because a task is popped before it runs (`:164-173`).
- `submit` throws after stop (`:85-89`).
- `try_submit` returns `nullopt` for both "full" and "stopped" (`:100-120`).
- It includes Log (`:2`).
- `Concurrency::Channel` (`Channel.hpp:13-116`): blocking only; `send(T)` consumes the value even when the channel is closed (`:24-35`); capacity 0 blocks forever (`:27-28`).
- `parallel_for` (`ParallelFor.hpp:12-26`) creates one future per index, so submission is unbounded. On the first throwing `fut.get()` it returns without joining the remaining tasks.
**Gap:** no bound that includes running work, no coroutine channel, no explicit future adapter, and chunk errors don't join.
**Minimal scope:** NEW `ThreadExecutor`, `FuturePool`, `AsyncChannel`, and a bounded `parallel_for` overload. Capacity-waiting (`async_wait_for_capacity`) and the 4 MiB channel byte budget are deferred (D-W11-13).
**NEW: `include/Void/Async/ThreadExecutor.hpp`**
```cpp
namespace Void::Async {
struct ThreadExecutorOptions { std::size_t workers{1}; std::size_t max_admitted{4096}; // queued+running; >=1
std::function<Void::Result::Result<void>(std::size_t)> before_worker_start{}; }; // fault-injection hook
struct ThreadExecutorStats { std::size_t queued, running, completion_queued; std::uint64_t rejected, legacy_posts, inline_after_join; };
class ThreadExecutor final : public Executor {
public:
[[nodiscard]] static Void::Result::Result<std::unique_ptr<ThreadExecutor>> create(ThreadExecutorOptions = {}); // no threads
[[nodiscard]] Void::Result::Result<void> start(); // once; partial failure joins started workers
void post(std::coroutine_handle<>) override; // never rejects; counted; may exceed bound (legacy)
[[nodiscard]] std::expected<void, AdmissionError> try_post(std::coroutine_handle<>) override; // overloaded if queued+running>=max
void post_completion(std::coroutine_handle<>) override; // reserved lane; drains after close(); prioritized
[[nodiscard]] bool supports_reservation() const noexcept override; // true
[[nodiscard]] std::expected<void, AdmissionError> try_reserve_slot() override;
void commit_reserved(std::coroutine_handle<>) override; void release_reserved() noexcept override;
[[nodiscard]] bool has_background_workers() const noexcept override; // true
void close() noexcept; // normal admission -> stopped
[[nodiscard]] Void::Result::Result<void> join(); // close+drain+join; self_join on worker
[[nodiscard]] std::size_t admitted() const noexcept; [[nodiscard]] ThreadExecutorStats stats() const noexcept;
};
}
```
**Mandatory for `ThreadExecutor`**
- Every resume runs inside `detail::ExecutorThreadGuard`; that is what `is_executor_thread` and self-join detection rely on.
- A slot is released only after the resumed handle returns.
- After `join`, `post` and `post_completion` resume inline on the caller (documented and counted). A handle is never dropped.
**NEW: `include/Void/Async/FuturePool.hpp`**
```cpp
class FuturePool { public: explicit FuturePool(ThreadExecutor&) noexcept;
template <std::invocable F> [[nodiscard]] std::expected<std::future<std::invoke_result_t<F>>, AdmissionError>
try_submit(F&& f); }; // reserve-then-transfer: f not moved on rejection; exceptions -> future
```
**NEW: `include/Void/Async/AsyncChannel.hpp`**
```cpp
enum class ChannelError : std::uint8_t { closed, empty, full, cancelled, timed_out, overloaded, invalid_argument };
struct ChannelOptions { std::size_t capacity{1024}; std::size_t max_waiters{1024}; TimerQueue* timers{nullptr}; };
template <class T> struct SendFailure { ChannelError error; T value; };
template <class T> class AsyncChannel : public std::enable_shared_from_this<AsyncChannel<T>> { public:
[[nodiscard]] static Void::Result::Result<std::shared_ptr<AsyncChannel>> create(Executor& resume, ChannelOptions = {});
[[nodiscard]] std::expected<void, SendFailure<T>> try_send(T);
[[nodiscard]] Coro::Task<std::expected<void, SendFailure<T>>> send(T, OperationOptions = {});
[[nodiscard]] std::expected<T, ChannelError> try_receive();
[[nodiscard]] Coro::Task<std::expected<T, ChannelError>> receive(OperationOptions = {});
void close() noexcept; [[nodiscard]] std::size_t size() const; [[nodiscard]] bool is_closed() const; };
[[nodiscard]] Void::Result::Error make_async_error(ChannelError, std::string message = {});
```
- A wait with a deadline but no `timers` returns `invalid_argument`.
- `close()` hands waiting senders `closed` together with their value. Receivers drain the buffer in FIFO order, then get `closed`.
- Resumption always goes through `post_completion`, outside locks.
- The deadline part depends on gate G2.
**EDIT: `include/Void/Async/ParallelFor.hpp`**
```cpp
struct ParallelForOptions { std::size_t grain{1}; std::size_t max_concurrency{0}; std::stop_token stop{}; bool stop_on_error{true}; };
struct ParallelForError { enum class Kind : std::uint8_t { invalid_argument, rejected, stopped, failed } kind;
std::size_t chunks_total{0}, chunks_started{0}, chunks_failed{0};
std::optional<std::size_t> first_failed_chunk{}; std::exception_ptr first_exception{}; };
template <std::integral I, std::invocable<I> F>
[[nodiscard]] std::expected<void, ParallelForError> parallel_for(I first, I last, F&& f, ThreadPool&, ParallelForOptions);
```
- `max_concurrency == 0` means the pool's thread count.
- Runner tasks are submitted with `try_submit`; if rejected, the caller thread runs chunks itself.
- No new chunk starts after a stop or (with `stop_on_error`) an error.
- All started runners are always joined. The reported error is the lowest-indexed failed chunk.
- D-W11-10: the 1.x overload should wait for all futures before rethrowing.
**Root pre-commit:** `AsyncErrorCode::closed = 9`, mapped to `ErrorKind::cancelled`.
**Unchanged:** `ManualExecutor`, `Concurrency::{ThreadPool, Channel}`, the existing `parallel_for` signatures, `spawn`, `schedule_on`.
**Tests (NEW, `tests/standalone/Async/`)**
- **`ThreadExecutor.cpp`:**
- `thread_executor_create_starts_no_threads`
- `thread_executor_bound_includes_running_work` (1 worker, max 2: blocker running plus 1 queued → `overloaded`; release → accepted)
- `thread_executor_reservation_with_task_scope_preserves_task`
- `thread_executor_completion_lane_bypasses_full_normal_lane`
- `thread_executor_close_rejects_normal_drains_completion`
- `thread_executor_join_self_join_on_worker`
- `thread_executor_partial_start_failure_joins_started`
- `thread_executor_legacy_post_spawn_schedule_on_compat`
- `thread_executor_stress_tsan`
- **`FuturePool.cpp`:**
- `future_pool_overloaded_does_not_consume_callable`
- `future_pool_stopped_after_close`
- `future_pool_exception_in_future`
- `future_pool_bound_includes_running`
- **`AsyncChannel.cpp`:**
- `channel_zero_capacity_invalid`
- `channel_try_send_full_returns_value`
- `channel_send_waits_resumes_on_receive`
- `channel_producer_stop_returns_value_cancelled_once`
- `channel_close_wakes_senders_with_value_and_drains_receivers`
- `channel_deadline_requires_timers`
- `channel_deadline_times_out_once_manual_clock_poll`
- `channel_waiter_bound_overloaded`
- `channel_move_only_values`
- `channel_mpmc_fifo_tsan`
- `channel_stop_vs_send_race_single_outcome_tsan`
- **`ParallelForBounded.cpp`:**
- `parallel_for_bounded_grain_and_concurrency_limit`
- `parallel_for_bounded_stop_joins_started_no_new_chunks`
- `parallel_for_bounded_errors_join_all_lowest_index_reported`
- `parallel_for_bounded_zero_grain_invalid`
- `parallel_for_bounded_rejected_pool_runs_inline`
- `legacy_parallel_for_exception_joins_all` (only if D-W11-10 is approved)
**Commands** (for each tag, `-Werror` on the default build, plus Debug TSan and ASan+UBSan build dirs)
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async4 -G Ninja -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-async4 && /tmp/void-w11-async4/tests/VoidTests --filter "^(ThreadExecutor|FuturePool|AsyncChannel|ParallelForBounded|ParallelFor|ThreadPool|ThreadPoolBackpressure|Channel|OperationScope|Executor)\." && ctest --test-dir /tmp/void-w11-async4 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async4-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-w11-async4-tsan && /tmp/void-w11-async4-tsan/tests/VoidTests --filter "^(ThreadExecutor|FuturePool|AsyncChannel|ParallelForBounded)\."'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-async4-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-async4-asan && /tmp/void-w11-async4-asan/tests/VoidTests --filter "^(ThreadExecutor|FuturePool|AsyncChannel|ParallelForBounded|ParallelFor)\."'
```
### M-ASYNC-05: EventBus/Observable snapshot dispatch, joined subscriptions, injected scheduling (sol → sonnet)
**Baseline**
- `EventBus` (`EventBus.hpp:37-284`):
- Sync `publish` iterates the live vector without the lock (`:156-164`). A handler that subscribes or unsubscribes during dispatch therefore causes undefined behavior.
- Async mode starts a private thread in the constructor (`:43-48`).
- The snapshot copies `std::function`s, so `unsubscribe` cannot retract queued copies (`:167-169`).
- A handler exception escapes the worker loop, which terminates the process (`:248-269`).
- The task queue and handler list are unbounded (`:272-278`).
- `Subscription::reset` doesn't join (`:115-121`).
- `Observable` and `Signal` iterate the live vectors (`Observable.hpp:74-77,116-119`); reentrant use is undefined behavior, and there is no threading policy.
- Existing tests: `EventBus.cpp` (12), `EventBusAsync.cpp` (4), `Observable.cpp` (14).
**Gap:** per the row.
**Minimal scope:**
- Subscription state held in `shared_ptr`, with snapshot dispatch gated per entry.
- A new injected-executor mode.
- Joins per subscription and per bus.
- Bounded nested Observable notifications.
**NEW (EDIT `EventBus.hpp`)**
```cpp
namespace Void::EventBus {
enum class Mode { Sync, Async, Injected }; // NEW enumerator
struct BusOptions { std::size_t max_subscriptions{1024}; std::size_t max_admitted_dispatches{1024};
std::function<void(std::exception_ptr)> error_sink{}; }; // outside locks
class EventBus { // EXISTING API unchanged, plus:
explicit EventBus(Void::Async::Executor& executor, BusOptions = {}); // no private thread; internal TaskScope
template <class Event> [[nodiscard]] Void::Result::Result<Subscription> try_subscribe(std::function<void(const Event&)>);
template <class Event> [[nodiscard]] Void::Result::Result<void> try_publish(const Event&); // overloaded / closed
[[nodiscard]] Void::Result::Result<void> close_and_join();
[[nodiscard]] Void::Result::Result<void> close_and_join_pumping(Void::Async::ManualExecutor&);
[[nodiscard]] std::uint64_t callback_failures() const noexcept;
class Subscription { /* EXISTING */ public: [[nodiscard]] Void::Result::Result<void> close_and_join(); };
};
}
```
**Semantics (D-W11-06)**
- 1.x `unsubscribe` stops future publishes from including the handler. In `Mode::Async` it still delivers already-queued copies, as 1.x does.
- NEW `Subscription::close_and_join` also suppresses admitted deliveries that have not started. It then waits for in-flight callbacks and resets the handler (releasing captured state) before returning.
- Calling it from the subscription's own callback returns `self_join`. Self-unsubscribe is supported.
- Callbacks run outside locks. Injected and Async modes catch callback exceptions and route them to `error_sink`, counting them. Sync `publish` still propagates exceptions as in 1.x.
**NEW (EDIT `Observable.hpp`)**
- Documented policy: single-threaded, not thread-safe, safe for reentrancy.
- `inline constexpr std::size_t kMaxPendingNotifications = 1024;`
- `Observable::try_set(T) -> Result<void>` returns `overloaded` and leaves the value unchanged.
- `dropped_notifications()`.
- A nested `set` updates the value immediately and queues `(old, new)` copies, delivered in FIFO order after the current pass.
- Unsubscribe during a pass skips that listener for the rest of the pass. Subscribing during a pass doesn't add the listener to the current pass.
- A throwing listener: its exception propagates out of the outermost `set`/`emit`, after state is restored, and queued notifications are dropped and counted.
- `Signal::emit` uses the same snapshot rules.
**Tests (NEW)**
- **`tests/standalone/Async/EventBusJoin.cpp`:**
- `bus_injected_no_private_thread_manual_pumping`
- `bus_injected_subscription_limit_overloaded`
- `bus_injected_dispatch_limit_overloaded`
- `bus_close_and_join_waits_inflight_releases_capture_tsan` (sentinel `use_count == 1` after join)
- `bus_unsubscribe_during_dispatch_prevents_later_admission`
- `bus_self_unsubscribe_ok_self_join_rejected`
- `bus_callback_throw_to_error_sink_others_run`
- `bus_legacy_async_unsubscribe_keeps_queued_copy` (pins 1.x)
- `bus_sync_reentrant_subscribe_unsubscribe_asan`
- `bus_publish_after_close_closed`
- **`tests/standalone/Async/ObservableReentrancy.cpp`:**
- `observable_nested_set_fifo`
- `observable_unsubscribe_in_listener_skips_rest`
- `observable_subscribe_in_listener_not_current_pass`
- `observable_try_set_overloaded_when_pending_full`
- `observable_listener_throw_restores_state`
- `observable_self_unsubscribe_releases_capture`
- `signal_reentrant_connect_disconnect_during_emit`
**Commands:** same form as M-ASYNC-04 with `--filter "^(EventBusJoin|ObservableReentrancy|EventBus|EventBusAsync|Observable)\."`, plus TSan and ASan dirs `/tmp/void-w11-async5{,-tsan,-asan}`.
### S-IO-03: bounded positional file workers, serialization, sync, active-cancel (astra → opus)
**Baseline:** see §0, including the D1 defects; there is no pread, pwrite or fsync anywhere in `src/IO`. `validate_limits` ignores the file fields (`IO/Types.hpp:110-122`).
**Gap:** the whole file path, plus a shutdown that joins workers safely.
**Minimal scope:**
- A file worker pool in a NEW translation unit, shared by the mock and epoll backends through `BaseBackend`.
- An injectable syscall shim.
- Explicit worker start.
- The D1 correctness fixes.
**NEW: `include/Void/IO/File.hpp`**
```cpp
namespace Void::IO {
struct FileOpenOptions { bool read{true}, write{false}, create{false}, truncate{false}, exclusive{false}; std::uint32_t mode{0600}; };
enum class SyncMode : std::uint8_t { data, full };
struct FileSyscallResult { std::int64_t value{0}; int error{0}; };
class FileSyscalls { public: virtual ~FileSyscalls() = default;
[[nodiscard]] virtual FileSyscallResult pread(int, std::span<std::byte>, std::uint64_t) noexcept;
[[nodiscard]] virtual FileSyscallResult pwrite(int, std::span<const std::byte>, std::uint64_t) noexcept;
[[nodiscard]] virtual FileSyscallResult sync(int, SyncMode) noexcept;
[[nodiscard]] virtual FileSyscallResult close(int) noexcept;
[[nodiscard]] static FileSyscalls& native() noexcept; };
class File { public: /* move-only */ [[nodiscard]] bool valid() const noexcept; [[nodiscard]] DescriptorId id() const noexcept;
[[nodiscard]] Coro::Task<Void::Result::Result<Transfer>> read_at(std::uint64_t, std::span<std::byte>, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<Transfer>> write_at(std::uint64_t, std::span<const std::byte>, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<Transfer>> read_at_owned(std::uint64_t, BufferLease&, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<Transfer>> write_at_owned(std::uint64_t, const BufferLease&, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<void>> sync(SyncMode = SyncMode::full, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<Void::Result::Result<void>> close_and_join(Async::OperationOptions = {}); };
[[nodiscard]] Coro::Task<std::expected<std::size_t, ComposedTransferError>> read_exact_at(File&, std::uint64_t, std::span<std::byte>, Async::OperationOptions = {});
[[nodiscard]] Coro::Task<std::expected<std::size_t, ComposedTransferError>> write_all_at(File&, std::uint64_t, std::span<const std::byte>, Async::OperationOptions = {});
}
```
**EDITs**
- `Driver.hpp` gains:
- `Result<File> open_file(const std::filesystem::path&, FileOpenOptions = {})`
- `Result<File> adopt_file_fd(int)`
- `Result<void> start_file_workers()` (explicit, once; D-W11-11)
- `Result<std::size_t> run_file_work(std::size_t max_requests = 1)` (manual stepping when no workers are running)
- `Types.hpp`:
- `BackendOptions::file_syscalls{nullptr}` (appended; borrowed)
- `DriverTelemetry` gains `queued_file_requests`, `active_file_requests`, `file_workers_running` (appended)
- `validate_limits` rejects `max_file_queue == 0`
- Root pre-commit: `IoErrorCode::sync_failed = 12`, mapped to `ErrorKind::io`
- `Detail/Backend.hpp` gains file submit virtuals.
- `EpollDriver.cpp` integrates the pool and the shutdown changes.
- NEW `src/IO/FileWorkers.{hpp,cpp}`; the `.hpp` is private and not globbed.
**Fixed semantics**
- **Admission:** a stopped or expired request, or a closed driver, is rejected before it is queued. `max_file_queue` counts queued requests; `max_operations` counts queued and active. Either limit returns `overloaded`. A zero-length request returns `{0, false}`. Offset plus length overflowing gives `invalid_argument`.
- **Ordering:** writes and syncs on one file run in admission order, at most one active at a time. Reads may run concurrently. Each request is exactly one syscall, with EINTR retried. A short transfer returns the bytes actually moved; a 0-byte read of a nonzero length means EOF.
- **Queued stop or expiry:** the request is removed and completes `cancelled` or `timeout`. Writes and syncs carry `DomainOutcomeKind::not_committed`. Expiry is checked by the driver clock in `poll_once` and again at worker dequeue.
- **Active stop or expiry:** recorded as intent only. The span or lease and the telemetry stay retained, and the result is the syscall's actual outcome. A sync that succeeds after a stop is a success. A sync that fails returns `sync_failed` with the native errno and `DomainOutcomeKind::unknown`.
- **`shutdown_and_join`** keeps its 1.x signature with extended behavior:
1. Close admission.
2. Cancel queued socket and file operations.
3. Wait for in-flight syscalls and for any concurrent `poll_once` turn (poll-owner exclusion).
4. Join the workers.
5. Only then close the fds, epoll and eventfd.
Called from a worker, or from inside poll dispatch, it returns `Async::make_async_error(AdmissionError::self_join)`.
- **D1 fixes (mandatory):**
- Release the backend reference only if this call retired the operation.
- The cancel and expire paths skip retired operations.
- Epoll marks an operation `in_execution` under `mu_` before its syscall.
**Tests: NEW `tests/standalone/IO/IoFile.cpp`**
- `io_file_native_roundtrip_isolated_tmpdir`
- `io_file_short_write_preserves_progress_write_all_at`
- `io_file_writes_syncs_serialized_admission_order`
- `io_file_reads_concurrent_explicit_offsets`
- `io_file_queue_and_ops_quota_overloaded`
- `io_file_queued_cancel_not_committed_zero_effects`
- `io_file_queued_deadline_expires_once_manual_clock_poll`
- `io_file_active_timeout_retains_buffer_until_syscall_returns`
- `io_file_sync_success_after_stop_is_success`
- `io_file_sync_failure_after_stop_sync_failed_unknown_errno`
- `io_file_manual_stepping_without_workers`
- `io_file_shutdown_joins_stalled_worker_then_delivers`
- `io_file_shutdown_from_worker_self_join`
- `io_epoll_shutdown_concurrent_with_poller_no_uaf_tsan`
- `io_stop_after_completion_releases_backend_ref_once`
**Commands**
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io3 -G Ninja -DVOID_ENABLED_MODULES="IO;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-io3 && /tmp/void-w11-io3/tests/VoidTests --filter "^(IoFile|IoDriver)\." && ctest --test-dir /tmp/void-w11-io3 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io3-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="IO;Testing" -DVOID_ENABLE_TSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-io3-tsan && /tmp/void-w11-io3-tsan/tests/VoidTests --filter "^(IoFile|IoDriver)\."'
# also an ASan+UBSan dir with the same filter, plus downstream IO users unfiltered:
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-io3-users -G Ninja -DVOID_ENABLED_MODULES="IO;IPC;SystemAsync;Storage;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-io3-users && /tmp/void-w11-io3-users/tests/VoidTests && ctest --test-dir /tmp/void-w11-io3-users --output-on-failure --timeout 120'
```
### S-IO-04: embedded pumping, joined shutdown, optional adapters (sol → sonnet)
**Baseline**
- The only driving entry points are `poll_once`, `wake` and `request_stop` (`Driver.hpp:91-96`).
- Embedded pumping today is hand-written loops (`IoDriver.cpp:490-499`). `TaskScope::join_pumping` drains the executor but never polls IO (`TaskScope.hpp:645-654`).
- System adapter already exists: SystemAsync `ProcessManager` borrows a `Driver` (`System/AsyncProcess.hpp:61`, `src/SystemAsync/AsyncProcess.cpp:434`).
- Net does not use IO at all (rg finds no `Void/IO` in `include/Void/Net` or `src/Net`).
**Minimal scope:** a bounded or repeatable `shutdown`, a `run` loop, a `pump_until` helper, and a SystemAsync conformance test. The Net adapter is deferred (D-W11-07).
**NEW**
```cpp
namespace Void::IO {
struct DriverShutdownReport { bool complete{false}; std::size_t pending_operations{0}, active_file_requests{0},
open_descriptors{0}, retained_buffer_bytes{0}; }; // Types.hpp
void Driver::begin_shutdown() noexcept; // idempotent, never frees
[[nodiscard]] Void::Result::Result<DriverShutdownReport> Driver::shutdown(Async::OperationOptions); // bounded; repeatable
[[nodiscard]] Void::Result::Result<std::size_t> Driver::run(std::stop_token, std::chrono::nanoseconds max_wait = std::chrono::milliseconds{5});
[[nodiscard]] bool Driver::quiescent() const noexcept;
struct PumpOptions { std::chrono::nanoseconds max_wait{0}; std::size_t max_turns{1u << 20};
Async::OperationOptions operation{}; Async::TimerQueue* timers{nullptr}; }; // NEW Pump.hpp
template <class Done> requires std::predicate<Done&>
[[nodiscard]] Void::Result::Result<std::size_t> pump_until(Driver&, Async::ManualExecutor&, Done&&, PumpOptions = {});
}
```
**Fixed semantics**
- `shutdown` evaluates its deadline and stop in `driver.clock()`.
- When it expires it returns `complete = false` and retains everything: no fd is closed, no buffer is released, and the workers stay alive.
- It never runs a poll turn while another thread is inside `poll_once`.
- A misuse case such as self-join is returned as an error.
- `pump_until` returns `timeout`, `cancelled` or `exhausted` and never frees work.
**Tests (NEW)**
- **`tests/standalone/IO/IoShutdown.cpp`:**
- `io_shutdown_expired_budget_incomplete_retains_stalled_file_worker`
- `io_shutdown_pending_socket_read_retains_buffer_until_delivery`
- `io_shutdown_repeated_idempotent_after_complete`
- `io_shutdown_concurrent_with_run_loop_tsan`
- `io_run_stops_on_token_and_on_shutdown`
- `io_begin_shutdown_rejects_new_admission`
- **`tests/standalone/IO/IoPump.cpp`:**
- `io_pump_until_scope_join_mock`
- `io_pump_until_deadline_injected_clock`
- `io_pump_until_max_turns_exhausted`
- `io_pump_until_drives_timer_queue`
- **`tests/standalone/SystemAsync/SystemAsyncShutdown.cpp`:** `systemasync_driver_shutdown_pending_pipe_read_retains_and_delivers_once`.
**Commands:** `-DVOID_ENABLED_MODULES="IO;SystemAsync;Testing"`, `--filter "^(IoShutdown|IoPump|IoFile|IoDriver|SystemAsyncShutdown|SystemAsync)\."`, with a `-Werror` dir and a TSan dir (`/tmp/void-w11-io4{,-tsan}`), plus `ctest` (IOOnly and SystemAsyncOnly).
### S-RUNTIME-02: explicit start, readiness, reverse failed-start cleanup (astra → opus)
**Baseline:**
- `Host` is inert (`Host.hpp:85-178`).
- Options: `Options.hpp:89-96`. `Options::file_workers` duplicates `IoLimits::file_workers` (`:91` vs `IO/Types.hpp:106`). Note the existing exemption quirk for 4096 timers (`:149`).
- `ResourceKind` includes `service` and `exporter` (`ResourceGraph.hpp:23-31`).
- Pinned by tests: `started_worker_count() == 0` after `create` (`RuntimeHost.cpp:77-79`), and inert `add_resource` nodes (`:134-138`).
**Gap:** everything about start. The executor and file-worker prerequisites come from the hidden edges in the summary.
**NEW: `include/Void/Runtime/Lifecycle.hpp`** (plus `Detail/HostCore.hpp`; stays header-only, D-W11-09)
```cpp
namespace Void::Runtime {
enum class StartStep : std::uint8_t { signal_gate, memory_budget, cpu_executor, io_driver, file_workers, reactor, components, readiness };
class SignalGate { public: virtual ~SignalGate() = default;
[[nodiscard]] virtual Void::Result::Result<void> install() = 0; // owner thread, before any Runtime thread
virtual void uninstall() noexcept = 0; }; // same thread, after all Runtime threads joined
class HostContext { public: Async::Executor& executor(); IO::Driver* io(); const Void::Time::MonotonicClock& clock();
Void::Memory::BudgetResource& memory_budget(); std::stop_token business_stop() const; };
class Component { public: virtual ~Component() = default;
[[nodiscard]] virtual Void::Result::Result<void> start(HostContext&) = 0; // outside Host locks
[[nodiscard]] virtual Coro::Task<Void::Result::Result<void>> stop(Async::OperationOptions) = 0; };
struct StartOptions { SignalGate* signal_gate{nullptr};
std::function<Void::Result::Result<void>(StartStep)> before_step{};
std::function<void(ShutdownPhase)> on_phase{}; // used by S-RUNTIME-03
std::chrono::milliseconds readiness_timeout{5000}; };
}
// Host (EDIT): all lifecycle state in std::unique_ptr<detail::HostCore>; Host stays movable.
[[nodiscard]] Void::Result::Result<void> start(StartOptions = {}); // once: constructed->starting->running|failed_start
[[nodiscard]] bool is_ready() const noexcept; [[nodiscard]] Async::Executor* executor() noexcept;
[[nodiscard]] IO::Driver* io() noexcept; [[nodiscard]] std::optional<std::thread::id> owner_thread() const noexcept;
[[nodiscard]] std::expected<Async::JoinHandle, Async::AdmissionError> spawn(Coro::Task<void>&&, Async::OperationOptions = {});
~Host(); // non-default: reverse teardown on allowed thread
// HostBuilder (EDIT):
[[nodiscard]] Void::Result::Result<void> add_component(std::string id, ResourceKind, std::shared_ptr<Component>,
std::vector<std::string> deps = {}, bool critical = true);
```
**Root pre-commit:** `RuntimeErrorCode::self_join = 8` (→ `conflict`) and `shutdown_incomplete = 9` (→ `timeout`).
**Fixed start algorithm.** Each step pushes a cleanup action. On failure, the cleanups are popped in reverse on the starting thread, the state becomes `failed_start`, and the error is returned wrapped with context, preserving the root `Status`.
1. Validate `constructed`; record the owner thread.
2. `signal_gate->install()`.
3. Memory budget.
4. `ThreadExecutor{cpu_workers, max_admitted = limits.max_cpu_tasks}` → `start()`.
5. `IO::Driver::create`, with `io.limits.file_workers = Options::file_workers` (Runtime is authoritative).
6. `start_file_workers()`.
7. A Runtime-owned reactor thread looping `poll_once(5ms)`.
8. Components in `plan_.startup_order`.
9. Readiness: an executor `try_post` probe plus one reactor turn → `running`.
Embedded mode skips steps 4–7 (no threads). `started_worker_count()` reports the real CPU, reactor and file threads.
**Tests (NEW)**
- **`tests/standalone/Runtime/RuntimeStart.cpp`:**
- `runtime_start_spawns_workers_only_on_start_ready`
- `runtime_start_twice_invalid_state`
- `runtime_failed_start_each_step_reverse_cleanup_no_threads_no_fds` (loop over `StartStep`; `/proc/self/task` and `/proc/self/fd` deltas are 0; a fresh Host then starts)
- `runtime_component_start_failure_unwinds_reverse`
- `runtime_signal_gate_before_threads_uninstall_on_owner` (fake gate)
- `runtime_embedded_start_no_threads`
- `runtime_move_after_start_keeps_resources_valid`
- **`tests/standalone/Runtime/RuntimeSignals.cpp`.** It includes `Void/System/SignalWatcher.hpp`, so it runs only when System is enabled. It uses a test-local adapter around `Process::SignalWatcher` and SIGUSR2.
- `runtime_system_gate_mask_inherited_by_workers`
- `runtime_system_gate_mask_restored_on_owner_after_failed_start_and_teardown`
- `runtime_signal_during_start_stays_pending_and_is_drained`
**Commands**
```sh
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-rt2 -G Ninja -DVOID_ENABLED_MODULES="Runtime;System;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-rt2 && /tmp/void-w11-rt2/tests/VoidTests --filter "^(RuntimeStart|RuntimeSignals|RuntimeHost)\." && ctest --test-dir /tmp/void-w11-rt2 --output-on-failure --timeout 60'
dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-rt2-nosys -G Ninja -DVOID_ENABLED_MODULES="Runtime;Testing" -DVOID_WARNINGS_AS_ERRORS=ON 2>&1 | grep "Skipping.*RuntimeSignals" && cmake --build /tmp/void-w11-rt2-nosys && ctest --test-dir /tmp/void-w11-rt2-nosys --output-on-failure --timeout 60'
# plus Debug TSan and ASan+UBSan dirs with "^(RuntimeStart|RuntimeSignals)\."
```
### S-RUNTIME-03: structured shutdown, repeated join, exporter-before-executor ordering, budget accounting (astra → opus)
**NEW**
```cpp
enum class ShutdownPhase : std::uint8_t { not_started, closing_admission, draining, cancelling, joining_business,
stopping_components, flushing_exporters, stopping_io, stopping_workers, releasing, stopped };
// ShutdownReport (EXISTING fields kept) + appended: phase, pending_business_tasks, pending_cpu_admitted,
// pending_io_operations, retained_buffer_bytes, drain_grace_expired, export_flush_expired, owner_release_pending
void Host::begin_shutdown() noexcept;
[[nodiscard]] Void::Result::Result<ShutdownReport> Host::poll_shutdown(); // non-blocking step
[[nodiscard]] Void::Result::Result<ShutdownReport> Host::shutdown_blocking(Async::OperationOptions = {}); // repeatable
[[nodiscard]] Void::Result::Result<ShutdownReport> Host::shutdown_pumping(Async::ManualExecutor&, Async::OperationOptions = {});
[[nodiscard]] std::optional<ShutdownReport> Host::last_shutdown_report() const;
```
**Fixed semantics**
- **Total deadline:** fixed at the first `begin_shutdown`, as `min(caller deadline, deadline_after(clock, total_timeout))`.
- **Phase deadlines:** drain = `min(total, phase start + drain_grace)`; flush = `min(total, phase start + export_flush_timeout)`.
- **Phase order:**
1. Close business scope admission.
2. Drain.
3. Request stop on the business scope.
4. Join it.
5. Stop non-exporter components (dependents first).
6. Stop exporters with the flush deadline. On expiry, request stop and set `export_flush_expired`, but keep IO, the reactor and the workers alive.
7. `driver->shutdown(remaining)`; if incomplete, retain it.
8. Stop and join the reactor, then `ThreadExecutor::join()`.
9. Drop component references, so exporters are destroyed before the executor is torn down.
10. Release budgets and fds. Signal-gate uninstall happens on the owner thread only; otherwise `owner_release_pending` is set and the next owner-thread call or `~Host` performs it.
- **Mandatory mechanics:**
- Component `stop` tasks are launched through `post_completion`, never through normal-lane admission, so a full queue cannot block them.
- Expiry of the total budget returns `complete = false` and state `shutdown_incomplete`, retaining all resources. The next call continues from there.
- Concurrent callers get the same final report, and there is exactly one teardown.
- Calling `shutdown_blocking` on a Runtime worker returns `RuntimeErrorCode::self_join`.
- Calling it from a non-owner thread completes every phase except the signal-gate release, as above.
**Tests: NEW `tests/standalone/Runtime/RuntimeShutdown.cpp`**
- `runtime_shutdown_concurrent_callers_single_teardown_tsan`
- `runtime_shutdown_full_normal_queue_still_delivers_completion`
- `runtime_shutdown_inflight_export_retains_io_workers_through_flush_expiry_then_completes` (exporter waits on a held mock read; total budget expires → incomplete, active ops 1, retained bytes > 0, threads alive; release → join again → complete; ordering log: `exporter_stopped < exporter_destroyed < executor_joined`)
- `runtime_shutdown_stalled_business_task_incomplete_retains`
- `runtime_shutdown_child_spawn_during_close_rejected`
- `runtime_shutdown_budget_min_caller_policy_manual_clock` (`poll_shutdown`)
- `runtime_shutdown_on_worker_self_join`
- `runtime_shutdown_non_owner_defers_gate_release`
- `runtime_shutdown_embedded_pumping`
- `runtime_destructor_joins_after_start`
**Commands:** as S-RUNTIME-02, with `"^(RuntimeShutdown|RuntimeStart|RuntimeSignals|RuntimeHost)\."`, in `-Werror`, TSan and ASan dirs, plus `ctest` (RuntimeOnly).
---
## 2. Dependency graph and INTERNAL_DEPS check
```
M-FUNCTIONAL-02✓ → M-FUNCTIONAL-03 ──(G1: RetryState)──→ M-TIME-03[Retry.hpp part]
M-TIME-02✓ → M-TIME-03[Timer.hpp part] ──(G2: TimerQueue)──→ M-ASYNC-04[AsyncChannel deadlines]
M-ASYNC-03✓ → M-ASYNC-04 → M-ASYNC-05
M-ASYNC-04 ──(G3, hidden: ThreadExecutor)──→ S-RUNTIME-02
S-IO-02✓ → S-IO-03 ──(G4, same files)──→ S-IO-04 (M-TIME-03 → S-IO-04 soft: PumpOptions::timers)
S-IO-03 ──(hidden: start_file_workers, safe shutdown)──→ S-RUNTIME-02
S-RUNTIME-01✓ → S-RUNTIME-02 → S-RUNTIME-03 ←(G5, hidden: Driver::shutdown(options))── S-IO-04
{M-ASYNC-05, S-IO-04, S-RUNTIME-03} → P-NETWORKED-02 / P-RELOADABLE-02 gates
```
**Critical path:** M-TIME-03 (Timer) → S-IO-03 → S-RUNTIME-02 → S-RUNTIME-03, with S-IO-04 needed before S-RUNTIME-03.
| Module | Change | Rule check against DEPENDENCIES.md |
| --- | --- | --- |
| Functional | none (stays empty) | Rule 1 and D-015: standard library only. `RetryState.hpp` includes no Void header. |
| Time | none | Rule 1. The helpers are `std::chrono` only. No Time→Functional edge (D-W11-02). |
| Async | none (Functional Time LogState) | Rule 2: no Log backend, no Runtime. New headers include only Async, Functional and Time. |
| IO | none internal; no Threads (D-W11-08) | Rule 2: IO depends on Async; no System, Runtime or Net. |
| Runtime | none (…Async IO) | Composes Async/IO/Time/Memory. No System edge; uses the `SignalGate` port. |
| SystemAsync, tests only | none | "System may use IO". System appears in `RuntimeSignals.cpp` as a test include only; the file is skipped without System. |
## 3. Ownership partition
**Root-owned, before dispatch (W11-0 contracts pre-commit; single writer):**
- `include/Void/Async/Detail/Types.hpp`: `AsyncErrorCode::closed = 9` plus its mapping case.
- `include/Void/IO/Types.hpp`: the enum part only, `IoErrorCode::sync_failed = 12` plus its case.
- `include/Void/Runtime/Options.hpp`: `RuntimeErrorCode::self_join = 8` and `shutdown_incomplete = 9` plus their cases.
**Root-owned throughout:**
- `docs/agent-workflow/**` (task specs, TASKS, STATE, DECISIONS, VERIFICATION)
- `CMakeLists.txt`, `cmake/*`, `tests/CMakeLists.txt`, `tests/package/InstalledComponents.cmake` (no change planned)
- `include/Void/Functional/Error.hpp` (no change planned; no new domains)
- All integration, commits and merges
**Package A: sonnet-implementer (sol rows), run in order**
| Step | Task | Owned paths |
| --- | --- | --- |
| A1 | M-FUNCTIONAL-03 | `include/Void/Functional/RetryState.hpp` (NEW), `include/Void/Functional/Retry.hpp`, `tests/standalone/Functional/RetryState.cpp`, `tests/standalone/Functional/RetryBlocking.cpp` |
| A2 | M-ASYNC-04 | `include/Void/Async/ThreadExecutor.hpp`, `include/Void/Async/FuturePool.hpp`, `include/Void/Async/AsyncChannel.hpp` (all NEW), `include/Void/Async/ParallelFor.hpp`, `tests/standalone/Async/{ThreadExecutor,FuturePool,AsyncChannel,ParallelForBounded}.cpp`. Channel deadline waits wait for G2. |
| A3 | M-ASYNC-05 | `include/Void/Async/EventBus.hpp`, `include/Void/Async/Observable.hpp`, `tests/standalone/Async/{EventBusJoin,ObservableReentrancy}.cpp` |
| A4 | S-IO-04 (after G4: IO ownership passes from B to A) | `include/Void/IO/{Types,Driver,Pump(NEW)}.hpp`, `include/Void/IO/Detail/Backend.hpp`, `src/IO/EpollDriver.cpp`, `src/IO/FileWorkers.{hpp,cpp}`, `tests/standalone/IO/{IoShutdown,IoPump}.cpp`, `tests/standalone/SystemAsync/SystemAsyncShutdown.cpp`. Not owned: `src/SystemAsync/*` (stop and report). |
**Package B: opus-implementer (astra rows), run in order**
| Step | Task | Owned paths |
| --- | --- | --- |
| B1 | M-TIME-03 | `include/Void/Async/Timer.hpp` (NEW), `include/Void/Async/Retry.hpp` (NEW, after G1), `include/Void/Time/Clock.hpp`, `tests/standalone/Async/{TimerQueue,AsyncRetry,DeadlineDomains}.cpp`, `tests/standalone/Time/ClockSaturation.cpp` |
| B2 | S-IO-03 | `include/Void/IO/File.hpp` (NEW), `include/Void/IO/{Types,Driver}.hpp`, `include/Void/IO/Detail/Backend.hpp`, `src/IO/EpollDriver.cpp`, `src/IO/FileWorkers.{hpp,cpp}` (NEW), `tests/standalone/IO/IoFile.cpp` |
| B3 | S-RUNTIME-02 (after G3 + B2) | `include/Void/Runtime/{Host,Lifecycle(NEW)}.hpp`, `include/Void/Runtime/Detail/HostCore.hpp` (NEW), `tests/standalone/Runtime/{RuntimeStart,RuntimeSignals}.cpp`, `tests/package/RuntimeOnly/main.cpp` (optional smoke) |
| B4 | S-RUNTIME-03 (after G5) | same Runtime files, plus `tests/standalone/Runtime/RuntimeShutdown.cpp` |
**Gate sequence (root integrates at each):**
- G1: A1 merged, then B1 writes `Retry.hpp`.
- G2: B1's `Timer.hpp` merged, then A2 adds channel deadlines.
- G3: A2 merged, then B3.
- G4: B2 merged, then A4.
- G5: A4 merged, then B4.
No path is owned by both packages at the same time. No worker touches `Executor.hpp`, `Operation.hpp`, `TaskScope.hpp`, `ThreadPool.hpp` or `Channel.hpp`.
## 4. System signal gate (S-RUNTIME-02)
It exists:
- `Void::Process::SignalWatcher` (`include/Void/System/SignalWatcher.hpp:16-43`). Its contract (`:13-15`): construct it before worker threads; destroy it on the creating thread.
- `create` blocks the mask with `pthread_sigmask` and opens a `signalfd` with `SFD_CLOEXEC|SFD_NONBLOCK` (`src/System/SignalWatcher.cpp:74-90`).
- `~Impl` closes the fd and restores the mask only when `pthread_equal(owner, self)` (`:27-37`). Off-thread destruction silently skips the restore.
- It has been unchanged since before baseline (`3851aeb`).
Runtime has no System edge. The S-RUNTIME-01 spec excludes it, and the Runtime area plan doesn't list it, although DEPENDENCIES.md does not forbid it.
Minimal in-wave work:
- The `SignalGate` port: installed as start step 1, uninstalled last on the owner thread, with deferred owner release if shutdown runs elsewhere.
- A test-local adapter over `SignalWatcher` inside `RuntimeSignals.cpp`.
- No System source changes.
- A production bridge module (for example a NEW `RuntimeSystem` with deps Runtime+System, following the SystemAsync pattern) is deferred to S-RUNTIME-04 (D-W11-04).
## 5. S-RPC-04 verdict: do not ride along; defer to the P3 wave
**What is in place:**
- S-RPC-03 is VERIFIED (`docs/agent-workflow/TASKS.md:129`).
- The Net WebSocket pieces are present: codec and client (`Net/WebSocket.hpp:127-185`), server sessions (`Net/Server.hpp:205-300`), `add_websocket_route` (`Net/HttpServer.hpp:93-99`), and subprotocol negotiation (`WebSocket.hpp:37-45,127-130`).
- It is file-disjoint from this wave (`include/Void/RPC`, `src/RPC`, `tests/standalone/RPC`).
**Why it should wait:**
1. `WebSocketLimits::max_output_messages` and `max_output_bytes` (`WebSocket.hpp:32-33`) are never read in `src/Net`. Server sends are a synchronous `send_all` under a per-connection mutex (`src/Net/HttpServer.cpp:930-946`). So "no memory growth under stalled consumers", and a reserved control lane for CANCEL/TERMINAL, can't be guaranteed at the transport layer without a Net change or an explicit acceptance of blocking-send semantics.
2. The client is synchronous (`WebSocket.hpp:166-170`). The planned `Task<Result<DuplexCall>>` API would naturally sit on M-ASYNC-04's `AsyncChannel`, which makes it dependent on this wave's output.
3. It is an astra row and would compete with the opus critical path.
4. It is P3, against D-027 ordering.
**Prerequisite for later:** a small Net task to enforce output budgets or a bounded non-blocking send queue, or a recorded decision to accept blocking sends.
## 6. Risks
- **D1 (high):** the existing epoll double reference release and the shutdown-versus-poller use-after-free / fd-reuse risk. It is fixed in S-IO-03 and needs TSan and ASan evidence.
- **SIGUSR2 is fatal if left pending.** A blocked SIGUSR2 that is still pending when the mask is restored takes its default action and kills the VoidTests process. The signal tests must drain the signal via `poll()` before uninstalling.
- **`/proc` counting:** thread and fd deltas can be disturbed by background threads from earlier tests. Measure deltas within a single test (tests run sequentially by default, `Runner.cpp:734-740`), with Host telemetry as the primary check.
- **ThreadExecutor join while coroutines are still suspended elsewhere** falls back to inline resume. Runtime must reach driver quiescence before executor join; the S-RUNTIME-03 phase order enforces this.
- **ManualClock with blocking waits:** `shutdown_blocking` and IO `shutdown` must re-evaluate the injected clock in short slices. Deterministic tests use `poll_shutdown` or expired deadlines rather than sleeps.
- **Internal TaskScopes in destructors:** a `TaskScope` destructor pumps or blocks (`TaskScope.hpp:562-575`). EventBus (Injected mode) and Host must join their internal scopes before destruction.
- **Behavior changes in 1.x:** Observable and Sync EventBus reentrancy used to be undefined behavior and now get defined semantics. Async-mode handler exceptions change from terminate to catch-and-count (needs D-W11-06 approval).
- **Scope size:** B3 and B4 are the largest items and carry the highest schedule risk.
- **Out of scope:** `Concurrency::Channel` with capacity 0 deadlocks (`Channel.hpp:17,27-28`), and Resilience `wait_with_stop` mixes real sleeps with the injected clock (`AsyncPolicy.hpp:553-575`).
## 7. Open decisions (recommendation for each)
| ID | Decision | Recommendation |
| --- | --- | --- |
| D-W11-01 | Where TimerQueue is owned | Async header `Async/Timer.hpp`, delivered by M-TIME-03 (astra) |
| D-W11-02 | Clock/sleeper adapter placement | Callables injected into Functional; no Time→Functional edge and no Time retry header (resolves the Functional.md wording) |
| D-W11-03 | Zero-attempt success in legacy `retry` | Keep unchanged (D-029), pin it with a test, and record it for the Wave C migration |
| D-W11-04 | How the signal gate is wired | `SignalGate` port, no Runtime→System edge; production bridge deferred to S-RUNTIME-04 |
| D-W11-05 | S-IO-03 (opus) then S-IO-04 (sonnet) in shared IO files | Accept serial hand-off at G4, with the risky shutdown and poll fixes placed in S-IO-03. No other role deviation. |
| D-W11-06 | EventBus semantics | Legacy `unsubscribe` keeps delivering queued copies in Async mode; NEW `close_and_join` gates and joins; Async-mode handler exceptions go to `error_sink` (no terminate) |
| D-W11-07 | Net adapter for IO | Defer. The System adapter is the existing SystemAsync, validated by the new shutdown test. |
| D-W11-08 | `Threads::Threads` for IO and Runtime | Don't add it. Adding it would require changing IOOnly/RuntimeOnly flags in `InstalledComponents.cmake`. |
| D-W11-09 | Runtime build shape | Stay header-only (`Detail/HostCore.hpp`), so packaging is unchanged |
| D-W11-10 | Legacy `parallel_for` on exceptions | Join all futures before rethrowing; this fixes a lifetime hazard without changing the API |
| D-W11-11 | When file workers start | Explicit `start_file_workers()`, so existing Driver users don't get hidden threads |
| D-W11-12 | S-RPC-04 | Defer to the P3 wave, after a Net output-bounds task |
| D-W11-13 | `async_wait_for_capacity` and the channel byte budget | Defer; neither is in the row acceptance |
| D-W11-14 | Host-managed TimerQueue | Defer to S-RUNTIME-04 |
| D-W11-15 | New enumerators | Root pre-commit before dispatch: `AsyncErrorCode::closed`, `IoErrorCode::sync_failed`, `RuntimeErrorCode::{self_join, shutdown_incomplete}` |
**Roadmap inconsistencies, all resolvable:**
- The S-RUNTIME-02 and S-RUNTIME-03 rows omit their M-ASYNC-04 and S-IO-03/04 prerequisites; add the edges.
- The area plan's awaited `Coro::Task` shutdown on the host's own executor would conflict with stopping that executor; the plan uses blocking and polling shutdown APIs instead.
- Runtime and IO each define a `file_workers` setting; Runtime is authoritative.
- The IO plan describes a "driver thread" but the code has none; S-IO-04 adds `run()`, and Runtime owns the reactor thread.
None of these contradicts D-001..D-036 or needs a forbidden edge.
## 8. Checks not run
- No builds or tests were run, and no probe was compiled. Every command above is proposed and unverified.
- Graph and Serena tools weren't used, so no `check_index_coverage` either. All claims come from direct file reads and `rg`.
- Not inspected in depth: the SystemAsync `ProcessManager` shutdown path, IPC and Storage test names (their commands run unfiltered), and `docs/roadmap/PERFORMANCE.md`.
- Two C++ points are assumed, not compile-checked: that the `move_only_function` used by `TimerQueue` is available, and that `std::uniform_int_distribution` is consistent across toolchains (the tests assert bounds, not exact values).
**Files most relevant to this plan:**
- `/home/faumaray/Projects/VoidLibrary/src/IO/EpollDriver.cpp`
- `/home/faumaray/Projects/VoidLibrary/include/Void/Async/Executor.hpp`
- `/home/faumaray/Projects/VoidLibrary/include/Void/Async/TaskScope.hpp`
- `/home/faumaray/Projects/VoidLibrary/include/Void/Runtime/Host.hpp`
- `/home/faumaray/Projects/VoidLibrary/include/Void/Functional/Retry.hpp`
- `/home/faumaray/Projects/VoidLibrary/include/Void/System/SignalWatcher.hpp`
- `/home/faumaray/Projects/VoidLibrary/src/System/SignalWatcher.cpp`
- `/home/faumaray/Projects/VoidLibrary/tests/package/InstalledComponents.cmake`
- `/home/faumaray/Projects/VoidLibrary/src/Net/HttpServer.cpp`
@@ -0,0 +1,349 @@
# W11-PLAN-REV1 contract addendum (opus-planner, 2026-11-29)
Verbatim agent return. Advisory input; root dispositions are recorded in `DECISIONS.md`.
# W11-PLAN-REV1: contract addendum (deltas only)
**Status: DONE.** I accepted every root resolution, with three clarifications recorded at the end:
- F5: the off-owner signal adapter should close its fd. That matches 1.x and avoids a descriptor leak.
- F1(a): the injected `FileSyscalls` shim is the one exception to "workers never run user code".
- Observable: queuing nested updates for copyable types is a 1.x ordering change that MIGRATION must record.
Nothing was written to the repository. The reviewer's findings aren't persisted separately: `W11-PREFLIGHT.md` is the review brief. I worked from your F1–F13 and P3 summary. Gates G1–G5 stay; G6 is new; the B2 and A4 file sets change (table at the end).
---
## F1 (P1) S-IO-03 teardown thread rule (owner B2)
**Invariants**
- **(a)** A file worker performs one syscall (native or `FileSyscalls` shim) and nothing else. It then pushes `{request, result}` onto `FileWorkerShared::completions` under the shared mutex and calls the waker.
- Resume tickets are produced only by a poll turn, which drains `completions` through the existing `complete_op_and_collect_tickets` / `dispatch_tickets` path.
- `run_file_work()` executes one syscall on the caller's thread and only queues its result.
- **(b)** Workers hold only `std::shared_ptr<detail::FileWorkerShared>` (queues, mutex/condvar, completion queue, and a waker given as function pointer plus context). They never hold `shared_ptr<DriverBackend>`.
- The waker's raw backend pointer stays valid because workers are joined before the backend can be destroyed: `Driver::~Driver` and `shutdown_and_join` both join first.
- **(c)** `~EpollBackend`, `~MockBackend` and `~FileWorkers` never block. `~FileWorkers` finding a joinable thread prints a diagnostic to stderr and calls `std::terminate`.
- Today `~EpollBackend` blocks (`EpollDriver.cpp:953-955` calls `shutdown_and_join`); that call is removed.
- `Driver::~Driver` (`:1737-1742`) becomes the blocking teardown: `backend_->teardown_blocking()`.
- **(d)** Two thread-local markers detect misuse:
- `tl_io_worker_owner` (a non-null pool pointer on worker threads)
- `tl_polling_backend` (set while a thread runs that backend's `poll_once` turn)
`~Driver` with either marker matching prints a one-line stderr diagnostic and calls `std::terminate`.
- NEW, declared in `Driver.hpp` and defined in `FileWorkers.cpp`:
```cpp
[[nodiscard]] bool Void::IO::is_io_worker_thread() noexcept; // true on any Driver's file-worker thread
```
**(e) Tests (`IoFile.cpp`)**
- `io_driver_destroyed_from_coroutine_resumed_after_poll_dispatch_same_thread`: with `ManualExecutor`, `poll_once` dispatches a ticket and `exec.drain()` on the same thread resumes a coroutine that resets the `unique_ptr<Driver>`. Teardown must complete with no terminate.
- `io_worker_thread_marker_only_on_file_workers`: a gated shim records `is_io_worker_thread()` as true inside `pread`; it is false on the main thread, inside the poll turn and inside executor drain. The terminate path is documented only; no death test, because the Runner has no fork-based death support (`src/Testing/Subprocess.cpp:142` only execs helpers).
## F2 epoll/eventfd lifetime (B2)
- The epoll fd and eventfd still close in `~EpollBackend`, as in 1.x (`:956-963`).
- Shutdown closes only operation and descriptor fds, and only after it holds poll ownership.
- `wake()` loads `std::atomic<bool> wake_closed_` (acquire) and returns if set. It is set (release) when shutdown completes.
- Lock vs atomic: atomic is enough, and TSan-clean. `wake_fd_` is written only in the constructor (`:1255-1265`) and in `~EpollBackend`.
- All `wake()` callers hold a shared owner: `Driver::backend_`, the `CancelForwarder` weak→lock at `:589-596`, and `StreamState::lock_backend` at `Backend.hpp:89-96`.
- Workers are joined first.
- So the destructor's write happens after every `wake()` call, through the `shared_ptr` control block's acq_rel ordering.
- `poll_once` checks `shut_down_` (acquire) on entry and returns `0` before touching any fd. That keeps the 1.x return value (`:1057-1059` returns `work_done`).
## F3 / F4 Runtime shutdown phases and budgets (B4)
```cpp
enum class ShutdownPhase : std::uint8_t { not_started, closing_admission, draining, cancelling, joining_business,
stopping_components, flushing_exporters, releasing_components, stopping_io, stopping_workers, releasing, stopped };
```
**Phase order**
| # | Phase | What happens |
| --- | --- | --- |
| 1 | `closing_admission` | business scope closes admission |
| 2 | `draining` | wait for the business scope to drain (deadline fixed at first entry) |
| 3 | `cancelling` | request stop on the business scope |
| 4 | `joining_business` | wait for the business scope to finish |
| 5 | `stopping_components` | non-exporter components stop |
| 6 | `flushing_exporters` | exporters stop (flush deadline fixed at first entry) |
| 7 | `releasing_components` | drop every component `shared_ptr`, so exporters are destroyed here |
| 8 | `stopping_io` | owned driver shuts down |
| 9 | `stopping_workers` | wait for the owned executor to go idle within budget, then join the reactor and executor |
| 10 | `releasing` | budgets and fds; signal gate on the owner thread |
| 11 | `stopped` | |
- The ordering assertion `exporter_stopped < exporter_destroyed < executor_joined` stays.
- **Per-call budget:** every `shutdown_blocking`, `poll_shutdown` and `shutdown_pumping` call uses `call_deadline = min(options.deadline, deadline_after(clock, total_timeout))` for the work that remains.
- **Phase deadlines:** the drain and flush deadlines are fixed when their phase is first entered and stay expired afterwards.
- Drain expiry moves on to phase 3 and sets `drain_grace_expired`.
- Flush expiry requests stop on the exporter operations, sets `export_flush_expired`, and keeps waiting.
- **Incomplete:** if `call_deadline` expires in a waiting phase (4, 5, 6, 8 or 9), the sequence stops and returns `complete=false`, with the phase and state recorded as `shutdown_incomplete`. The next call resumes at that phase.
- NEW `[[nodiscard]] bool Async::ThreadExecutor::idle() const noexcept;` (both queues empty and nothing running), used by phase 9 so the executor join is never unbounded.
## F5 Host ownership (B3, with the B4 parts)
- All lifecycle state and teardown live in `detail::HostCore`, owned by `std::unique_ptr`. `~HostCore`:
- if the host is started and not stopped, calls `shutdown_blocking({})` (unbounded);
- then `gate->uninstall(this_thread == owner)`.
Default move-assign is therefore safe.
- **Moved-from Host** (`HostState` has no moved-from value, `Host.hpp:19-29`):
- NEW `[[nodiscard]] bool valid() const noexcept;`
- `state()` returns `stopped`; `is_running()` and `is_ready()` return false; `started_worker_count()` returns 0.
- `executor()` and `io()` return `nullptr`; `owner_thread()` and `last_shutdown_report()` return `nullopt`.
- `start`, `shutdown_*` and `poll_shutdown` return `RuntimeErrorCode::invalid_state`; `spawn` returns `AdmissionError::stopped`.
- `clock()` stays safe through its System-clock fallback (`:147-151`).
- `memory_budget()` has the precondition `valid()`. This is a pre-existing hazard: the 1.x code dereferences a null `owned_budget_` after a move (`:153-156`).
- `~HostCore` running on a Runtime worker, the reactor or an IO worker prints a stderr diagnostic and calls `std::terminate`. Detection uses:
- `executor->is_executor_thread()` (`Executor.hpp:86-96`)
- a Runtime `tl_reactor` marker
- `IO::is_io_worker_thread()`
- **SignalGate shape:**
```cpp
class SignalGate { public: virtual ~SignalGate() = default;
[[nodiscard]] virtual Void::Result::Result<void> install() = 0;
virtual void uninstall(bool on_owner_thread) noexcept = 0; }; // replaces uninstall()
```
- `shutdown_*` called off the owner thread leaves the gate installed (`owner_release_pending=true`). A later owner-thread call, or `~HostCore`, calls `uninstall(this_thread == owner)`.
- The System test adapter destroys its `SignalWatcher` in both cases. 1.x closes the fd on any thread (`SignalWatcher.cpp:29-31`) but restores the mask only on the owner (`:32-36`). Off-owner teardown therefore cannot restore the owner's mask; document this.
- Test: `runtime_offowner_destroy_closes_gate_fd_mask_not_restored`, which checks the `/proc/self/fd` delta is 0 and that the owner's mask is still blocked.
## F6 Teardown follows ResourceOwnership (B4)
- An embedded or borrowed executor, driver, clock or memory resource is never shut down, closed or joined by the Host. Phases 8 and 9 are skipped for borrowed resources.
- Signature:
```cpp
[[nodiscard]] Void::Result::Result<ShutdownReport> Host::shutdown_pumping(
Async::ManualExecutor&, Async::OperationOptions = {}, Async::TimerQueue* timers = nullptr);
```
It drives progress with `IO::pump_until(*io, manual, done, PumpOptions{.operation = call_budget, .timers = timers})`, so gate G5 stays.
- Test: `runtime_embedded_shutdown_never_shuts_borrowed_driver_or_executor`. After shutdown the borrowed driver still accepts `create_mock_stream` and the executor still accepts `try_post`.
## F7 AsyncChannel arbitration (A2)
- One `std::mutex` covers the buffer and both waiter lists.
- Waiter nodes live in the awaiter, inside the coroutine frame. Each holds `enum class WaiterState { linked, claimed, cancelled, timed_out, closed }`. A send waiter holds `std::optional<T> value`; a receive waiter holds `std::optional<T> slot`.
- Pairing a sender with a receiver happens under the lock, in one critical section: unlink and claim the waiter, then move the value. A value is therefore always in exactly one place: the sender node, the buffer or the receiver slot. It is never in limbo.
- Stop callbacks and timer callbacks take the same lock.
- If the waiter is still `linked`, it is unlinked and set to `cancelled` or `timed_out`. A sender keeps its value and gets it back.
- If it is already `claimed`, the callback does nothing. A sender gets success; a receiver gets the value that is already in its slot.
- Every resume is dispatched through `post_completion` after unlock. Each sender gets success or its value back exactly once.
- Tests:
- `channel_receiver_stop_after_claim_delivers_value_no_loss`
- `channel_sender_stop_vs_receive_race_exactly_once_tsan`: 10,000 iterations; the multiset of values sent equals values received plus values returned.
- `channel_timer_close_settles_waiter_cancelled` (see F12)
## F8 Default URBG (A1, B1)
House convention: `Retry.hpp:89` seeds with `std::random_device`.
```cpp
namespace Void::Retry::detail { template <class G> G seeded_engine()
{ if constexpr (std::is_constructible_v<G, std::random_device::result_type>) return G{std::random_device{}()}; else return G{}; } }
// RetryState::create(spec, start, URBG urbg = detail::seeded_engine<URBG>(), std::optional<SteadyTimePoint> = {})
// BlockingRetryOptions::urbg default member init = detail::seeded_engine<URBG>(); retry_async param default likewise
```
- Tests pass seeded `std::mt19937_64{42}` everywhere except `retry_state_default_engine_jitter_in_bounds`, which checks bounds only.
## F9 Revised D-W11-05: B2 owns the shutdown core, A4 owns thin wrappers
**B2 internal primitive in `detail::DriverBackend` (`Backend.hpp`):**
```cpp
virtual void begin_shutdown() noexcept = 0; // idempotent: close admission, cancel queued, stop active
[[nodiscard]] virtual Void::Result::Result<DriverShutdownReport> advance_shutdown(
std::optional<Void::Time::MonotonicClock::time_point> deadline, std::stop_token stop) = 0;
[[nodiscard]] virtual bool shutdown_complete() const noexcept = 0;
[[nodiscard]] virtual bool quiescent() const noexcept = 0; // no owned ops/requests/in-flight syscalls
virtual void teardown_blocking() noexcept = 0; // Driver::~Driver only
```
- B2 also owns `DriverShutdownReport` in `Types.hpp`, using the plan's fields.
- 1.x `shutdown_and_join()` becomes `advance_shutdown(nullopt, {})` mapped to `Result<void>`.
- `advance_shutdown` details:
- Waits for the injected-clock deadline in ≤1 ms real slices, re-reading the clock each time.
- Calls `wake()` to interrupt the current poller.
- Runs its own poll turns only while it holds poll ownership.
- Returns `self_join` if called on this backend's worker or inside its poll turn.
- **Poll-owner exclusion** uses a dedicated `std::mutex poll_mu_`. `poll_once` tries the lock and returns `std::unexpected(make_io_error(IoErrorCode::busy, ...))` if it can't get it, without touching any fd.
- I chose `busy` over `0` for three reasons: `busy` already means "concurrent op not allowed" (`EpollDriver.cpp:533-540`); the only library caller in a loop ignores the result (`IPC/Session.cpp:1128`); and a silent `0` would let a second `run()` loop spin.
- Test: `io_concurrent_poll_once_second_caller_busy_no_fd_touch_tsan`.
**A4 public wrappers** (inline in `Driver.hpp`; A4 touches no `.cpp`):
```cpp
void begin_shutdown() noexcept; // -> backend_->begin_shutdown()
[[nodiscard]] Void::Result::Result<DriverShutdownReport> shutdown(Async::OperationOptions); // -> advance_shutdown(o.deadline, o.stop)
[[nodiscard]] Void::Result::Result<std::size_t> run(std::stop_token, std::chrono::nanoseconds max_wait = std::chrono::milliseconds{5});
[[nodiscard]] bool quiescent() const noexcept;
```
A4 also delivers `Pump.hpp`/`pump_until`, the SystemAsync conformance test, and tests.
## F10 Roadmap and doc edits (root, before dispatch)
**`docs/roadmap/modules/Functional.md`**
- **:95-96**: "NEW `RetryState` exposes `begin(now)`, `next(now, outcome)` and `resume(now)`: `next` returns `stop` or `wait_until(absolute time)`; `begin`/`resume` return `attempt` or `stop`. Callers map their error to `AttemptOutcome` with a supplied classifier."
- **:99**: append "; the default engine is seeded from `std::random_device`."
- **:104-106**: "Retain 1.x `retry`/`retry_while` unchanged, including the zero-attempt default-result defect (recorded for Wave C). NEW `retry_blocking` takes injected `now`/`sleep` callables, so Functional stays standard-library-only and no Time-dependent retry header exists. Async supplies `Async::retry_async` over `TimerQueue`."
**`docs/roadmap/subsystems/Runtime.md`**
- **:48-51**: "`Result<void> start(StartOptions); Async::Executor* executor(); IO::Driver* io(); Result<ShutdownReport> shutdown_blocking(Async::OperationOptions); Result<ShutdownReport> poll_shutdown(); Result<ShutdownReport> shutdown_pumping(Async::ManualExecutor&, Async::OperationOptions);` An awaited shutdown Task on the host's own executor is not offered, because it would self-join."
- **:73**: "install the injected `SignalGate` (Runtime has no System dependency; System-backed adapter optional) on the owner thread"
- **:77**: append "; off-owner teardown calls `uninstall(false)`, which cannot restore the owner's mask."
- **:114-117**: "6. After cleanup/export callbacks and backend references retire, drop component/exporter references, then stop owned IO, the reactor and CPU/file workers, and release budgets, descriptors and the signal gate in reverse creation order. Borrowed executor, driver, clock and memory are never shut down or joined by the Host."
- **:119**: "Each shutdown call observes min(caller deadline, now + total_timeout (30 s)) for remaining work. Drain-grace and flush deadlines are fixed at first entry to their phase. An incomplete phase stops the sequence and the next call resumes there."
- **:124-126**: "Destruction blocks to join only off Runtime threads. Destruction on a Runtime worker, reactor or IO file-worker thread is a programmer error that terminates after a diagnostic."
- **:159**: deps become "P2 / S-RUNTIME-01, M-ASYNC-04, S-IO-03; signal gate (injected port)".
- **:160**: deps become "P2 / S-RUNTIME-02, S-IO-04".
**`docs/roadmap/subsystems/IO.md`**
- **:77-79**: "The Driver owns no thread. One thread at a time runs a `poll_once` turn (the poll owner) and owns interest updates and generations; a concurrent caller gets `busy` without touching descriptors. Producers wake the owner through eventfd. Runtime or the embedder supplies the thread (`Driver::run`, `pump_until`)."
- **:92**: "Files use a bounded blocking worker pool started explicitly by `start_file_workers()` or stepped by `run_file_work()`. Workers run only the syscall or injected shim and queue its result; completions are delivered only by a poll turn."
- **:118-120**: "Driver shutdown closes admission, cancels queued requests, stops active ones, waits for the poll owner and in-flight syscalls, drains completions, joins workers, then closes operation descriptors. Epoll and wake descriptors close in the backend destructor. Blocking teardown runs in `Driver::~Driver`; destruction on a file worker or inside a poll turn is a programmer error."
- **:121-122**: "`File::close_and_join` returns `incomplete_shutdown` on expiry and retains the fd and buffers. A dropped File closes its fd after its last in-flight request drains."
- **:154**: "optional System/Net adapters" becomes "SystemAsync conformance; Net adapter deferred (Net has no IO use)".
**`docs/roadmap/MIGRATION.md:61` (Async/IO row, append to the evidence cell)**
"Recorded W11 changes:
- `Driver::shutdown_and_join` blocks for in-flight syscalls and joins file workers.
- `validate_limits` rejects `max_file_queue == 0`.
- Sync EventBus and Observable/Signal dispatch over snapshots; subscription changes take effect next pass.
- Nested Observable/Signal updates for copyable types are queued FIFO.
- Legacy `parallel_for` waits for all tasks before rethrowing.
- Async-mode EventBus handler exceptions are counted instead of terminating.
- Legacy `retry` zero-attempt result is kept until Wave C."
**DECISIONS:** amend D-W11-05 per F9, and add F1, F2 and F5 as root decisions.
## F11 Within-step failure coverage
- **IO (B2):** `BackendOptions::before_file_worker_start` (NEW, appended):
```cpp
std::function<Void::Result::Result<void>(std::size_t)> before_file_worker_start{};
```
- `start_file_workers` treats a hook error exactly like a caught `std::system_error`: it joins the workers already started, returns `os_error` (with the system code when one exists), and allows a retry.
- Test: `io_file_workers_partial_start_failure_joins_started`.
- **ThreadExecutor (A2):** `start()` catches `std::system_error` from `std::thread` through the same path as `before_worker_start`.
- **Runtime (B3):**
```cpp
struct StartOptions { /*...*/
std::function<Void::Result::Result<void>(StartStep, std::size_t thread_index)> before_thread_start{};
std::chrono::milliseconds cleanup_timeout{5000}; };
```
- `before_thread_start` is forwarded to the executor and IO hooks and to the reactor's `std::thread` creation, which also catches `std::system_error`.
- Failed-start component cleanup waits at most `cleanup_timeout` (injected clock). If it runs out, the state is `failed_start`, resources are retained, and the next `shutdown_blocking` or `~HostCore` continues the cleanup.
- Tests:
- `runtime_failed_start_thread_fault_each_threaded_step_reverse_cleanup` (cpu_executor, file_workers and reactor, at index 0 and at the last index)
- `runtime_failed_start_component_cleanup_timeout_retains_then_completes`
- `thread_executor_system_error_path_shared_with_hook`
## F12 Shared-core lifetimes
- **EventBus (A3):**
- Injected-mode dispatch frames capture `std::shared_ptr<detail::BusCore>`.
- `~EventBus` closes admission. On an executor thread it does not wait: frames finish against the shared core. Off the executor it calls `close_and_join` (blocking, or pumping on `ManualExecutor`).
- NEW `[[nodiscard]] Void::Result::Result<void> flush_blocking();` returns `self_join` on an executor thread or inside a bus callback, and `invalid_argument` on a `ManualExecutor` (`Executor.hpp:195`).
- NEW `flush_pumping(ManualExecutor&)`.
- Legacy `flush()` in Injected mode calls `flush_blocking()` and discards the error, because the 1.x signature returns `void` (`EventBus.hpp:193-201`). It never deadlocks.
- **TimerQueue (B1):**
```cpp
enum class TimerEvent : std::uint8_t { expired, closed };
using TimerCallback = std::move_only_function<void(TimerEvent) noexcept>;
```
- `TimerHandle` holds `shared_ptr<detail::TimerEntry>`, whose state is an atomic pending→{fired, cancelled} transition. `cancel()` is valid after the queue is destroyed.
- The callback runs exactly once (`expired` or `closed`), or never if `cancel()` returned true. Queue close or destruction invokes pending callbacks with `closed`; AsyncChannel maps that to `cancelled`.
- Test: `timer_handle_cancel_after_queue_destroyed_safe`.
- **`parallel_for` (A2):**
- Shared `detail::PForState` holds the decay-copied `F`, the chunk counter and the error slots.
- The caller waits for every submitted runner future, including runners that were never started.
- Nested use on the same pool from a pool worker is documented as unsupported.
- Test: `parallel_for_bounded_waits_all_submitted_runners`.
## F13 File descriptor lifetime (B2)
- `detail::FileState` is shared-owned and holds the fd, the shim, the in-flight count, a `close_pending` flag and the per-file ordering lane. Every request holds a reference to it.
- When the last handle drops:
- with no requests in flight, an internal close request is enqueued, using reserved capacity outside `max_file_queue`;
- otherwise `close_pending` is set, and the poll-turn retirement of the last request enqueues the close.
- Close always executes on a worker, or in `run_file_work`. Teardown closes any remaining file fds after the workers are joined.
- `File::close_and_join(options)` is always admitted.
- Deadline or stop expiry returns `IoErrorCode::incomplete_shutdown`; the File stays valid with its fd and buffers retained, so the call can be repeated.
- Success invalidates the File.
- A close syscall failure returns `os_error`, and the fd is treated as closed.
- This differs from `ByteStream::close_and_join`, which consumes the stream (`Stream.hpp:105`); document the difference.
- Tests:
- `io_file_drop_with_inflight_defers_close_until_drained`
- `io_file_close_and_join_expiry_incomplete_retains_then_completes`
## P3 resolutions
- **`retry_blocking` template defaults (A1):** use defaulted function-template parameters, because deduction cannot read a default function argument:
```cpp
template <class F, class NowFn = SteadyNow, class SleepFn = ThreadSleep,
class Classify = RetryEveryError, class URBG = std::mt19937_64>
auto retry_blocking(const RetrySpec&, F&&, BlockingRetryOptions<NowFn, SleepFn, Classify, URBG> = {});
```
Tests spell the option types explicitly; aggregate CTAD is a convenience only.
- **Observable/Signal (A3):**
- `Observable<T>` with `std::copy_constructible<T>`: a nested `set` updates the value immediately and queues `(old, new)` copies, delivered FIFO after the current pass and bounded at 1,024. On overflow, `set` keeps the new value and counts a dropped notification. `try_set` (only when copyable) returns `overloaded` without changing the value.
- Move-only `T`: the 1.x behavior stays — immediate recursive notification — but iteration runs over a listener snapshot. There is no queue and no `try_set`.
- `Signal<Args...>` follows the same rule when `(std::copy_constructible<std::decay_t<Args>> && ...)`; the queue is a `mutable` member, since `emit` is `const`.
- On a throw, the value stays the new value (as in 1.x, `Observable.hpp:40-42`), dispatch depth is restored, and that pass's queued notifications are dropped and counted.
- **S-IO-03 downstream build:**
```sh
-DVOID_ENABLED_MODULES="IO;IPC;SystemAsync;Storage;CryptoAsync;Runtime;ConfigurationAsync;Testing"
```
run unfiltered, plus `ctest`.
- **Error-kind alignment:** `RuntimeErrorCode::shutdown_incomplete = 9` maps to `ErrorKind::conflict`, matching `IoErrorCode::incomplete_shutdown` (`IO/Types.hpp:51-53`). IO is unchanged. Root pre-commit.
- **D1 regression seam (B2):**
- Test `io_epoll_stop_requested_at_deadline_scan_completes_once` uses a clock whose `now()` requests stop. That `now()` call happens in the wait computation, only when the op has a deadline (`EpollDriver.cpp:1083,1098`).
- The sequence:
1. The socket already has data.
2. The stop puts the cancel in the queue.
3. `drive_read` sees the stop and completes the op (`:1452`).
4. The end-of-turn cancel pass hits the same op (`:1173`).
- NEW appended telemetry field `DriverTelemetry::duplicate_completions_ignored`. The test asserts a single delivery and a counter ≥ 1.
- **Mock reactor spin (B3):** `MockBackend::poll_once` ignores `max_wait` (`EpollDriver.cpp:739-741`) and its `wake` only counts (`:637-640`).
- The Runtime reactor (and A4's `Driver::run`) waits on a stop-aware condition variable for `max_wait` when the backend is mock and a turn did no work.
- IO is unchanged, so the `IoDriver` test timing is untouched.
- **Business scope:** `TaskScopeOptions{.max_tasks = limits.max_cpu_tasks, .stop_on_first_error = false}`, because the default is `true` (`TaskScope.hpp:32`).
- **ThreadExecutor (A2):**
- After `close()`, a legacy `post()` goes onto the completion lane and is counted.
- `join()` drains until both lanes are empty and nothing is running. After join, posts resume inline and are counted.
- No drain cap: abandoning a handle would strand a frame, which C-03 forbids (`ARCHITECTURE.md:63-64`, "owner until exactly one terminal result"). A handle that re-posts itself forever prevents join; that is documented as a caller error.
- `~ThreadExecutor` without a prior join calls `close()` then `join()`. On its own worker it prints a diagnostic and terminates.
- **Runtime worker detection** uses `IO::is_io_worker_thread()` (F1).
- **Layering check (A4):**
```sh
rg -n "Void/(Runtime|Net|System)/" include/Void/IO src/IO # expect no output
git diff --stat -- src/IO/module.cmake # expect empty
```
- **Budget accounting (B4):** test `runtime_shutdown_budget_bytes_retained_while_incomplete_zero_after_complete`.
- The Host passes `memory_budget()` as the Driver's pmr resource (`Driver.hpp:69-74`).
- An exporter holds a `BufferLease` across a stalled read.
- While incomplete: `memory_budget().stats().requested_live > 0` (`BudgetResource.hpp:106`, `Memory/Resource.hpp:22-30`), and `executor()->admitted()` and `DriverTelemetry::owned_buffer_bytes` stay as they were.
- After release and a second join: all three are 0.
- **M-ASYNC-05 captured-state tests (A3):**
- `bus_sync_unsubscribe_releases_captured_state`
- `bus_legacy_async_unsubscribe_then_flush_releases_captured_state`
- `bus_legacy_async_close_and_join_releases_capture_with_queued_copies`
All three assert the sentinel's `use_count() == 1`.
## Revised gates and ownership (changes only)
**Gates**
- G1–G5 as before.
- G4 now hands A4 only `Driver.hpp` (inline wrappers), the NEW `Pump.hpp` and tests.
- **G6 (new):** after A4 merges, all IO files are root-owned. B4 must stop and report if it needs an IO edit.
| Step | Owned-file delta |
| --- | --- |
| Root pre-commit | `RuntimeErrorCode::shutdown_incomplete` maps to `conflict` (changed from `timeout`) |
| B1 | adds `TimerEvent` and the shared-state `TimerHandle` to `Async/Timer.hpp` |
| B2 | adds to `IO/Driver.hpp`: `is_io_worker_thread`, `~Driver` teardown. Adds to `IO/Types.hpp`: `DriverShutdownReport`, `BackendOptions::before_file_worker_start`, `DriverTelemetry::duplicate_completions_ignored`. Adds to `IO/Detail/Backend.hpp`: the shutdown primitives. Also `src/IO/{EpollDriver.cpp, FileWorkers.{hpp,cpp}}` and `tests/standalone/IO/IoFile.cpp` |
| A4 | `include/Void/IO/Driver.hpp` (inline wrappers only), `include/Void/IO/Pump.hpp` (NEW), `tests/standalone/IO/{IoShutdown,IoPump}.cpp`, `tests/standalone/SystemAsync/SystemAsyncShutdown.cpp`. Not owned: `EpollDriver.cpp`, `Backend.hpp`, `Types.hpp`, `FileWorkers.*` (stop and report) |
| B3 / B4 | `Runtime/Lifecycle.hpp` gains `SignalGate::uninstall(bool)`, `StartOptions::{before_thread_start, cleanup_timeout}` and the renumbered `ShutdownPhase`. `Host.hpp` gains `valid()` and the 3-argument `shutdown_pumping`. A2 additionally owns `ThreadExecutor::idle()` |
## Root resolutions I'd adjust (not silently changed)
1. **F5 adapter wording.** "Releases its fd ... only on the owner thread" doesn't match 1.x: `SignalWatcher` closes the fd on any thread (`SignalWatcher.cpp:29-31`). Keeping the fd open off-owner would leak it, because no later owner-thread call is guaranteed. I recommend closing the fd and skipping only the mask restore, exactly as 1.x does; the F5 section above specifies that.
2. **F1(a) "workers never call user code".** The injected `FileSyscalls` shim runs on workers by design. It should be stated as the only exception: a syscall substitute that must not call Driver, Executor or File APIs.
3. **Observable copyable queuing.** It changes 1.x nested-set ordering from recursive to FIFO for copyable types. That's acceptable, since the roadmap mandates the queue, but it must appear in the MIGRATION record; F10 includes it.
**Checks not run:** no builds or tests. All citations come from direct reads during this session.
+125
View File
@@ -0,0 +1,125 @@
# Wave 11 execution-path backfill — architecture and task plan
Task ID: W11-PLAN
Role: opus-planner
Status: READY
## 1. Context and baseline
- Repo root / cwd: `/home/faumaray/Projects/VoidLibrary`; branch `feat/roadmap-p2-wave11`
created from `main` at `38436b1` (Waves 1–10 merged at `7d7d23e`, pushed to `origin/main`).
- Tracked tree clean. Untracked user files (`.env`, `WG.conf`, `keys`, `jev_token`, `.serena/`,
`.vbs/`, dotfiles, `compile_commands.json`) are NOT task inputs; never read, copy or quote them.
- Root gap analysis (2026-11-29): roadmap task tables list 300 tasks; `docs/agent-workflow/TASKS.md`
marks Waves 1–10 done, but these execution-path tasks remain open and their pre-roadmap
headers are untouched since baseline `f1f9ba3` (`git log f1f9ba3..HEAD` on
`Async/{Channel,EventBus,Observable,ParallelFor,ThreadPool}.hpp`, `Functional/Retry.hpp`
shows no commits; `IO`/`Runtime` only received `S-IO-01/02` `673bb7e` and `S-RUNTIME-01` `1b3331e`):
- P1 leftovers: `M-FUNCTIONAL-03`, `M-TIME-03`.
- P2: `M-ASYNC-04`, `M-ASYNC-05`, `S-IO-03`, `S-IO-04`, `S-RUNTIME-02`, `S-RUNTIME-03`.
- These gate `P-NETWORKED-02` / `P-RELOADABLE-02` ("Runtime/Async/IO lifecycle gates").
- Requirement/contract references: `docs/roadmap/REQUIREMENTS.md` R-001..R-016,
`docs/roadmap/ARCHITECTURE.md` C-01..C-14, gates G-ERROR/G-EXEC/G-IO in `DEPENDENCIES.md`.
- Baseline full build/test of `main` is running separately under root; not your concern.
## 2. Objective and deliverables
Produce an implementation-ready plan (returned as text, not written to files) for the eight
tasks above, plus a readiness verdict for `S-RPC-04` (WebSocket streaming) as an optional
ride-along. Deliverables in the reply:
1. Per task: observed baseline (exact existing symbols/behavior with `path:line`), the gap
against its roadmap row and area plan, and the minimal complete scope to satisfy the
row's acceptance text.
2. Per task: NEW public interfaces (C++ signatures, enums, error codes in existing domains,
limits/defaults) marked NEW, and which existing 1.x APIs stay unchanged (D-029).
3. Dependency graph between the eight tasks, and the module `INTERNAL_DEPS` changes, if any,
with a check that every edge respects `DEPENDENCIES.md` target package rules.
4. A partition into 2–3 worker packages with exclusive file ownership (exact paths), role
(`astra_*` rows → opus-implementer, `sol_*` rows → sonnet-implementer), and order.
Identify root-owned shared edits (e.g. `include/Void/Functional/Error.hpp`,
`tests/package/InstalledComponents.cmake`, top-level `CMakeLists.txt`, `cmake/*`).
5. Per task: concrete test list (test file paths, scenario names) mapping to acceptance text,
and exact verification commands (module subset, filters) in the repository's form.
6. Whether the "System signal gate" named by `S-RUNTIME-02` exists in current source
(cite symbols), or what minimal in-wave work it implies without adding Runtime→System
unless `DEPENDENCIES.md` permits it.
7. Risks, open questions that need a root decision, and anything in the roadmap rows that
is infeasible or contradictory, with a recommended resolution.
## 3. Scope and non-goals
In scope: planning only for the eight tasks and the S-RPC-04 readiness note.
Non-goals: editing files, writing specs, implementing code, running long builds, planning
foundation P2 leftovers (Core/Math/Text/Data/Binary/…) or P3/P4 platforms.
## 4. Files to inspect
- Roadmap: `docs/roadmap/modules/{Functional,Time,Async}.md`, `docs/roadmap/subsystems/{IO,Runtime,RPC}.md`,
`docs/roadmap/{ARCHITECTURE,DEPENDENCIES,MIGRATION,VALIDATION,PERFORMANCE}.md`,
`docs/roadmap/platforms/{NetworkedApplications,ReloadableApplications}.md` (gate wording only).
- Prior specs for style/precedent: `docs/agent-workflow/tasks/{M-ASYNC-02-03,S-IO-01-02,S-RUNTIME-01,M-TIME-02,M-FUNCTIONAL-02,M-SYSTEM-01-05}.md`.
- Source: `include/Void/Functional/{Retry,Error,Result}.hpp`, `src/Functional/module.cmake`;
`include/Void/Time/{Clock,Stopwatch}.hpp`; `include/Void/Async/*.hpp`, `src/Async/module.cmake`;
`include/Void/IO/{Types,Driver,Stream}.hpp`, `include/Void/IO/Detail/*`, `src/IO/{EpollDriver.cpp,module.cmake}`;
`include/Void/Runtime/{Options,ResourceGraph,Host}.hpp`, `src/Runtime/module.cmake`;
`include/Void/System/*` (signal handling), `include/Void/Net/*` (only for S-IO-04/S-RPC-04 adapters);
existing tests under `tests/standalone/{Functional,Time,Async,IO,Runtime}/`;
`cmake/Module.cmake`, `tests/CMakeLists.txt`, `tests/package/InstalledComponents.cmake`.
## 5. Write ownership and coordination
Write scope: none
Allowed commands: read-only `git`, `rg`, `ls`, `wc`, Serena/codebase-memory read tools. You may
compile a tiny probe only under `/tmp/void-w11-plan-probe` if essential; do not touch the
repository tree. `dev cpp-gcc ...` must run unsandboxed (nix fetcher lock); avoid it unless needed.
## 6. Implementation or investigation approach
1. Read each roadmap row and area-plan section; extract mandatory behavior and limits.
2. Inspect the current headers/tests via Serena symbol tools; record what exists.
3. Derive minimal complete NEW interfaces that layer beside 1.x APIs (Wave A+B, D-029).
4. Check layering: Functional has zero `INTERNAL_DEPS` (D-015) — retry decisions must take
injected time values or a template clock, not depend on `Time`; Async must not depend on
Log backends or Runtime; IO must not depend on Runtime/Net/System; Runtime composes.
5. Build the task DAG and the ownership partition minimizing cross-package header edits.
6. Draft test scenarios that prove each acceptance sentence deterministically (manual clocks,
mock IO backend) and TSan-relevant concurrency cases.
## 7. Interfaces and data contracts
Use existing contracts: `Void::Functional::{Result,Error,Status,ErrorCode}`, domains
`kTimeErrorDomain=4`, `kAsyncErrorDomain=7`, `kIoErrorDomain=8`, `kRuntimeErrorDomain=11`;
`Void::Time::{MonotonicClock,ManualClock}`; Async `OperationOptions`/`TaskScope`/`Executor`;
IO `Driver`/`BufferLease`; Runtime `Host`/`HostBuilder`/`ResourceGraph`. Any new error code
must extend an existing domain enum; propose exact enumerator names.
## 8. Dependencies and integration
Upstream: Waves 1–10 on `main`. Root owns integration, shared build files, and all commits.
Implementers will be dispatched only after a fresh opus-reviewer PREFLIGHT of your plan.
## 9. Edge cases security and performance
Call out: exactly-one-terminal-result races, stop/expiry/completion permutations, buffer
retention on active cancel, bounded queues including running work, reentrancy and
unsubscribe-during-dispatch, failed-start reverse cleanup with no leaked threads/fds,
signal-mask ownership, exporter-before-executor shutdown ordering, no user callbacks
under locks, overflow-safe deadline arithmetic.
## 10. Acceptance criteria
1. Each of the eight tasks has baseline, gap, NEW interface, tests and commands.
2. DAG and INTERNAL_DEPS changes respect DEPENDENCIES.md rules (stated per edge).
3. Ownership partition has no overlapping paths and lists root-owned shared files.
4. S-RUNTIME-02 signal-gate question answered with cited symbols.
5. S-RPC-04 readiness verdict with prerequisites cited.
6. Open decisions listed with a recommendation each.
## 11. Verification commands and evidence
Not applicable for builds: planning-only. Cite `path:line` for every baseline claim. Command
templates you propose must follow the observed form, e.g.
`dev cpp-gcc -c bash -lc 'cmake -S . -B /tmp/void-w11-<x> -G Ninja -DVOID_ENABLED_MODULES="Async;Testing" -DVOID_WARNINGS_AS_ERRORS=ON && cmake --build /tmp/void-w11-<x> && /tmp/void-w11-<x>/tests/VoidTests --filter "<Pattern>*" && ctest --test-dir /tmp/void-w11-<x> --output-on-failure --timeout 60'`.
## 12. Constraints and stop conditions
No repository edits, no commits, no network calls beyond local tools, no secrets. Stop and
report if a roadmap requirement contradicts a recorded decision (D-001..D-032) or would need
a new dependency edge forbidden by DEPENDENCIES.md.
## 13. Authorization and decisions
Root decision under D-027/D-031 (continuous roadmap-order execution): Wave 11 is the
execution-path backfill. Planning-only authorization; you do not approve your own plan.
## 14. Return format
Return task ID; DONE/BLOCKED/PARTIAL; summary; per-task sections (baseline, gap, NEW
interfaces, tests, commands); DAG; ownership partition; signal-gate answer; S-RPC-04 verdict;
risks; open decisions with recommendations; checks not run. Do not spawn children.
@@ -0,0 +1,162 @@
# W11-PREFLIGHT-2 output (opus-reviewer, 2026-11-29)
Verbatim agent return. Advisory input; root dispositions are recorded in `DECISIONS.md`.
**Task W11-PREFLIGHT-2. Verdict: CHANGES_REQUIRED.** The addendum and the root edits fix the first review's P1 (F1) and most of F2–F13. Six P2 gaps remain. One is a contradiction inside the addendum itself (N1). Four are gaps that the addendum's own resolutions create (N3–N6), and one is a state the addendum never covers (N2). All six can be fixed by adding sentences to the contract text. No re-plan, gate change or ownership change is needed.
- **Blocked until the text is amended:** B2 (N3, N4), B3/B4 (N1, N2, N3), A2's channel deadlines (N5; the rest of A2 can proceed), A3's EventBus work (N6). A4 picks up N3's loop rules when its spec is written.
- **Not blocked:** A1 (M-FUNCTIONAL-03) can continue. B1 (M-TIME-03) can continue but needs one documentation-only note (N5). Neither needs an interface change.
Paths are relative to `/home/faumaray/Projects/VoidLibrary`. "Addendum" means `docs/agent-workflow/tasks/W11-PLAN-REV1-OUTPUT.md`; "plan" means `W11-PLAN-OUTPUT.md`.
## Item status
| Item | Status | Evidence / residual |
|---|---|---|
| F1 | RESOLVED | Workers only run a syscall and queue the result, so no completion runs on a worker. They hold a separate worker-pool object, never the backend. Backend destructors never block, and only `~Driver` does a blocking teardown, behind two terminate markers. Residual: P3-9. |
| F2 | RESOLVED for sockets | The epoll and wake fds still close in the backend destructor (`EpollDriver.cpp:953-963`). Every socket-path `wake()` caller holds a strong reference (`:589-596`, `Backend.hpp:89-96`, `Stream.hpp:105-120`). The file path depends on N4. |
| F3 | RESOLVED | Phase 7 drops the components before IO stops (phase 8) and before the executor is joined (phase 9). |
| F4 | PARTIAL | The per-call budget fixes the zero-budget repeat call, but it contradicts the destructor rule (N1). Phase 2 is missing from the waiting-phase list (P3-1). |
| F5 | PARTIAL | Moved-from rules are fine; gaps in N1, N2, P3-3 and P3-7. |
| F6 | PARTIAL | Borrowed resources are skipped, but the embedded `ManualExecutor` path hangs (N2). |
| F7 | PARTIAL | The single-lock claim/hand-off rule is sound. The timer callback can still reach a destroyed waiter (N5). |
| F8 | RESOLVED | `seeded_engine` is in `M-FUNCTIONAL-03.md:114-142`. Nit: P3-6. |
| F9 | PARTIAL | The routing fix is done. Choosing `busy` without loop rules creates N3. |
| F10 | RESOLVED | The `7f95f89` doc edits match the addendum. Small gaps: P3-4. |
| F11 | RESOLVED | The IO and executor start hooks plus `cleanup_timeout` cover failures inside a step (a later destructor finishes the cleanup, see N1). |
| F12 | PARTIAL | `TimerHandle` shared state and the `parallel_for` shared state are fine. Gaps: N5 (timer) and N6 (EventBus). |
| F13 | PARTIAL | The `FileState` deferred close is right in direction. The fd state machine is incomplete (N4). |
**First-review P3 items**
| Item | Status |
|---|---|
| `retry_blocking` template defaults | RESOLVED (`M-FUNCTIONAL-03.md:135-142`) |
| Observable/Signal move-only and "state restored" | RESOLVED |
| Downstream build list | RESOLVED |
| Error-kind alignment | RESOLVED; observed in `Runtime/Options.hpp`, `shutdown_incomplete` maps to `conflict` |
| D1 regression seam | RESOLVED (seam at `:1083`/`:1098`); see P3-5 |
| Mock reactor spin | PARTIAL: the mock case is covered, the epoll cases are open (N3) |
| Business scope `stop_on_first_error` | RESOLVED |
| MIGRATION: `shutdown_and_join` blocks / `max_file_queue==0` / Sync snapshot / `parallel_for` | RESOLVED, all four observed in `MIGRATION.md:61` |
| Unspecified: concurrent `poll_once` | PARTIAL (N3) |
| Unspecified: IO file ownership after G5 | RESOLVED (G6) |
| Unspecified: stop-and-report if an IO edit is needed | PARTIAL: stated for B4 and A4, not for B3 |
| Unspecified: worker detection | RESOLVED (`is_io_worker_thread`) |
| `ThreadExecutor` endless drain, destructor without join | RESOLVED |
| Acceptance gaps (layering `rg`, within-step faults, ordering, budget test, receiver stop, legacy-mode captures) | RESOLVED; budget test lifetime in P3-2 |
**Named checks (§3)**
| Check | Answer |
|---|---|
| `busy` breaking existing callers | It does not. The only library loop that polls is `~Session` (`src/IPC/Session.cpp:1118-1129`): bounded to 1,000 iterations, result ignored. Every test drives a driver from one thread, and the one cross-thread test polls from only one thread (`IoDriver.cpp:458-508`). The hazard is in the new loops (N3). |
| `wake_closed_` atomic argument | Sound. The last `shared_ptr` release orders the destructor after every `wake()`. The flag is effectively optional because the fd closes only in the destructor. The file wake path is not enumerated (N4). |
| `FileState` reserved close capacity | Bounded only if files take descriptor slots. The addendum doesn't say so (N4). |
| `ThreadExecutor::idle()` in phase 9 | Usable, but it is a snapshot, so "join never unbounded" is overstated (posts after the snapshot still extend the join). Safe in Runtime because phase 8 has already stopped IO dispatch. |
**Named hazards (§6.2)**
| Hazard | Answer |
|---|---|
| Raw waker pointer lifetime | Sound for workers: every backend destruction path goes through `~Driver`, which joins the workers first. `~File` must not use that waker (N4). |
| `busy` and loop callers | See N3. |
| Reserved close capacity unbounded | See N4. |
| Phase-9 idle wait vs inline resume after join | Unreachable from IO, because phase 8 runs first. External posts (stop callbacks, user threads) resume inline; this is documented. |
| `~HostCore` unbounded shutdown on destruction | Contradicted by the per-call budget (N1). Hangs in embedded mode (N2). |
**Planner adjustments**
| Adjustment | Verdict |
|---|---|
| Signal adapter closes its fd off the owner thread | Agree. It matches `src/System/SignalWatcher.cpp:27-37`, and `Runtime.md` is updated. Test hygiene: P3-3. |
| Injected syscall shim as the one exception | Agree. `IO.md:94-96` is updated. |
| Observable FIFO ordering change | Agree. It is recorded in `MIGRATION.md`. |
## New findings
**N1 (P2, observed contradiction): the destructor's shutdown is called "unbounded" but the budget rule caps it at 30 s.**
- **Where:** addendum `:85` says "(unbounded)". Addendum `:75-79` caps every call at `min(deadline, now + total_timeout)` and returns `complete=false` on expiry. `validate_options` rejects `total_timeout <= 0`, so the cap can't be switched off. The failed-start continuation (`:230`) relies on the same path.
- **What happens:** a stall longer than 30 s makes `~HostCore` return from the shutdown call incomplete. A joinable reactor `std::thread` then calls `std::terminate`. If it didn't, members would tear down while components still exist.
- **Related:** `poll_shutdown()` takes no options, so its budget restarts on every call. The plan test `runtime_shutdown_budget_min_caller_policy_manual_clock (poll_shutdown)` (plan `:745`) can therefore never see an expiry.
- **Fix:** `~HostCore` loops `shutdown_blocking({})` until `complete` (or calls an internal no-deadline variant). State "destruction blocks until complete". Move that test to `shutdown_blocking` with an expired or manual-clock deadline. Define how `poll_shutdown` relates to the budget.
**N2 (P2, inferred hang): embedded mode with a borrowed `ManualExecutor`.**
- **Where:** `~HostCore` calls `shutdown_blocking`. Phase 4 then reaches `TaskScope::join_blocking`, which waits on a condition variable that nothing will ever pump (`include/Void/Async/TaskScope.hpp:289-303`). Component `stop()` tasks also need pumping.
- **What happens:** destroying an unstopped embedded Host that has a business task or any component hangs forever.
- **Second problem:** the terminate check uses `executor->is_executor_thread()`, which is true inside an ordinary `manual.drain()` of the borrowed executor.
- **Fix:**
- `shutdown_blocking` returns `invalid_argument` when the executor has no background workers, as `flush_blocking` already does.
- `~HostCore` with a `ManualExecutor` pumps, following the `~TaskScope` pattern (`TaskScope.hpp:562-575`).
- The terminate check applies only to owned executors.
- `shutdown_pumping` in managed mode returns `invalid_argument`, because the reactor owns polling and `pump_until` would just get `busy`.
**N3 (P2, inferred spin plus one hang path): who polls during shutdown is never specified.**
- **Spins:**
- `busy` returns immediately, so the B3 reactor loop (`poll_once(5ms)`), A4's `Driver::run` and `pump_until` spin hot while `advance_shutdown` holds poll ownership.
- The 1.x early return once stopping is set (`EpollDriver.cpp:1057-1059`) skips `epoll_wait`, so loops spin throughout the shutdown window.
- After `shut_down_`, `poll_once` returns 0 immediately, so the reactor spins until phase 9 joins it.
- **Hang:** the addendum doesn't say where file completions are drained relative to that early return. If the drain sits after `epoll_wait` (the natural place, next to `drain_wake_fd`), in-flight file requests are never retired. `quiescent()` then never becomes true, `advance_shutdown` never completes, and `teardown_blocking` in `~Driver` hangs.
- **Undefined behaviour:** `try_lock` on `poll_mu_` by the thread that already owns it, reachable through an inline resume inside a turn.
- **Fix, one sentence each:**
- Cancels, controls and file completions drain before any stop-flag return.
- Say whether `begin_shutdown` sets `stopping_`.
- Library loops wait up to `max_wait` (stop-aware) on `busy` and exit on `shutdown_complete()`.
- Choose one: phase 8 stops and joins the reactor before `advance_shutdown`, or the reactor exits on completion.
- `advance_shutdown` either releases `poll_mu_` between its 1 ms slices or makes the other pollers park.
- `poll_once` checks the thread-local polling marker before `try_lock`.
- Define what `advance_shutdown` returns when its stop token fires.
**N4 (P2, inferred double close / use-after-free): the File fd state machine is incomplete (F13).**
- **Missing invariants:**
- The transitions between handle drop, in-flight count and `close_pending` happen under one mutex, so exactly one close is enqueued.
- A File that outlives shutdown completion or `~Driver` holds an fd that teardown closed. A later `~File` or `close_and_join` must not close that number again, because it may now belong to someone else. Reads and writes must return `closed` without a syscall.
- `close_and_join` after the workers are joined has nothing to run the close on ("close always executes on a worker or `run_file_work`").
- `~File` must wake through a weak→strong backend lock or the worker condition variable, never the raw waker.
- Reserved close capacity is not stated as bounded.
- **Fix:**
- Give `FileState` an `open → closing → closed` state under the pool mutex; whoever closes sets `closed`.
- After completion, `close_and_join` returns at once and `~File` does nothing.
- Files count against `max_descriptors`, which bounds the reserved close capacity.
- Preallocate the close node inside `FileState`, so the `noexcept` `~File` path never allocates.
**N5 (P2, inferred use-after-free; affects B1, which is running): channel timer callbacks vs waiter nodes.**
- **Where:** `M-TIME-03.md:63-65,89,113` says callbacks fire outside the lock after pending→fired, and that `cancel()` returning true means "never runs". It does not cover a callback that has fired and is still running. Addendum F7 puts waiter nodes in coroutine frames and has the timer callback "do nothing if claimed".
- **What happens:** a sender claims the waiter, the receiver resumes and its `cancel()` returns false, its frame is destroyed, and the in-progress callback then reads the dead node.
- **Fix:**
- B1, documentation only: `cancel()==false` does not mean the callback has finished. B1 may continue.
- A2: the timer callback captures shared waiter state, or the channel plus a waiter id that it looks up under the channel lock. It must never hold a raw pointer into a frame.
**N6 (P2, inferred use-after-free): `~EventBus` on an executor thread doesn't wait (F12).**
- **Where:** `Subscription` holds a raw `EventBus*` (`include/Void/Async/EventBus.hpp:137-146`), and handlers commonly capture `EventBus&` to publish follow-up events.
- **What happens:** frames already queued keep delivering after the destructor returns, and any handler that touches the bus hits a dead object.
- **Fix:** `~EventBus` gates every admitted-but-not-started delivery on every thread before it returns. Either wait for callbacks running on other threads (excluding the current one, via a thread-local depth) or document that residual.
**P3 (each changes one spec line)**
1. Add phase 2 to the list of phases that return incomplete when the call deadline expires. Today a caller deadline shorter than the drain grace is ambiguous.
2. The owned BudgetResource, executor and driver objects must live until `~HostCore`.
- The budget test reads `memory_budget()` and `admitted()` after `complete`, and `admitted()` needs `ThreadExecutor`, not `Executor*`.
- A `BufferLease` that outlives its resource is a use-after-free.
3. Signal gate:
- The borrowed `signal_gate` must outlive the Host.
- `uninstall` must be idempotent or tracked, because failed-start cleanup already uninstalls.
- The off-owner signal test must restore the owner's mask and drain SIGUSR2 at the end.
4. MIGRATION and Runtime.md:
- Add "concurrent `poll_once` returns `busy`" and "`~Driver` on a file worker or inside a poll turn terminates" to MIGRATION.
- `Runtime.md` is missing the `TimerQueue*` parameter on `shutdown_pumping`.
5. The D1 seam clock must be armed after submission. `submit_io` reads the clock at `:503`, and a stop there takes the pre-queue path, so D1 never reproduces.
6. Use `G(std::random_device{}())` (parentheses). Braces are a narrowing error for engines whose seed type is narrower than `unsigned`. Documentation-only for A1.
7. Moved-from Host and HostCore:
- The moved-from rules omit the reference accessors (`options`, `lifecycle_plan`, `embedded_resources`).
- HostCore must not hold pointers into Host members, because Host is movable.
8. Carry D-W11-06's condition into A3: a throwing `error_sink` is caught and counted. Add a B3 stop-and-report rule for IO edits.
9. Teardown with an already-joined `ThreadExecutor` resumes continuations inline inside the shutdown's own poll turn. Either dispatch after releasing ownership, or document that the executor must not be joined before the Driver is torn down (the Runtime order already satisfies this).
## Re-review scope
Only the amended text for N1–N6 and the P3 lines above. This can be checked on the B2, B3, B4, A2 and A3 task specs; no new planner round is needed.
## Checks not run
- No builds, tests or compile probes. Everything above comes from direct `sed`/`rg` reads. No Serena or codebase-memory coverage checks.
- Not read: `EpollDriver.cpp:1475-1640` (the rest of `drive_read` and `drive_write`), `ThreadPool.hpp`, `ResourceGraph.hpp`, the `RuntimeHost.cpp` tests, and TASKS/STATE.
- `M-TIME-03.md` and `M-FUNCTIONAL-03.md` were only partly read.
- A new commit, `a8a9249` (D-039), landed during the review. I checked it: it does not touch the W11 contracts.
@@ -0,0 +1,80 @@
# Wave 11 PREFLIGHT re-review of the contract addendum
Task ID: W11-PREFLIGHT-2
Role: opus-reviewer
Status: READY
## 1. Context and baseline
- Repo root / cwd: `/home/faumaray/Projects/VoidLibrary`; branch `feat/roadmap-p2-wave11` from `main`
`38436b1`. Uncommitted root prep: workflow docs, roadmap area-plan edits
(`docs/roadmap/{modules/Functional.md,subsystems/IO.md,subsystems/Runtime.md,MIGRATION.md}`), and new
enumerators `AsyncErrorCode::closed=9` (→cancelled), `IoErrorCode::sync_failed=12` (→io),
`RuntimeErrorCode::{self_join=8, shutdown_incomplete=9}` (→conflict). Untracked user files
(`.env`, `WG.conf`, `keys`, `jev_token`, `.serena/`, `.vbs/`, dotfiles) are not inputs.
- Baseline `38436b1`: `VoidTests` 1,484 discovered, 1,480 passed, 4 skipped, 0 failed.
- First PREFLIGHT verdict CHANGES_REQUIRED: `docs/agent-workflow/tasks/W11-PREFLIGHT-OUTPUT.md`.
Original plan: `W11-PLAN-OUTPUT.md`. Planner addendum answering it: `W11-PLAN-REV1-OUTPUT.md`.
Root disposition: `docs/agent-workflow/DECISIONS.md` D-038.
## 2. Objective and deliverables
Fresh, independent verdict (READY / CHANGES_REQUIRED / INSUFFICIENT_EVIDENCE) on whether the
addendum plus root doc edits resolve findings F1–F13 and the P3 list without introducing new
defects, so implementation specs can be written. Severity-ranked findings for anything still
open or newly introduced.
## 3. Scope and non-goals
In scope (from the first review's re-review scope): revised S-IO-03, S-IO-04, S-RUNTIME-03
contracts (F1–F6, F9, F13); AsyncChannel, Retry, EventBus, TimerQueue invariants (F7, F8,
F12); area-plan/MIGRATION edits (F10); the three planner adjustments (signal adapter closes
fd off-owner; syscall shim exception; Observable FIFO ordering change). Also check the
`poll_once` concurrent-caller choice (`busy`), the `wake_closed_` atomic argument, the
`FileState` close-request reserved capacity, and `ThreadExecutor::idle()` use in phase 9.
Non-goals: re-reviewing parts confirmed sound in the first review, style, other waves.
## 4. Files to inspect
`docs/agent-workflow/tasks/{W11-PLAN-OUTPUT,W11-PREFLIGHT-OUTPUT,W11-PLAN-REV1-OUTPUT}.md`,
`docs/agent-workflow/DECISIONS.md` (D-038), `git diff` of the root prep, and source cited by
the addendum: `src/IO/EpollDriver.cpp`, `include/Void/IO/{Types,Driver,Stream}.hpp`,
`include/Void/IO/Detail/Backend.hpp`, `include/Void/Async/{Executor,Operation,TaskScope,EventBus,Observable}.hpp`,
`include/Void/Runtime/{Host,Options}.hpp`, `src/System/SignalWatcher.cpp`, `src/IPC/Session.cpp`
(poll_once result use), `include/Void/Memory/BudgetResource.hpp`.
## 5. Write ownership and coordination
Write scope: none
Allowed commands: read-only `git`, `rg`, `ls`, `sed -n`, Serena/codebase-memory read tools; optional
probes only under `/tmp/void-w11-preflight2-probe`. A root subset build runs in
`/tmp/void-w11-prep`; do not touch it.
## 6. Implementation or investigation approach
1. For each F1–F13 and P3 item: state RESOLVED / PARTIAL / UNRESOLVED with evidence.
2. Look for new hazards the resolutions introduce (e.g. raw waker pointer lifetime, `busy` from
`poll_once` breaking existing callers that loop on it, reserved close capacity unbounded,
phase-9 idle wait vs inline-resume after join, `~HostCore` unbounded shutdown on destruction).
3. Check the area-plan edits are consistent with the addendum and with D-001..D-038.
## 7. Interfaces and data contracts
Not applicable for new authorship: review the addendum's signatures as written.
## 8. Dependencies and integration
A1 (M-FUNCTIONAL-03) and B1 (M-TIME-03 Timer) may be dispatched in parallel with this review
(D-038); report any finding affecting F8/F12 explicitly so root can correct them.
## 9. Edge cases security and performance
Same list as the first PREFLIGHT: fd reuse, signal masks, partial start, TaskScope destructor,
ManualClock + blocking waits, inline resume after join, retained buffers, tombstones.
## 10. Acceptance criteria
1. Verdict with justification. 2. Each F1–F13/P3 item marked RESOLVED/PARTIAL/UNRESOLVED.
3. New findings have severity, location, trigger, impact, evidence, recommendation.
## 11. Verification commands and evidence
Read-only inspection, e.g. `git diff -- docs/roadmap include/Void`, `rg -n "poll_once\(" src include`.
## 12. Constraints and stop conditions
No edits, commits or network; no spawning. Mark INSUFFICIENT_EVIDENCE rather than guess.
## 13. Authorization and decisions
Root decisions D-034, D-038 under user decisions D-027/D-031. Technical check only.
## 14. Return format
Task ID; verdict; per-item status table; new findings P0→P3; checks not run. Compact.
@@ -0,0 +1,163 @@
# W11-PREFLIGHT output (opus-reviewer, 2026-11-29)
Verbatim agent return. Advisory input; root dispositions are recorded in `DECISIONS.md`.
**Task:** W11-PREFLIGHT. **Verdict: CHANGES_REQUIRED.**
The plan's direction is sound. The layering holds, no `INTERNAL_DEPS` change is needed, no two packages own a path at the same time, the gates G1–G5 contain no cycle, and almost every baseline claim matches the source. It is not yet complete enough to write specs from. There is one P1: the plan has no rule for what happens to driver teardown on a worker or poll thread. Eleven P2s need a fix or an explicit risk acceptance before dispatch.
Paths below are relative to `/home/faumaray/Projects/VoidLibrary`. "Plan" means `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md`.
## P1
**F1. S-IO-03: no destructor or teardown-thread rule once the driver owns threads.** (Inferred defect if the spec is written as the plan reads.)
- **Location:** plan :542-548. `Driver::~Driver` at `src/IO/EpollDriver.cpp:1737-1742` and `~EpollBackend` at :953-963 both call `shutdown_and_join()` and ignore the result.
- **Evidence:**
- `Driver::poll_once` (:1843-1847) does not hold its own reference to the backend during a turn.
- Streams hold only a `weak_ptr` to the backend (`include/Void/IO/Detail/Backend.hpp:85-125`). Stop forwarders lock it briefly (:279-285). So the last owning reference can drop on any thread.
- **Trigger:** the plan makes `shutdown_and_join` return `self_join` on a worker or during poll dispatch, and makes it block until the poll turn and the workers finish. Then either:
- `~Driver` or `~EpollBackend` runs on a file worker or the poll thread. The self_join result is ignored, and a joinable `std::thread` is destroyed or joins itself, which calls `std::terminate`. Or the poll turn waits on itself and deadlocks.
- The last backend reference drops on a worker or poller.
- Also, after `ThreadExecutor::join` the plan resumes coroutines inline, so a coroutine can run on a file worker and destroy the `Driver` or a `File` there.
- **Impact:** abort or deadlock on the main teardown path every 1.x IO user takes (IPC, SystemAsync, CryptoAsync, Storage, Runtime).
- **Fix:** add mandatory invariants to the S-IO-03 spec:
- Only `~Driver` does a blocking teardown. It defines what happens on a worker or poll thread: a documented programmer error such as `terminate`, or deferring the join to a safe owner.
- `~EpollBackend` and `~FileWorkers` never block and never destroy a joinable thread.
- Workers and pollers never hold the last owning reference to the backend, or the pool's state is owned separately.
- Tests: Driver destroyed inside a coroutine resumed by poll dispatch, and inside a worker completion.
## P2
**F2. S-IO-03 shutdown step 5 opens a new fd-reuse hazard.**
- **Location:** plan :547, "close the fds, epoll and eventfd".
- **Evidence:** in 1.x, `epoll_fd_` and `wake_fd_` are closed only in `~EpollBackend` (:953-963). `wake()` reads a plain `int` and writes to it (:1033-1042). `enqueue_cancel` (:153-166) and `request_stop` call `wake()`.
- **Trigger:** S-RUNTIME-03 phase 7 shuts the driver down, then phase 8 stops the reactor, which typically calls `wake()`. Late stop forwarders do the same. The write lands on a closed, possibly reused, integer fd. That is also a data race that TSan will report.
- **Fix:** keep epoll/eventfd closure in the backend destructor (1.x placement), or guard `wake()` with a lock and a closed flag. After shutdown, `poll_once` must return before touching any fd. 1.x already returns early once `stopping_` is set (:1056-1058).
**F3. S-RUNTIME-03 contradicts itself on exporter vs executor order.**
- Plan :729-730 joins the executor (phase 8) before dropping component references (phase 9).
- The test at :742 asserts `exporter_destroyed < executor_joined`.
- **Fix:** drop exporter/component references after their stop finishes and before reactor/executor join (this matches the row name), or change the assertion. Decide in the spec.
**F4. S-RUNTIME-03: a repeated join after expiry has no budget.**
- Plan :719 fixes the total deadline at the first `begin_shutdown`. Plan :734 says the next call continues.
- After the first expiry, every later `shutdown_blocking` has zero wait budget. Thread joins and executor progress need real waiting, so "release → join again → complete" (:742) becomes a busy loop or a flaky test.
- **Fix:** after a total-budget expiry, later calls use the caller's new deadline. Expired phase deadlines (drain, flush) stay expired. Also say explicitly that an incomplete phase stops the sequence; plan :728 "if incomplete, retain it" is ambiguous.
**F5. Host lifecycle holes.**
- **Move-assignment:** `Host& operator=(Host&&) = default` (`include/Void/Runtime/Host.hpp:91`) destroys the overwritten state through the `unique_ptr<HostCore>` without running `~Host`. If teardown lives in `~Host` (plan :661), move-assigning over a started Host leaks joinable threads, and `std::thread`'s destructor terminates. Put teardown in `~HostCore` or write a custom move-assignment.
- **Moved-from Host:** accessors like `options()` and `state()` need defined behaviour when the core is null.
- **`~Host` on a Runtime worker:** behaviour is unspecified. The roadmap calls it a detected programmer error.
- **`~Host` off the owner thread:** a non-owner destructor cannot restore the mask, and `SignalWatcher` silently skips the restore off-thread (`src/System/SignalWatcher.cpp:27-37`). The plan (:731) must say whether the gate is leaked or uninstalled without a mask restore.
**F6. Embedded mode would shut down borrowed resources.**
- Phase 7 calls `driver->shutdown()` and phase 8 joins the executor unconditionally (plan :728-729). In embedded mode both are borrowed (`include/Void/Runtime/Host.hpp:31-56`). The roadmap says borrowed resources must outlive final cleanup.
- **Fix:** tear down by `ResourceOwnership`. Embedded `shutdown_pumping` drains only the business scope and components, and must drive IO and timers through `pump_until`; `TaskScope::join_pumping` never polls IO (`include/Void/Async/TaskScope.hpp:639-647`).
**F7. AsyncChannel: hand-off vs stop/close arbitration is unspecified (value-loss risk).**
- Plan :327-344 states only the outcomes.
- **Fix:** mandate that a waiter is claimed under the channel lock before a value moves; the stop callback must take the same lock to remove a waiter; a value is never in limbo; a sender gets either success or its value back, exactly once.
- Add a receiver-stop test (no value lost).
**F8. Retry: the default URBG is deterministic.**
- Plan :102, :137 and :228 default-construct `std::mt19937_64`, which always starts from the same fixed seed. Every process then draws the same jitter, which defeats jitter's purpose.
- House convention seeds from `random_device` unless a deterministic seed is given (`include/Void/Functional/Retry.hpp:87`; `include/Void/Resilience/AsyncPolicy.hpp:487,525-529`).
- **Fix:** seed from `random_device` by default; tests pass a seeded engine.
**F9. D-W11-05 routing: sonnet takes the riskiest code.**
- A4 (sonnet) rewrites the bounded, repeatable shutdown, poll-owner exclusion, manual-clock-sliced waits and `run()` concurrency in the same `src/IO/EpollDriver.cpp` B2 just changed. That is astra-level work.
- **Fix:** B2 delivers an internal deadline-aware shutdown/poll-owner primitive; A4 only adds the public wrappers, `pump_until` and tests. Or route that part to opus.
**F10. C-13: area plans must be updated before parallel work.**
- The plan changes contracts in area plans:
- Functional.md: the clock/sleeper adapter moves out of the separate Time header (D-W11-02).
- Runtime.md: awaited shutdown becomes blocking/polling APIs; `file_workers` authority.
- IO.md: the "driver thread" model.
- Several row prerequisites change.
- `docs/roadmap/ARCHITECTURE.md` C-13 (:246-252) requires the decision ledger and area plans to be updated before parallel implementation. `docs/roadmap/**` is missing from the root-owned list (plan :786-790). Add a root step before dispatch.
**F11. Within-step start failures are not covered (S-RUNTIME-02 acceptance).**
- The `before_step` hook (plan :652, :686) only injects failure between steps.
- Not specified or tested:
- partial failure inside `start_file_workers()`
- the reactor thread constructor throwing `std::system_error`
- `std::thread` throwing inside `ThreadExecutor::start`
- the stop budget for components during failed-start cleanup.
- **Fix:** add an IO fault hook and `io_file_workers_partial_start_failure_joins_started`, catch thread-creation exceptions, and bound the cleanup.
**F12. Async lifetimes of borrowed objects.**
- **EventBus (Injected mode):** `~TaskScope` skips joining when it runs on an executor thread (`include/Void/Async/TaskScope.hpp:562-575`). If `~EventBus` runs on a worker, dispatch frames can still touch the destroyed bus. Dispatch must reference only a shared core, or this must be a documented error. `flush()` semantics in Injected mode are also unspecified.
- **TimerHandle:** move-only and may outlive its `TimerQueue` (plan :198-199). It needs shared control state.
- **Bounded `parallel_for`:** "All started runners are always joined" (plan :358). Runners that were queued but not yet started would later touch the caller's stack. Either wait for all submitted runners (and document that nested use on the same pool is unsupported) or put runner state, including the copied `F`, in shared ownership.
**F13. File lifetime is unspecified.**
- `~File` with requests still in flight must defer the fd close until they drain; otherwise the fd can be reused while a worker still uses it.
- `File::close_and_join` on expiry should return `incomplete_shutdown` (exists at `include/Void/IO/Types.hpp:32`) and keep the fd and buffers.
- The roadmap says workers keep the descriptor until the syscall returns.
## P3
- **`retry_blocking` signature:** the template parameters have no defaults (plan :139-141), so `retry_blocking(spec, fn)` cannot deduce `NowFn` and the rest from the defaulted argument. Add the defaults.
- **Observable/Signal:** queuing nested `(old, new)` notifications and arguments requires copyable `T`/`Args`, which breaks 1.x compile for move-only types (D-029). Also state "state restored" precisely: the value stays new, as in 1.x.
- **S-IO-03 downstream build** (plan :576): omits CryptoAsync, Runtime and ConfigurationAsync, which also depend on IO.
- **Error kinds:** Runtime `shutdown_incomplete` maps to `timeout`, but IO `incomplete_shutdown` maps to `conflict` (`include/Void/IO/Types.hpp:50-52`). Align them.
- **D1 regression test needs a seam:** the double release isn't visible through the public API. Suggested deterministic trigger: an injected clock whose `now()` requests stop. That call happens between the step-1 drain and the event dispatch (:1083).
- **Mock reactor spin:** the mock `poll_once` ignores `max_wait` (:739-740), so a Runtime reactor on a mock driver busy-spins under TSan.
- **Host business scope:** the default `stop_on_first_error=true` (`include/Void/Async/TaskScope.hpp:32`) means one failing business task stops all of them, against the roadmap's per-component failure policy.
- **MIGRATION records needed** ("observable behavior" row): `shutdown_and_join` now blocks and joins; `validate_limits` rejects `max_file_queue==0`; Sync EventBus becomes snapshot dispatch; legacy `parallel_for` waits for all tasks.
- **Unspecified:** behaviour of concurrent `poll_once` callers; who owns IO files after G5; a stop-and-report rule if B3 or B4 needs an IO edit; how Runtime detects that it is running on a file worker.
- **ThreadExecutor:** `join()` can drain forever if `post()` keeps re-posting after close. `~ThreadExecutor` without `join` is unspecified.
## D1 claims (all confirmed)
- **(a) Unconditional release — CONFIRMED.** `complete_op_and_collect_tickets` releases at :448, even though `retire_op_locked` is idempotent (:391-394). `release_backend_ref` cannot be called twice safely (`include/Void/Async/Operation.hpp:185-193`); the count underflows.
- **(b) Cancel path doesn't skip finished operations — CONFIRMED** (:1332-1351). The mock path does skip them (:770-781).
- Precise trigger: a stop arrives after the start-of-turn drain (:1053) while `drive_read`/`drive_write` completes the operation (including their own stop check, :1453-1458 and :1527-1535). The end-of-turn drain (:1173) then releases a second time.
- Impact the plan omits: if the waiting coroutine has not suspended yet, `try_arm_suspend` sees a non-zero count and the coroutine hangs forever. Otherwise the counter is silently corrupted.
- **(c) Syscalls outside `mu_` without `in_execution` — CONFIRMED.** `::read` at :1466; `::send` and `::write` at :1549 and :1560. `in_execution` is used only by the mock (:653-671, 758, 774, 791, 847-850).
- **(d) Cross-thread shutdown — CONFIRMED** (:1179-1238).
- It finishes operations regardless of whether a syscall is in progress (:1186-1206). The caller can then free its buffer while `::read` is still writing into it.
- It closes the fd (:1221 → :363) while the poller still holds the integer it read at :1151, so the number can be reused.
- Additional facet: when `~Driver` is the shutdown path, the backend object itself can be destroyed mid-turn (F1).
- **"No test covers it" — CONFIRMED.** `tests/standalone/IO/IoDriver.cpp:458-508` cancels a read that never becomes readable and joins the poller before teardown.
## Other source claims
- **ManualExecutor bound — CONFIRMED.** `post` counts without a check (`include/Void/Async/Executor.hpp:128-135`); `run_one` decrements before resuming (:216-228).
- **SignalWatcher — CONFIRMED** (`include/Void/System/SignalWatcher.hpp:13-15`; `src/System/SignalWatcher.cpp:27-37,74-90`).
- **Host movable, default destructor, worker count always 0 — CONFIRMED** (`include/Void/Runtime/Host.hpp:88-92,173`).
- **Threads flags — CONFIRMED** (`tests/package/InstalledComponents.cmake:73-79,104-112`; `cmake/VoidConfig.cmake.in:97`).
- **Minor:** `tests/standalone/Async/OperationScope.cpp:135` is not a thread-backed executor; it wraps a ManualExecutor.
## D-W11-01..15
| ID | Recommendation |
| --- | --- |
| D-W11-01 | Accept |
| D-W11-02 | Accept, and update Functional.md (F10) |
| D-W11-03 | Accept; label the pinned test as defect characterization and record it for Wave C |
| D-W11-04 | Accept. System requires Threads, so a Runtime→System edge would also break RuntimeOnly. Add the off-owner rules from F5 |
| D-W11-05 | Modify (F9) |
| D-W11-06 | Accept, provided a throwing `error_sink` is caught and counted and Sync propagation is unchanged; record the change |
| D-W11-07 | Accept |
| D-W11-08 | Accept, provided IOOnly/RuntimeOnly start a real worker thread with Threads disabled; record the libc-with-integrated-pthreads assumption (IO already relies on it at `src/IO/EpollDriver.cpp:47`) |
| D-W11-09 | Accept |
| D-W11-10 | Accept; it fixes a real use-after-free when caller-stack captures outlive a throw. Record the timing change |
| D-W11-11 | Accept, plus partial-start semantics (F11) |
| D-W11-12 | Accept (`max_output_*` unused in `src/Net`, confirmed) |
| D-W11-13 | Accept; record that the C-05 defaults are deferred |
| D-W11-14 | Accept; document that nothing polls a TimerQueue under managed Runtime, so channel deadlines and `retry_async` need caller-driven polling or `pump_until` |
| D-W11-15 | Accept; align error kinds (P3) |
## Acceptance sentences not covered
- **S-IO-04:** "no IO→Runtime/Net dependency" has no check. Add `rg -n "Void/(Runtime|Net|System)/" include/Void/IO src/IO` (expect no output) plus a diff of `src/IO/module.cmake`.
- **S-RUNTIME-02:** "failure at every creation/start step" only covers failures between steps (F11).
- **S-RUNTIME-03:** "exporter-before-executor ordering" contradicts the phase order (F3). "Budget accounting" is ambiguous: only the shutdown budget is tested, not memory or admission permits.
- **M-ASYNC-04:** no test for receiver-side cancellation.
- **M-ASYNC-05:** "no captured state in use after join" is tested only for Injected mode, not the legacy Async or Sync modes.
- M-FUNCTIONAL-03, M-TIME-03 and S-IO-03 are fully mapped.
## Checks not run
- No builds or compile probes; every plan command is unverified.
- No Serena or codebase-memory coverage checks; all evidence comes from direct `sed`/`rg` reads.
- The advisor call timed out.
- Not inspected: the SystemAsync `ProcessManager` shutdown path, IPC/Storage/CryptoAsync internals, `docs/roadmap/VALIDATION.md`, `docs/roadmap/PERFORMANCE.md`.
**Re-review scope:** the revised S-IO-03, S-IO-04 and S-RUNTIME-03 contracts (F1–F6, F9, F13), the AsyncChannel, Retry, EventBus and TimerQueue invariants (F7, F8, F12), and the area-plan updates (F10).
+107
View File
@@ -0,0 +1,107 @@
# Wave 11 PREFLIGHT review of the execution-path plan
Task ID: W11-PREFLIGHT
Role: opus-reviewer
Status: READY
## 1. Context and baseline
- Repo root / cwd: `/home/faumaray/Projects/VoidLibrary`; branch `feat/roadmap-p2-wave11` from
`main` `38436b1`. Only workflow docs changed so far (uncommitted): `docs/agent-workflow/{STATE,TASKS,DECISIONS}.md`,
`docs/agent-workflow/tasks/W11-*.md`. Untracked user files (`.env`, `WG.conf`, `keys`, `jev_token`,
`.serena/`, `.vbs/`, dotfiles) are not inputs; never read or quote them.
- Observed baseline: full RelWithDebInfo `-Werror` build of `38436b1` in `/tmp/void-w11-base`:
`VoidTests` 1,484 discovered, 1,480 passed, 4 skipped, 0 failed; `ctest` 2/2 passed.
- Subject: `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md` (opus-planner output for
`M-FUNCTIONAL-03`, `M-TIME-03`, `M-ASYNC-04`, `M-ASYNC-05`, `S-IO-03`, `S-IO-04`,
`S-RUNTIME-02`, `S-RUNTIME-03`). Assignment it answered: `W11-PLAN.md`. Root decisions D-033..D-037 in
`docs/agent-workflow/DECISIONS.md`. Contracts C-01..C-14 in `docs/roadmap/ARCHITECTURE.md`.
## 2. Objective and deliverables
Independent PREFLIGHT verdict (READY / CHANGES_REQUIRED / INSUFFICIENT_EVIDENCE) on whether the
plan's contracts, ordering gates, ownership partition and failure semantics are correct and
complete enough to write implementation specs. Deliver severity-ranked findings (P0–P3) with
location, trigger, impact, evidence and recommended correction, plus a disposition
recommendation for each open decision D-W11-01..D-W11-15.
## 3. Scope and non-goals
In scope: contract soundness, missing or contradictory invariants, cross-file obligations,
hidden dependencies, layering violations, 1.x compatibility (D-029), testability of every
acceptance sentence, and the plan's factual claims about current source (especially the
claimed epoll defects "D1" in `src/IO/EpollDriver.cpp`, the `ManualExecutor` bound,
`SignalWatcher` behavior, `Host` movability, and installed-consumer Threads flags).
Non-goals: writing code or specs, reviewing unrelated modules, style nits, re-planning
other waves. Do not agree with the planner by default; verify claims in source.
## 4. Files to inspect
- `docs/agent-workflow/tasks/W11-PLAN-OUTPUT.md` (subject) and `W11-PLAN.md` (its brief).
- Roadmap rows/plans: `docs/roadmap/modules/{Functional,Time,Async}.md`,
`docs/roadmap/subsystems/{IO,Runtime}.md`, `docs/roadmap/{DEPENDENCIES,ARCHITECTURE,MIGRATION}.md`.
- Source cited by the plan: `include/Void/Functional/Retry.hpp`, `include/Void/Time/Clock.hpp`,
`include/Void/Async/{Executor,Operation,TaskScope,ThreadPool,Channel,ParallelFor,EventBus,Observable}.hpp`,
`include/Void/Async/Detail/Types.hpp`, `include/Void/IO/{Types,Driver,Stream}.hpp`,
`include/Void/IO/Detail/Backend.hpp`, `src/IO/EpollDriver.cpp`, `include/Void/Runtime/*.hpp`,
`include/Void/System/SignalWatcher.hpp`, `src/System/SignalWatcher.cpp`,
`include/Void/Resilience/AsyncPolicy.hpp`, `src/SystemAsync/AsyncProcess.cpp`,
`tests/package/InstalledComponents.cmake`, `tests/CMakeLists.txt`, `CMakeLists.txt`, `cmake/Module.cmake`,
`src/Testing/Runner.cpp` (filter semantics), existing tests in `tests/standalone/{Functional,Async,IO,Runtime}/`.
## 5. Write ownership and coordination
Write scope: none
Allowed commands: read-only `git`, `rg`, `ls`, `wc`, `sed -n`, Serena/codebase-memory read tools.
Optional tiny compile probes only under `/tmp/void-w11-preflight-probe` (never in the repo);
`dev cpp-gcc ...` works only unsandboxed. No repository writes, no commits.
## 6. Implementation or investigation approach
1. Verify every baseline claim the plan relies on against source (cite `path:line`).
2. For each NEW interface, check: invariants stated, ownership/lifetime of borrowed objects,
exactly-one-terminal-result, stop/expiry/completion races, callbacks outside locks,
overflow-safe time arithmetic, bounded resources, error mapping into existing domains.
3. Check gate order G1..G5 and the A/B partition for overlapping writes, impossible orders,
or hidden edges the plan missed (e.g. Runtime needing Timer, Host move with live threads,
IO `Types.hpp` edited by both root pre-commit and B2/A4).
4. Check layering against `DEPENDENCIES.md` rules 1–2 and D-015 (Functional std-only),
and installed consumers IOOnly/RuntimeOnly (`-DCMAKE_DISABLE_FIND_PACKAGE_Threads=TRUE`).
5. Check 1.x compatibility: `JitterMode` relocation, `ExponentialBackoff` users in Resilience,
EventBus/Observable behavior changes, legacy `parallel_for` change (D-W11-10).
6. Check that each acceptance sentence of the eight roadmap rows maps to at least one
deterministic test in the plan.
## 7. Interfaces and data contracts
Not applicable for new authorship: you review the plan's proposed interfaces as written in
`W11-PLAN-OUTPUT.md`. Existing contracts: `Void::Functional` error domains (`Error.hpp`),
`Async::OperationOptions`/`AdmissionError`/`TaskScope`, `IO::Driver`/`BufferLease`, `Runtime::Host`.
## 8. Dependencies and integration
Root will convert your verdict into persisted per-package task specs. Blocking findings
(P0/P1) must be resolved before dispatch; P2 need fix or explicit risk acceptance.
## 9. Edge cases security and performance
Pay particular attention to: fd reuse after close during concurrent poll, signal-mask
inheritance and pending-signal default action, thread/fd leak on partial start failure,
`TaskScope` destructor pumping/blocking, `ManualClock` + blocking waits, coroutine resume
on a joined executor, retained buffers after shutdown timeout, unbounded tombstones.
## 10. Acceptance criteria
1. Verdict stated with justification.
2. Every finding has severity, location, trigger, impact, evidence, recommendation.
3. Each D1 defect claim is CONFIRMED or REFUTED with cited lines.
4. Each of D-W11-01..15 has an accept/modify/reject recommendation.
5. Uncovered acceptance sentences (if any) are listed per task.
## 11. Verification commands and evidence
Read-only inspection. Example: `rg -n "release_backend_ref|in_execution" src/IO/EpollDriver.cpp`,
`sed -n 430,460p src/IO/EpollDriver.cpp`, `git log --oneline f1f9ba3..HEAD -- include/Void/Async`.
Report any probe compile command and its exit status if you run one.
## 12. Constraints and stop conditions
No edits, commits or network. Stop and report INSUFFICIENT_EVIDENCE for any claim you cannot
verify rather than guessing. Do not spawn agents.
## 13. Authorization and decisions
Root decision D-034 (Wave 11 scope) under user decisions D-027/D-031. PREFLIGHT is a technical
check; it neither approves scope nor authorizes commits.
## 14. Return format
Return task ID; verdict; findings ranked P0→P3 (severity, location, trigger, impact,
evidence, recommendation); D1 confirm/refute; D-W11-01..15 dispositions; uncovered
acceptance sentences; checks not run. Compact bullets. Do not spawn children.
@@ -0,0 +1,186 @@
# W11-SPEC-REVIEW-1 output (opus-reviewer, 2026-11-29)
Verbatim agent return. Advisory input; root dispositions are recorded in `DECISIONS.md`.
**Task W11-SPEC-REVIEW-1. Verdict: S-IO-03 is CHANGES_REQUIRED and M-ASYNC-04 is CHANGES_REQUIRED.**
There are no P0 or P1 findings. Every fix below is added spec text. None needs a re-plan, a change to ownership or reopening a D-W11 decision. Each finding says whether I saw it in the text and code ("observed") or worked out an interleaving ("inferred").
- **Blocks dispatch:** S-IO-03 S1–S8, plus a root decision on S9. M-ASYNC-04 A1–A3.
- **Editorial:** all P3 items. They are clarifications and can be folded into the same edit.
Spec line numbers refer to `docs/agent-workflow/tasks/S-IO-03.md` and `docs/agent-workflow/tasks/M-ASYNC-04.md` as they are now.
## S-IO-03 (B2): CHANGES_REQUIRED
**S1 (P2, inferred): shutdown can be starved by a concurrent poller (§6 l.86-91, l.124-131).**
- **Text:**
- The spec requires a `std::mutex` acquired with `try_lock` (l.86-87).
- While stopping, a turn with no work holds ownership inside `epoll_wait` for up to `max_wait` (l.89-90).
- `advance_shutdown` takes ownership only between slices of at most 1 ms (l.125-127), and it must own the poll to close fds (l.131).
- **Effect:** a poller loop re-locks within nanoseconds after each `wake()`, so `try_lock` almost never wins. The mandatory test `io_epoll_shutdown_concurrent_with_poller_no_uaf_tsan` (l.211) and a cross-thread 1.x `shutdown_and_join` can stall for seconds or hang.
- **Append to Shutdown core:** "Ownership handoff: before each slice `advance_shutdown` sets atomic `shutdown_waiting_` and calls `wake()`. While it is set, `poll_once` on any other thread returns `busy` before `try_lock`, touching no fd and not incrementing `turns`. It is cleared once `advance_shutdown` holds `poll_mu_`. Between slices, after `advance_shutdown` releases `poll_mu_`, other pollers may run turns (R2 N3)."
**S2 (P2, observed omission): completion order, final drain and fd-close ownership are unstated (l.124-132).**
- REV1 F2 says shutdown closes operation and descriptor fds "only after it holds poll ownership" (W11-PLAN-REV1-OUTPUT.md:43). That sentence is missing from the spec.
- The step order is not given. Inferred consequence: a completion pushed after the last drain is stranded, because after shutdown `poll_once` no longer touches anything.
- **Replace l.131-132 with:** "Order: (1) `begin_shutdown()`. `advance_shutdown` calls it itself, because A4's `shutdown(options)` wraps only `advance_shutdown`. (2) Wait until no queued or active file request and no op `in_execution`. (3) Under `poll_mu_`, run a final drain of cancels, controls, file completions and close waiters. (4) Join workers. (5) Still under `poll_mu_`, close the remaining file fds (mark them `closed` and complete pending `close_and_join` waiters with success), then close op and descriptor fds. (6) Set `shut_down_` (release), then `wake_closed_`. (7) Release `poll_mu_`, then dispatch the tickets (P3-9). `self_join` misuse is detected before any state change. `begin_shutdown` only records intent and wakes the poller; it never completes or dispatches anything (F1(a))."
**S3 (P2, observed contradiction): l.107-108 has workers re-check expiry with the driver clock at dequeue.**
- That conflicts with l.92-94, with D-038 ("file workers never call … user code except the injected syscall shim") and with IO.md:95-96. `MonotonicClock::now()` is injected user code. The D1 seam clock even requests stop from inside `now()`.
- **Replace l.107-108 with:** "Expiry is checked with the driver clock in `poll_once`. The epoll wait bound includes the earliest queued-file deadline. At dequeue, a worker checks under the pool mutex, without calling the clock, the request's stop flag and the expired mark set by the last turn. Such a request completes `cancelled`/`timeout` with no syscall."
- If the root prefers to keep the worker clock read, declare the clock a second documented exception that must be thread-safe. `ManualClock` is atomic (`Clock.hpp:129`).
**S4 (P2, observed; the tests cannot assert what they are named for): `DomainOutcomeKind` is not observable.**
- `File` returns `Result<…>`, and `Error` carries only status and `system_code()` (`Functional/Error.hpp:136-235`). So `io_file_queued_cancel_not_committed_zero_effects` and `…sync_failed_unknown_errno` (l.202-205) cannot assert `not_committed` or `unknown`.
- Also, "via the existing `complete_op_and_collect_tickets` path" (l.95-96) cannot work as is. That function is typed for `Transfer` and hard-codes `cancelled`/`failed` (`EpollDriver.cpp:421-447`).
- **Add to §6:** "Observable contract:
- Queued stop gives `IoErrorCode::cancelled`; queued expiry gives `IoErrorCode::timeout` (both kIoErrorDomain), with zero shim calls and unchanged file bytes.
- Sync failure gives `IoErrorCode::sync_failed` with `system_code()==std::error_code{errno, std::generic_category()}`, matching `errno_code`.
- Internally, settle with `try_commit_error(err, not_committed|unknown)`. `Result` does not expose that kind and tests do not assert it.
- Retirement uses a retire-once path equivalent to `complete_op_and_collect_tickets`, generalized for `OperationState<void>` and the file outcome kinds."
**S5 (P2, observed omission plus inferred double close): it is unspecified whether files use the socket slot table (l.101-102, l.115-118).**
- The shutdown sweep calls `release_slot_locked(idx, true)` on every in-use slot (`EpollDriver.cpp:1209-1223`), and that closes `slot.fd` (`:362-363`). If an implementer stores the file fd in a slot, the fd gets closed twice.
- **Add:** "A File occupies a `DescriptorSlot`. It counts in `active_descriptors_`, is bounded by `max_descriptors`, and `File::id()` is that slot's `DescriptorId`. The slot has `fd = -1` and a file-kind flag, and socket paths (interest updates, `close_fd` controls, stale-event checks, the shutdown sweep) skip it. The file fd lives only in `FileState`."
**S6 (P2, inferred use-after-free): `~File` after `~Driver` must lock the pool mutex (l.115-123).**
- **Add:** "`FileState` holds `shared_ptr<detail::FileWorkerShared>` and `weak_ptr<DriverBackend>`, never raw pool or backend pointers. The raw-context waker is called only by workers, which are joined before the backend is destroyed."
**S7 (P2, observed plus inferred hang): stop flag and mock held tokens.**
- **Shared stop flag:** `request_stop()` already sets `stopping_` (`EpollDriver.cpp:282-286`). If `begin_shutdown`'s idempotence is keyed on that flag (l.124-125), a prior `request_stop()` makes it a no-op. Queued file requests are then never cancelled, and with manual stepping `~Driver` hangs.
- **Mock held tokens:** 1.x mock shutdown skips held requests (`:847-851`). The `MockController` dies with the `Driver`, so if teardown waits for those requests it deadlocks.
- **Add:** "`request_stop()` == `begin_shutdown()`, with idempotence on a separate `shutdown_begun_` flag. On mock, requests held by a token never block `advance_shutdown`; `finish_*` still completes them, and `teardown_blocking` completes any still held with `IoErrorCode::closed`."
**S8 (P2, observed ambiguity): the D1 seam test (l.212-213) can fail even with a correct fix.**
- An implementation that purges retired ops from `cancel_queue_`, or that reads the clock before the start-of-turn drain, leaves `duplicate_completions_ignored == 0`.
- **Add to the D1 bullet (l.82-85):** "Increment `duplicate_completions_ignored` each time a cancel, expiry or shutdown path meets an already-retired op and skips it. Retired ops are not purged from the cancel queue early. A turn's first `clock_.now()` comes after the start-of-turn cancel/control/file drain; the queued-file expiry scan reads the clock only when queued file requests have deadlines."
**S9 (P2, observed verification gap; needs a root decision): B2 cannot test the bounded primitive it owns.**
- `advance_shutdown`'s deadline, stop, report and slice-release behaviour is reachable only as `advance_shutdown(nullopt, {})`, through `shutdown_and_join` and `~Driver` (`Driver.hpp:98-104`, `backend_` is private).
- A4 may not edit `EpollDriver.cpp` (REV1:340, G6). A defect found in A4 therefore bounces back to the root.
- **Choose one and write it into §10/§14:**
- (a) Add a NEW test-only accessor in the `MockController` style.
- (b) "B2 lists the unexercised primitive paths. A4's IoShutdown tests are the G4 acceptance gate before B2 is VERIFIED, and fixes found there are root-owned."
**P3 (editorial):**
- **l.20-21:** fix the line citations. `StreamState`'s `weak_ptr` is at `Backend.hpp:80-116` (the file has 118 lines). The stop-forwarder lock is at `EpollDriver.cpp:589-596`.
- **l.86-88:** "`busy` only if the marker equals this backend; save and restore it for nested turns of other drivers."
- Give the busy test a deterministic hold point: the first poller is parked in a long `epoll_wait` after `turns` has incremented.
- Add a test `io_poll_once_reentrant_inline_resume_busy`, using an executor whose `post_completion` resumes inline.
- **l.89-90:** append "mock `poll_once` still ignores `max_wait` (REV1 P3)".
- **l.92-94:** carve-out: "a Driver API called from a worker is detected (`shutdown_and_join` → `self_join`). This is the only worker-side Driver call, used by `io_file_shutdown_from_worker_self_join`."
- **l.99-102:**
- Error codes: closed → `closed`, stop → `cancelled`, expired → `timeout` (as `submit_io`, `:495-506`).
- Overflow: `offset > OFF_MAX` or `offset+len > OFF_MAX` → `invalid_argument`.
- Counting: file requests count in the shared `active_operations_` until poll-turn retirement.
- **l.103-105:** "reads are unordered relative to writes".
- **l.112-114:**
- A second `start_file_workers` → `invalid_argument`.
- `file_workers==0` → success with no threads.
- After shutdown begins → `closed`.
- `run_file_work` while workers run → `busy`.
- **l.115-123:**
- `close_and_join` waits for (and does not cancel) the file's queued and active requests. Success invalidates the File.
- After an expired call, the File is `valid()` but closing. New ops return `closed`, and a repeat call waits.
- Document the difference from `ByteStream::close_and_join` (`Stream.hpp:102-120`) (F13).
- **l.128:** say exactly `Async::make_async_error(Async::AdmissionError::self_join)`.
- **l.131:** add the P3-9 documentation requirement: "the executor must outlive the Driver; an owned executor must not be joined before Driver teardown."
- **l.161-162:** `read_exact_at`/`write_all_at` mirror `Stream.hpp:126-180` with the offset advancing and one deadline. A 0-byte pwrite with bytes remaining returns an error; it must not loop.
- **l.165-166:**
- Flag map: RDWR/WRONLY/RDONLY; neither read nor write → `invalid_argument`; `truncate` requires write; `exclusive` requires create; always `O_CLOEXEC`; runs on the caller's thread.
- `adopt_file_fd` takes ownership only on success.
- **l.173:** the shim must outlive Driver teardown.
- **§10:** add tests for EINTR via the shim, zero-length/overflow/`max_file_queue==0`, files counting against `max_descriptors`, a second start, and `poll_once` after shutdown returning 0.
- **§5/§10:** `IoFile.cpp` may include only Void/{IO, Async, Time, Memory, Functional, Core, Testing} headers, or it is silently skipped (`tests/CMakeLists.txt:12-41`). `ScopedTempDir` is local to the CryptoAsync test file.
## M-ASYNC-04 (A2): CHANGES_REQUIRED
**A1 (P2, observed): "`-Werror` clean" is never actually checked (l.174, §11).**
- The warning flags are `PRIVATE` and apply only to modules that have `.cpp` sources (`cmake/Module.cmake:176-178`). `src/Async` holds only `module.cmake`.
- `VoidTests` gets no `-W` flags (`tests/CMakeLists.txt:113-123`; `cmake/VoidTesting.cmake` sets no compile options).
- Sanitizers do reach the tests: they are `PUBLIC` through `Void::Testing` (`Module.cmake:184-209`), so the TSan and ASan runs are valid.
- **Add to §11** (and to S-IO-03 for `IoFile.cpp`, optionally):
```sh
dev cpp-gcc -c bash -lc 'for f in ThreadExecutor FuturePool AsyncChannel ParallelForBounded; do g++ -std=c++26 -fsyntax-only -Iinclude -Wall -Wextra -Wpedantic -Werror -Wno-missing-field-initializers tests/standalone/Async/$f.cpp || exit 1; done'
```
Add `-freflection` on GCC 16 or later, as `CMakeLists.txt:24-26` does.
**A2 (P2, inferred hang): `join()` and the destructor when no worker is running (l.61-71).**
- If work is queued before `start()`, or after a failed `start()`, then `~ThreadExecutor` → `join()` waits for workers that do not exist.
- **Add:** "Admission before `start()` queues normally. When no worker is running, `join()` and the destructor drain both lanes inline on the caller under `ExecutorThreadGuard` (counted as `inline_after_join`) and never wait. `start()` after `close()` or after a successful `start()` → `invalid_argument`. After a failed `start()` it may be retried."
**A3 (P2, inferred race): a reservation outstanding across `close()`/`join()`.**
- `TaskScope` reserves and commits in separate steps (`TaskScope.hpp:679-732`), and FuturePool will do the same.
- **Add:** "A reserved slot counts in `admitted()` and in the bound. `try_reserve_slot` after `close()` → `stopped`. A reservation taken before `close()` stays binding: `commit_reserved` after `close()` enqueues normally. `join()` also waits until no reservation is outstanding."
**P3 (editorial):**
- **l.125:** must be `inline` (Async is header-only, so the ODR applies): `[[nodiscard]] inline Void::Result::Error make_async_error(ChannelError, std::string message = {});`
- **l.75-84 (AsyncChannel):**
- Deadlines and timers:
- Deadlines are judged by `timers->clock()`.
- Check stop, then deadline, then "deadline without timers" → `invalid_argument`, before any state change. The value is returned in `SendFailure`.
- `TimerEvent::closed` → `cancelled` (REV1 F12; today only a test name implies it).
- `schedule_at` failure: `overloaded` → `ChannelError::overloaded`, `stopped` → `cancelled`.
- Waiters and lifetime:
- `max_waiters` applies per direction; 0 → `invalid_argument`.
- Frames hold `shared_from_this()`.
- Never construct or destroy a `std::stop_callback` while holding the channel mutex.
- Destroying a suspended Task is a caller error.
- The resume executor must outlive every pending resume.
- FIFO means per-producer order.
- **l.85-90 (parallel_for):**
- At most `max_concurrency` chunks run at once, counting the caller when it runs chunks inline.
- `Kind::rejected` is not produced in this wave.
- Precedence: `invalid_argument` > `failed` > `stopped`.
- `first >= last` → success.
- Compute the range in the unsigned type of `I`.
- **ThreadExecutor:** `idle()`/`stats()` are snapshots. The switch to inline mode happens under the executor mutex. `admitted()` = queued + running + reserved.
- **FuturePool:** if creating the frame throws, release the slot and rethrow.
- **§12:** stop if `Async/Timer.hpp` is missing or differs from M-TIME-03 §7.
- **l.16:** `ExecutorThreadGuard` is at `Executor.hpp:32-51`.
## R2 and carry-over coverage
| Spec | Item | Status |
| --- | --- | --- |
| S-IO-03 | N3 | Partial. All B2 bullets are present; the owned-executor documentation and handoff liveness are missing (S1, P3). |
| S-IO-03 | N4 | Yes, l.115-123. S5 and S6 are needed to implement it without guessing. |
| S-IO-03 | P3-5 | Yes, l.212-213, but see S8. |
| S-IO-03 | P3-9 | Partial. Dispatch after release is there; the documentation is missing. |
| S-IO-03 | F1 | Yes, but contradicted by l.107-108 (S3). |
| S-IO-03 | F2 | Partial: fd close under poll ownership is missing (S2). |
| S-IO-03 | F9 | Yes, except that `advance_shutdown` must begin shutdown implicitly (S2). |
| S-IO-03 | F11 | Yes. |
| S-IO-03 | F13 | Yes, except "success invalidates the File" and the ByteStream note (P3). |
| M-ASYNC-04 | N5 | Yes, l.80-82. |
| M-ASYNC-04 | F7 | Yes. |
| M-ASYNC-04 | F11 | Yes. |
| M-ASYNC-04 | F12 | Yes, except `TimerEvent::closed`→`cancelled` is implicit (P3). |
| M-ASYNC-04 | REV1 P3 ThreadExecutor, `idle()` | Yes. |
## Write scope
The two specs' write sets are disjoint. Neither touches `Timer.hpp` (B1), Functional (A1) or Runtime (B3).
- **Driver.hpp:** it passes from B2 to A4 in sequence at G4 (REV1:339-340), so there is no concurrent ownership.
- **No build edits needed:** `src/IO/FileWorkers.cpp` is picked up by the source glob (`Module.cmake:14`), so `module.cmake` needs no edit. `File.hpp` becomes a public header through the header glob.
- **Commands select the new tests:** the module closures cover the includes, and the filters match the file stems (`Runner.cpp:205-225`), including `TimerQueue` (M-TIME-03.md:34).
## Checks executed and not run
- **Executed:** read-only reads of:
- both specs, R2, REV1, the PLAN §§ for these tasks, PREFLIGHT-2, `IO.md`, `Async.md`;
- all of `EpollDriver.cpp`, the IO headers, `Executor.hpp`, `Operation.hpp`, `Detail/Types.hpp`;
- `TaskScope.hpp` (parts), `ThreadPool.hpp`, `ParallelFor.hpp`;
- the cmake files and `tests/CMakeLists.txt`, the IoDriver tests and consumer tests;
- M-TIME-03.md §§6-10 and DECISIONS D-034/038/040.
- **Not run:** no builds, tests or compile probes.
- `Timer.hpp` is not in the main checkout, so I checked it against M-TIME-03.md §7 only.
- S-IO-04 and S-RUNTIME-02 specs do not exist yet, so disjointness was checked against PLAN §3 and the REV1 ownership tables.
- No Serena or codebase-memory coverage checks; the hooks reported partial indexing, so I read the source directly.
- **Residual for the A4 spec:** R2 N3 loops must exit on `shutdown_complete()`, but F9's public wrapper list has no public `Driver::shutdown_complete()`.
**Re-review scope:** only the amended text for S1–S9 and A1–A3.
@@ -0,0 +1,69 @@
# Wave 11 spec review: S-IO-03 (B2) and M-ASYNC-04 (A2) against contract R2
Task ID: W11-SPEC-REVIEW-1
Role: opus-reviewer
Status: READY
## 1. Context and baseline
- Repo `/home/faumaray/Projects/VoidLibrary`, branch `feat/roadmap-p2-wave11`, HEAD `99203ce`
(prep `7f95f89`, docs `a8a9249`, R2 `99203ce`) on `main` `38436b1`. Untracked user files are not inputs.
- PREFLIGHT-2 (`docs/agent-workflow/tasks/W11-PREFLIGHT-2-OUTPUT.md`) said the R2 amendment can be
re-reviewed on the task specs. Root wrote `docs/agent-workflow/tasks/W11-CONTRACT-R2.md` and draft
specs `docs/agent-workflow/tasks/S-IO-03.md` and `docs/agent-workflow/tasks/M-ASYNC-04.md`.
- Design chain: `W11-PLAN-OUTPUT.md` → `W11-PLAN-REV1-OUTPUT.md` → `W11-CONTRACT-R2.md` (R2 wins).
## 2. Objective and deliverables
Verdict per spec (READY / CHANGES_REQUIRED / INSUFFICIENT_EVIDENCE): is each spec complete,
internally consistent, faithful to PLAN+REV1+R2, implementable without guessing, with acceptance
tests covering the roadmap row and every mandatory invariant? Findings P0–P3 with exact spec line
and the replacement text you recommend.
## 3. Scope and non-goals
In: the two specs, R2 items N3, N4, N5, P3-5, P3-9 as reflected in them, F1/F2/F7/F9/F11/F12/F13
carry-over, verification commands (module lists, filters, sanitizer flags), write-scope
disjointness between the two specs and versus S-IO-04/S-RUNTIME-02 later steps.
Out: re-litigating accepted decisions D-W11-01..15; other specs.
## 4. Files to inspect
The two specs, `W11-CONTRACT-R2.md`, `W11-PLAN-REV1-OUTPUT.md`, `W11-PLAN-OUTPUT.md`,
`docs/roadmap/subsystems/IO.md`, `docs/roadmap/modules/Async.md`, and source they cite
(`src/IO/EpollDriver.cpp`, `include/Void/IO/*`, `include/Void/Async/*`, `cmake/Module.cmake:14`,
`CMakeLists.txt:13-15`, `tests/CMakeLists.txt`).
## 5. Write ownership and coordination
Write scope: none
Allowed: read-only `git`, `rg`, `sed -n`, Serena/codebase-memory reads. Two implementers (M-FUNCTIONAL-03,
M-TIME-03) run in separate worktrees; ignore them.
## 6. Implementation or investigation approach
1. Diff each spec's mandatory list against PLAN/REV1/R2; list omissions or contradictions.
2. Check every signature is consistent with existing types it names (`ComposedTransferError`,
`Transfer`, `DescriptorId`, `BufferLease`, `Coro::Task`, `Void::Result::Result`, `ThreadPool`).
3. Check acceptance tests are deterministic and map to invariants; flag untestable ones.
4. Check commands will actually select the new tests (module closure; silent skip rule).
## 7. Interfaces and data contracts
Not applicable for authorship: review signatures written in the specs.
## 8. Dependencies and integration
Root will fix the specs from your findings, set Status READY, lint, and dispatch.
## 9. Edge cases security and performance
As listed in the specs §9; flag any missing hazard from PREFLIGHT-1/2.
## 10. Acceptance criteria
1. Verdict per spec. 2. Findings with spec line + replacement text. 3. Explicit statement whether
each R2 item relevant to the spec is fully reflected.
## 11. Verification commands and evidence
Read-only, e.g. `rg -n "ComposedTransferError|struct Transfer|DescriptorId" include/Void/IO`.
## 12. Constraints and stop conditions
No edits, commits, network or spawning. INSUFFICIENT_EVIDENCE rather than guess.
## 13. Authorization and decisions
Root decisions D-034, D-038, D-040. Technical check only.
## 14. Return format
Task ID; verdict per spec; findings P0→P3 with replacement text; R2 coverage statement; checks not
run. Compact.
+38
View File
@@ -0,0 +1,38 @@
# P0 Process Test Environment Isolation
Task ID: X-BASE-01
Phase: P0
Status: APPROVED
## 1. Context and baseline
`tests/standalone/System/Process.cpp` currently invokes `/bin/echo`, `/bin/cat`, and `shell("seq 1 10000")`. On NixOS and minimal container hosts without `/bin/echo`, `/bin/cat`, or `seq` in `PATH`, those tests fail with child exit code 127.
## 2. Deliverables
- Controlled standard-library helper executable `tests/helpers/ProcessHelper.cpp` (`VoidProcessHelper`).
- CMake wiring in `tests/CMakeLists.txt` defining `VOID_PROCESS_HELPER_PATH` when `VoidTests` and `Void::System` are built.
- Updated `tests/standalone/System/Process.cpp` using `VOID_PROCESS_HELPER_PATH` instead of host `/bin/echo`, `/bin/cat`, or `seq`.
## 3. Exact files and interfaces
- `tests/helpers/ProcessHelper.cpp`:
- `echo [args...]`: prints space-separated args + `\n`, exits `0`.
- `cat`: copies raw stdin to stdout in 4096-byte chunks until EOF, exits `0`.
- `seq <start> <end>`: prints signed 64-bit integers inclusive one per line, exits `0`.
- `streams`: writes `"to_stdout\n"` to `stdout` and `"to_stderr\n"` to `stderr`, exits `0`.
- `exit <code>`: exits with parsed integer status code.
- `lines [--no-newline] [--stderr] [items...]`: emits lines to stdout or stderr.
- Invalid usage: prints diagnostic to `stderr` and exits `2`.
- `tests/CMakeLists.txt`: build `VoidProcessHelper` with C++26 (`VOID_TESTING_NO_AUTO_SCAN TRUE`) and pass `VOID_PROCESS_HELPER_PATH="$<TARGET_FILE:VoidProcessHelper>"` to `VoidTests`.
- `tests/standalone/System/Process.cpp`: replace hardcoded host commands; keep shell builtin tests (`/bin/sh` `echo`/`exit`) and `run_missing_executable_returns_code_127`; add direct argv `exit 42` and `streams` tests via `VOID_PROCESS_HELPER_PATH`.
## 4. Edge cases
- Helper binary uses only the C++ standard library (no `Void::` module dependencies) so it cannot mask failures in `Void::System`.
- Numeric parsing in `seq` and `exit` uses `std::from_chars` and rejects malformed/partial inputs with exit `2`.
## 5. Acceptance criteria
- `Process` and `ProcessStream` suites pass with 0 failures on NixOS without `/bin/echo`, `/bin/cat`, or `seq`.
- Full `VoidTests` passes with 0 failures (only existing intentional skip demonstrations in `Testing/Math.cpp`).
## 6. Verification commands
```sh
cmake --build /tmp/void-p0-base --parallel 4
/tmp/void-p0-base/tests/VoidTests --filter "Process*"
```
+33
View File
@@ -0,0 +1,33 @@
# P0 Warnings-as-Errors Isolation for Boost Headers
Task ID: X-BASE-02
Phase: P0
Status: APPROVED
## 1. Context and baseline
Building with `-DVOID_WARNINGS_AS_ERRORS=ON` on GCC 16.2.0 (`-std=c++26`) fails inside fetched Boost 1.84.0 headers (`boost/intrusive/detail/ebo_functor_holder.hpp`, `boost/beast/core/detail/string.hpp`, `boost/beast/http/span_body.hpp`) when compiling `src/Net/Http.cpp`.
## 2. Deliverables
- Mark FetchContent Boost headers as `SYSTEM` in `cmake/Dependencies.cmake`.
- Keep `-Wall -Wextra -Wpedantic -Werror` strict across all Void-owned sources in `cmake/Module.cmake`.
## 3. Exact files and interfaces
- `cmake/Dependencies.cmake`: add `SYSTEM` to `FetchContent_Declare(Boost ...)`; ensure Boost target properties preserve `SYSTEM TRUE` without modifying global warning flags.
- `src/Net/Http.cpp` (only if template instantiation inside Void TU still surfaces a Boost diagnostic): isolate strictly at the offending `#include`/site via scoped `#pragma GCC diagnostic push/pop`.
## 4. Edge cases
- Do NOT disable warnings globally or weaken `VOID_WARNINGS_AS_ERRORS` in `cmake/Module.cmake`.
- Any warning originating in Void's own code must be fixed at its source.
## 5. Acceptance criteria
- Full all-module configure/build with `-DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=ON` exits `0` with zero warnings or errors.
- Full `VoidTests` runs and passes.
## 6. Verification commands
```sh
cmake -S . -B /tmp/void-p0-werror -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DVOID_ENABLE_TESTING=ON -DVOID_WARNINGS_AS_ERRORS=ON \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
-DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src
cmake --build /tmp/void-p0-werror --parallel 4
/tmp/void-p0-werror/tests/VoidTests
```
+37
View File
@@ -0,0 +1,37 @@
# P0 Module Closures, Header Ownership, and Consumer Matrix
Task ID: X-BASE-03
Phase: P0
Status: APPROVED
## 1. Context and baseline
Audit of `src/*/module.cmake` vs `#include <Void/...>` reveals:
1. `<Void/Log/Log.hpp>` is used by `LogState`, `Async`, `System`, `Stacktrace`, `Configuration`, `Plugin`, and `Service`, yet is installed only by `Void_Log`.
2. Undeclared acyclic internal dependencies in `Containers`, `Data`, `Configuration`, `Service`, `Plugin`, `Fsm`, `Testing`, `TestingMock`, and `Log`.
3. `Core/Uuid.hpp` still leaks `<Void/Math/Random.hpp>` (resolved in `M-CORE-02`); `Functional/Detail/Repr.hpp` includes `<Void/Core/Meta.hpp>`.
4. `tests/CMakeLists.txt` fails when `VOID_ENABLED_MODULES` builds subsets, and `InstalledComponents.cmake` lacks foundation, embedded, static, and relocated checks.
## 2. Deliverables
- Extend `cmake/Module.cmake` with `EXTRA_HEADERS` / `EXCLUDE_HEADERS`; transfer `<Void/Log/Log.hpp>` ownership to `LogState`.
- Reconcile acyclic `INTERNAL_DEPS` across `src/*/module.cmake` files and introduce `Void::FunctionalCoreFormatting`.
- Filter `VoidTests` sources in `tests/CMakeLists.txt` by required `ACTIVE_MODULES` and forward `ACTIVE_MODULES`, `CMAKE_GENERATOR`, and `CMAKE_MAKE_PROGRAM` to `InstalledComponents.cmake`.
- Add `tests/package/Foundation`, `tests/package/Embedded`, and relocated-prefix validation in `InstalledComponents.cmake`.
## 3. Exact files and interfaces
- `cmake/Module.cmake`, `src/LogState/module.cmake`, `src/Log/module.cmake`
- `src/Containers/module.cmake`, `src/Data/module.cmake`, `src/Configuration/module.cmake`, `src/Service/module.cmake`, `src/Plugin/module.cmake`, `src/Fsm/module.cmake`, `src/Testing/module.cmake`, `src/TestingMock/module.cmake`
- `include/Void/FunctionalCoreFormatting/Repr.hpp`, `src/FunctionalCoreFormatting/module.cmake`
- `tests/CMakeLists.txt`, `tests/package/InstalledComponents.cmake`, `tests/package/Foundation/*`, `tests/package/Embedded/*`
## 4. Edge cases
- Do not add `Math` to `Core/module.cmake` (violates C-01); keep `Core -> Math` documented until `M-CORE-02`.
- Keep `Void/Functional/Detail/Repr.hpp` installed with `Functional` for Wave A+B while providing `Void::FunctionalCoreFormatting`.
- Fail loudly if `VOID_ENABLE_TESTING=ON` without `Testing` enabled or if 0 package consumers run.
## 5. Acceptance criteria
- Full `ctest` (including relocated `VoidInstalledComponentConsumers`) passes with `-Werror`.
- Minimal foundation subset (`Time;Math;Text;Binary;Functional;Testing`) builds and passes with external packages disabled.
- `System;Testing` without `Log` installs `include/Void/Log/Log.hpp` and passes `Process*`.
- Static (`-DBUILD_SHARED_LIBS=OFF`) and embedded `add_subdirectory` (`tests/package/Embedded`) consumers build and pass.
## 6. Verification commands
See `VERIFICATION.md` commands for `/tmp/void-p0-closures`, `/tmp/void-p0-minimal`, `/tmp/void-p0-system`, `/tmp/void-p0-embedded`, and `/tmp/void-p0-static`.
+33
View File
@@ -0,0 +1,33 @@
# P0 Compiler, Reflection, and Sanitizer Capability Probes
Task ID: X-BASE-04
Phase: P0
Status: APPROVED
## 1. Context and baseline
`CMakeLists.txt` defines ASan/UBSan/Coverage options without verifying compiler+linker support or mutual exclusion with TSan, and lacks feature probes for C++26 reflection (`<meta>`, `^^int`) and `std::expected`.
## 2. Deliverables
- `cmake/Capabilities.cmake`: `check_cxx_source_compiles` probes for `VOID_HAS_CXX26_REFLECTION`, `VOID_HAS_STD_EXPECTED`, and requested sanitizer options (`VOID_ENABLE_ASAN`, `VOID_ENABLE_UBSAN`, `VOID_ENABLE_TSAN`), plus `void_report_capabilities()`.
- Mutual-exclusion guard (`ASAN` + `TSAN`) and `VOID_ENABLE_TSAN` wiring in `CMakeLists.txt` and `cmake/Module.cmake`.
## 3. Exact files and interfaces
- `cmake/Capabilities.cmake`
- `CMakeLists.txt`
- `cmake/Module.cmake`
## 4. Edge cases
- Probes must respect existing `-freflection` flags on GNU >= 16.
- Unsupported sanitizer flags fail configure cleanly with a clear diagnostic rather than silently skipping checks.
## 5. Acceptance criteria
- Full Debug ASan+UBSan+`-Werror` build compiles cleanly and passes `VoidTests` with `detect_leaks=1:halt_on_error=1`.
- TSan subset (`Async;Time;Core;Functional;Testing`) configures, compiles, and passes tests.
## 6. Verification commands
```sh
cmake -S . -B /tmp/void-p0-asan -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug \
-DVOID_ENABLE_ASAN=ON -DVOID_ENABLE_UBSAN=ON -DVOID_WARNINGS_AS_ERRORS=ON -DVOID_ENABLE_TESTING=ON \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_SOURCE_DIR_BOOST=/home/faumaray/Projects/VoidLibrary/build/_deps/boost-src
cmake --build /tmp/void-p0-asan --parallel 4
ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 /tmp/void-p0-asan/tests/VoidTests
```
+39
View File
@@ -0,0 +1,39 @@
# P0 Reproducible Benchmark Harness and Initial Baseline
Task ID: X-BASE-05
Phase: P0
Status: APPROVED
## 1. Context and baseline
`PERFORMANCE.md` requires reproducible workload manifests, separate empty-harness baselines, median/p95/p99/95%-CI statistics over >= 5 warmup and >= 20 measured repetitions, and JSON raw sample artifacts before optimizing foundation code.
## 2. Deliverables
- `VOID_ENABLE_BENCHMARKS` CMake option in `CMakeLists.txt`.
- `benchmarks/CMakeLists.txt` and `benchmarks/FoundationBench.cpp` (`VoidFoundationBench`).
- `tests/corpus/README.md` defining seeded parser/codec corpus layout.
## 3. Exact files and interfaces
- `CMakeLists.txt`: add `option(VOID_ENABLE_BENCHMARKS ... OFF)` and `add_subdirectory(benchmarks)` when enabled.
- `benchmarks/CMakeLists.txt`: build `VoidFoundationBench` linking available foundation targets (`Core`, `Functional`, `Containers`, `Math`, `Time`, `Binary`, `Data`).
- `benchmarks/FoundationBench.cpp`:
- Flags: `--warmup <N>` (5), `--reps <N>` (20), `--ops <N>` (10000), `--json <path>`, `--filter <substr>`.
- Empty harness baseline (`harness_empty_loop`) plus 12 foundation workloads (`core_uuid_*`, `core_hash_*`, `functional_*`, `math_checked_add_loop`, `containers_*`, `binary_reader_u64_be`, `data_json_*`).
- Reports median, min, max, p95, p99 (nearest-rank), 95% CI half-width, ops/sec, raw samples, and environment metadata.
- `tests/corpus/README.md`: corpus conventions for `Binary`, `Data`, `Text`.
## 4. Edge cases
- Do not subtract harness baseline into negative latencies; report harness baseline separately.
- Must compile cleanly under `-DVOID_WARNINGS_AS_ERRORS=ON` and work in selected foundation builds.
## 5. Acceptance criteria
- `VoidFoundationBench --json /tmp/void-p0-bench/baseline.json` exits `0` and produces valid parseable JSON with all 13 records (harness + 12 workloads).
- P0 records (`STATE.md`, `TASKS.md`, `VERIFICATION.md`) updated with exact observed command outputs.
## 6. Verification commands
```sh
cmake -S . -B /tmp/void-p0-bench -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DVOID_ENABLED_MODULES="Core;Functional;Containers;Math;Time;Binary;Data" \
-DVOID_ENABLE_TESTING=OFF -DVOID_ENABLE_BENCHMARKS=ON -DVOID_WARNINGS_AS_ERRORS=ON
cmake --build /tmp/void-p0-bench --parallel 4
/tmp/void-p0-bench/benchmarks/VoidFoundationBench --json /tmp/void-p0-bench/baseline.json
python3 -m json.tool /tmp/void-p0-bench/baseline.json >/dev/null
```
+288
View File
@@ -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).
+127
View File
@@ -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.
+141
View File
@@ -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).
+151
View File
@@ -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.
+108
View File
@@ -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.
+112
View File
@@ -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. Recorded W11 changes: `Driver::shutdown_and_join` blocks for in-flight syscalls and joins file workers; `validate_limits` rejects `max_file_queue == 0`; Sync EventBus and Observable/Signal dispatch over snapshots (subscription changes take effect next pass); nested Observable/Signal updates for copyable types are queued FIFO; legacy `parallel_for` waits for all tasks before rethrowing; Async-mode EventBus handler exceptions are counted instead of terminating; legacy `retry` zero-attempt result kept until Wave C; a concurrent `poll_once` caller gets `busy`; `~Driver` on a file worker or inside a poll turn terminates with a diagnostic |
| 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.
+106
View File
@@ -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.
+124
View File
@@ -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.
+73
View File
@@ -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).
+119
View File
@@ -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).
+150
View File
@@ -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.
+212
View File
@@ -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).
+148
View File
@@ -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).
+167
View File
@@ -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).
Loaded 100 of 653 files, more files were not shown because too many files have changed in this diff. Show more