docs/internal/agenthub-service.md
AgentHub direct service v1
The service composes the current store, credentials, security time, invitation carrier, gateway, endpoint engine, local control, authorization registry, and audit. The public listener accepts normal peer TLS and composes a direct peer connection manager. One directory owner feeds definitely committed local-catalog values to synchronization engines over authenticated normal-peer connections on that listener. It exposes no catalog through local control or EzAgent JSONL. The gateway lists verified learned rows. Remote availability composes current publication, a unique usable binding, stable-origin route reachability and installed local production carrier support. Route reachability alone cannot make a remote endpoint usable. The production consumers run over the existing endpoint engine. Production origin admission requires the frozen endpoint descriptor and current local publication; bare fixture setup remains denied in production. Circuit bootstrap and internal fixture composition cover reservations, acquisition/settlement and joined shutdown, followed by fixed-attachment sessions with service evidence, bounded retained recovery, automatic entry retry and real signed/TLS service composition. No idle accepted origin or endpoint socket dial is authorized without the production consumers described below.
The private contract is implemented by 79 concrete administration operations plus transport cancel. The original 22 retain their shapes except for required alias tokens on status and alias-set results, and the read-only purpose field on status pending rows. The backend adds three configuration, 30 durable browse/detail, 21 runtime/audit, and three exact-action operations. DTOs, codecs, correspondence, online/offline adapters, directory projections and repair validation, result reservations, configuration/alias ownership, protected offline audit, and exact client-card carrier retirement are wired. The existing command dashboard consumes configuration, durable, runtime/audit and exact-action operations. See the command guide, service tests and test ownership policy. The direct-handshake review owns ceremony ordering.
Routing composition boundary
The service composes production routing. peers.Ready = s.startPeerSync; the directory-only predecessor is
removed. budget.go defines routing memory, exact-link runtime and control
resources without changing aggregate caps. See the
routing status and
link ownership.
Startup reserves 4 MiB data and 64 KiB control atomically before reading and
verifying the local AuthorityLineage genesis or constructing the sole RAM
table. READY reserves 512 KiB data and 32 KiB control before claims or workers.
The runtime key is the immutable exact-link ReadyLink.Done() channel identity,
not a relationship or current head. RegisterRouteRelease transfers that
charge to exact-link finalization, which joins dispatcher and managed holds
before releasing it outside locks. Registration rejection releases locally.
The engine's Reserve returns a nonnil no-op release, never the real service
budget release.
READY claims directory and route synchronously, binds through BindTable, and
calls Activate before scheduling either worker. The engine receives the lease
as its barrier and an already-activated maintenance adapter, so its supervisor
owns Step/Shutdown without activating twice or creating another worker. Every
required failure drains READY, including reservation rejection before claims.
Acquired claims close on rollback; there is no selected directory-only fallback.
Neighbor root is verified ready.Genesis; authenticated heads continue to choose
directory/mux ordering. Route ordering uses stable roots. Channel setup uses
lease.SetupDeadline; the initial exchange independently uses
channel.CommitmentTime + routing.SetupTimeout. Setup cancellation is released
before starting runtime timers.
Retirement synchronously invalidates the exact bound table contribution. The
route engine cancels and joins reader/writer, aborts I/O, waits for settlement,
and releases its explicit channel hold. The service closes the route claim only
after that joined return. Setup rollback aborts, awaits settlement and explicitly
releases the hold before closing the claim. Exact finalization owns the real
runtime charge through all those joins and dispatcher exit. One
routing.RunMaintenance owner is joined before table closure and global charge
release. Table-scoped failure invokes service.fail only after maintenance or
engine returns outside admission/table locks; ordinary service shutdown joins
all owners. It never reconnects into a new table identity in the same process.
Service.lookupRoute(verified OriginRoot) is an internal stable-root lookup.
Callers close its bounded immutable lease. Neither lookup nor admission opens
channels or creates trust, directory identities or addresses. The concrete
resource proof
retains the 32-runtime, 129-worker and 161-timer bounds. Real signed/TLS service
tests exercise the composition and unavailable remote projection. Relay uses
the frozen paired-lane extension below. Gateway direct handling, pairing,
SQLite and JSONL are unchanged.
Relay composition
Startup creates one relay.Setup and one neutral owner scope using the existing
routing table and learned directory. READY claims relay with relay.OwnerIssuer
and that scope after its directory and route claims, then installs
Setup.BindLink before the sole exact-link dispatcher starts. Missing claims or
failed binding drain that exact READY and unwind all acquired holds. Required
channel readiness still gates optional traffic. There is no second peer registry,
relationship opener, relay dispatcher or per-link relay consumer goroutine.
RelayLease.BindDispatch invokes only bounded local validation, budget/owner
reservation and pair association outside manager and admission locks. The same
proposal logic remains available through standalone Setup.RunLink. Production
uses the existing dispatcher, which launches a supervisor only after one attempt
owner has been reserved. Origin callbacks and all lane I/O run on that charged
supervisor, never on the dispatcher. Link teardown cancels and joins its attempt
supervisors before closing the relay claim. Exact-link finalization also runs
this idempotent cleanup when READY rollback prevented dispatcher startup.
If incoming mux reservation succeeds but the commit-time admission recheck fails,
ReserveIncomingPair returns the failed-but-owned pair alongside its error.
Relay retains that owner, incident claim, assembly key and service lease, then
launches its charged supervisor to abort and join RESET settlement. The
reservation callback never joins physical settlement on the dispatcher. No
OPEN_OK is emitted, capacity is not released early, and unrelated proposals
on that exact link remain dispatchable during rollback.
Pre-admission classification copies only five prefix bytes into fixed dispatcher
scratch. Incoming.CopySetup copies into a supplied bounded buffer without
allocation; SetupMatches and SetupMatchesAt compare mux-owned setup under its
mutex without cloning it or exposing mutable storage. RelayProposal.CopyPeerSetup
fills the class-prefixed 828-byte parser buffer in the exact-link assembler.
consumeProposal decodes once, then passes that same borrowed decoded value to
assembly, including validation failures. Oversized setups retain only the bounded
association prefix for poisoning and are rejected, never decoded as truncated
valid requests. Relay proposals expose no allocating setup-copy API.
Fresh attempt owner and service budget reservation precede endpoint capture and route lookup for entry and incoming setup. Incoming syntax/hop/duplicate classification remains fixed-size and uncharged by an attempt; nil new-mode directory is a local composition error. Unknown endpoints consume a reservation and promptly return it after the charged watcher joins. Directory capture and commit recheck use the atomically published, charged endpoint admission index, with no record scan/parse or allocation under Manager.mu. The paired lock order and transit's single owner across both pairs are unchanged.
The existing 6 MiB mux charge explicitly includes an 8 KiB fixed per-link
PeerDispatchScratchBytes allowance for this parser/assembler and bounded value
temporaries. Its measured inventory is 5,349 bytes; the raw peer setup is 828 bytes.
The concrete mux proof adds all 8 KiB rather than relying on unspecified headroom:
5,313,176 total bytes, leaving 978,280 bytes within the unchanged charge. Maximum
valid copy/decode and setup comparisons allocate zero payload objects before
attempt reservation. Post-admission attempt storage remains separately charged.
This is a bounded structural parser proof, not whole-attempt runtime allocation
accounting for contexts, timers, channels or goroutine stacks.
ResourceRelayMemory allows 32 counts and 3 MiB per service;
ResourceRelayControl allows 32 counts and 256 KiB. The injected
ReserveAttemptBudget atomically reserves one count plus 96 KiB data and one
count plus 8 KiB control in that service. It performs only local budget work,
including on rejection; it cannot emit synchronous audit I/O. It checks caller
and service cancellation before and after reservation and unwinds late success.
The package-global 32-slot allocator limits the sum across service instances.
Its separate 64 KiB process-lifetime structural storage is not a service startup
lease and is never reset or sponsored by a service shutdown. Each transit owns
one lease for both incident pairs, retained until joined settlement.
Service.startRelay is the retained internal relay fixture boundary. Service.startCircuit
owns internal circuit fixture invocations.
It performs one supplied-candidate attempt, preserves table-fatal routing causes,
and cannot prepare an endpoint or select a remote gateway. Setup.Stop forbids
new entries and cancels a fixed set of at most 32 entry lifecycles;
Setup.Wait joins their existing supervisors. The caller context remains their
lifecycle parent after success. Service shutdown stops entry admission, retires
peer dispatch and joins incoming attempts, joins service workers and entry
supervisors, then releases table/directory/budget state. Borrowed control storage
stays charged until its circuit owner releases it, so shutdown correctly waits
for that release rather than freeing borrowed bytes.
Cancellation sources are detached from custom caller contexts. Existing charged setup watchers and established supervisors observe the original Done/Err, deadline and values plus local service stop; no hidden propagation worker is created by relay context derivation. Semantic admission and guarded commit keep that watcher charged until join, including cancellation during directory lock contention.
Before budget success no relay worker may exist. The bounded synchronous budget callback therefore receives the actual caller context, not the detached semantic admission context. Caller Done, deadline and values remain directly observable. The return barrier checks local Stop and setup expiry and closes late partial leases before constructing storage/capability. Relay and service tests own this reservation boundary.
Without a circuit consumer the relay uses a fail-closed origin handler. It returns Denied on an accepted origin control lane, best-effort before
RESET. There is no direct-handler fallback,
AF_UNIX dial, endpoint recreation or endpoint TLS replacement. Only package
service tests can inject Options.relayOrigin, a bounded handler with an
abortable/joinable acquisition. The handler receives immutable metadata and
bounded lanes, not a peer connection or endpoint opener. New still requires
later client/circuit authentication. Reattach must acquire live matching retained
state and its existing endpoint connection, then authenticate before any paused
endpoint bytes resume. Ready permits quarantined circuit bootstrap only; it is
not authentication. Relay itself implements neither retained recovery state nor
circuit cryptography. Circuit bootstrap implements circuit possession/control
integrity, not client admission or endpoint TLS/ACL application authorization.
The separate package-private Options.circuitConsumer owns bounded bootstrap
fixture composition; production leaves it nil.
Focused TestServiceRelay* regressions exercise production TCP/TLS dispatch,
A-B-C transit, both bulk/control directions, immutable metadata, one charged
owner per Hub, caller cancellation, peer removal, entry/transit/origin shutdown,
cancellation-responsive blocked Admit, borrowed-control retention and READY
rollback before dispatcher startup. Real-mux setup tests additionally prove
entry-local cancellation/timeout attempts the frozen abort frame before RESET,
with no downstream echo and bounded fallback when control credit is exhausted. Missing endpoint and retained-entry fakes
are refused with zero direct-preparation calls and no connection to an active
registered UNIX listener. Cross-service tests prove shared slot exhaustion,
atomic failure of either budget charge and preservation of the survivor's live
slots. Tests do not claim authenticated recovery or a remote TUI milestone.
Relay adds at most five workers and five timers per charged owner, at most 160 each. Production adds zero idle per-link relay workers by reusing peer dispatch. Relay transport evidence adds real TLS diamond/line tests, eight-pair service saturation, FIN drain and fork/RESET isolation. Runtime pressure tests hold all 32 active/terminating owners charged through settlement. Allocation reductions leave a 77,824-byte non-stack model and 28,672 bytes for five stacks on Go 1.25 amd64, not an unconditional runtime bound. The contract uses the structural/live-owner standard. A hard total-runtime ceiling would require a separate reviewed contract/design change; more measurements cannot establish it. No gateway remote readiness is enabled.
Startup and shutdown
Startup opens and validates protected state and credentials before constructing workers or binding explicitly enabled listeners. Listener binding is last and rolls back as a group. Joined shutdown closes workers before releasing the Hub store.
Private administration binds owner-private, same-user AF_UNIX control.sock
through controlsocket, authenticating before EzHub hello. One shared
ezhubapi.Server owns concurrent typed dispatch and its global handler ceiling;
the existing connection budgets and parser/input/output reservations remain.
admin.ControlExecutor returns concrete results and reports internal
CommittedResult metadata for synchronous definite-commit effects and once-only
audit before terminal delivery. Typed peer removal still holds the registration
barrier and joins revoked workers. No predecessor listener or generic-parameter
adapter remains. See private administration.
Inbound mode has one local listen binding and one advertised public address;
they may differ for NAT or containers. First contact, admission, exact-pinned
reconnect, endpoint access, and application traffic all use that advertised
address. Disabled mode opens no listener.
Time and capacity
Security time has a durable nondecreasing floor. Required persistence failure latches new credential issuance and handshakes. Local-control mutations reserve time through their revision-checked owners; elapsed transport deadlines remain separate. See local control.
One finite generic global/per-source pool precedes authentication. Reserve it before worker and TLS allocation. Unauthenticated ALPN, source, and operation data cannot select a privileged budget. After closed TLS and valid state selection, ownership transfers exactly once into the appropriate invitation, ordinary-client, endpoint, pairing, or peer budget; every exit releases exactly once.
The pairing ALPN on the existing public accept owner selects strict mutual
authority TLS, never gateway or mux. Generic pre-TLS ownership transfers to a
per-authority pairing reservation before Challenge. A separate pairing
scheduler and worker/queue reserves keep pairing pressure out of client
invitation reserves. No pairing connection becomes a normal peer connection.
Fresh normal-peer TLS uses ez-agent-hub-peer/1 on the same accept owner.
The peer manager logs confirmed authenticated links with remote authority ID
and inbound/outbound direction. A closure logs the same ID and direction plus
removed, shutdown, or transport. Failed handshakes and arbitration retries
do not log successful link events. Diagnostic failure does not affect transport.
Delivery uses the peer manager's bounded process-wide dispatcher:
four workers and 128 queued events, with new events dropped on overflow. A
callback or stderr write may block forever without delaying establishment,
removal joins, fork callback/audit, or service shutdown. All four blocked workers
stop delivery for every manager until a sink returns; manager restarts do not
allocate replacement consumers. Delivery may be concurrent or out of order.
Shutdown does not flush or join diagnostic sinks, and callbacks must not use
resources torn down by shutdown. These best-effort diagnostics are separate from
the terminal fork audit callback.
Only an unambiguous active Peer head with an exact current key and generation can reach
PeerEntry; Prepared and Accepted pairing rows cannot. After TLS, the accept
worker transfers generic ownership to ResourcePeerConnection (32 total,
two per authority, 128 KiB charged per connection). The peer reserve is
separate from ordinary clients, invitations, and pairing. After reciprocal
READY, the manager reserves ResourcePeerMux before constructing the mux:
32 concurrent sessions, two per authority, 6 MiB each in the aggregate data
budget. Its 2 MiB receive windows, 2 MiB outbound queue and bounded staging
fit this charge. The mux lease ends after joined workers and channel lease
releases. Failure to reserve never creates a ready link. The gateway hands the typed *hoptls.PeerConn to peer.Manager.AcceptOwned
with the relationship request sampled during peer TLS verification before local
credential selection. Registration rechecks it under the store barrier. There
is no service callback override around manager registration. The gateway retires
and joins its transport owner before passing the authenticated lease to the
manager. It retains no fallback transport close after adoption. AcceptOwned
is synchronous and closes its lease before returning. The service owns and
joins that inbound serving goroutine before the Hub store closes. The manager
joins its scan and at most eight concurrent outbound dials; outbound-established
links retain the same authenticated per-authority peer budget until their link
worker exits. peerControl orders a successful
local removal and closure of every committed and provisional link for that
relationship genesis against registration and new channel holds before replying
to local control. A definite failed removal
leaves the link alone. No removal is sent to the remote Hub.
Peer authority discovery reuses saved-address AHLQ after failed exact TLS.
A complete signed lineage is verified before the Peer manager selects the first
unseen successor for a non-authorizing proposal. Each later successor needs
its own approval. A TLS mismatch alone does not stage evidence.
The peer manager reports uncertain store writes or poisoned-store reads directly
to the service failure owner, which cancels the service without waiting for a
periodic security-time check. Ordinary transport failures remain retryable.
The local-control executor approves or denies the exact stored proposal and
revision. Approval after any intervening store write requires restaging the
proposal under the current revision. Definitely committed decisions emit peer_transition_approved or
peer_transition_denied audit events with the stable peer identity and commit
revision. Denial uses the denied outcome. Failed, stale, cancelled and uncertain
requests emit neither success effects nor decision-success audit. Current
head changes stop new channel holds immediately and use the link owner's
bounded draining policy for existing holds. Removal resolves either current
head or genesis to the stable relationship and closes all its links.
The target accepts a first Claim or authenticated recovery on the same public
address. For recovery it checks the exact durable request, current generations,
local role and authenticated authority against the row after Challenge, before
status, Approval or Cancel work. A Prepared joining row has an exact saved
target key but no signed target generation, so its poll-first recovery, exact-Q
Claim retry use InitialPairingClient with that key. Its local Cancel remains
durable, but no Cancel is delivered because the row lacks a target-clock
deadline. Once signed Context installs durable target trust, Approval, Cancel
and later polling use exact-pinned PairingClient. The service has only the typed
initial-pairing public entry; there is no optional pinned-provider/callback
composition. The initial joining-administrator wait retains its pairing slot
for at most 300 seconds. Timeout, EOF and transport loss
release it without protocol Cancel. During each initial or recovery evaluation,
pairing joins carrier cancellation before adopting the scheduler worker's
cancellation context. It joins that callback before scheduler finish releases
the lane and worker reserve, even when graceful TLS Close blocks after the
bounded evaluation exits. Reply writes and the held-decision wait regain carrier
cancellation ownership. One connection-local close guard prevents independent
callbacks from issuing duplicate graceful closes; connection capacity remains
charged until joined cleanup. This uses the same cancellation-join-before-finish
ordering as client invitations without changing pairing's graceful close policy.
For the typed InitialPairingEntry.Serve callback, Entry retires its
pre-auth cancellation owner before handoff. The callback owns cancellation and
any graceful close while it runs and must join all transport work before return.
After return, Entry calls typed InitialPairingConn.Abort and joins transport retirement
before releasing pairing capacity, even if the callback did not close. There is
no concurrent Entry cancellation callback or fallback graceful TLS write. This
does not interrupt the engine-owned graceful close while Serve runs or change peer adoption.
Finite limits provide local failure containment, not DDoS prevention. Whole-state snapshot and invitation/tunnel/TLS owned-capacity charging are implemented below. JSONL maximum escaped-payload/queue headroom, private configuration adapters and queue-pressure classification are implemented below. Shared process-pool and broad simultaneous-capacity gates remain capacity-acceptance work. The canonical remaining proxy marker is in JSONL proxy.
Authorization and audit
service.SecurityTime establishes an independent protected horizon before the
listener opens. Its 5-second maintenance poll reserves through UTC minute
boundaries with a 20-second lead. TLS samples monotonic RAM time covered by the
definitely durable horizon; it cannot wake, enqueue or flush persistence. A
forward jump or exhausted horizon refuses fresh TLS until maintenance catches
up. Renewal failure does not stop authenticated sessions or passive local
control. Restart uses the prior horizon as a conservative floor, but renewal
does not use that restart clamp, so repeated restarts cannot inflate time.
Online and offline ControlExecutor callbacks sample their execution clock at
preparation and final WAL append. Local semantic mutations commit that time in
their own WAL transaction and do not wait for horizon renewal. A queued
protected-file job can cancel before execution without running later. Once
execution begins, its caller retains the barrier until a definitive result.
The storage contract owns
the exact sidecar, batching, replay and checkpoint-selection formats.
The authorization registry captures keyed RAM generations before looking up
committed authorization and security time outside its mutex. It rechecks the
capture, exact approval epoch, endpoint publication cut, and provisional gates
under the mutex before installing a lease or crossing BeginWork. The mutex
protects only generations, gates, indexes, and lease ownership. Store reads,
time providers, persistence callbacks, signing, and transport callbacks never
run under it. Time is sampled after the store lookup so a blocked lookup cannot
reuse an earlier pre-expiry second.
admin.Manager uses Registry.ReplaceScopedContext to install an exact
approval-epoch gate for revoke/replacement, or a selected endpoint publication
gate for withdrawal/retirement, before requesting durability. Existing leases
remain owned while the writer is pending; new matching registrations and work
are denied. Unrelated scopes continue without a global persistence mutex.
After store publication, exact indexed detachment and committed generation
fences precede gate removal. Transports abort outside all registry locks, and
the operation joins those aborts. Definite failure opens its gate without
detaching anyone. Qualified uncertainty returns no success and detaches the
possibly committed old scope. A larger regrant epoch survives old cleanup.
Exact approval-epoch and endpoint indexes avoid scanning unrelated leases.
Committed fences remain until all earlier captures and leases release their
generation references, including delayed lookups returning after gate removal.
Idle generations disappear rather than retaining an unbounded revoked-key
history. ReplaceContext retains its callback/outcome signature for private
runtime callers, but callbacks no longer obtain registry-wide exclusion.
Runtime owners must provide their own exact lifecycle ordering; a nil gate is
not a cross-owner persistence barrier.
Admission registration and post-open_ok endpoint first use call
HubStore.ObserveAuthorizationFirstUse outside the registry mutex. The store
queues finite, exact-epoch-deduplicated history asynchronously and discards a
delayed revoked/replaced epoch. Observation failure does not remove rights or
fail an otherwise valid registration. First-use fields do not authorize access.
Withdrawal preserves established work. Revocation and retirement close matching work. Audit is bounded, redacts secret-shaped fields, and latches write failure. Compromise and conflict become local terminal audit outcomes only after durable commit; remote responses remain generic.
Status and authority
Pairing administration handoff for service composition
admin.ControlExecutor.Pairing is the service-owned PairingActions bridge.
AddHub receives the local administrator's direct address, independently
entered inviting-authority check, one-time JOIN WORDS, and optional local alias.
It must authenticate the inviting authority against that check before releasing
the joining certificate, selector, or proof. It returns the authenticated
current remote authority ID, exact accepted request ID, and committed revision.
The control executor checks that the returned ID also satisfies the entered
lock. Never put JOIN WORDS in an effect, status, audit entry, or later display.
AddHub returns success only after durable authenticated Context. An earlier
prepared request remains recoverable but must not be reported as an approved
identity or a successful Add Hub. Do not hold a local-control request through
the five-minute joining decision window. The service owns the initial pairing
connection and decision channel across subsequent local-control calls. An
ApproveJoining call commits the joining approval before signaling that
channel; ApproveInviting commits the final target transaction only after a
valid locked claim and durable joining approval; CancelPairing commits locally
before best-effort authenticated cancellation when signed Context supplied the
exact target-clock deadline. All three decisions refresh the live clock after
operation owners join and at semantic preparation and final append, so a blocked alias reader
cannot carry a pre-deadline decision across equality. The initial connection's
single cancellation owner transfers to the five-minute decision context and no
continuation write extends that limit.
Pairing has separate semantic and runtime clocks. Engine.Now samples
SecurityTime.ExecutionSecurityTime for Prepared, target claim time, signed
ceremony deadlines and store decisions, including final-cut callbacks. TLS
continues to use covered TLSCurrentSecurityTime. Engine.RuntimeNow is the
unclamped clock shared with the dispatcher and both direct and routed handshake
owners. It supplies authentication, queue, challenge, worker finish, socket and
context deadlines. The existing five-second handshake/read, one-second
evaluation, twelve-second queue and 300-second decision limits do not include
the conservative restart offset. After Context durability or delivery, each end
refreshes semantic time and the committed floor, converts the target approval
cutoff to remaining duration, and adds at most 300 seconds to runtime time.
That refresh is bounded by the original runtime window and cannot restart it.
Semantic equality permits no continuation or new trust decision. Retries and
cleanup use the same runtime clock; pairing traffic writes no time horizon.
Deterministic engine fixtures without RuntimeNow retain the legacy Now
fallback. Production always supplies both clocks.
A Prepared row without Context cancels locally and does not dial or send
application bytes. The pairing engine notifies the service immediately with the
original local uncertainty error when available. The store's lifetime watcher
reads its exact first SemanticFailureCause. The service records that cause,
keeps passive control and unrelated established sessions alive, and refuses
fresh trust use through the frozen store. Remote failure remains generic.
Daemon-owned pairing recovery is removed.
Prepared and LocalApproved storage schedules no work at startup or while idle.
One private check_pairing request names the exact remote authority and request
ID, checks durable Peer access first, and synchronously runs one bounded recovery
sequence under caller cancellation. The open local pairing view owns every
repeat and its five-second pacing; closing it cancels and joins the caller.
Ordinary status is passive. Status comes first. Prepared recovery may
retry the same Claim; a matching recovered Context permits resending the same
stored approval only before the approval deadline. Accepted rows awaiting a
local decision and Cancelled rows do not poll. Cancellation makes one
best-effort fresh operation only when the row has that authenticated deadline,
after it cancels and joins any held decision or in-flight recovery owner. A
per-request cancellation barrier blocks replacement recovery registration until
the local terminal transaction and any permitted fresh operation finish.
Completion retrieval alone may converge after the approval deadline, before
existing retention expires. A post-cutoff transport failure remains temporarily
unavailable; a clean exact check without Completion reports timeout. Existing
Peer access remains active beyond ceremony retention. The initial carrier
registers exact-request ownership after constructing Q but before publishing
Prepared, and keeps the same owner through Prepared, Accepted and the held
decision. The post-commit Prepared notification remains separate. Failed
pre-publication registration retires the carrier without committing Prepared
or sending Claim. Initial and recovery owners reject one another in either
registration order. Checks defer to this carrier,
whose five-minute decision expiry cannot schedule reconnect. The service
retains exact-request exclusion and caller/Cancel joining, request-bound TLS,
uncertain-write semantic refusal, and pairing capacity accounting. It holds no connection
between requested checks and never uses an address learned from the peer. InspectPairing and InspectCard provide revision-bound, nonsecret exact-ID
preflights for control decisions. They must read the requested row regardless
of its position beyond the 64-row dashboard projection, and return only local
slot and phase (or card phase); a missing row returns conflict, never a secret
or a remote diagnostic. The store exposes narrow exact-ID lookups for these preflights. The service must recheck exact request, phase,
role, and expected revision in the writer: an inspected phase alone cannot
authorize a mutation. Pairing cancellation after activation
cannot substitute for peer removal. These methods must never promote a local
alias into the signed request, identity check, ceremony, or activation logic.
The current peer store has no advisory alias field. SetAlias and Alias on
PairingActions are local presentation operations keyed by remote authority
and exact request; the service must preserve these aliases across restart in a
separate protected local owner. SetAlias checks the expected store revision
and existence of that pairing but does not change the Hub store revision. Its
ordered non-WAL writer job forms an exact semantic revision barrier through
atomic sidecar publication. No request-facing store lock spans the write.
Approval, cancellation, removal or purge cannot pass the validated revision
between lookup and write. Each update and service startup prunes aliases whose pairing rows no
longer exist; stale entries cannot consume the bounded alias count. The alias
mutex remains separate from decision registration and cleanup. Both
Alias and SetAlias bound lock waits by caller and service cancellation,
including status reads and Add Hub after accepted selection. They recheck
cancellation after acquiring the alias lock and before atomic persistence begins.
Once that write begins, it owns completion and alias publication under the store
snapshot; cancellation does not interrupt kernel filesystem I/O or publish a
partial alias. A canceled accepted Add Hub joins its live decision worker and
releases transport capacity without changing durable Accepted restart recovery.
The local set_pairing_alias request and pairing_list.alias projection are never
part of Q, signatures, identity matching, or activation. The service does not
change the v1 store schema or accept aliases from the wire. A separate private
JSON file stores local aliases. CancelCard removes an unclaimed pairing card
by local row ID and exact revision; the store resolves its selector privately. The
bounded dashboard shows 64 pairings and pairing cards per status [page] read;
page numbers run from 0 to 63. Exact-ID commands remain available for rows
outside the first page, including after restart. Add Hub prints its returned
nonsecret authority and request IDs. Pages contain no invitation material.
The service composes direct pairing sessions, durable eligibility, fresh
normal-peer TLS, and one bounded mux per reciprocal-READY peer link. The
service directory owner receives an opaque peer.ReadyLink for the
physical link that emitted READY. It claims that exact link synchronously,
then schedules peersync.EstablishPair(ctx, lease) for one control/bulk pair.
A delayed callback for a drained or replaced link fails closed without claiming
the current replacement. The lower full authority ID from the claimed lease
opens; the other end accepts. Heads, cancellation, channels and cleanup all
belong to that same link. Both directions work on an outbound-established link.
There is no relationship-level directory claim or additional link registry.
The manager's
removal, draining, fork, failure, and shutdown barriers close the pair and join
its workers before releasing peer/mux leases. The daemon owns one shared
RAM-only learned directory and one snapshot-slot owner derived from protected
peer_connection.count, through 256. Standalone component constructors default
to sixteen slots. Disconnect retains learned contributions, while process
restart rebuilds them from peers.
The store signals only definitely committed changes of its cached public
catalog, coalesced with no queued full catalogs. Private Hub revision increments
(for example, security-time or invitation mutations) are not transmitted.
The service verifies and stages only the first immediate successor of the exact
active Peer relationship using the normal-peer link's revision-bound decision API. A fork
uses the normal-peer terminal revocation and joined cleanup. No received record creates
trust, consent, an address, or a usable endpoint route. Gateway listing projects
verified learned state with remote availability false. Routing and relay
transport use the production peer mux. Circuit authentication and bounded
retained recovery run over that mux; production remote gateway selection is
composed from the endpoint consumers below. Pairing TLS never enters mux.
Package tests own startup rollback, time serialization, capacity transfer, authorization
races, audit, credential runtime, and shutdown detail.
Transition regressions explicitly distinguish rejected TLS from AHLQ evidence staging, exercise address-free verified delivery without a direct dial target, and reopen after denial and post-rename persistence uncertainty. Denial retains the old authority for fresh TLS and rejects the candidate. An uncertain decision has no successful response/effect/audit and poisons the live store; restart strictly loads the actual complete snapshot, including an approved snapshot if the rename took effect. The bilateral remove/re-pair/live-link regression also runs under the race detector with the production pairing deadlines unchanged.
A Peer fork audit event is emitted once after a definite terminal store commit
and joined link and lineage-query cleanup. The audit validator accepts the
peer_fork_revoked event with peer scope. It contains only the stable genesis ID, not either
signed branch, public key, address, or pairing secret. A precommit failure or
uncertain persistence emits no successful fork event; uncertainty poisons the
store and fails the owning service closed.
The terminal relationship cannot approve either fork branch. Both sides must
remove locally and pair again; converging accepted heads in separate active
relationships are rejected without merging their Hub identities.
A rejected converging successor can commit a nonapprovable collision witness. It returns a conflict, not successful consent. Repeated evidence leaves the store unchanged. A later incomparable immediate successor commits the same terminal cleanup path regardless of observation order. The commit validator rechecks incoming public proof before erasing the witness and retaining only record digests; no success audit precedes that validation and durable commit.
Directory allocations (compact working values, verified selection, conflict
and snapshot state, queued updates and encoded writes) share the service's
aggregate data reserve. A separate 12 MiB directory-control resource under
the 16 MiB control pool pays for control parser frames and in-flight writes so
bulk pressure cannot consume repair/summary capacity. The directory data
resource has a 384 MiB process cap; the aggregate data cap is 512 MiB.
Maximum-catalog support does not raise either default. Scoped verification uses
one scratch graph at a time and interns independently verified dependencies;
transaction clones charge metadata rather than copying immutable graphs. The
maximum-endpoint regression covers the real default-budget startup, committed
feed replacement, direct SetLocal, and remote installation paths.
Byte-heavy regressions also fill 1,024 rows within 8 KiB of the signed-frame byte
limit, including replacement while readers retain the previous output. Decode,
verification and outbound construction transfer reservation ownership to their
retained products rather than simultaneously charging scratch and the same
retained storage again. Bulk peersync transfers its already reserved input buffer.
A cancellable construction gate prevents overlapping local-feed and peer-echo
graphs; readers and transport staging do not take that gate. Resource pressure
still rejects atomically without evicting the predecessor or changing limits.
Budget.PeakUsage records successful resource and aggregate high-water marks
under the admission lock, including concurrent reservations that polling misses.
The directory owner reserves working memory before selecting and encoding one
immutable compact value per generation. Engines share reference-counted handles,
including across snapshot retries, rather than reserving another 77 MiB encoding
workspace per peer. Retired values stay charged until their last write releases
them. Receiving and verifying a snapshot still needs its own working reservation.
These are reservation ceilings, not eager allocations.
Counts are bounded independently. Production admits one snapshot per peer,
with transfer and verification populations derived from protected
peer_connection.count, through 256 peer/mux owners. Standalone zero-argument
staging constructors default to sixteen. Reserve failure is a resource limit,
not a signature failure. Startup fails before binding when the initial catalog cannot
be reserved. Runtime local feed failure fails the service closed. A terminal directory
session error drains that link and lets the normal-peer link retry with fresh connection IDs;
it does not remove the relationship or stop unrelated peers.
Partial directory frames have a ten-second absolute completion deadline from
the first byte, even after summaries match and while mux keepalives continue.
Idle channels have no frame deadline. Timeout cleanup joins both readers and
releases parser/channel ownership before the manager replaces the link.
Directory reconciliation and conflict audit
Retained verified lineages are reconciled against every exact active Peer
relationship. Learned installs, local decisions and reconnects wake one coalesced
worker. Local reservation exhaustion and store.ErrPeerRevisionChanged schedule
one cancellable retry timer, starting at 100 ms and backing off to five seconds.
Each attempt reloads active relationships and their accepted heads. It filters
unrelated genesis IDs before signature work, then independently verifies the
complete matching lineage with cancellation before staging any successor. The
filter cannot authorize a successor or supply a dependency. Invalid or unrelated
lineage, removed relationships and denied proposals do not cause timer retries. Persistence uncertainty retains the existing store-poisoning and service
failure path. Shutdown joins this worker and cancels its timer.
After atomic directory installation, each newly conflicted ordinary signed
object emits one directory_conflict audit event. Its endpoint scope and denied
outcome contain only the public endpoint ID, record kind, signed object revision,
conflicted reason and two sorted canonical record digests in evidence_digests.
There are no frames, keys, descriptors, aliases, addresses or invitation data.
The closed audit validator permits only endpoint identity, hosting binding,
publication and revocation-list kinds. Existing 1,024-byte records and five
1 MiB audit files bound storage.
Conflict delivery is synchronous with installation under the directory lock; a subsequent repair cannot erase evidence before the event is written. Repeated witness delivery while the key remains quarantined emits nothing. A higher revision can repair the conflict, and a new conflict at a later revision emits a new event. No unbounded queue or lifetime digest history is retained. Failed verification, rejected reservations and abandoned stages emit no conflict event. Audit write failure follows the existing fail-closed service policy. Learned records and conflict evidence remain RAM-only; audit retains only public digests.
Initial pairing worker ownership
The initial joining worker owns and joins its engine task. It receives the bounded typed request handoff only after durable Context, installs the exact decision-channel registration, and notifies Add Hub. It then joins the engine, removes only its own registration, and releases transport and capacity before signaling completion. Store operations still require durable Accepted state and the exact revision before approval. Caller cancellation cancels and joins the worker. Decision registration uses a mutex separate from alias persistence, so a stalled alias I/O lock cannot retain an abandoned registration or prevent worker cleanup. Alias snapshot/write ordering under the existing store barrier remains unchanged.
Private administration retirement and deferred work
The typed server's cancellation ACK is sent after the exact handler retires,
including recovery registrations, joined cancellation callbacks, outbound
transport/capacity release and definite-commit processing. EOF and service
shutdown signal cancellation before joining. Durable terminals can survive
caller cancellation; missing ACK remains a distinct client retirement error.
The service socket tests own real recovery-carrier barriers. The subprocess
TestPairingCheckProcessFixture exposes only isolated layout/identity coordinates
and retirement events for TestPairingViewCloseJoinsProductionRecovery. That
regression uses the real view and shared client, waits at the production owner
retirement gate, then immediately reopens and starts a fresh check. It is not an
alternate production API.
Add Hub now reports definite Prepared and Context checkpoints through internal
engine callbacks with their actual commit revisions. Pre-Prepared failure
creates no row and returns an ordinary error. A later carrier or definite
Context-write failure preserves Prepared; definite Context preserves Accepted
independently of held-carrier delivery. Persistence uncertainty overrides earlier
checkpoint evidence and fails closed without an outcome. Failed initial workers
join transport, registration and capacity before replying, so the client's
immediate exact check can acquire recovery ownership. Successful Accepted
handoff retains only the existing bounded service-owned carrier. Alias-sidecar
failure produces alias_not_saved, not loss of pairing durability.
The isolated TestAddHubProcessFixture faults the initial carrier before
Challenge, after definite Prepared, or after Claim. Its config-dashboard
regression uses the real Client, AF_UNIX Server, AddHub and CheckPairing handlers,
and outbound recovery. It proves no precommit polling, immediate exact recovery,
joined close, and immediate reopen. Separate tests cover persistence ambiguity,
Context-write failure and alias outcomes. These regressions live with the
service tests.
No pairing wire or durable format changed. Routing, relay transport, circuit bootstrap and fixed sessions, bounded recovery with automatic entry retry, real signed/TLS service composition and production remote consumers and availability are described in the sections below.
Circuit composition
This section records the bootstrap composition. The retained origin and automatic entry wiring supersede its no-recovery composition, and production installs the endpoint consumers. The bootstrap bytes and ownership obligations remain unchanged.
circuit.NewEntry(relay.Entry, Bootstrapper, ReserveEndpoint) (Entry, error)
reserves before one exact relay Start and transfers the caller lifecycle to
bootstrap. There is no retry. NewOriginHandler(Bootstrapper, ReserveEndpoint, Consumer) (relay.OriginHandler, error) denies new/reattach without a consumer.
The package-private
Options.circuitConsumer and startCircuit exist only for bounded internal
fixtures, not gateway/admin/JSONL callers; production supplies the endpoint
consumers instead. Bootstrap fixtures exchange finite opaque
raw bytes then abort/join. Session fixtures Take the result into Session.Start,
exchange finite opaque duplex scripts and join authenticated circuit close or
failure. Neither reports application EOF or opens an endpoint socket.
Origin reserves before taking the offer, returns a charged acquisition promptly, and waits for Ready in its worker. The admission context is not its lifecycle. An explicit acquisition cancellation bridge joins before acquisition Wait returns. Wait never calls Attachment.Wait. Relay invokes optional OriginSettlement once, after acquisition/pump/user/borrowed-control joins and both lane settlements, on established and rollback paths.
The service charges fixed circuit_memory and circuit_control ownership
separately from actual retained circuit_ciphertext buffers. The
production capacity map owns current
limits and coexistence profiles. Each circuit lease has two idempotent gates,
circuit work joined and relay settlement joined. Capacity returns only after
both gates. Remote proof selection retains its separate directory charge.
Frozen per-direction queue limits are unchanged. Counts are finite
structural/live-owner bounds, not heap or RSS ceilings.
Service entry invocations occupy the bounded circuit cancellation array. They keep
one current result/input owner through Take and terminal join; shutdown seals
new calls, cancels active invocations and joins them. Custom caller contexts use
an explicit joined bridge, never implicit context propagation. Origin invocations
are bounded and joined by the existing relay supervisors during peer shutdown.
Entry terminal Wait joins attachment settlement synchronously without a detached
waiter. Origin leaves that settlement to relay, preventing self-join deadlock.
Typed semantic-store uncertainty from control mutations or automatic healing
enters a nonfatal diagnostic mode. The store refuses new TLS, authorization,
catalog use and semantic mutations. The service records the first failure but
keeps its context and control listener alive for passive status/browse; unrelated
established sessions remain owned. Uncertain revocation or replacement detaches
only its exact affected authorization epoch or endpoint scope. Explicit shutdown
still joins every owner. Close and Wait return the first recorded failure,
including recovery/final-healing failures, before closing the snapshot budget.
Horizon renewal failure or exhaustion is a separate fresh-use refusal, never
service shutdown. Bootstrap messages and diagnostics carry no secrets or nested
causes.
The real A-B-C fixture uses only A/B and B/C signed neighboring pairing. C rotates afterward and only B explicitly approves its successor. There is no A publication, A/C Peer or nonadjacent head approval, client admission or endpoint ACL. Both sides resolve their own complete local directory lineages. Bootstrap does not mutate pairing, authority decisions, invitations, admission or ACL state. Direct bypass, passive pairing and remote unavailable gateway policy remain unchanged. Bootstrap composition feeds the reliable fixed sessions; recovery and remote application composition are described in later sections.
Shutdown phases and terminal outcomes
Focused real-topology tests now call origin Service.Close while its acquisition
is blocked before Ready, while it owns an untaken BootstrapResult, and after Take
has transferred a SessionInput. Entry Close additionally covers an untaken
result. Close itself triggers cancellation; fixture release channels do not.
Before-Ready coverage observes the real service lease's circuit mark and holds
its Close return at a completion barrier. Established origin coverage borrows a
real relay control message: circuit/consumer and acquisition Wait return while
Attachment.Wait and Service.Close remain blocked and both circuit and relay
charges remain live. Releasing that borrowed owner permits relay settlement and
Close returns with zero data/control circuit and relay usage. The entry untaken
case verifies the current invocation/bridge remains charged through its final
completion join even after result Wait has joined the attachment.
Standard and custom caller contexts cover these shutdown phases, blocked entry settlement, healthy-circuit-preserving resource denial, proof-phase bootstrap loss and fatal security-time persistence failure. The custom context detects implicit context propagation by its Done call stack; joined completion precedes final budget checks. Real-mux failed OK publication also covers both parent kinds. No test adds a transport or changes the production worker/resource allowance.
The finite fixture consumer retains script, circuit-lifecycle, result Wait, attachment Wait and reservation-close outcomes separately. Intentional fixture abort is not a script failure or application EOF, but its terminal error is not discarded. Concurrent BootstrapResult Wait tests compare every return with the same cached terminal outcome for both roles after healthy bootstrap cleanup and induced post-bootstrap attachment failure. Entry Wait collects a circuit caller cancellation and the typed relay settlement failure together. Origin Wait reports only circuit-owned failure, without joining relay's supervisor; a healthy origin Wait that initiates its own abort can return nil because it owned no prior circuit failure. That nil result does not mean authenticated application EOF. No production prerequisite defect was found by these added tests.
Fixed session composition
This section records the fixed-attachment session composition. Retained recovery keeps the same session on attachment loss and composes automatic replacement; the following bootstrap/byte-edge obligations remain in force.
The service keeps the same internal Options.circuitConsumer and counted
startCircuit invocation for fixtures. Entry/origin
constructors install the bootstrap request's private ownership-role anchor.
The service bootstrap wrapper preserves it. Bootstrap rejects a differing public
Role before proof/TLS allocation and uses the anchor for TLS, result ownership
and settlement. Entry failures abort/join Attachment.Wait and release both lease
gates; origin failures leave settlement to relay to avoid an acquisition cycle.
Real constructor regressions alter public Role to the opposite valid role, zero
and an invalid value under standard/custom callers, cancel during held cleanup,
and prove zero proof work, no consumer entry and exactly-once gate release. A bounded consumer
calls BootstrapResult.Take, constructs a starter with
NewSessionStarter(SessionConfig{Clock: MonotonicSessionClock{}}), then calls
starter.Start(input). The constructor returns a starter/error; Start consumes every field on success
and error. The returned Session provides Read/Write/CloseWrite, Abort/RTT and
terminal Wait. The consumer must return only after Wait. Authentication and
exact TLS retirement still precede any session allocation or raw I/O.
The invocation remains alive through Take and session Wait. Entry's lease wrapper holds its circuit mark until the invocation bridge joins; the underlying lease also requires local relay settlement. Origin's reservation returns only after session/acquisition join and relay's optional settlement callback. Session Wait joins six fixed workers and public byte users before releasing storage and clearing material. Entry joins Attachment.Wait itself; origin never joins the supervisor that is waiting for its acquisition. Custom callers use explicit joined Background-rooted bridges. No new settlement worker is introduced.
Service session fixtures exercise the actual result-to-session transfer over signed/TLS one-relay and two-relay paths, exact binary bytes beyond retained budgets, authenticated close, RX backpressure, directory updates and unrelated mux progress. Actual ACK wire capture/MAC verification is a separate sole-owner pre-Start probe. Preference changes leave the admitted full path and attempt fixed. Without recovery, link removal, verified fork, transport loss and replacement destroy sessions; the recovery fixtures instead retain the session and recover through a fresh attempt, including removal/fork alternate-path cases. A token never mutates an existing attachment.
Shutdown evidence distinguishes local joins. An entry reservation completion barrier after worker/API join holds its invocation and Close; an origin acquisition barrier after Session.Wait holds origin relay settlement. Origin does not thereby hold entry-local pair settlement. Borrowed-control topology tests and real-mux component tests own the actual blocked Attachment.Wait proof. Standard/custom parents, invalid public roles and both valid-role swaps after real Take, and concurrent/repeated Wait preserve settlement authority, cached results and zero joined data/control charges. Start requires the public Role to match Take's immutable private local-role anchor before session allocation. Entry rejection joins Attachment.Wait; origin rejection leaves settlement to relay. Explicit zero-anchor package fixtures still require a valid Role.
The authorized review correction also fixes locally generated RESET delivery.
The sole session control writer makes one nonwaiting opaque terminal-control
admission to the existing relay writer/abort slot after canceling ordinary sends.
Relay retains its existing one-second abort-forward deadline and separate charges;
ordinary occupied slots fall back to immediate abort. Context-aware control close
keeps cancellation from stranding that sole writer. The signed/TLS origin-Abort
fixture blocks byte users, aborts the session itself and joins acquisition plus
relay settlement without an origin self-join or retained material. This is not a
physical delivery guarantee on a stalled socket. The earlier clock prerequisite
uses the specified stateless MonotonicSessionClock type.
The fixed session is fixed-attachment circuit work, not application acceptance. The circuit owner describes the terminal-state split, retained queues/cursors/material and bounded attachment-only joins used by recovery. Current service composition uses bounded live-owner acquisition and automatic fresh-attempt orchestration, never an accept-any reattach handler. The endpoint consumer carries inner endpoint TLS through the existing ACL/open engine before remote rows are enabled. Direct entry-equals-origin preparation and passive pairing remain unchanged. The circuit byte layer grants no socket authorization and adds no application JSONL, schema or dependency change. Retained recovery and retry compose with it as described below.
Recovery composition contract
The recovery design defines the circuit recovery bytes and lifecycle. This section defines the service composition. Nil consumer denial, direct local service, public/private JSONL, schema and existing trust ceremonies remain unchanged.
Circuit service composition owns a demand-grown retained-owner registry under configured admission, prepaid metadata and the counted service lifecycle. Register only after successful bootstrap transfer at Session.Start. Registry rows retain immutable endpoint/entry/origin/session bindings, original material, queues and the same byte edge. A provisional origin reattach acquisition must hold a real live matching row before returning relay OK. It cannot accept an idle placeholder or call the endpoint engine to recreate lost state. Inner TLS can still be in progress; recovery preserves its stream and object. Consumer runs once per original session, never once per replacement attachment.
service/circuit.go separates service/client parent cancellation from
per-attempt cancellation. The initial acquisition's Attachment.Done does not
terminate the persistent consumer parent. Retained registry removal
seals new holds; service stop cancels every persistent owner and joins byte/API/
MAC/I/O users, attempt acquisitions and settlement before returning its lease.
Do not keep a failed origin acquisition blocked in Session.Wait: relay is joining
that acquisition before settlement. Origin Wait remains circuit-only; entry
synchronously joins its own retired Attachment.Wait. No detached settlement
waiter, per-attempt consumer, implicit custom-context bridge or uncharged worker
is allowed.
The entry recovery scheduler consumes the existing local routing Table.Lookup, CandidateView/AdmissionToken and LookupLease.Changed. Close all leases, including nonnil NoRoute results. A replacement calls relay.Entry.Start with ModeReattach, fresh ordinary exact-link admission and the circuit-owned authenticated Setup. It never calls Bootstrapper or PrepareEndpoint, learns an address or changes an established path. Eligible peer links may be reused; fresh links still pass normal peer TLS, approved trust, mux and READY without repeating pairing.
Fixed 65-second grace begins at declared failure, immediately for explicit transport loss and at the existing liveness boundary for silence. Route refresh, old notifications, retries and successful writes never extend it. Existing absolute 30-second pending FIN/EOF/close deadlines continue and win if earlier. Client-entry loss, inner TLS failure, revocation, store fatal causes, retained state/process loss and service stop remain terminal. Attempt errors and notices carry physical provenance so an old attachment cannot cancel the replacement.
Recovery does not enlarge payload allowances. Fixed endpoint leases cover candidate metadata and the lifetime service registry allowance covers retained indexes. Each old or candidate relay attempt remains separately reserved and charged through settlement. Preserve the eight-worker endpoint ceiling and one session timer by replacing old acquisition/invocation bridges, not stacking new retry owners. Admission reserves before allocation. Real service fixtures must prove alternate/restored paths, pre-inner-TLS recovery, lost replies, unchanged trust/ACL and publication withdrawal behavior, no duplicate consumer, old-notice isolation, healthy circuit progress and zero joined charges on shutdown. Production remote endpoint application and gateway rows come from the endpoint consumers below.
Retained acquisition seam
initCircuit installs circuit's NewRecoveringOriginHandler with the service
lifecycle parent. A nil Consumer denies both modes. An internal
consumer's Session.Start registers the actual retained origin owner. ModeReattach
acquires that owner before relay Offer.Take/Acceptance, with one held candidate
through settlement and no repeated bootstrap, Consumer, endpoint preparation or
dial. The original attachment acquisition can settle without joining the terminal
consumer; the retained endpoint lease still waits for the consumer and all origin
attempt settlements. Service stop seals admission, cancels retained sessions and
joins their consumers alongside its existing invocation and relay shutdown gates.
The explicit circuit.Reattach operation supplies one fresh entry-selected
immutable attempt. It does not install service route lookup/retry orchestration.
The entry-supervisor and service owners own that surrounding integration. Codec,
authentication, replay and replacement installation are implemented, with replay/live
admission checks and paired fault coverage. These are
not declarations or accept-any handlers. The circuit owner records their exact
seams and test evidence.
Real signed/TLS fixtures cover withdrawal for a matching retained session,
quarantine/auth rejection and post-replacement duplex bytes. These fixtures use bare internal consumers; the
endpoint TLS/ACL/application consumer and remote availability are separate.
Internal entry retry wiring
Internal startCircuit uses circuit.NewRecoveringEntry with the service's
existing RAM routing table and relay Setup. The initial supplied path remains
exact. After bootstrap Take and Session.Start, the retained entry session owns
automatic replacement lookup and paced, sequential Reattach attempts. No second
consumer, bootstrap or endpoint reservation is created.
The invocation's pre-transfer cancellation bridge retires and joins at Take. SessionInput carries the original caller as an additional terminal parent; the persistent session bridge watches it while service shutdown still cancels the tracked invocation. Retry reuses the retired bridge's worker position. The endpoint lease remains charged through session/API/retry joins, invocation join and relay settlement. Without a consumer both new and reattach offers are denied. Real-service composition and evidence follow; the endpoint consumer sections own production endpoint/application composition.
Real service recovery composition
The internal service consumes the complete retained circuit implementation.
initCircuit installs one NewRecoveringOriginHandler with the service parent;
startCircuit uses NewRecoveringEntry with the existing RAM routing table.
Production supplies no Options.circuitConsumer for these fixtures. This
composition itself adds no gateway/admin remote open, remote endpoint
preparation, endpoint socket dial or remote availability.
A counted entry invocation reserves its endpoint before allocating phase work. Bootstrap Take joins the invocation bridge and transfers its worker position to the single retry supervisor. The retained session watches the original caller and service parent. Origin Session.Start registers one actual retained owner; reattach acquires the matching immutable endpoint/entry/origin/session binding before relay acceptance. The consumer is invoked once for the original session, not for each path. Authentication and replay reuse its material, queues, partial read offsets, close state and byte edge.
The entry alone leases routing's atomic selected/ordered alternative projection.
LookupLease.Changed wakes lookup without bypassing pacing. Each fresh attempt
passes the complete candidate and exact physical-link token to relay. Existing
ATTACHMENT_ABORT/RESET reports remain best effort and attempt-scoped. Lost reports
fall back to session liveness. A route change never edits a live attachment,
creates an application connection or asks a relay to choose a suffix. Fresh peer
links still pass normal TLS, trust, mux and READY checks. Old tokens cannot admit
paths on restored physical links.
The origin registry seals new holds on stop. Original acquisition Wait joins only original attempt work, not terminal consumer work. Late original Abort, Wait, result and settlement cannot clear the replacement candidate hold or abort its byte edge. The original endpoint reservation remains charged through terminal session/consumer joins and every incident attempt's settlement. Entry's invocation gate additionally joins its surrounding owner. Shutdown cancels persistent owners and pending attempts, then joins invocation, retained consumer, relay and incident-link work before releasing service storage. These are current runtime owners, not accepting placeholders.
A successful retry context also parents its relay attachment. Clean terminal publication now leaves that context live until entry Attachment.Wait settles; Session.Wait cancels it before marking final settlement. Abnormal termination and a blocked pre-READY attempt still receive immediate cancellation. This fixes a real-service regression where authenticated EOF and exact recovered bytes succeeded but entry Wait returned CodeCancelled during clean drain.
The service recovery tests cover automatic line restoration with 16 MiB each direction and preserved partial reads, diamond alternate/restored-original paths, an independent healthy circuit, withdrawal, delayed original cleanup and pending half-close. Diamond peer-removal and verified-transit-fork cases also require automatic alternate installation, exact bytes, unchanged healthy circuits and fixed consumer counts. Caller cancellation and entry/origin shutdown are exercised at both acquisition before READY and authenticated-confirmation/origin-install boundaries, using the real service retry supervisor rather than a manual relay attempt. They join the retry/invocation, retained acquisition and relay settlement once, return endpoint charges, and prove all global routing lookup slots reusable. Finite control pressure and exact lost-notification/deadline boundaries remain with the existing real service and controlled-clock owners. No real inner endpoint TLS/application consumer is part of this evidence, and no aggregate acceptance claim is made here.
Routing-clock and exact grace regressions
Options.RoutingClock is optional; nil retains production routing.RealClock.
The selected clock is shared by the routing table, route engines and expiry
maintenance. Relay setup and peer paired admission translate only the remaining
setup allowance between table-clock and physical transport domains. The table's
original validation closure stays in its own domain; mux deadlines, setup
contexts, commitment times and settlement remain physically bounded. The route
engine's initial-exchange deadline translates the remaining physical allowance
from OPEN commitment into the routing clock. Its maintenance adapter steps peer
tickets with physical time and translates only the returned timer deadline;
stored ticket deadlines and zero deadlines remain unchanged. No clock or
timestamp is added to a wire frame. The optional relay control-lane wrapper
is a bounded internal fault seam, unset in production, preserving original lane
cancellation and pair release ownership.
Service recovery tests join natural 20-second refresh/60-second TTL expiry with fresh authenticated retained recovery before, at and after the fixed 65-second grace. Physical peer links remain open during expiry. The tests also lose an original encoded abort notification, preserve fixed grace through pending FIN and route changes, and prove automatic recovery with its existing polling allowance. The exact last-nanosecond admission probe uses explicit retained recovery; it does not promise automatic polling at that instant. Separate production carrier tests recover the same incomplete inner TLS handshake and deny fresh sessions after publication withdrawal while retaining the original application. These are in-process service tests; the bounded real-grace shipped-process journey belongs to the process suite.
Concrete consumer handoff
These APIs are the recovery handoff, not a new public JSONL API:
circuit.Consumer.Consume(context.Context, *BootstrapResult) errorowns the result on every outcome and joins before returning.BootstrapResult.Taketransfers its SessionInput once.NewSessionStarter(SessionConfig).Startconsumes that input, including retained registration/retry ownership, and returns the sameSessionbyte edge for its whole lifetime.Sessionsupplies Reader, Writer, CloseWrite, Abort, RTT and joined Wait. CloseWrite seals one authenticated direction; physical loss is not EOF. Entry Wait joins attachment settlement. Origin Wait does not join its relay supervisor. Neither consumer reruns Take, bootstrap or application setup on recovery.Service.startCircuitis currently a package-private, counted, blocking fixture invocation, not a production remote-open API.endpoint.Engine.PrepareDirectandDirectHandlercurrently validate a local published endpoint and returngateway.PreparedEndpointplus its reservation. PreparedEndpoint consumes anet.Conn. The engine establishes endpoint TLS, registers authorization and callsRunApplication, or the existing invitation server for endpoint access.RunApplicationacceptsAuthenticatedEndpoint, which includes net.Conn, Peer and Abort; its existing ACL/epoch checks own the eventual socket dial. The outer Hub/circuit identity cannot substitute for the authenticated inner client.
Session is a bounded byte edge, not a net.Conn. The production contracts below resolve its carrier and consumer ownership.
Production composition contract
This is the production composition contract. The Options.circuitConsumer
option and Service.startCircuit remain package-private fixtures; a nil
consumer denies new and reattach at origin. The binary additions and independent literals are owned by
the circuit carrier and
the restricted relay carrier.
Existing gateway and EzHub JSONL fields, signed ceremony bytes, durable formats,
AHRA, bootstrap, AHCC, DATA and recovery encodings do not change.
API ownership and preparation order
Keep gateway.PreparedEndpoint, DirectEndpointPrepareFunc, DirectContext
and the PrepareEndpoint call signature. Service installs a dispatcher in that
slot, rather than teaching gateway to dial or acquire circuit secrets. Local
selection calls Engine.PrepareDirect. Remote selection calls a separate
service preparation owner; no error, route miss or race takes the local branch.
The public gateway.Endpoint row remains unchanged. Its OriginRoot and
selection token stay in a private preparation snapshot.
The service snapshot contains endpoint ID and canonical SPKI, verified
OriginRoot, binding generation, publication state and exact directory token,
purpose, admitted outer-client identity, local stable entry root, caller context,
and one complete routing.CandidateView. Resolve the root from verified
endpoint binding, never its current authority head, contributor or next hop.
Hold at most one LookupLease; close it after exact candidate admission. A
subsequent attempt is a fresh selection, never a mutation of that snapshot.
The remote prepare owner performs this order:
- Re-read the learned endpoint and require the same ID/SPKI, unique usable
binding, positive generation, exact
OriginRoot, published and nonconflicted state. Require installed entry AND origin carrier support locally; routing reachability alone cannot turn on production. Availability is a local capability projection, not a claim that every remote Hub supports the codec. - Reserve the circuit endpoint lease, additional carrier lease and gateway
tunnel working space before allocating buffers, timers or invocation work.
Preserve
reserveCircuitEndpoint,circuitInvocationLeaseand the counted invocation/stop boundary ofstartCircuit. Do not return an uncountedBootstrapResultto gateway. The production prepare owner has one counted worker and a one-slot outcome handoff; the worker stays counted through Consumer return and all cancellation joins. Gateway's current tunnel charge must transfer here or remain gateway-owned, never be reserved twice. - Lookup
OriginRoot, take the complete selected candidate, and use exact-link admission. Carry purpose and binding generation in AHES. Extend the internalcircuit.EntryRequestwith an optional value-owned production descriptor;entry.StartwrapsSetupOpaque()only when that descriptor is present. Existing bare-bootstrap fixtures keep their exact bytes. The recovery owner wraps its original descriptor around the unchanged 144-byte recovery setup. - For new, origin's service wrapper validates AHES, local root, published
endpoint, exact ID/SPKI and binding generation against relay's NewAdmission
before delegating to the recovering origin. Reserve the SAME engine handler
used by direct preparation, plus its carrier capacity, before returning an
origin acceptance. For reattach, validate the retained descriptor/session
instead, without publication admission or another engine reservation. No endpoint socket or inner TLS starts inside
Admit. Circuit bootstrap and the authenticated AHEC exchange then establish that entry and origin chose the same descriptor. Relay OK alone is not readiness. - Each Consumer calls Take once and SessionStarter.Start once. The bounded circuit-owned AHEC state machine calls the typed EndpointRecheck phases and completes before session I/O workers can consume control messages. Service never receives raw control, Attachment or Material through that callback. Origin registers retained state before reporting START. Entry starts its Session and carrier adapter, then publishes the one-slot preparation result to gateway. The origin engine may block waiting for inner TLS bytes; it must not wait for gateway ready.
- Immediately before returning preparation success, entry rechecks the exact
directory snapshot, endpoint ID/SPKI,
OriginRoot, generation, publication, conflict state, captured route token, immutable attachment attempt/path and origin, current attempt ownership, live Session, reservations, cancellation and absolute preparation deadline. The final ready-send barrier repeats these checks through a private prepared-owner validation hook in gateway. The hook must not change any JSONL field. Do not rely onLookupLease.Erras a candidate recheck; add the bounded exact-tokenTable.RecheckCandidateoperation, using the same candidate validation asReservePairbut issuing no new hold. Each local peer owner validates its incident admitted exact links, not a root-to-current-link lookup. Entry validates its first incident link and immutable authenticated end-to-end metadata; it cannot inspect remote relay link handles. There is no new remote recheck protocol. Do not nest directory locks with table/peer admission locks. - Gateway sends its existing ready only after the handler, tunnel capacity and
owner validate. Its
TypeTunnelboundary validates the same owner again before tunnel_ok. A route or publication change before either boundary rejects this pending open. Each validation is the local admission linearization point; no lock spans a network write. Retirement after it is handled as failure of an admitted pending carrier, not hidden by fallback.
gateway.Server.runGateway currently reconstructs selection with only ID/SPKI
and tests publication again before tunnel_ok. Keep that public selection shape;
private hooks must carry the full preparation snapshot. Add an internal gateway
PreparedValidator interface with ValidateReady(ctx) and ValidateTunnel(ctx)
methods. The remote reservation io.Closer implements it; runGateway invokes it
before each corresponding send, treating a missing production validator as
unavailable. Existing direct reservation types need no validator and keep their
current recheck. A stale owner cannot validate by comparing only SPKI or by
looking up the newest selected route.
endpoint.Engine.checkSelected currently knows only local ID/SPKI/publication.
The engine owner adds PrepareRouted and a shared private preparation function
with an explicit local-validation callback. PrepareDirect keeps its direct
checks. PrepareRouted accepts only service-constructed local-origin evidence,
requires exact root/generation rechecks, and calls that shared function. Its
internal input includes the service-owned routed TLS reservation callback keyed
by exact entry root and the marked routed handshake lease. Do not pass an invalid
Source to the current ReserveOrdinaryTLS/ReserveInvitationTLS IP callbacks.
Direct uses those unchanged callbacks; routed uses the same TLS/ceremony
lifecycle with separate finite root-keyed pre-authentication admission. It is
not an accept-any wrapper around RunApplication.
Identity, purpose and once-run origin consumer
Purpose is closed: application or endpoint_access. It is immutable for the
retained Session and authenticated by AHEC. No runtime role selector, admission
purpose or endpoint-independent tunnel is legal. DirectContext.Client is
entry admission evidence only. Origin never uses it for endpoint ACLs,
certificate identity, invitation claimant identity or authenticated budget keys.
Do not transmit outer-client certificates or source addresses in setup.
Origin's routed context uses the authenticated entry stable root from bootstrap
and an invalid netip.Addr for the unknown source. Current ReserveHandshake and
TrafficIdentity.validate reject that combination. The invitation owner adds
ReserveRoutedHandshake(entryRoot, now) with a private routed lease marker,
using the existing hub ceiling of 128 and a new eight-per-entry handshake
ceiling instead of a source-IP map. AuthenticateCarrier
accepts an invalid source only on that marked lease, with its exact nonzero
Entry and endpoint_access or pairing purpose; ordinary direct leases retain
their current validation. All routed handshake, challenge, queued-claim and
connection counters charge entry-root plus existing aggregate/key/subject
limits, without a synthetic IP or an invalid-address shared source bucket.
ConnectionEntryLimit and ClaimQueueEntryLimit remain 32; hub/key/subject/lane
limits are unchanged. Direct source counters remain unchanged. The same
scheduler and lease release paths remain in use.
After inner TLS, conn.Peer() supplies claimant identity and the existing
ReserveConnection key. TrafficIdentity.Entry is the entry root; its Claimant
is the inner device. For application, Registry.RegisterEndpoint/BeginWork own
the exact ACL/epoch barrier and the sole AF_UNIX dial. For endpoint_access, the
same scheduler, endpoint TLS provider, invitation exporter and ServeEndpoint
own the ceremony, including claimed-response recovery. The circuit exporter
cannot substitute for either inner exporter.
The origin wrapper retains the prepared engine closure, its reservation,
descriptor and once-consumed result under the retained initial owner. Associate
that descriptor through a package-private acquisition/result field, not
context values or a global map keyed only by attempt ID. The circuit owner adds
these exact internal Go interfaces in circuit, using the closed
EndpointDescriptor from the circuit contract:
| 1 | // The service implementation captures one prepared engine/reservation owner. |
| 2 | type EndpointConsumer interface { |
| 3 | Consumer // Consume(context.Context, *BootstrapResult) error |
| 4 | Abort() // Idempotent, nonwaiting; wakes the scoped owner. |
| 5 | Close() error // Idempotent join, then release engine/carrier reservations. |
| 6 | } |
| 7 | type EndpointOrigin interface { |
| 8 | RecoveringOrigin // Includes relay.OriginHandler, StopRetained/WaitRetained. |
| 9 | AdmitEndpoint( |
| 10 | context.Context, |
| 11 | relay.OriginRequest, |
| 12 | *relay.OriginOffer, |
| 13 | EndpointDescriptor, |
| 14 | EndpointConsumer, |
| 15 | ) (relay.OriginAcceptance, error) |
| 16 | } |
| 17 | func NewEndpointOriginHandler( |
| 18 | Bootstrapper, |
| 19 | ReserveEndpoint, |
| 20 | context.Context, // Service retained-lifetime parent, not a setup timer. |
| 21 | ) (EndpointOrigin, error) |
NewEndpointOriginHandler constructs the same concrete recovering-origin owner with one retained registry and no global fixture Consumer. It returns a typed EndpointOrigin so service need not assert undocumented concrete methods. Ordinary Admit on that production owner denies bare fixture setup; only the service's validated wrapper calls AdmitEndpoint. NewRecoveringOriginHandler and its fixture Consumer retain their existing signature and behavior. The new constructor validates dependencies and installs no worker until admission. The concrete recovering origin implements EndpointOrigin over its SAME retained registry and admission implementation as Admit. OriginRequest.Setup supplied to this method is the unwrapped inner setup; the wrapper first validates AHES and passes its value descriptor separately. Circuit compares the descriptor against the inner mode and its private retained descriptor. Metadata still comes from the offered attachment, not a substituted service value.
For ModeNew, a nonnil EndpointConsumer is required and transferred on method entry, including malformed request, reservation failure, cancellation and bad offer. Before Consume starts, that scoped owner holds only prepared engine and adapter capacity, never a result/attachment. Zero acceptance returns only after Abort/Close have joined that owner and unwound circuit-local acquisitions. A success captures it under the retained initial acquisition. A nonzero acquisition returned with an error retains the owner for relay's existing Abort/Wait/OriginSettlement cleanup; service must not close it concurrently. Consume owns BootstrapResult on every outcome, joins the once-run engine and adapter, and returns only after result/session cleanup. The retained lifetime owner then calls Close exactly once before finishConsumer, even when bootstrap fails and Consume never runs. Repeated Close calls join the same completion; it is not a bare budget release. Abort wakes pending work but releases nothing. Close runs outside relay/directory/registry locks and never joins Attachment.Wait. OriginSettlement still owns incident attempt release after relay settlement.
For ModeReattach, pass a nil consumer. A different descriptor or nonnil new consumer denies without endpoint preparation or publication admission. Any mistakenly supplied nonnil owner is still consumed and Abort/Close joined on that invalid call. Success acquires only the matching retained session and its original engine owner; no Consumer/Close rerun on a replacement attempt. Ordinary Admit and fixture Consumer signatures retain their existing behavior. No typed API shape here is enabled by this documentation gate.
The origin Consumer starts the reserved Session adapter and calls the prepared engine closure exactly once. Normal engine completion uses bounded graceful TLS/raw Close, draining admitted output and authenticated FIN before the Consumer joins pumps/Session.Wait and closes the engine reservation. Terminal failure uses AbortWithReason, then joins the same owners. The raw adapter never joins the Consumer invocation calling Close; that outer join belongs to the retained lifetime owner. Graceful close failure is not normal application EOF. It never calls Attachment.Wait; the relay supervisor owns that join. Its result/session lease remains governed by retainedOriginLease: consumer join AND all incident attempt settlements precede capacity reuse. Entry's Consumer owns its stable adapter and gateway-facing joined pumps for the entire client connection. Recovery changes only Session attachment work. Neither side recreates inner TLS, application decoder/encoder, invitation session or local socket.
Cancellation and reservation transfer
Before Take, result Abort/Wait owns cleanup. After Take, Start consumes the SessionInput on every outcome; a failed circuit-owned AHEC phase follows Start's existing role-specific rejection cleanup. Service constructs one monotonic SessionClock for bootstrap retirement, AHEC, Session and carrier deadlines; controlled tests inject the same clock in all owners, never compare unrelated epochs or derive phase time from a delayed result handoff. The invocation bridge joins at entry transfer, and TerminalParent remains the original gateway caller. Preparation deadlines are phase deadlines, not Session parents. Origin's retained registration changes Parent to the service lifetime; the consumer's terminal context still wakes on Session terminal publication. Losing the original relay attempt must not cancel the once-run endpoint engine after retained registration.
Caller loss, revocation, service stop, inner TLS failure and terminal Session failure abort both local carrier directions and wake engine/gateway I/O. Attachment loss alone pauses transport under the fixed recovery grace and does not close the adapter or manufacture EOF. Queue backpressure remains bounded. Cancel before gateway tunnel closes the prepared owner and joins it; it cannot leave a reserved idle Session. The current ten-second ready-to-tunnel bound still applies. Origin may wait for inner TLS only within the engine's existing handshake bound, never indefinitely waiting for an entry acknowledgment.
The reservation io.Closer returned with PreparedEndpoint is an idempotent joined preparation owner, DISTINCT from the raw carrier net.Conn.Close. On invocation it transfers to that worker. On unused owner Close it aborts and joins the worker, Session and entry attachment settlement before release. After invocation, ordinary raw/TLS Close drains gracefully; failure/cancellation invokes the narrow raw Abort capability before joined owner Close. Gateway currently defers reservation.Close after three pump joins; keep that release order, but replace its unconditional first-result cancellation for production with reason-aware orderly drain versus immediate abort. A clean output-pump EOF or normal engine return seals output and joins within the existing close bound; it does not cancel the terminal context and discard admitted writes. The hoptls/endpoint/service owner owns this factoring, as specified in the link close contract. Close/join must be called outside registry/admission locks. Origin engine TLS, invitation scheduler, authenticated connection and local socket reservations retain their existing distinct owners. The circuit lease cannot pay for them, and neither a deadline setter nor a lost route frees them.
The service budget owner supplies EndpointCarrierMemory/Control and RestrictedPairingMemory/Control RAM rows from the effective configuration. Reserve each DATA/control pair atomically; these rows cannot exceed the configured aggregate ceilings. Current sizes are in the production capacity map. The reserved production preparation worker/status owner uses the carrier control lease and the gateway's existing 2*32 KiB+8192 tunnel charge, not an uncharged status queue. Routed pre-TLS reserves the existing PendingHandshakeBytes charge under an entry-root key with eight-per-key admission; authenticated endpoint/pairing transfer uses the existing purpose/inner-identity connection resources. Beyond the adapter's two pumps, production adds at most two joined workers per entry owner: the counted preparation/Consumer invocation and the sole gateway output writer. The writer also samples lifecycle Changed, so there is no separate status-observer worker. Origin uses its existing counted Consumer invocation. At most 32 prepared entry owners admit those additional 64 worker positions. Existing gateway pumps, circuit workers, engine/proxy work and their reservations are still counted separately. Preparation phase timers fit the carrier control owner and expire before that owner enters its steady phase; no timer is allocated per status.
Failure and delivery ownership
Before ready, policy or identity mismatch, withdrawal, fork, missing route,
stale candidate and non-supporting origin map to the existing
endpoint_unavailable. Local capacity exhaustion maps to resource_limit.
Malformed client control maps to protocol_error. After ready but before
tunnel_ok, carrier failure uses existing error circuit_failed. After tunnel_ok
it uses existing terminal status with circuit_failed, then joined close.
Use EndpointSession.Observe's closed TerminalClass, not SessionTerminal alone
or arbitrary error strings. TerminalJoining is pending authenticated-close
settlement and emits no failure status. TerminalClean requires nil joined Wait
and closes normally with no circuit_failed. TerminalFailed follows the phase
mappings above. TerminalCallerLost still joins all owners, with best-effort
delivery only if an outer transport survives. No writer blocks on Session.Wait
to discover its class; the owning Consumer joins and publishes the final pulse.
Revocation, inner TLS failure, service stop, grace/close expiry, authenticated
RESET, malformed control and abnormal proxy/application failure are
TerminalFailed. Normal application completion enters graceful TLS/adapter close,
not generic Session.Abort; only successful authenticated close and settlement
become TerminalClean. The local entry calls AbortWithReason(StopCallerLost) on
actual client-entry transport loss. TerminalParent/service-parent bridges
preserve that distinction; remote origin never infers its own caller loss from
an entry reset. Errors that win after partial writes cannot be recast as clean.
Caller loss may prevent delivery.
No route path, detector position, origin private detail, ACL, socket or internal
error reaches gateway or EzHub output. Typed routing table-fatal and ambiguous
store errors still reach routeFailure/Service.fail; generic delivery must not
hide service shutdown.
Only declared recoverable attachment failure enters recovering. Origin revocation, inner TLS errors and grace expiry are terminal, not a new circuit or a direct retry. A successful replacement reports recovered only after bilateral REPLAY_DONE and LIVE/LIVE_OK, never after ROUTE_OK or ATTACH_OK. Use the existing gateway codec and serialized delivery. Restricted pairing has its own carrier, no reliable circuit recovery and no gateway status stream. Local typed Prepared/Accepted outcomes and definite commit callbacks remain its result authority.
Downstream implementation and acceptance owners
- Circuit/carrier owner implements AHES/AHEC, the pre-worker hook, reserved
adapter and bounded local Session observation. No protocol parser precedes
the literal corpus in
internal/agenthub/testdata/carrier. - Peer/routing owner implements exact-token recheck and the separate restricted single-channel capability/settlement path. No dummy endpoint or relay pair.
- Service/endpoint/gateway owner installs preparation dispatch and once-run origin consumption. It owns no-fallback, reserve-before-ready, unchanged schema and joined shutdown tests.
- Routed-ceremony owner branches carrier acquisition in AddHub, recoverOnce, recoverApproval and cancelRemote on stored mode, preserves empty addresses and the existing decisions/recoveries/canceling registry. It uses the same pairing engine and view-owned exact checks. Persisted rows create no timer or dial.
- Integration/review owners test real isolated line/diamond/outbound-only topologies, inner TLS/application continuity and exactly one socket/consumer across recovery, invitation continuation, target/exporter substitution, deadlines, pressure, settlement and unrelated-link isolation. The contracts and literals alone are not production acceptance.
Fixed-path production consumers
Service.Start now installs the production endpoint-origin wrapper when no
fixture Consumer is supplied, and installs Service.prepareEndpoint as the
shared gateway dispatcher. Local published ownership takes the direct engine
branch before route work. A remote miss or failure never falls back to it.
Fixed-path fixtures use a package-private availability override that exposes
one captured endpoint only for service-path tests; the production projection
described below replaces it for ordinary learned remote rows.
Remote preparation captures the exact directory admission value and complete
candidate token/path. Table.RecheckCandidate checks that same token without
issuing another hold or nesting directory and peer locks. Ready and tunnel
validation use the same retained preparation owner, not a fresh selection.
An attachment-loss episode makes that pending owner ineligible for either
barrier, even if it has already recovered. Before ready this is unavailable;
at the tunnel barrier it is circuit_failed. Already-invoked applications keep
their original owner and do not repeat either barrier.
Entry's current TLS authority head is normalized to its locally verified stable
root before routed setup. Endpoint SPKI is canonical and its hash must match the
selected ID. The AHES descriptor carries only purpose and binding generation.
The counted entry invocation reserves its circuit lease, carrier RAM charge and
process-wide ReserveSessionConnLease slot before allocating invocation work.
Gateway reserves its existing tunnel charge before calling preparation. One
preparation worker owns the result through Take, AHEC, adapter handoff and joined
settlement. Its explicit pre-Take caller/service bridge joins at transfer. An
unused ready owner aborts and joins; an invoked reservation Close joins without
turning an orderly drain into cancellation. The gateway framing writer samples
the same Session observation directly, without a separate observer worker.
Its 32 KiB output slot and the two entry 16 KiB copy buffers fit the existing
64 KiB tunnel working-space charge. The adapter's at most four demand-allocated
32 KiB buffers charge the separate shared ciphertext budget.
Origin unwraps AHES, validates local publication/root/generation and reserves
Engine.PrepareRouted plus carrier capacity before accepting new setup. Circuit
owns AHEC and the non-acquirable-to-live registration transition. The scoped
Consumer starts one Session adapter and invokes the prepared endpoint engine
once. The origin engine and adapter use the service lifetime, not the original
attempt's expiring setup context. Session terminal failure wakes their byte I/O;
service stop also cancels their lifetime. Reattachment compares the retained
descriptor and acquires that same registry and consumer, without another engine
reservation, endpoint TLS instance, decoder or socket dial.
Routed preparation uses the existing endpoint TLS provider, inner device identity, ACL/epoch registry, application codec and JSONL proxy. The only AF_UNIX dial remains after RegisterEndpoint/BeginWork. Endpoint-access uses the existing invitation exporter and scheduler with a marked entry-root handshake lease. Direct source-IP admission is unchanged. No private application profile, socket path, alias, outer client certificate or client ACL enters relay setup or learned public endpoint projection.
Normal completion now seals and drains accepted proxy output, sends inner TLS close_notify and authenticated Session FIN, and joins under the first close bound. The unbuffered local tunnel pipe has directional CloseWrite. A client framing sender remains usable after reverse EOF until reciprocal inner TLS output has drained. Abort is independent and nonwaiting. Failure classification is published before worker cancellation; TerminalClean requires nil joined settlement and emits no circuit_failed. Directional output EOF alone cannot close outer TLS. The gateway waits for Session joined classification before delivering outer EOF. The TLS wrapper also rejects raw transport EOF without close_notify, including loss exactly between records; caller disappearance cannot fabricate an authenticated FIN. Session observation retains the last episode's fixed deadline after recovery, so a writer busy with a physical frame can still emit recovering before recovered without extending grace.
The focused tests cover one/two-relay real Hub service exchanges, no entry Peer at origin, one socket dial, unfiltered JSONL/capability-shaped values, private metadata absence, the existing endpoint-access challenge, unrelated inner identity rejection, direct bypass, pre-bootstrap cancellation, unused readiness, local revocation/deletion/shutdown joins and unchanged inner TLS/application through one transit restart. The AF_UNIX application in these tests is a bounded script fixture, not a live EzAgent process. They do not enable or accept general remote availability, routed pairing, aggregate/race capacity, or live-process acceptance. Those remain with the downstream endpoint-composition owners.
Revocation tests assert the affected local retained owner joins before further caller cleanup. Authenticated terminal notification is best effort. If it is lost, the other edge still observes the existing close or recovery bound. The fixtures stop their isolated topology for remaining remote cleanup; they do not claim instantaneous remote notification after process loss.
Remote availability and selection checkpoint
Service.Start installs remoteEndpointCandidate into the gateway. It requires
both the production endpoint-origin carrier and the endpoint engine, a current
verified published/nonconflicting admission value, and a selectable route to
that value's stable OriginRoot. An opaque fixture consumer supplies no such
capability. No protocol probe, address learning, trust installation or socket
dial occurs during listing. Availability is a local capability/reachability
hint, not a promise that a remote process supports the carrier or grants access.
LearnedDirectory.Endpoints captures the fixed admission value under the same
lock as the public canonical key and row. Gateway rows carry that value and one
complete route candidate privately. Neither appears in gateway frames or public
JSON projections. TypeSelect reprojects current state, retains the whole selected
row, and clones its SPKI. Lists remain hints rather than leases. Preparation
cannot look up a replacement candidate for that selection.
Entry rechecks the exact identity/publication/revocation/binding token and route
candidate before allocation, before starting the attempt, at authenticated AHEC
phases, and through the prepared owner's ready/tunnel barriers. The bounded
WithEndpointAdmission callback performs only table validation; it takes no
peer/store lock, reserves nothing, and performs no I/O. The owner also pins the
initial immutable attachment attempt and rejects any attachment-loss episode,
even if recovery already restored a live Session. Before ready, invalidation
returns endpoint_unavailable. Known carrier loss at the tunnel barrier returns
circuit_failed. Cancellation and owner cleanup remain joined and bounded.
Local rows have no remote token and enter the direct engine branch before route work. A remote token cannot enter that branch, even if publication or routing changes while preparation is pending. It never falls back to PrepareDirect. Preference changes affect fresh selections only; a still-valid captured candidate and existing attachment keep their immutable path. Candidate replacement, withdrawal, expiry or exact-link loss invalidates that candidate. Other eligible candidates can keep or recompute fresh availability independently of the failed attempt. No refresh changes the retained recovery grace.
The fixed-path checkpoint now uses ordinary production availability, without the fixed-path predicate override. One- and two-relay fixtures open actual client-entry TLS, endpoint TLS, the existing application protocol and one AF_UNIX connection, then exchange byte-preserving JSONL and join clean close. Signed withdrawal, publication replacement, conflict, supported newer binding and revocation replacements are injected after selection and before prepare or ready. Tests also cover withdrawal after list, incident link loss before ready, controlled candidate/path replacement, expiry, removal and surviving alternatives. Approved descriptor and opaque-row behavior stays client-owned and unchanged.
Availability/selection and fixed-path application fixtures use a scripted AF_UNIX endpoint, not a live EzAgent process. Restricted routed pairing belongs to its service tests; shipped EzAgent behavior belongs to the process suite. No frontend work is added.
Routed endpoint authorization
The production PurposeEndpointAccess carrier enters Engine.PrepareRouted
and the same private preparation, endpoint TLS and InvitationServer.ServeEndpoint
implementation as direct access. The route carries only the reviewed endpoint
purpose/binding descriptor and opaque endpoint-TLS bytes. No relay consumes
private Context, JOIN material, selector, claimant credential or result. No
AF_UNIX socket is opened by authorization, and entry admission is not an ACL.
Public Add agent keeps independent subject checks and the directory-selected canonical SPKI before device-certificate disclosure. Verification obtains and cancels the existing pre-claim challenge, then joins authenticated inner TLS and carrier closure before explicit confirmation. Fresh exact-pinned TLS precedes durable request preparation. Successful terminal-result closure also drains TLS before carrier join. Aborting instead of draining a successful routed response can leave the origin waiting for FIN and holding invitation capacity. Failure and cancellation remain abortive; they never become successful authorization. The client contract owns these local ordering and exact-credential rechecks.
Real one- and two-relay fixtures use the public gateway listing/selection and client authorization APIs, actual peer links, production circuit consumers, endpoint TLS, invitation claim/continuation/ACK and separate administrator approval. Only entry admission and neighboring peer prerequisites are seeded. Endpoint ACLs and descriptors start absent; the ceremony creates them. The private socket dial is a sentinel and must remain unused. The revoked-descriptor case observes signed revocation, blocks ordinary use, and completes explicit fresh re-grant with a new revision and secret.
Durable routed regressions also drop actual claimed-response and ACK-response TLS ciphertext after the corresponding origin commit, interrupt client response validation, retry the byte-identical unanswered request after client reopen, reject subject substitution, and require post-ACK root retry to return only the empty acknowledgement hint. Cancelled ACKed approval, actual transit stop and restart, actual origin-service restart and lost approved-result recovery retain exact Context/request IDs, keys, selectors and original pre-completion deadlines. Terminal approval keeps the existing Completed plus RecoveryLifetime rule. Equality at the client credential deadline rejects before fresh endpoint TLS. All fixtures join their isolated services and check invitation/TLS ownership.
The normal endpoint claimed response is one bounded chunk. These real routed flows exercise the common manifest/chunk path; existing invitation-engine tests own multi-chunk ordering, MAC, hash and context substitution. They do not change content or durable formats to manufacture a multi-chunk endpoint grant. Existing client approval tests retain the three-attempt automatic recovery/exhaustion policy. These are public package/service flows, not shipped-process or live EzAgent acceptance. Joined-source independent review, focused race, aggregate, live-process and recovery acceptance remain with the topology gates below. Restricted Hub pairing is separate and gains no client ACK.
Live application recovery checkpoint
This checkpoint composes circuit recovery with the production entry/gateway and origin endpoint consumers. Alternate and restored paths carry the same inner endpoint TLS connection, application codecs and AF_UNIX socket. Replacement performs fresh immutable path admission and retained session authentication, not independent bootstrap, PrepareRouted, Consumer, application open or JSONL hello. There is no remote-to-direct fallback.
The production diamond fixture follows the actual sticky selected path. After partially reading a 192 KiB required JSONL response it stops that transit, gates actual replacement acquisition, and completes a separate healthy application on the alternate path. The original then resumes, restores the first transit on fresh normal-peer links, withdraws publication, loses the alternate and recovers through the restored path. Exact captured requests and replies, clean EOF, immutable ModeReattach metadata and once-only bootstrap/consumer/preparation/dial counts establish continuity. Withdrawal blocks fresh selection but does not remove retained-session authority. Endpoint/admission revocation, client-entry loss, application failure and loss of retained entry/origin state remain terminal. Remote failure notification is best effort, not an instantaneous-close promise.
The origin keeps the same proxy queue during recovery. A paused production carrier retains more than 4 MiB of required output behind the circuit window; restoration delivers roughly 10 MiB of required JSONL in order. The configured 16 MiB queue remains bounded, preserves a snapshot frozen at the existing 15-second equality boundary, replaces only the newer obsolete queued snapshot, and releases its payload charges after drain. Gateway recovering and authenticated replacement controls progress while DATA is paused. This is a payload/owner bound, not a total Go-runtime memory or maximum-capacity proof.
Pending application EOF drains accepted output and real endpoint TLS close_notify through the replacement before clean joined close. A controlled Session clock, independent of certificate/security time, proves retention at grace minus 1 ns and failure at the fixed 65-second equality boundary. Both the client application edge and actual origin AF_UNIX edge close, native adapter/preparation joins fail rather than reporting clean completion, and charges return without rescue by caller or topology shutdown.
The adapter has a terminal-wakeup rule: with RX queue and staging both full, the idle send pump observes the retained Session's Changed pulse and caller cancellation as well as adapter activity, so terminal cleanup does not depend on a later application read or Wait call. The existing two pumps, four buffers, timers and reservations are unchanged.
The sole gateway writer emits existing recovering/recovered/terminal frames
outside inner TLS. Clienttransport consumes them and exposes a bounded local
TunnelStatusObserver on the returned application handle. This is runtime state
for later presentation, not a new JSONL/EzHub operation, durable state or recovery
overlay. See client observation
and service recovery tests.
The checkpoint uses real Service.Start, peer TLS/mux, routing, relay, circuit bootstrap/recovery, endpoint TLS, ACL/epoch registration, application framing and AF_UNIX dialing. Its local application is a bounded socket script, not a running EzAgent daemon. Focused race, aggregate and live/shipped-process acceptance belong to the topology gates, and restricted routed pairing is separate carrier/ceremony work. This checkpoint alone does not claim complete production acceptance; the client owns polished recovery overlays.
Restricted routed Hub pairing
Service composes one restrictedpairing.Setup with the existing route table and
READY owner. startPeerSync claims and binds restricted dispatch alongside the
required directory/route and relay owners before activation. There is still one
peer dispatcher. Service reserves ResourceRestrictedPairingMemory and
ResourceRestrictedPairingControl atomically, 128 KiB and 16 KiB per owner,
with sixteen-owner limits inside the unchanged aggregate data/control budgets.
The carrier contract
owns exact setup, fixed paths, quotas, deadlines and native settlement.
Target acquisition and disclosure
reserveRestrictedTarget reserves pairing connection capacity and the scheduler's
ReserveRoutedHandshake lease against the authenticated immediate incoming
READY neighbor, carried as local Request.IngressRoot evidence. Both reservations
precede fresh credential loading and verification of local signed genesis/current
head, and remain owned through settlement. Provider loading repeats the head
check for TLS. Predecessor validation does not authenticate earlier path members
or Path.Roots[0]; those claims cannot select another Hub's quota. The retained
scheduler TrafficIdentity.Entry uses the same authenticated ingress principal,
not the claimed joining root. Endpoint-circuit authenticated-entry accounting is
a separate policy. The target runs only InitialPairingServer with pairing ALPN, then
serveInitialPairing, the same factored callback used by direct public pairing.
Authenticated remote/local authorities supply claimant/subject to the original
pairing.Engine.ServePublic. There is no endpoint or normal-peer accept branch.
Joining AddHub reserves ResourcePairingConnection before carrier acquisition.
selectPairing consumes charged verified learned lineages, resolves one maximal
nonforked authority head satisfying every independently supplied check, borrows
that exact selection, and looks up only its genesis root. Routes cannot resolve
ambiguous identity checks or confer successor consent. After public OK, provider
loads and outgoing TLS writes recheck the borrow and captured route candidate.
The write guard checks again before the client certificate flight enters the raw
queue. InitialPairingClient retains the original independent short checks and
also enforces the selected exact head. The proof hold ends after TLS and the
final recheck; an established carrier's path stays immutable.
The original held TLS and engine perform Challenge, register the exact initial owner, and commit Prepared before selector/proof disclosure. The existing callbacks return typed Prepared or Accepted. Only signed Context installs target generation and the target-clock deadline. No carrier nonce, path or setup field enters Q, signatures, approvals or durable formats.
The user approved routed add_hub and the AgentHub EOF, half-close, drain and
joined-shutdown lifecycle changes. These changes add no public agent
JSONL fields or RPC semantics. The proxy's current lifecycle is owned by
JSONL proxy.
Recovery, cancellation and eligibility
Stored routed mode is checked before address indexing in recoverOnce,
recoverApproval and cancelRemote. Every check uses the exact durable pin and
Q with a fresh restricted carrier and TLS. Prepared uses initial pairing TLS
for status first, then a separate fresh exact-Q Claim retry when existing engine
policy permits it. Context-bearing rows use the existing request-bound pairing
provider. LocalApproved polls first and sends the same stored signature only
when returned Context proves delivery is still needed. Prepared without an
authenticated target deadline sends no Cancel.
The existing local view alone owns repeated checks and pacing. Durable rows,
service restart, route refresh and physical loss schedule no reconnect. Engine
calls use the carrier terminal context, so physical loss cancels a held decision
without another bridge worker. Cleanup joins TLS/engine work before entry
Release, then connection capacity and exact registry retirement. Service
shutdown joins these users before Setup.Stop. The original seven-day approval
cutoff and Completion-only retrieval until original retention remain unchanged.
Both routed Pairing and Peer address lists remain empty. Activation grants eligibility, not a live link or a learned dial address. The original store blocks re-pairing while either relationship remains nonremoved. Bilateral removal requires fresh ceremony material and both new approvals; activation constructs a new Peer without inherited successor decisions, collision witnesses or fork evidence. Outbound routed normal-peer transport is not implemented.
Evidence and downstream gates
Service pairing tests use real signed stores, normal-peer TLS/mux, directory sync and route engines with initially unrelated joining/target Hubs. They cover typed checkpoints, restart, exact-Q status-first Claim recovery, same-signature approval retry, both approvals, Completion, cancellation, physical loss, capacity joins and fresh consent after removal. Real transport negatives cover target/check/role/exporter/mode/lineage substitution and arbitrary/oversized/deadline abuse. A store regression also proves a denied successor decision does not survive same-genesis routed re-pairing. It does not claim a full routed ceremony after target rotation.
Joined race, aggregate and shipped/live-process acceptance, including routed diamond/outbound-only and rotated-authority topology matrices, belong to the topology gates below and remain independently reviewed. The private administration backend consumes the existing local API/backend states; the client owns presentation. No new administration operation or second transport is introduced here.
Production topology and private backend handoff
The approved private contract is frozen in local control. The sections below describe production composition and private-backend ownership.
The joined implementation now has production service tests for outbound-only
eligible connections, diamond application recovery and routed pairing, revoked
admission/endpoint epochs followed by fresh grants, and fresh routed consent
after a denied authority successor and bilateral removal. These are public
service.Start topologies with signed neighbor relationships, actual peer TLS,
READY mux, verified catalogs, routing and end-to-end TLS. They are not evidence
that an accepting circuit fixture is a production consumer.
production_topology_test.go leaves the production preparation, origin handler,
endpoint engine and AF_UNIX dial installed. Its one- and two-relay cases disable
the origin listener entirely. Entry and origin each dial an eligible relay;
relay-side relationships have no reverse dial address. Fresh endpoint
invitation authorization and ordinary application opening reuse those links in
both directions. Neither operation invents a direct address or peer trust.
The AF_UNIX server is a bounded scripted byte fixture, not a launched EzAgent.
production_pairing_topology_test.go completes address-free diamond pairing
with passive restart and exact-Q recovery over an alternate. Its rotated-target
case prepares a genuine signed successor through the durable authority owner,
approves transfer only at the adjacent relay, and denies it at the old partner.
A nonremoved relationship remains protected. With a changed target key, the
joining Hub can reach Prepared before signed Context identifies genesis; the
target still refuses Claim, so no Context, approval or replacement Peer results.
After bilateral removal and fresh identity checks, a new request receives new
bilateral consent without inherited denial, address, collision or fork state.
The same test owner now also completes one/two-relay pairing toward an
inbound-disabled target over its actual outbound READY link. The rotation is
staged while services are stopped. This does not prove live old-link draining
or rotation during a held pairing TLS flight.
production_lifecycle_test.go composes real endpoint and admission revocation
with a live routed application. The affected local owner joins before re-grant;
the revoked owner stays terminal and a new grant opens a distinct application.
Endpoint re-grant changes the secret and approval revision without changing its
SPKI. Admission re-grant requires the public initial admission ceremony, not a
registry override. A separate diamond case removes the selected transit's origin
relationship and preserves the same application/socket through alternate
recovery. Its instrumentation delegates to the production engine and retained
origin. Circuit time is controlled; certificate/security time is not. Remote
RESET remains best effort, and bounded remote cleanup is not an instantaneous
revocation-notice guarantee.
Client carrier handoff joins its transport owners. Automatic approval recovery rechecks credentials before TLS, and post-ready circuit failure retains its failure precedence. Service tests own these boundaries; the process suite owns shipped admission/authorization, pairing, recovery and application integration. Process socket continuity is not an internal invocation-count proof. Select terminal checks through the computer-use guide.
A routed Add Hub fixture with no verified target follows the existing generic local failure mapping, not unsupported-mode rejection. Rejected invitation replay writes its literal failure and aborts TLS, not authenticated close_notify. The related fixture corrections change tests only, preserve state/audit/capacity assertions, add routed stale-revision coverage and check server retirement with invitation failure.
Two-relay manual TUI, shipped diamond/alternate and selected-peer-removal recovery, pressure/drain matrices, live rotation with held applications/ceremonies and old-link draining, and external NAT/firewall checks where feasible remain capacity and deployment-acceptance work. The client owns recovery/terminal presentation and visible shutdown progress during the existing bounded graceful drain.
Backend inputs for the private administration backend
| Existing owner | Available input | Consumption boundary |
|---|---|---|
store, admin, pkg/ezhubapi | Revisioned local status pages, exact invitation/ACL/peer mutations, authority successor proposals and decisions, publication/withdrawal | Keep expected revision and exact request/approval/proposal IDs. Do not rebase a conflict or interpret a route as consent. Online and offline administration use the same mutation owners. |
store.PeerTargets, PeerConnectionIdentity; peer.Manager.Hold and exact-link admission | Durable eligible relationship versus currently authenticated reciprocal-READY link | These are different questions. An active routed Peer can have empty addresses and no live link. A successful relationship transfer still requires fresh normal-peer TLS; a pairing carrier cannot supply it. |
routing.Table.Lookup and bounded LookupLease | Selected immutable candidate and ordered alternatives, projection revision/change notification, candidate recheck | Close leases promptly. Tokens and physical-link capabilities are internal admission evidence, not remote identity or user authorization. Route refresh/expiry remains 20/60 seconds. No new wire polling exists. |
circuit.EndpointSession.Observe, endpointPreparation.Observe | Latest phase, terminal class, joined bit, recovery episode, attempt, fixed grace deadline and change pulse | Constant-sized snapshots, not retained event history. Refresh after a pulse. Terminal before Joined means retirement is still running. Replacements change attempt, not session byte edges. |
clienttransport.TunnelStatusObserver | Latest received gateway status/code/remaining time, local state, joined bit and change pulse | Existing bounded status fields only. No status is inserted into inner JSONL. Do not call transport loss clean application completion. |
service.Budget.Usage, PeakUsage | Locked resource/class counters and successful reservation peaks | These are separate local samples, not one atomic cross-owner snapshot or a hard total Go-runtime memory ceiling. |
service.Audit, peer.Manager.Diagnostic | Closed bounded audit records and best-effort peer lifecycle notices | Audit admits fixed fields/domains, 1 KiB records, five 1 MiB files. Peer diagnostics use four process-wide workers and a 128-event queue, drop on pressure, and can arrive concurrently or out of order. A blocked sink must not delay transport or Close. Rejection IDs are locally accepted heads, not authenticated rejected identities. |
These backend inputs now feed the private EzHub API. StatusRequest remains its
original passive bounded summary, while the concrete private operations expose local
durable rows, peer/link observations, directory conflicts and evidence,
route/candidate samples, retained sessions and paths, protected audit, active
limits, configuration, renewal, card cancellation and explicit binding repair.
They remain owner-private local operations, never remotely callable mesh
operations. The
private contract
governs DTOs, target/parent/revision/generation correspondence, closed nullable
groups and enums, directory/repair validation, encoded bounds and result
ownership. The existing command dashboard consumes configuration, durable,
runtime/audit and exact-action operations. Service tests
and typed library tests own the corresponding regressions.
Approval does not permit public EzAgent or inter-Hub protocol changes. Do not add a second
administration socket, persist routes or decisions in diagnostics, or expose
internal capabilities simply to make them displayable. A combined screen must
label independent samples rather than promise a global atomic topology.
For lifecycle display, keep four separate facts: durable peer eligibility, reciprocal READY physical links, currently eligible route candidates, and an established immutable attachment belonging to a retained circuit session. Neither Active pairing nor route reachability grants endpoint ACL access. Replacement changes the attachment attempt, not the retained session, inner TLS or application. Terminal and Joined are separate states; terminal observation does not grant permission to reuse charged capacity before the owner joins. Change pulses can coalesce, so read the latest snapshot again. Client status remaining time is the last received value, not permission to renew grace.
Reuse the existing typed administration operations
through the same authenticated local control client. Mutations carry the observed
Hub expected_revision plus their exact domain target:
- Endpoint registration/publication/withdrawal/deletion and authority
transitionuse their existing request types. Local endpoint socket paths stay local. - Invitation creation retains purpose, subject, claimant lock, lifetime and mode. Approve/regrant/reject/cancel use subject, selector and invitation revision. Revoke uses scope, client and exact approval revision, plus endpoint for endpoint scope. A fresh grant does not revive an old application owner.
- Pairing approval/cancel/alias/removal target remote ID and exact pairing request
ID; card cancellation targets its row ID.
check_pairingis explicit exact-Q recovery, not passive status or background dialing.add_hubreports definite Prepared/Accepted checkpoints, not bilateral approval or a live peer link. - Successor approve/deny targets genesis, pairing request, proposal revision and old/new authorities. Signed lineage alone does not authorize transfer.
On conflict, refresh and require a decision for the newly observed target; do not silently rebase. Consume any definite committed result even when cancellation also reports a join failure, and release owned results. Diagnostics are not a mutation log or authority for reconstructing consent. These constraints remain in force in the implemented private adapters.
Diagnostic and audit fields do not contain JOIN material, selectors/proofs, status keys, receipts, control secrets, credentials, client endpoint secrets, inner TLS ciphertext or application JSONL. Public identity IDs and bounded reason enums are sufficient. Owner-private administration status may still show local endpoint aliases and socket paths; that is local administration, not relay or public network diagnostics. Service tests own audit rejection/redaction and blocked diagnostic-sink regressions. The private adapters retain these restrictions and explicit revision checks.
Projection and configuration owners
The approved private contract
and finite configuration
remain the private adapter contract. The runtime inventory/audit domain readers
implemented below now feed private control operations through one
ControlExecutor behind the existing authenticated control Server. Do not install these adapters
in public EzAgent dispatch, the gateway wire codec or peer/mux dispatch.
| Implemented internal interface | Owner and retirement requirement |
|---|---|
Typed durable List*Context / Get*Context projections | store takes a short cancellable RAM borrow of the committed generation at one exact revision, then copies one public page/detail outside the RAM lock. It does not clone the secret-bearing store. admin converts public identities and enum projections. |
PeerObservationReader | peer.Manager; generation-scoped link display registry includes pending/ready/draining/closing links until joined release. Durable eligibility comes from separate store reads. No returned ReadyLink capability. |
DirectoryObservationReader | directory.LearnedDirectory plus local catalog owner; exposes every retained endpoint/conflict/origin/evidence row by page, not gateway.ProjectEndpoints' two-origin explanation. It projects verified origin generations and record digests without copying evidence buffers or learning addresses. |
DirectoryObservationReader.ValidateRepairReferenceContext | After an outside-lock exact store-revision check, validate endpoint + runtime generation + sequence + complete conflict digest and maximum binding generation once under the directory lock. Before-cut substitution is cursor_expired, even at the same maximum generation. Neither registry nor store locks surround the callback. Release the directory lock before signer/I/O work; owner execution rechecks the exact store revision and binding generation without rebasing consent. After-cut evidence may create a later conflict. Offline has no reference and supplies an explicit entered generation through the same mutation domain. |
RouteObservationReader | routing.Table; exact public candidate/expiry projection and sequence under the table lock. Do not use Lookup to create a held admission lease for browsing. |
SessionObservationReader | service registry of entry/origin preparation/session owners and restricted pairing carriers. Allocate the bounded public display entry before work starts, transfer ownership explicitly on handoff, and remove only after Joined. The circuit observer supplies causal phase/attempt/grace; the adapter supplies purpose/target and latest successfully emitted local gateway status. It has no access to another process's client TunnelStatusObserver. No separate event history. |
LimitsObservationReader | service.Budget; counters/limits/peaks sampled under one budget lock, active startup configuration token supplied separately. No per-key map export. |
AuditReader.ReadContext | service protected bounded audit-file reader; readers scan outside the writer lock and join cancellable read workers before terminal/ACK. No rotation pin, arbitrary filesystem path or auth-file access. |
| Configuration read/replace owner | config under the same administration lock, exact byte-token conflict and definite atomic replacement. service.Start consumes validated effective limits and records its startup token; no live reload. Offline uses the identical writer and service.NewOfflineRuntime supplies audit only. |
| Renewal / client-card cancellation / binding repair | admin.Manager and store credential/invitation/signed-endpoint owners. Registry callbacks do not serialize persistence or external evidence validation. Exact store revision checks and the service's carrier owner handle lifecycle effects before terminal delivery. Definite repair refreshes the local committed catalog; it does not install a learned binding or repair a peer. |
cancel_client_card also composes Service.RetireClientCardContext. After the
row commits, the service captures every exact registered carrier under its
carrier-owner lock, signals them outside the locks, and joins each outer
carrier lifecycle before terminal delivery. Cancellation after commit cannot
skip that cleanup, and cancelling a fresh card does not revoke an unrelated
authorization epoch.
The runtime readers add generation-scoped public handles and bounded projection storage to existing owners, not new network owners. Peer link slots are bounded by connection admission, directory slots by existing catalog bounds, route slots by 257 roots and 256 physical-link contributions per nonlocal root, with selected/best-alternative projections bounded to 32 candidates. Endpoint sessions intersect configurable logical admission, resource budgets and prepaid registry metadata, not a fixed 2,048-slot array. Restricted pairing has its existing 16-carrier budget and a separate purpose discriminator. Charge registry slots, page copies, sequences, scan workers and buffers before allocation under the documented resource/class. Route-table origins, physical-link slots, candidates, selected-path roots and lookup/admission owners are separate bounds in the fixed collection inventory. Browsable endpoint notices retain all 1,024 permitted rows per endpoint. Session registry phases are exactly preparing/live/recovering/terminal, and each phase transition advances the sample sequence before handoff/removal observation. Alias operations register their lifecycle before acquiring the alias-state mutex. Service shutdown seals that admission and joins all registered reads/writes and atomic persistence before clearing state and releasing capacity. Retirement does not acquire the alias-state mutex, so a caller retaining that mutex while closing the service cannot deadlock shutdown. Alias token/publication semantics and exact revision/consent checks are unchanged.
Alias projection returns its independently sampled canonical sidecar-byte token
under the alias lock, including same-store-revision changes; it is not a store
cursor invalidation or a runtime generation change.
Do not retain terminal display entries forever or export capabilities to avoid
building a safe projection. Offline durable/configuration/alias/action operations
remain available. service.NewOfflineRuntime supplies protected audit reads;
peer, directory, route and session calls return runtime_unavailable.
The backend accounts each operation from concrete request through schema, correspondence, executor, owner, effect/audit and online/offline behavior. A missing command is not complete merely because the API exists. Configuration help and load/edit/save/limits commands are present in the current line-oriented dashboard, along with durable browse/detail, runtime/audit and exact-action commands; no full-screen replacement is claimed. The command guide describes the consumers. Service and process tests own backend and shipped-command integration.
Implemented runtime inventory and audit domain readers
Domain readers cover peers, links, routes, candidates, retained
production endpoint sessions, restricted pairing carriers and protected audits.
Service.PeerObservations, RouteObservations, Sessions, RuntimeGeneration
and ReadAuditContext are the adapter entry points. The peer and route entry
points expose read-only interfaces. They do not expose READY, lookup or relay
admission capabilities. service/runtime_api.go installs the 20 live inventory
handlers plus read_audit through admin.RuntimeActions. The existing command
dashboard consumes these operations. Runtime-reader and adapter regressions live
with the service.
peer.Manager reads current durable eligible targets before its own runtime
lock. Address-free targets remain visible with no_address. Link rows use the
current relationship head for their relationship key and retain the historical
TLS identity separately as AuthenticatedHead. Removed relationships fall back
to that authenticated head while their links remain owned. A link display handle
is allocated at pending admission and survives draining/closing until exact
finalizer join. Reciprocal READY, channel settlement and lease ownership remain
with the existing manager. Diagnostic callbacks are not an inventory source.
routing.Table copies selected candidates and ordered alternatives without a
lookup lease. Expiry/unusable contributions are swept under the table lock,
advancing the sample sequence. Candidate/link handles are display values, not
routing tokens. The self candidate has its local root as next hop and one-root
path, with no link or expiry. Both owners accept an explicit nonzero startup
generation. Service passes the same generation to peers, routes and sessions;
sequences remain independent. No wire frame or polling protocol was added.
SessionRegistry reserves the configured session_registry CONTROL allowance
for its lifetime, default 64 MiB and minimum 4 MiB. Rows, maps and an AVL ordered
index allocate lazily. A 64-KiB fixed allowance plus 4 KiB per row capacity covers
public rows and paths, runtime/cancellation and retained-origin indexes, and map
growth overlap. Endpoint capacity intersects the global circuit policy and
circuit resource counts. Endpoint observations take no second global circuit
token; restricted pairing retains its separate 16-registration process allowance.
Pagination and shutdown use no maximum-sized scratch arrays. Lists return at most 16 rows. Path pages/details return at most eight
roots. Preparation allocates an identity before bootstrap/engine work; observer
handoff transfers causal updates to the circuit owner. A bounded local callback
runs with circuit-to-registry lock order, never I/O or an admission operation.
Preparation failures publish terminal before cleanup/settlement waits. A terminal
row cannot become live again. Circuit projections publish Joined separately;
restricted carriers and pre-handoff owners call the distinct idempotent joined
transition after native/consumer/target/claim/budget joins. Once-owned release
only removes an already-joined row and never fabricates Joined. A test-only
barrier outside owner locks proves the joined row is readable before removal.
Production installs no barrier and does not retain joined rows as history. Replacement
changes the attachment handle and path while preserving the session display
identity, byte edges, inner TLS and once-invoked application owner. Restricted
carriers are hub_pairing, never peer links or relay-forwarder endpoint sessions.
Only a completed gateway encoder write records the latest locally emitted
status. No client receipt, application frame, TLS material or circuit-control
secret is inspected.
Audit.ReadContext opens only the five protected audit filenames. It captures
handles/complete lengths under the writer metadata lock and scans outside it.
ReadAuditContext is the offline equivalent, for an owner holding the local
exclusive administration lock. Cursor/page types and argument validation are
platform-neutral. Non-Unix readers fail closed with ErrAudit without opening
files; they do not prevent supported AgentHub targets from compiling. Unix
readers validate no-follow opens, regular type,
same-user ownership, private permissions, closed LF-delimited records, cursor
boundaries and inode/first-record identity. Continuations keep their original
high-water through retained rotation and expire after eviction/replacement.
Scans examine at most five headers, 64 records and 64 KiB and return at most eight
1 KiB records. Service admits eight synchronous readers, charging 32 KiB each,
then cancels and joins them before writer shutdown. Returned page storage belongs
to the caller after return; the private adapter charges its retained result
through delivery/ACK separately.
Runtime circuit_changed and every atomic Budget.Reserve limit rejection use
closed best-effort producers. One rejection labels the batch's primary admission
resource, not a caller key or rejected identity. Four process-wide workers and
128 fixed pending slots bound stalled sinks and storms. Matching pending events
coalesce with saturating counters. Queue contention, saturation and producer
closure drop observations, not durable commits. Enqueue and producer close never
wait for a sink; durable mutation audits keep their synchronous committed path.
Service shutdown closes the runtime producer, then flushes pending invalid-input
summaries, writes service_stopped and seals the audit writer under one mutex.
A runtime sink admitted before producer closure can arrive later, but cannot
append after that marker. An already writing record finishes before the marker;
a delayed not-yet-writing sink is dropped. This preserves the four-worker bound
without joining an arbitrary stalled runtime callback. It does not make filesystem
Sync/Close, or the synchronous stop audit, cancellable when the protected audit
filesystem itself stalls.
Storage numbers describe bounded owned structures, not a Go allocator/RSS
ceiling. Peer/route page storage and caller-retained results still need the
private adapter's result reservation and retirement accounting. Every ordinary
private operation admits four times its concrete LF-inclusive result ceiling
plus 4 KiB before handler entry. Production control-socket composition charges
it through Options.Reserve; shipped online clients and both offline transport
endpoints install the API-owned finite LocalResultBudget.
Directory operations and repair validation additionally reserve 1,536 KiB of independent
directory_control scratch before scanning the bounded retained conflict index.
The supported minimum now admits that projection alongside one synchronization
engine's maximum nine control-frame owners, including pending deltas, queued and
processing events, the reader and a serialized write. Config correspondence and
production private-socket browse/repair tests cover the 10-count, 2,162,816-byte
resource floor within the current 9,796,736-byte minimum CONTROL aggregate. This closes minimum-profile
incapacity, not multi-engine or whole-process capacity acceptance.
The global runtime-audit queue/worker bound is process-owned, not a per-service
budget lease.
Directory observations/repair-reference validation, limits/config readers,
private DTOs/correspondence/error mapping and typed online/offline composition
are installed, as are the durable, runtime/audit and action commands in the
existing dashboard. Service and
typed library tests own projection, result-reservation and
retirement regressions. These domain APIs do not establish whole-process capacity.
Snapshot and staging accounting
Service.Start resolves finite limits before protected Hub/client reads and
installs store.OpenHubReserved and OpenClientReserved with a service Budget
adapter. A separate snapshot Budget owns retained state, working copies,
protected-read growth, YAML decode staging, immutable-file staging and encoding.
It uses the same atomic reservation and exactly-once retirement implementation
as the DATA/control Budget, without allowing malformed-document decode admission
to consume connection or control capacity.
store.ResolveSnapshotLimits exposes the explicit calculation. On amd64 the
combined store envelope is 103,040,088,788 bytes of admitted capacity. The service
snapshot default adds 150,737,652 bytes for a configuration operation and
262,144 bytes of conservative spare margin. Production config output projections
charge CONTROL instead. None is allocated at startup. The decoder first streams
node/depth/collection preflight without a document tree, then performs one YAML
decode for header, shape and typed conversion. Its input-derived scanner/parser
headroom remains conservative for malformed syntax. The private document ceiling is 64 MiB and the node ceiling 3,000,000 so
populated supported collections fit. Collection, depth, public directory and wire bounds remain unchanged. Exported reserved marshaling
checks context and allocation-free preflight, then reserves explicit validation
scratch plus candidate encoding capacity before domain validation. Returned bytes
retain that full charge. State owners also include validation headroom for
internal domain, credential and transition checks before encoder admission.
The store retains old/new/index overlap until true retirement. See
storage accounting for formulas
and ownership. This is neither a total Go allocator nor an RSS ceiling.
StagingAccounting is a separate process-wide ledger around existing connection,
invitation and tunnel budget owners. It enforces global, public pre-TLS/source,
independent nested/outgoing preparation, authenticated-role and cross-role
same-SPKI bounds. Public accepted connections exclusively own the 128/eight
pending_handshake budget and staging pool. Nested endpoint TLS and outgoing
peer/pairing TLS own separate finite runtime preparation resources, never a
fabricated public source or a public pending slot. Authentication transfers the
exact lease without a release gap. A rejected transfer retains the prior owner
until failure cleanup joins. Shutdown rejects new ownership but does not erase
live charges.
The gateway charges both direct and routed outer-client tunnels before endpoint
preparation and retains two 32 KiB pump buffers plus the 8 KiB pipe through joined
workers. Established endpoint-access frames reserve 2*body+4096 bytes before
allocating opaque body/copy or encoder/frame storage. They retain the frozen
1 MiB outer maximum and use a finite 64-count/12 MiB control-class pool, not an
uncharged bypass under DATA pressure. Each frame also contributes to the same-SPKI
ledger. Ordinary application and JSONL owners remain separate. TLS charge formulas
and exact peer/pairing/carrier retirement are documented in link.
Internal APIs for the next private limits/configuration chunk:
ResolveResourceLimits(Options)validates and copies defaults/overrides.Service.ResourceLimits()independently samples copied effective limits and the snapshot calculation. It is not a cross-owner state/usage transaction.Budget.Limits()andStagingAccounting.Limits()return independent maps.Options.Limits,Options.SnapshotLimitsandOptions.StagingLimitsselect finite internal overrides. Smaller ceilings reject admission; they never change document, gateway, JSONL or collection protocol bounds.store.SetSnapshotReserver, reserved open/create/parse/marshal APIs andstate.Reserverallow other owning processes to compose the same accounting. Reserved byte holders must remain live until their caller retires all aliases.
Current default DATA/control limits are owned by the configuration table and the production capacity map. The supported JSONL value/queue contract remains 64 MiB. Payload/configuration integration provides targeted headroom evidence, not shared process-pool or broad capacity acceptance. No persistent schema, public EzAgent API or inter-Hub wire encoding changed. Actual signed semantic profiles cover 4,096 admissions/invitations, 256 ACTIVE pairings/peers, 1,024 endpoints, 65,536 total ACL rows and a 4,096-row endpoint ACL with 1,024 signed notices. Each loads, queries, mutates, persists and reopens. The combined profile reaches all those collection counts with 1,024 notices total, one-transition remote lineages and legal one-address ACTIVE initiator peers. Separate gates cover 64-transition lineage and a 16-address saved-client entry. This is not a Cartesian guarantee for every nested maximum. See the exact envelope and store regressions. The direct-call pool fixture overlaps old/candidate/encoder, protected read, admitted decode scratch and a config operation as synthetic upper-bound arithmetic; its dummy DATA projection does not represent the private API output owner. Production Hub mutations and service config replacement serialize at the same administration lock. A separate EzHub-server regression proves cancellation at that lock, later durable replacement, and concurrent real configuration/session CONTROL projections plus audit reader through blocked terminal delivery. Reserved scratch is capacity evidence, not allocated maximum parser memory. The configuration/output-owner regressions live with the service tests.
Payload, configuration and pressure integration
Production startup loads protected config.LoadEffectiveContext bytes and their
exact startup token, then converts every closed configured resource before owner
construction. Application/parser resource defaults are 256 MiB each within the
current configured DATA/control aggregates. The correspondence regression covers all
38 configurable resources, the derived tunnel resource and fixed invitation-frame
resource. Snapshot and
TLS staging retain separate finite owner calculations; these admitted-capacity
bounds are not RSS claims.
Service.Configuration and Service.ReplaceConfiguration provide saved intent,
startup-token comparison and restart-required state. Replacement holds the
existing store administration lock via WithAdministrationRevision; the Hub
revision is unchanged. Staging uses the existing protected atomic writer, then
rechecks exact bytes and file identity immediately before rename. It syncs the
directory and verifies installed protected bytes. Failed staging files are
removed even if staging committed before reporting failure. Post-rename
uncertainty fails the online service closed without a success result. The approved three private
DTO/codec/client operations, online registrations, offline administration and
existing command dashboard are now composed with these domain owners.
Real endpoint TLS, AF_UNIX, queue, application codec and production reserve callbacks deliver an escaped 64 MiB value unchanged on direct and one-relay routes. Independent production-mapping reservations cover maximum line/compact, queue, incoming decode and outgoing wrapper/write overlap while control remains admissible. Boundary/+1/malformed/failed-write tests remain with the application and proxy owners. These checks do not replace the parent's simultaneous-capacity or shipped-process gates.
Origin pressure publishes a typed local resource cause before aborting a partial
TLS write. That classification stays local to its Hub. A received circuit
resource RESET is a generic terminal failure without echo or recovery. A remote
mux resource reset is a CodeTransport attachment failure eligible for normal
recovery under the fixed 65-second grace and existing earlier deadlines.
The approved Hub-to-client feedback is terminal/resource_limit for entry-Hub
locally detected pressure, including local endpoint-carrier admission failure.
Remote resource reasons do not authorize that feedback. Otherwise the gateway
emits terminal/circuit_failed or closes with generic transport failure. Its local
emission recorder, private emitted-sample validator and client decoder accept the
same closed terminal union. Accepted local pressure survives native
application-handle/frontend Wait and Close outside EzAgent JSONL. Independent
application/control progress and joined cleanup have focused coverage. See the
exact gateway contract.
Terminal delivery remains best effort under the existing bounded transport. Lost notices remain generic failure; attachment loss may traverse the existing recovery grace. Neither is labeled clean or entry-local resource pressure from a remote reset reason. Exact origin-queue subtype or guaranteed diagnosis would need separately approved semantics. This permission adds no application/service or inter-Hub wire or lifecycle change. See the configuration capacity reconciliation for phase-one targets still above compiled limits; none are silently removed.
Final configuration/limits correction
The approved private operations are now production consumers, not only internal
methods. The shared ezhubapi client/server supports get_configuration,
replace_configuration and get_limits. Online handlers bind the service owner;
offline dispatch binds the existing administration/store owner. The existing
command dashboard has load/edit/save and active-limits commands, exact displayed
config-token saves, explicit reload after conflicts, restart-required display,
minimum/default profiles and fixed structural bounds. No new full-screen app,
second public listener or alternate admin protocol was introduced.
Budget.Snapshot copies limits, current usage and peaks under one lock, with an
independent map and monotonically increasing sample sequence. Exhaustion cannot
wrap or block existing lease release. It does not claim an atomic transaction
with store revision, directories, sessions or other owners. The closed active
sample has 40 rows: 38 configurable resources, a derived tunnel resource and a
fixed invitation-frame resource.
All 79 ordinary private handlers admit their concrete result profile before
projection or effects: four times the LF-inclusive ceiling plus 4 KiB.
Production Options.Reserve must admit it; the shipped offline in-memory server
and client share a finite API-owned local budget. That lease covers bounded
DTO/projection/validation/serialization work and raw terminal ownership while
queue admission waits. The separately charged marshaled
waiting/writer copy remains owned through write retirement. Client decode
reservations survive until ReleaseResult. Directory browse/detail and online
repair separately reserve 1,536 KiB of directory_control scratch for complete
bounded conflict projection and validation. Denial precedes sampling or commit.
Cancellation, errors, blocked output and failed writes retire each owner exactly
once.
Config YAML work has independent malformed-input headroom. Online config reads
and replacement reserve config.OperationCapacityBytes() through the snapshot
owner; startup and offline calls use config's separate eight-operation finite
fallback. The 150,737,652-byte operation charge precedes bounded reads, parsing
and replacement encoding. Its result does not retain YAML trees or raw bytes.
Snapshot/fallback exhaustion maps to private resource_limit, not internal.
The current snapshot budget can reject config operations under snapshot pressure;
this does not consume DATA/control reserve or change document bounds.
Minimum validation includes simultaneous leases, fixed startup owners and direct outer/inner authenticated connection overlap. Impossible saved settings are rejected before restart. Control, direct/routed maximum-delivery and simultaneous-pressure regressions live with the service tests. See minimum ownership for the configuration contract.
Private integration lock and audit cuts
The directory runtime generation is initialized once during service startup.
DirectoryObservations is a plain accessor; directory readers and repair
validation acquire the owner mutex with the request context. Online repair
admits its 1,536 KiB directory scratch, checks the exact store revision, then
compares the displayed reference once under the directory lock without a
registry/store lock. Owner execution rechecks that revision and binding
generation before commit. Expired or missing displayed references return
cursor_expired.
Directory installation captures at most 256 value-only conflict notices under
its mutex and delivers them synchronously after unlocking. The installation
transaction remains owned through delivery. Notice storage reserves
4096 + 256 * sizeof(records.ConflictNotice) before allocation, 32,768 bytes on
this 64-bit host, and retires after the observer joins. Reservation failure does
not publish the candidate. Cancellation after publication cannot discard its
audit. The observer may read the store; repair callbacks no longer nest store
and directory locks.
Audit timestamps use a read-only wall sample clamped to an observed durable security floor. Auditing does not reserve a security second or increment the Hub revision. Authorization, TLS and issuance retain their existing durable time-reservation owners. This distinction keeps successful alias and saved configuration writes from changing store revision through their success audit.
Composed lifecycle evidence
Service topology tests now retain actual endpoint-TLS applications through later-shorter selection, operational renewal and approved stable-authority recovery. Explicit peer leases retain the normal-peer bounded drain policy; retiring routed READY bindings can still require a new authenticated attachment. Exact consent controls that attachment's current pin, never directory evidence alone. Refusal does not re-pair, install a successor or reopen the application socket.
Two-relay blocked socket cleanup proves independent relay shutdown and exact origin join. Signed-directory adversarial inputs reach the real receiver through normal-peer TLS/mux, while native process loss, real grace expiry, pressure exit and supervisor runtime-reset checks use shipped binaries. These are distinct owners: live shipped endpoint renewal and stable-authority transitions now have native ENTRY consent and peer-dashboard decision coverage. In-process operational Hub renewal belongs to the service tests; shipped renewal and authority-transition checks belong to the process suite. Host sandbox/network compatibility requires separate deployment checks.
Production capacity ownership
These limits describe local-Hub accounting, not a sum over a multi-Hub topology. The shipped daemon owns one Hub per process. Circuit adapters, relay issuer slots, routing lookup slots and route-ticket fallback pools also have finite process-wide bounds; in-process multi-Hub fixtures share those fallback pools. Maximum acceptance must use the actual production owners, not multiply a single budget-only admission probe across fixture Hubs.
DATA/CONTROL defaults are 16 GiB/512 MiB admitted-accounting limits, not startup allocations or RSS ceilings. Resource byte budgets remain independent of high logical admission counts and can bind first. There is no aggressive RSS memory-pressure monitor or OOM-safety guarantee. Trusted workgroup defaults do not relax untrusted pending/source controls, authorization, signatures or endpoint ACLs.
| Default or structural bound | Admission and trusted key | Bytes and release | Configuration and regression owner |
|---|---|---|---|
| 512 physical TCP descriptors by default | NetworkAccounting.reserve, public observed IP before TLS; outbound has no fabricated incoming-source key. dialPhysical admits before dial. Public accept reserves a physical/global pending slot before Accept, then binds the observed source before protocol work. Saturation waits cancellably without accepting an uncharged descriptor. One outstanding Accept consumes a slot even while idle. Public pending cap 128, observed-source cap eight; outgoing descriptors retain physical ownership but do not borrow public pending slots. | network_connection, 128 KiB per physical owner. physicalConn.Close marks descriptor closure; networkLease.Close marks serving-owner join. Neither alone returns capacity. Pending-to-authenticated transfer changes phase atomically without another physical count. | network_connection.count/bytes, adjustable above defaults independently of the OS descriptor limit; pending count/per-key from pending_handshake. service/network_test.go, TestOneAddressFreshAdmissionEndpointAuthorizationAndApplication. |
| 256 gateways by default, also 256 per stable client | reserveEntryConnection after client-entry TLS/state selection. ResourceGatewayConnection and physical transfer use the authenticated stable authority SPKI, not source IP, operational certificate, or relay metadata. | 128 KiB lifetime charge, retained through typed lifecycle retirement. Keyed bytes default to 32 MiB. Gateway list/frame reservations are additional gateway_capacity owners and are not gateway connections. | gateway_connection count/bytes/per-key/key-bytes, adjustable above defaults. Authenticated endpoint TLS has the same 256-owner/32-MiB keyed defaults. Network/staging transfer regressions. |
| Logical circuit policies default to 524,288 each | reserveCircuitEndpointFor plus circuitRuntime.admit. AdmissionPool has independent process-global circuit and adapter counters without proportional arrays or channels. Per-Service client and endpoint counters use trusted keys. Entry binds DirectContext.Client; origin binds only the locally authorized endpoint. Origin reserves before carrier, registry or TLS preparation; AdmitReservedEndpoint consumes that lease without another reservation. Entry and origin each count once; transit has no circuit session or replay cache. | 32 KiB fixed DATA and 16 KiB CONTROL per circuit owner, retained through circuit join and relay settlement. Retained recovery keeps the same owner. Registry metadata is prepaid for its lifetime, default 64 MiB/minimum 4 MiB, with lazy rows and indexes and a 4-KiB per-row capacity allowance. Endpoint observations take no second global token. Adapters reserve 16 KiB DATA/16 KiB CONTROL plus actual charged buffers. | limits.circuit_admission.global/per_client/per_endpoint are restart-applied positive int64 policies. Live Services sharing the process pool must agree on its global limit. circuit_memory/control, endpoint_carrier_memory/control and session_registry independently constrain actual admission. Configured policy, retained/replay and joined accounting tests own these boundaries. |
| 256 MiB shared retained circuit storage by default | CiphertextBudget.ReserveCiphertext survives invocation and retained-origin wrappers. Three demand-grown FIFOs reserve payload capacity plus a 256-byte node allowance before allocation. TX emits its 24-byte header and borrowed payload without a DATA staging copy. RX validates the header, charges the exact body, then copies into a separately charged RX queue and releases the temporary body. Adapter buffers are demand-driven and charged; native Session readiness precedes receive-pump allocation. | Actual retained ownership, not cumulative traffic or a full 12-MiB replay window per possible session. ACK/reconciliation, complete delivery and joined terminal release return charges; partial delivery keeps full capacity charged. SessionConn transfers allocations between queue and pump without copying or recharging. Admission denial is terminal resource pressure, not transport recovery; known preparation pressure remains gateway.ErrResourceExhausted. | DATA circuit_ciphertext is byte-only with count zero; config count one is a sentinel. Its byte budget is adjustable independently of the unchanged protocol queue/slot bounds. Circuit allocation/retirement and service accounting tests own this boundary. The 1-GiB retention fixture is an explicitly raised stress profile, not the product default. |
| 1,024 local application sockets by default | reserveEndpointSocket before authorized local socket open, keyed by locally registered endpoint ID. | 32 KiB each; forwarding releases after joined ownership. Global and per-endpoint defaults are 1,024 owners and 32 MiB, adjustable independently of circuit policy. | local_socket; one-address and routed application composition, authenticated application-process profile and a separate 1,024-socket structural AF_UNIX profile with byteflow and joined reuse. |
| 4,096 relay bindings | relay.reserveAttemptSlot plus atomic DATA/CONTROL service lease before attempt storage allocation. One attempt owner includes both incident pairs at transit. Pending setup, borrowed controls and retiring bindings consume the same owner bound. Slots and PairOwnerAuthority.Issue now use 16-bit indices. | 96 KiB DATA and 8 KiB CONTROL per attempt; capability claims and joined pumps prevent early retirement/reuse. Fixed allocator/issuer metadata has a separate 512-KiB process-lifetime allowance. initRelay admits one 128-KiB per-Hub Setup DATA owner in relay_memory, with count zero, before allocation. It releases only after Setup and exact-link consumers join. Capabilities and claims remain per-attempt CONTROL, not fixed empty-pool storage. | relay_memory/control; relay ownership/settlement tests and routing.TestWideRelayCapabilitySlots. Slot capacity is not evidence of 4,096 bound transports. |
| 8,192 mux-channel target; 17,152 default liabilities | mux.Config.ReserveChannels, supplied by peer manager from service CONTROL budget. Charge ordinary outgoing/incoming OPENs, all three required signal channels, rejected terminal records, and missing pair siblings before allocation. The first incoming lane retains its original charge; materializing a reserved sibling adds none. | 1 KiB CONTROL metadata per liability, plus 12 MiB fixed mux DATA per exact peer link. Pair charges survive abort until joined pair close and both lane settlements. Transport-failure charges survive physical I/O worker join. Terminal RESET records remain charged. | mux_channel, peer_mux; mux/capacity_test.go, pair/terminal regressions and concrete mux memory proof. Per-link profile has 128 active/128 terminal slots, 32 pairs, 16 pending OPENs, 8 MiB receive, 2 MiB outbound and 256 KiB control-class DATA partition. |
| 256 peer identities | Store MaxPeers and exact bilateral TLS/state eligibility, then peer manager's existing duplicate arbitration. The peer connection budget defaults to 32 and can be raised through the 256-link structural bound; mux and routing owners include retiring links. | 128 KiB TLS connection DATA, 12 MiB mux DATA, 512 KiB routing DATA and 32 KiB routing CONTROL per link. Retirement retains charges until dispatcher, mux, directory/routing and managed channel owners join. | peer_connection, peer_mux, routing_runtime/control; fixed routing_memory 128 MiB includes table and bounded lookup storage. Routing selection uses signed 16-bit indices, exporter pins span 256 links, lookup slot indices span 4,096 slots. Candidate projections remain bounded to the selected route and best 31 alternatives. Wide-index/pin tests and existing real signed/TLS peer composition. |
Nested endpoint/circuit TLS, gateway tunnels and invitation frames remain separate staging leases. They cannot increase physical descriptor or gateway counts. Public pending-to-authenticated transfer holds staging and network admission locks together. Outgoing peer TLS uses the transport-aware reserve hook, direct pairing adopts the exact dialed descriptor, and raw lineage control retains a physical owner through cancellation-watcher join. No address/context lookup invents the identity of an existing descriptor.
Defaults come from the protected config resource table through one service
adapter. The approved private configuration DTO gains network_connection,
gateway_connection, circuit_ciphertext and mux_channel. Its complete closed
table has 38 resources plus the two existing fixed runtime resources. No EzAgent
application JSONL, inter-Hub frame, ACK, replay, liveness or lifecycle contract
changes. Circuit directional budgets remain 2 MiB unsent, 8 MiB unacknowledged,
2 MiB receive and 64 KiB segments. The 64 MiB JSONL payload/queue contract remains.
The configuration coexistence arithmetic is part of this contract. The default includes 17,152 channel liabilities so 4,096 transit relays and 768 required signal channels can coexist without lowering the 8,192-channel target. Peer lease admission is capped at 512 per exact link and route tickets at 8,192 globally/64 per link; retiring owners stay charged. The gateway lifetime, local-socket and metadata budgets can constrain active circuits before logical admission. Origin and entry circuit owners, retained recovery and retiring owners are distinct and must be reported in maximum evidence. Counts alone do not prove a maximum live topology, retained-buffer or process journey. Service capacity tests own the distinct component and authenticated-process profiles.
Peer inventory remains bounded to 256 links. Session totals use native int,
not uint16 or a fixed 2,064-row ceiling. Private totals remain nonnegative JSON
integers; actual session populations intersect configured policy and metadata
budgets, with a separate 16-owner restricted-pairing allowance. Session pages
remain 16 rows and paths eight roots.
Candidate browse totals count the bounded selected/best-31 projection, not all
256 possible table contributions. Channel/lease fields also use 16-bit internal counters, with private result
bounds of 256 channels and 512 leases per link. Wide-total and bounded-observation regressions
protect these changes separately from maximum live-capacity acceptance.
The 128 MiB global routing DATA owner also covers the peer manager's fixed 8,192-slot ticket index. Startup admits the global DATA/CONTROL lease before constructing either the manager or table. The 64 KiB global CONTROL owner covers service maintenance bookkeeping, not that index. Per-link ticket objects and admission handles belong to the existing 512 KiB routing DATA owner. Both route supervisors derive their wait storage from the shared 64-ticket bound, with 128 wait channels, 137 engine select cases and 133 standalone select cases. Ticket cancellation still releases holds outside admission locks. Nine-ticket engine, standalone and cancellation regressions cover the old eight-ticket overflow without claiming maximum-capacity acceptance.
The lookup pool retains only its 4,096-slot pointer index when idle. Each admitted lookup allocates one bounded 32-candidate payload, including NoRoute leases, and explicit release or table shutdown detaches it. The maximum table plus lookup value inventory is 65,941,816 bytes on linux/amd64, within the 128 MiB global reservation, not an RSS claim. A table's shutdown cannot erase another table's leases or later slot generations. Route tickets, relay pairs and restricted carriers all check the shared 512-hold ceiling under the exact-link admission mutex before validation and hold publication. Restricted admission returns a nil ticket when no rollback owner exists; a failed incoming owner still transfers to its caller for joined settlement.
The ordinary relay runtime regression binds 64 real transit owners across four
fully occupied local incident links using mux.PeerConfig, with 32 pairs and
three required signal channels per link. The component fixture extends only
idle probing to one hour so serial maximum setup is not a liveness trial.
Every bulk and control body identifies
its owner and direction. Mixed termination, held settlement, joined reuse and
late release are covered. The opt-in 4,096-owner matrix uses the same production
profile and byte assertions. Neither the 64-owner matrix nor the allocator's
8,192-ticket test proves maximum physical TLS READY or production coexistence.
The relay runtime matrix now supplies ReserveChannels on every mux session.
All local incident sessions share one bounded ledger; remote fixture sessions
have separate ledgers. The maximum requires exactly 17,152 local liabilities,
including 768 required channels, and checks atomic +1 refusal, unchanged mixed
and held-terminal usage, required-only usage after pair joins, zero after link
joins and a full live pair/binding refill with identifiable bytes. Ordinary
matrices scale the ledger ceiling to their actual occupancy, without padding.
This exercises the production mux hook, not a service budget or TLS topology.
Directory CONTROL defaults derive from all 256 sync engines, each retaining up
to nine owners and 589,952 bytes, plus the 32 globally admitted private handlers
shared by runtime projections and online repairs. The latter retain 1.5 MiB of
scratch each, including repairs waiting for a writer. The resulting default is
2,336 owners and 201,359,360 bytes, not the historical 256-owner/12-MiB ceiling.
The unchanged minimum covers one engine and one scratch owner. Atomic complete
inventory admission, +1 denial, unchanged usage/peaks, joined release and reuse
are covered by TestDirectoryControlFullInventoryAndJoinedReuse.
service.TestServicePeerMaximum256 supplies the opt-in physical-peer
gate. One central Hub has 256 genuinely signed bilateral relationships and
actual TLS/mux READY links; the same fixture runs with three peers by default.
Required channels, route owners, bilateral initial signed directory installs
and budget occupancy are observed through bounded signals, not sleeps. Initial
startup is serial, while all admitted peers and their engines remain live.
The retirement barrier uses a real fixture-owned exact-link hold because the
directory engine closes its production lease before the after-run hook. It
checks retired READY and invalid route provenance while TLS/mux/routing charges
remain retained until the final join. Replacement has a new physical handle;
old cleanup/token use cannot retarget it. Removal, complete shutdown, zero
retained charges and same-state/listener reuse are checked. This seam is
implemented. Its extended 256-peer profile covers 768 required channels,
directory contributions, retirement/replacement/removal and joined restart/reuse,
including complete private traversal. Selection and result reuse follow the
test policy.
Origin admission and pressure audit
Production origin endpoint quota precedes SessionConn capacity, projection row
registration and PrepareRouted. Local endpoint admission and the immutable
descriptor are checked first. The service then reserves one endpoint-bound
circuit lease, with no claimed client key. It obtains only that admission's
selected SPKI through reservation-backed LearnedDirectory.EndpointSPKI, not a
full directory projection. The key's DATA reservation precedes selection and
copying. It charges directory bytes only, since the counted circuit lease bounds
retained key owners without consuming catalog/proof operation slots. Refusal
returns the existing relay LIMIT before carrier, registry or
TLS preparation. Stale/unusable authority remains Denied. Pre-transfer failures
and cancellation release key ownership; after transfer the consumer holds it
until preparation and consumption have closed, then drops key references and
releases it. The service transfers the circuit lease through
EndpointOrigin.AdmitReservedEndpoint. That internal method consumes the lease
and scoped consumer on every outcome and never makes a second circuit
reservation. Before transfer, failures close both circuit and settlement gates
because no attachment exists. After acquisition, the retained origin owner
keeps the existing consumer/circuit/all-settlements joins, including recovery.
The unreserved internal fixture entry and replacement path remain available.
Pressure audit labels are still a closed, independent allowlist. It includes
circuit_ciphertext, network_connection, gateway_connection and mux_channel
as well as the earlier configured/service-added Budget resources. A real
ciphertext Budget rejection passes through recordLimit, the nonblocking
runtime producer, durable Audit writer and readback. Delivery remains bounded
and best effort under queue contention; this correction removes the silent
label rejection, not that documented delivery policy. A correspondence test
checks all 40 production Budget resources against producer and writer/readback
validation. The regressions live with the service tests.
Gateway/application admission
Gateway projections do not prepay 3*ListCapacity for every chooser, which
would charge 102 MiB to both gateway and parser resources even for one endpoint.
store.PublicEndpointsReserved admits local row capacity and
PublicEndpointProjectionScratchBytes before parsing under the store read lock.
The scratch covers maximum-tag record canonicalization. Directory
GatewayEndpoints admits unique-row and candidate-container capacity under its
own lock and omits retained evidence-frame copies that the gateway cannot send.
The gateway charges three bounded row/list copies, candidate-container growth,
and bounded conflict-selection scratch. Learned allocation adds bytes to the
already counted local projection through ReserveProjectionGrowth; both leases
remain held through final send. One combined projection count remains alongside
the encoder or prepared tunnel, preserving the minimum two-owner gateway profile. Reservations survive
list encoding and slow TLS writers. Endpoint/tag/frame/parser maxima remain
independent of configurable connection and admission settings.
The production eight-client regression uses eight separate test executable
processes sharing one protected client store. Each performs ordinary TCP/TLS
admission, overlapping list writes, selection, endpoint TLS, AF_UNIX application
opening and JSONL exchange. Nested TLS and tunnel owners add no physical TCP
count. A ninth same-SPKI gateway is refused before local dial. Clean drain joins
all application resources; a subsequent real application reuses admission.
The native first-use commit retries temporary client-store process-lock contention
within a ten-second context bound, with at most eight revision conflicts. Each
retry reloads and revalidates the exact device and authorization epoch. Replaced
or revoked grants and persistent contention still fail closed. A validated
endpoint opening resource_limit retains its known native pressure cause through
joined carrier cleanup; unrelated rejection or missing feedback remains generic.
The application framing code is unchanged and no JSONL message is injected.
The pending regression accepts 128 actual partial TLS connections from sixteen observed loopback addresses, eight each. It checks source +1 refusal, failed client-certificate TLS cleanup, global admission backpressure, a real TLS/hello replacement while the other 127 partial owners remain, and cancellation at full pending occupancy. The local-socket regression explicitly completes kernel socket closure, then holds its proxy read worker through clean drain, caller cancellation and admission/endpoint revocation. It checks retained charges, +1 rejection before dial, joined release, and live reuse for drain/cancellation. These tests do not claim combined 2,048-physical, 1,024-gateway or 1,024-socket maximum coexistence. The regressions live with the service tests.
Public-pending isolation and production quota
The public accept loop derives source IP from the accepted transport's
RemoteAddr before reserving EntryServer admission. The common pre-authentication
TLS policy is eight active workers and 32 rolling starts per second globally,
with two workers and eight starts per observed source. Partial TLS records can
hold only that source's two workers; excess pending work waits within the same
absolute five-second entry deadline. The 128-global/eight-source pending bounds
remain unchanged and intersect lower configured pending limits. This policy
does not grant privileges to unverified roles, change authenticated identity
accounting or apply fabricated incoming-source labels to outbound peers. NAT
cold starts share the allowance and can time out. It provides single-source
isolation, not distributed DDoS protection or progress at aggregate saturation.
TestPublicTLSIncompleteSourceAllowsAuthenticatedEntryAndLocalRevoke uses real
TCP sources, production EntryServer and store TLS credential providers. While
same-source incomplete TLS connections stay open, another source completes
authenticated client-entry TLS, hello and an endpoint list. Same-user private
status and exact admission revocation remain usable. It also exercises pending
bounds below defaults and cancellation with joined zero network/staging owners.
TestPublicTLSRapidFailingSourceLeavesStartsForAuthenticatedEntry checks rapid
invalid records, unrelated authenticated progress and rolling-window wakeup.
These ingress tests do not characterize storage latency. The separate
maximum-catalog regression proves that ordinary TLS time reads do no snapshot,
catalog, WAL or horizon write work. Durable administration still depends on
storage completion, without holding request-facing store or registry locks.
StagingLimits.Preparations owns independent nested endpoint TLS, outgoing
peer TLS and outgoing pairing TLS resources. Production derives these counts
and the authenticated role counts from the protected connection budgets, so
raising a supported setting does not encounter an old fixed staging default.
Fixed-size owner counts are also bounded by the corresponding byte budget
before computing staging bytes. These are admitted package-owned buffers, not
preallocated memory or whole Go/crypto allocator bounds. The global staging
ceiling includes all three pools plus the public and authenticated envelopes.
Keyed resource budgets retain role-specific admission; the cross-role SPKI
staging allowance does not add an unrelated fixed 128-owner cap. Preparation
pools are derived owners, not extra YAML knobs or private resource fields.
Parser/metadata limits and 64 MiB JSONL remain unchanged.
Direct and routed endpoint preparation no longer charge pending_handshake.
They charge the endpoint preparation pool before the typed constructor. Outgoing
peer and pairing constructors charge their respective preparation pools, without
public-source buckets or invented remote SPKI. The exact staging lease transfers
under the accounting lock to the actual TLS-authenticated role/SPKI and releases
only through joined ownership. NetworkAccounting distinguishes public pending
from outgoing physical descriptors. Public pre-Accept admission remains 128/eight;
outgoing descriptors still charge network_connection and the shared configured
physical ceiling, default 512, with closure plus serving-owner join required for retirement.
This isolation does not bypass the physical ceiling or claim protection from
arbitrary aggregate DATA pressure.
TestPhysicalPendingCoexistsWithNestedAndOutgoingTLS holds a real direct
or routed endpoint TLS partial handshake and actual outgoing peer/pairing
ClientHellos while admitting 128 public TCP partial handshakes from sixteen
observed sources, eight each. It checks the same-source eight, both public
budget/staging counts, independent preparation charges, cancellation and joined
zero ownership. The pool regression also fills all three finite preparation
resources, checks +1 atomic refusal, public 128/eight coexistence, transfer,
release, reuse and copied limit maps.
Circuit policy regressions use five-slot component fixtures around production admission, Budget, circuit leases and invocation-worker ownership. They check denial, per-Service isolation, zero origin client identity, rollback, held join and relay settlement, then reuse. Configuration tests check startup propagation and saved-versus-active policy without another routed TLS/application journey. Focused security and socket-revocation tests retain their own real boundaries. Combined and authenticated application maxima below remain separate explicit capacity profiles. Selection follows the test guide.
Production capacity profiles
service/combined_maximum_test.go owns an explicit mixed stress profile with
raised connection and retained-ciphertext budgets, not shipped defaults. One
entry Hub holds 2,048 production circuit Sessions across 64 signed/TLS peer
links, 32 pairs per link, plus structural TCP/gateway/AF_UNIX holders admitted by
that Hub's actual budget, network and staging owners. Its configured 1 GiB
retained-storage cap counts actual queue, node and RX-body allocations, not
dummy reservations or persistent Session staging buffers.
The raw consumer supplies deterministic fixture AEAD ciphertext. The exact
retained ceiling is asserted before any release. Independent entry writer gates
then let one queued Session exchange its hash-checked payload and reply while
all other writers remain blocked, with live attachments, unjoined invocations
and their retained ciphertext still charged. At exactly 1 GiB, actual
Session.Write +1 refuses allocation before copy, accepts zero bytes and reports
terminal resource pressure. Borrowed DATA remains charged through the
held writer's join. Only that terminal slot is retired and refilled; pressure is
not transport recovery. The restored 2,048-pair population then recovers each pair
sequentially through real attachment interruption, retaining its Sessions and
verifying every stream's SHA-256 hash, decrypted identity and duplex reply.
The first recovered pair progresses with 2,047 other writers blocked and their
retained storage still charged. Payloads drain sequentially, so neither a
constant 1 GiB through every recovery nor simultaneous population-wide recovery
is claimed. All Sessions/invocations join, and a new circuit carries bytes.
While the complete DATA population remains held, GetLimits traverses the real
AF_UNIX private API and returns all 40 runtime resource rows. Result and CONTROL
ownership release without reducing held ciphertext. Separate component profiles
retain 1 GiB across 512 Sessions and exercise 2,048 actual TCP sockets, 1,024 gateway
lifetimes and 1,024 AF_UNIX sockets without topology overhead. All profiles retain
charges through serving joins. Physical/gateway/socket overflow uses production
admission. TestCircuitRealAllocatorBorrowedExactLimit remains the smaller
allocation-before-copy and borrowed-write regression.
These are not 1,024 authenticated gateway/application TLS client processes.
Structural gateway holders supply synthetic SPKIs to the production transfer
boundary. AF_UNIX holders exercise real sockets and production admission but
not the endpoint authorization engine. The circuit consumer ends at the raw
Session boundary; it does not pretend its fixture AEAD is endpoint TLS.
Small circuit-admission component tests cover configured policy, invocation
worker joins, relay settlement and reusable capacity without another complete
authenticated journey.
Relay/mux component maxima likewise use real mux transport over net.Pipe,
not a TLS process matrix. The service tests
own the profiles and opt-in selectors; the test guide owns commands.
Service.Start passes protected peer_connection.count to peersync.NewSlotsForPeers and
directory.NewLearnedDirectoryForPeers, bounded by 256. A burst from supported
peers no longer encounters an unrelated fixed sixteen-transfer admission ceiling.
Component constructors still default to sixteen. Each peer may stage one value;
encoded input, metadata and verification still reserve DATA before allocation.
Graph construction remains serialized and cancellation-aware. No wire fields,
frame ordering, repair deadline, parser or signature limit changed.
Authenticated application maximum and private projections
service/authenticated_application_maximum_test.go owns an explicit
maximum-capacity reciprocal-star profile with higher configured connection
counts than the shipped defaults. Routine package tests do not repeat its
in-process and subprocess control journeys. The central Hub holds 1,024 ordinary gateways for 128
stable clients, 2,048 entry/origin circuit owners, and 1,024 authorized AF_UNIX
sockets across 16 endpoints on 64 signed/TLS peer links. Each link carries 16
ENTRY and 16 ORIGIN applications within its 32-pair ceiling. The profile uses
128 client and 64 remote-Hub test executables with production
client-entry TLS, endpoint TLS and JSONL. These are not 1,024 native TUIs.
Remote owners are not added to central counts. This legal profile does not
combine 256 peers, 4,096 transit bindings, pending ingress and 1 GiB ciphertext.
Current private maximum hooks reuse peer/application/combined fixture owners. They check expected family totals and complete ordered typed pagination, without repeating detail/path calls or blocked lifecycles at every maximum row. Small signed domain controls own exact identities, ReadyLink handles, route provenance, bootstrap/registration/attachment identity, full learned evidence metadata, output expiry, Terminal/Joined ordering, held results and refill. The retained-ciphertext component supplies no private-assertion callback. The service tests own these assertions and opt-in selectors. Component ownership, private population and maximum transport checks remain distinct scopes rather than a release-signoff claim.