Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
800e590
ci: indent build.yml's heredoc continuations by an even width
christianparpart Nov 27, 2026
89a0c61
fix(build): configure as a subproject on a Clang without clang-scan-deps
christianparpart Nov 27, 2026
9f13d06
test: skip the seven Windows cases wine cannot hold
christianparpart Nov 27, 2026
2076055
feat(fs): descriptors resolved beneath their directory on POSIX and W…
christianparpart Nov 26, 2026
a97b90c
feat(net)!: classified resolver failures and a resolver that runs on …
christianparpart Nov 26, 2026
0804939
feat(net): endpoints, IpSocketAddress and unconnected TCP sockets
christianparpart Nov 26, 2026
f6e3640
feat(net): an EventLoop-driven datagram socket
christianparpart Nov 26, 2026
c16571c
feat(net): standard streams, pollable where the OS allows and offload…
christianparpart Nov 26, 2026
4fd593a
feat(net)!: fail-closed TLS clients, trust stores and platform chain …
christianparpart Nov 26, 2026
42afe66
refactor(net): one accept loop, acceptLoop, for serve and the servers…
christianparpart Nov 27, 2026
83dc2a3
feat(http): message types, framing table, head parser and chunked codec
christianparpart Nov 27, 2026
ba01470
feat(http): role-aware connection with streamed bodies and trailers
christianparpart Nov 27, 2026
c07908c
feat(http): coroutine HTTP/1.1 client with TLS, a keep-alive pool and…
christianparpart Nov 27, 2026
820d654
feat(http): keep-alive HTTP/1.1 server with chunked bodies and trailers
christianparpart Nov 27, 2026
6c05d53
feat(base): constant-time byte comparison and secure zeroing
christianparpart Nov 27, 2026
4d7bd5e
feat(platform): cacheHome
christianparpart Nov 27, 2026
f9b33ab
feat(fs): owner-only creation and an access scope read on the handle
christianparpart Nov 27, 2026
534a788
feat(fs): directory containment decided on opened handles, and the ro…
christianparpart Nov 27, 2026
019ee40
docs: document core::fs, core::http, the socket surface and the trust…
christianparpart Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
283 changes: 259 additions & 24 deletions .agent/reference/provenance.md

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion .agent/reference/source-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ src/core/
async/ core::async, headers but for two sources that own thread-local state:
StopToken (std:: or the fallback); Task, UniqueCoroHandle,
Cancellation, Awaitable, whenAll/whenAny (contour);
executors, AsyncQueue (planned, B1)
executors, AsyncQueue (planned, B1); Offload (offload: a blocking
call on an injected executor, resumed on the home one)
net/ core::net_types (NetError, IoResult; header-only, everywhere),
core::net (EventLoop over IoBackend, which DISPATCHES readiness to
the handlers registered with it; PlatformLoop owns the default
Expand All @@ -74,6 +75,19 @@ src/core/
hold. The WebAssembly subset is IoBackend, IHostScheduler,
HostDrivenBackend and EventLoop with PlatformLoop and TestLoop over
it; IOCP, sockets and dialling (planned, B6-B11)
fs/ core::fs: Descriptor (IDescriptorFileSystem, IDescriptor, relation),
NativeFileSystem, FsError, PathPolicy (isRootedLinkTarget), Rights
(the one rights table), AccessScope (classifyAccess); detail/ (the
path walk every resolver runs, Ancestry's decision) posix/ linux/
(openat2, mountinfo) bsd/ darwin/ (firmlink exits) windows/ (ntdll
beneath walk, owner security, stable file id rows) are private and
CMake picks one file per concern; testing/ holds
InMemoryDescriptorFileSystem; DescriptorTestSupport.hpp is test-only
http/ core::http: Message (HttpErrorCode, Fields, the validating
factories), Framing (HttpLimits, request/responseFraming, HeadParser,
ChunkedDecoder), Body, Connection, HttpClient (the per-origin pool),
HttpServer (serveHttp, errorStatusTable); testing/ScriptedConnector;
SmugglingCorpus.hpp and HttpTestSupport.hpp are test-only
tui/ core::tui_output (endo: TerminalOutput, SyncGuard, SgrBuilder,
TerminalProtocols, CursorShape, Error; links base alone; with
CORE_CPP_WITH_TUI_OUTPUT, which the full TUI forces on),
Expand Down Expand Up @@ -119,6 +133,8 @@ tests/
repositories it builds for the purpose
check-install.cmake installs the build, consumes the package, and exports from a
parent with CORE_CPP_INSTALL on and off
check-module-scan.cmake configures core-cpp top-level and as a subproject on a Clang
without clang-scan-deps, and a parent asking for modules
consumer-shared/ ConsumerSmoke.hpp: the loopback echo and the core::log line the CPM
and vendored consumer programs both run, so neither carries a copy
consumer-cpm/ a consumer's own project, added to core-cpp with CPM: asserts that
Expand All @@ -130,6 +146,8 @@ tests/
consumer-install/ a consumer of the INSTALLED package: find_package(core-cpp), core::net,
and core::testing_main where the build installed it
consumer-install-nested/ a parent exporting a target that links core-cpp's, as morph does
consumer-module-scan/ a C++23 parent that adds core-cpp and never asks for modules, as
Isoline does
scripts/
tool-versions.py prints, installs or checks the pinned clang-format/clang-tidy
clang-format.py formats or checks the C++ sources named, or --all, with the pinned build
Expand Down
41 changes: 41 additions & 0 deletions .agent/rules/async-and-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ The contract is the spec's (Part I §2, rules 1 to 6), and it is short enough to
`core::async::OperationCancelled`; a cancel from the resource (`close()`, `cancelRead()`, a
closed listener) returns `NetErrorCode::Cancelled` as a value. If a receive already completed
with bytes, the data wins.
- **A blocking OS call runs only on an injected blocking executor, through `async::offload`**; it
resumes on the home executor, and `NativeDescriptor_test.cpp`'s *native: every descriptor
operation parks on the blocking executor* holds it. The blocking executor is drained before the
home executor dies. A call that may never return (a lookup, a read of a terminal) waits through
`net::detail::ParkedCall` instead, which hands its waiter back on a stop.

## The turn, and the orderings inside it

Expand Down Expand Up @@ -1351,6 +1356,42 @@ in-process doubles (`testing::DatagramBus`, `testing::InMemorySocket`, the parki
fit is dropped and answered `DatagramWait::MessageTooLarge` -- `MSG_TRUNC` through `recvmsg`,
`WSAEMSGSIZE` -- never handed back cut short and never read as a timeout. A datagram send that places fewer bytes than it was given is
`MessageTooLarge`, never a partial write to retry: the rest resent is a second message.
- **The loop-driven datagram socket has one state machine, and its double runs it** (P13 Task 10).
`IAsyncDatagramSocket` is `AsyncDatagramSocket.cpp` over a `detail::IDatagramChannel`; the
platform channels (`posix/ReadinessDatagramSocket.cpp`, `windows/IocpDatagramSocket.cpp`) and
`testing::InMemoryAsyncDatagramNetwork`'s channel only do what the socket decided. So a refusal
-- closed, unbound, unconnected, the other family -- cannot be answered more permissively by the
double: a new state rule goes in the socket, never in a channel. A send or receive holds its own
share of the channel, so a socket destroyed while one is parked leaves the frame something to read.
- **Three kernel differences the datagram socket hides, each where it is written down.** Linux
unbinds a socket whose port the kernel chose when it disconnects (`__udp_disconnect`), so the
socket binds that endpoint again; macOS refuses an address on a connected socket's `sendto` with
`EISCONN`, so a send naming the remote is sent unaddressed; and Windows fails an unconnected
socket's next receive with `WSAECONNRESET` after an ICMP port-unreachable, so
`SIO_UDP_CONNRESET` is turned off at open. An immediate `WSAEMSGSIZE` from an overlapped
`WSARecvFrom` is answered `MessageTooLarge` at once, never waited for, and the operation is left
announced and holding itself, so a packet that may or may not follow frees it. The rebind after a
Linux disconnect takes the address `bind` was given, not `getsockname`'s connected source.
- **A standard handle's flags are the parent's, so the standard streams never set one** (P13 Task
11). `O_NONBLOCK` lives on the open file description an inherited descriptor shares with its
parent, and a shell whose stdin turned non-blocking under it reads `EAGAIN` as end of input. A
Pollable input (`classifyStreamHandle`: a pipe, a socket, a terminal) therefore waits on the loop
and then asks a zero-timeout `poll` before it reads, so a spurious readiness never blocks the
loop's thread on a blocking descriptor. A regular file and `/dev/null` are never Pollable, because
epoll refuses both (`EPERM`); a registration the backend refuses anyway (macOS kqueue, some ttys)
turns the stream Blocking for good. No Windows handle is Pollable: a console cannot join a
completion port, and an inherited pipe is not overlapped.
- **A blocking stdin read is a `detail::ParkedCall`, not `async::offload`** (P13 ruling R13):
`offload` never resumes before its work returns, and a read of a terminal may never return. A stop
hands the waiter back at once; the worker read stays the stream's ONE outstanding read, the next
read waits for that same worker (swapping in a fresh call under the worker's mutex), and what it
read is the next read's -- bytes beyond the next read's `maxBytes` are kept, never dropped. On
Windows the stop also sends `CancelSynchronousIo` to the worker's thread, recorded and forgotten
under that mutex so it can never reach the pool thread's next job.
- **A write to a pipe nobody reads is an error, not a signal.** There is no `MSG_NOSIGNAL` for a
pipe and no descriptor flag a child may set, so the standard output blocks `SIGPIPE` on the
writing thread for the write and consumes one the write raised (`sigwait`, since macOS lacks
`sigtimedwait`) before the mask returns.
- **Sharing a port buys hearing a broadcast, and nothing else.** A unicast to a shared port reaches
one socket, and which one differs by platform, so a node that shares a port to hear the segment
sends -- and is answered -- from an address only it holds (`answerFromOwnAddress`,
Expand Down
13 changes: 13 additions & 0 deletions .agent/rules/build-and-toolchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,19 @@ presets, scripts and paths.
`CMAKE_CXX_SCAN_FOR_MODULES` to OFF. Origin: core-cpp's first Portability run (FreeBSD 14.3,
clang 19.1.7), reproduced on Linux by pointing `CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS` at a
missing file.
**As a subproject that default is not there**, and the root `CMakeLists.txt`'s
`cmake_minimum_required(VERSION 3.25...3.31)` sets CMP0155 NEW in core-cpp's scope, so a C++23
parent's configure stopped at FindThreads with exit 127 (Isoline P18). The root sets
`cmake_policy(SET CMP0155 OLD)`: a directory policy, which the parent's scope does not see, under
which only a probe or target whose `CXX_SCAN_FOR_MODULES` is ON scans -- so a parent's explicit
`CMAKE_CXX_SCAN_FOR_MODULES=ON` still applies. `core-cpp.module-scan` configures both roles with
a missing scanner, and the parent that asks, which must fail. The line sits inside
`if(POLICY CMP0155)`: CMake 3.25 to 3.27 do not know the policy and refuse to configure on it, and
the hygiene check's `unguarded-policy` rule refuses a `cmake_policy(SET …)` without that guard.
**Dependencies core-cpp fetches as a subproject still scan**: each sets CMP0155 NEW with its own
`cmake_minimum_required`, and the top-level default does not reach them there. The check runs with
`CORE_CPP_FETCH_DEPS=OFF`, so a fetching subproject build on a Clang without clang-scan-deps is
unproven.
- **Run clang-format and clang-tidy at the pinned version, in a build directory of their own.**
An older clang-tidy is not a laxer one: it is silent about checks it does not have (a file
clean under 18 arrived at CI with thirteen findings from 22). The PyPI wheel finds its
Expand Down
6 changes: 6 additions & 0 deletions .agent/rules/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ Most of these rules were paid for in fastcached; the full measurements are in
everywhere and run by nothing, and an absent check looks exactly like a passing one.
`core-cpp.tree-level-coverage` refuses that in both directions, but know the rule as well as the
gate: a gate tells you that you broke it, the rule tells you what it is.
- **Test support that needs Catch2, `SKIP` or another module is a test-only `*TestSupport.hpp`**
next to the tests (`async/StrandTestSupport.hpp`, `fs/DescriptorTestSupport.hpp`), in no
`FILE_SET`, never in `testing/`, which is compiled into the module. Like a `*_test.cpp`, it is
compiled only into a test binary, which may link more than the module's row lists, so
`core-cpp.layering`'s include scan skips it as it skips the tests themselves; its self-check
plants one that reaches a module its row does not.
- **Script-driven checks are `cmake -P` scripts under `tests/cmake/`**, registered in
`tests/CMakeLists.txt`, each with a self-test that proves every rule it states refuses.

Expand Down
Loading
Loading