docs/internal/agenthub-local-control.md
AgentHub private EzHub JSONL v1
Local administration uses the typed pkg/ezhubapi JSONL
API over owner-private, same-user AF_UNIX control.sock. It is independent of
public EzAgent JSONL and every inter-Hub protocol. The predecessor
internal/agenthub/localcontrol package has been removed. There is no generic
operation/parameters executor, U32BE local administration, alias, protocol
sniffing, or compatibility fallback.
Startup and closed schemas
The socket adapter authenticates the peer before the API receives bytes. Startup
is exactly one {"type":"ezhub_hello","version":1} line and one
{"type":"ezhub_hello_ack","version":1} line. Startup rejection uses
ezhub_hello_error, then closes. Hello, partial-frame completion and individual
writes have bounded deadlines. Healthy idle connections have no read deadline.
Each subsequent line is a closed JSON object. Concrete requests contain type
and an opaque nonzero 32-hex RPC request_id; mutations also contain positive
expected_revision. Operation-specific fields are top-level, never serialized
parameters. A normal result is <operation>_result with the matching RPC ID and
positive observed or committed revision. Pairing request IDs and durable row
IDs are separate nonzero 32-hex namespaces, named pairing_request_id and
row_id. Authorities, endpoints, clients, genesis IDs and selectors use complete
lowercase 64-hex values. The library page lists
79 concrete administration operations plus transport cancellation. The original
22 shapes remain intact except for required alias_token fields on
status_result and set_pairing_alias_result, and required purpose on each
status.pending row. Its closed value is admission or endpoint, exposing
the existing invitation scope for read-only presentation and exact-tuple
validation with subject, selector and invitation revision. It does not grant
access, change a ceremony, schedule recovery or add an operation.
The private backend adds 57 closed operation
pairs.
Unknown, duplicate decoded names, case-folded names, missing fields, invalid UTF-8, unexpected nulls, noninteger numbers and secret-shaped extensions fail closed. Recursive schemas, depth/value limits and role-derived public identity checks apply on both sides. Hello and cancellation lines have a 1 KiB ceiling; ordinary request/result lines have 64 KiB and status has 512 KiB, including LF. The library owns parsing and correlation, not store policy or authentication.
Operations and committed effects
status is passive. Optional pairing_page is an integer from 0 to 63; absent
means page 0. Counts and truncation flags remain independent. Each status carries
up to eight active endpoints, 64 pending approvals, eight terminal invitation
notices, 64 pairings, 64 pairing cards and eight authority proposals. Endpoint
rows contain alias, ID, configured local socket and publication flag. The command
dashboard prints configured socket paths without dialing applications. Status
and browse refresh are passive, not health probes or authorization decisions.
Terminal notices use local row IDs, not remote invitation selectors, and remain
until the existing retention deadline. Compromised/conflicted invitations need
fresh JOIN WORDS, not approval or reuse.
Revision-checked mutations cover registration, invitation creation and decisions,
revoke/regrant, publication/withdrawal/deletion, authority transition, peer
removal/successor decisions, Add Hub, alias, bilateral approval and pairing/card
cancellation. bootstrap and pair are not socket operations. Bootstrap is an
explicit offline command.
admin.ControlExecutor dispatches concrete ezhubapi.Request types to the
existing closed domain hooks. It returns concrete results, never a serialized
legacy request. The executor samples wall time without writing the store;
status does not reserve security time. Time-dependent operations clamp wall time
to the durable floor under exact-revision ownership. Registration and transition
reserve their issuance second at the caller's revision, prepare credentials,
then activate at the returned revision without rebasing over another writer.
Internal admin.CommittedResult carries definitely committed effects and audit
metadata separately from wire results. The service processes it synchronously
before returning the typed terminal. Uncertain persistence returns the stable
persistence_uncertain error, stops the service, and produces no success effect
or success audit. An error preserves an available observed revision. Conflicts
are not retried automatically.
Status, revision preflights, error-revision sampling and invitation owner-reference lookup use the request context for store lock acquisition. Cancellation and EOF must retire these reads even while a writer remains locked. If cancellation prevents revision observation, the correlated error carries revision zero, without a background fallback. A definite CheckPairing outcome can retain its pre-check observed revision when the canceled final refresh cannot run.
Invitation creation requires independently entered claimant evidence before
JOIN WORDS generation. The immutable lock cannot be derived from an observed
claim or rebound later. Closed CreateAdmission, CreateEndpoint and
CreatePairing hooks select claimant role and policy. Client invitations require
ClientIdentityLock; pairing requires HubIdentityLock. Approval rechecks the exact
invitation revision, durable client ACK and authenticated claimant under the
writer lock. Private locks stay out of network diagnostics and public records.
Identity, cards and response ownership
Public identities contain id, key_check, check_byte and fingerprint.
The codec derives words and byte from the full ID and its field role. Status and
authority effects use Hub authority; registration and endpoint cards use
endpoint; pending claimants use client device. Registration identity must match
the effect's endpoint ID. Old/new authority projections must match their effect
IDs. No provenance, signed proof buffer or private credential is exposed.
Invitation cards contain purpose, subject, immutable claimant lock, expiry,
canonical five-word dot-separated EFF JOIN input, nullable configured
hub_address, and mode. Admission uses the operator's configured public
address; it is not a destination supplied by a remote claim. Public displays and
ordinary Go formatting redact secrets. Results with cards remain caller-owned
until ReleaseResult, including after failed display. Add Hub borrows an owned
Secret; the caller releases its request after Call returns.
The client retains the originating request and validates operation, purpose, subject, mode, claimant forms, target and identity correspondence before transferring a terminal. A mismatched response closes the connection and releases its reservation. JOIN input never appears in status, effects, errors, checkpoints or cancellation. No dummy-card exception remains in the fixture or checker.
Peer authority decisions
approve_peer_transition and deny_peer_transition carry genesis,
pairing_request_id, proposal_revision, old and new, plus the outer Hub
revision. Approval updates active Peer and Pairing trust atomically; denial keeps
the old pin. Status proposal rows contain exact genesis/request/revision/status
and both complete public identities, without certificates, addresses or proofs.
Signed continuity does not authorize NEW. NEW remains untrusted for normal-peer TLS until local approval commits. The dashboard shows both identities and exact commands:
| 1 | detail peer_proposals <revision> <genesis> <request-id> <proposal-revision> |
| 2 | durable successor <approve|deny> <genesis> <request-id> <proposal-revision> <old-id> <new-id> <revision> |
| 3 | durable confirm <revision> <review-token> |
Effects include stable peer ID, exact pairing request, old/new IDs and public identities. Stale, failed, cancelled and uncertain requests emit no decision success. A verified fork clears the proposal and removes the relationship; neither branch can be approved. Both sides must remove locally and pair again. Converging accepted heads are rejected, never merged. Typed removal retains the registration barrier and joins revoked workers before terminal delivery.
Shared client and cancellation
The online dashboard holds one concurrent ezhubapi.Client for command and
pairing-view calls. controlsocket.NewClient securely dials before hello. Only
controlsocket.ErrAbsent permits offline locked administration through
admin.NewOfflineClient. Unsafe paths, refused sockets, failed authentication
and failed hello do not bootstrap or open offline state.
check_pairing is a read/recovery request with remote_id and
pairing_request_id, no expected revision. It checks active Peer access first,
then performs one bounded status-first observation under caller cancellation.
The result carries revision, outcome and phase, not Q, approval, grants,
credentials, subscriptions or schedules. Outcomes are active, waiting,
terminal, timeout and temporarily-unavailable; phase is empty except for a
known local terminal phase. Status and Hub restart do not dial Prepared or
LocalApproved rows.
pairing open owns immediate and sequential repeated exact checks. Close, EOF,
input failure and exit cancel and join the view's in-flight call and timer.
Reopen checks immediately. Existing approval wake behavior is retained. The
five-minute initial service carrier may finish without a competing check but
cannot initiate reconnect. Local cancel pairing is a separate durable decision
that joins exact decision/recovery owners under the existing registration barrier.
Transport cancellation uses its own RPC ID and target_request_id. The server
captures the exact target owner, signals it outside the map lock and ACKs only
after handler retirement. That includes joined recovery callbacks, outbound
transport closure, capacity release and definite-commit processing. It does not
roll back a committed mutation. EOF and shutdown cancel then join all owners.
The client continues correlating original terminal and cancellation ACK during a
separate cleanup window. A durable result can accompany ErrJoinTimeout; consume
and release it while reporting the missing retirement ACK. A remote typed error
is preserved alongside that timeout. Never replay Add Hub after transport loss.
A terminal already in client dispatch survives concurrent writer failure: teardown joins dispatch before failing unresolved calls. On the server, up to eight admitted terminal owners can wait for bounded queue space after handler retirement. The original terminal and cancellation ACK both retain delivery ownership; ordinary queue saturation alone does not abort them. One fixed rejection owner keeps the input dispatcher nonblocking under rejection pressure. Queue limits and service aggregate budgets are unchanged. See the library resource contract.
Add Hub durable outcomes
add_hub_result reports prepared or accepted, exact nonsecret remote and
pairing request IDs, and the actual checkpoint commit revision. The engine
reports Prepared synchronously after definite persistence and before Claim
transmission. A separate post-Context callback supplies Accepted evidence even
if the held-carrier handoff fails or its decision deadline has elapsed.
Failure before Prepared is an ordinary correlated error, with no new pairing
row or automatic view. After definite Prepared, a carrier failure or definite
Context write failure returns prepared. Definite Context returns accepted.
Uncertain persistence returns no checkpoint and fails the service closed,
including uncertain Context after definite Prepared. Transport loss before
result delivery leaves the client outcome unknown; never replay Add Hub.
Direct and routed requests use the same typed outcomes. Routed requests acquire a
restricted Hub-targeted pairing carrier over eligible peer links, without a dial
address or normal-peer promotion. A stale revision is rejected before carrier
work. Failure to resolve or reach the verified target before Prepared returns an
ordinary correlated error and creates no new pairing row; it is not an
unsupported-mode result. The existing local error mapping remains generic.
The command dashboard validates direct address and independently supplied public
checks before interactive JOIN entry. Explicit compact combined-form = input
requires a valid nonempty full fingerprint; it never silently removes that
independent authenticator. Role-specific identity validation remains unchanged.
Prepared and Accepted share a provenance-aware public identity renderer, which
labels candidate-derived checks/fingerprints separately from independently entered
matches and omits duplicate unlabelled identity values.
A Prepared result means the request is saved for recovery, not that signed Context or approval exists. Both outcomes open one pairing view or wake its existing owner with an immediate exact target, before status-page discovery. The view holds at most eight queued targets plus its active target, deduplicates both, and applies caller-owned backpressure when full. Checks remain sequential and client-paced. An exiting dashboard does not reopen for a late result.
A failed carrier's registration, transport and capacity retire before Prepared
is returned. Only a successful Accepted handoff permits a bounded service-owned
initial carrier to remain. Alias publication is separate: canceled or failed
sidecar writes return alias_not_saved without erasing the pairing checkpoint.
The result's revision remains the proven pairing commit revision, not a later
alias or status observation. Fresh checks show the current row even if another
administrator has already cancelled it. Pairing wire, durable formats, exact-Q
exclusion, disclosure order, deadlines and passive restart remain unchanged.
Fixtures and tests
pkg/ezhubapi/testdata/control.json
contains literal LF-terminated startup, all 22 operation/result pairs, transport
cancellation, prepared/accepted checkpoints, stable errors including persistence
uncertainty, derived identities, closed-schema negatives and stream chunking.
The independent check-config-control.rb and reproduce-control.rb checks live
under internal/agenthub/testdata/trust; the former also checks YAML, and the
latter requires byte-identical reproduction with --check.
literal_test.go exercises concrete decoding, originating-request correspondence,
startup rejection and fragmented/coalesced streams. Other inter-Hub fixture bytes
are unchanged.
Package and real AF_UNIX tests cover socket safety, shared-client cancellation,
committed audits, claimant locks, paging and handler retirement. The shipped
process tests require dashboard hello/status for readiness and exercise typed
revision errors, cards and concurrent calls across a process boundary.
Service tests and
process suites own these checks, including exact-link
assertions. TestPairingViewCloseJoinsProductionRecovery uses the actual view,
shared client, private AF_UNIX server and production outbound recovery in a
separate process. It holds exact-owner retirement behind a gate, observes no
early cancellation ACK, verifies transport/capacity retirement, and immediately
reopens the view to start a fresh check on the same client. Separate service
socket tests cover abrupt EOF and shutdown joining.
The typed library tests own codec and transport checks. Add Hub business composition belongs to admin and service tests. The private Hub API/domain scope is frozen below and the codec and backend implement it; the existing command dashboard consumes configuration, durable, runtime/audit and exact-action operations. Routing, relay, circuit, recovery and routed pairing status is in the circuit status and service composition. Client UX is separate. Public EzAgent and inter-Hub additions are not approved.
Frozen private configuration contract
This section is the exact approved contract and documents the implemented
private backend. The user approved these private Hub daemon/configuration-client
JSONL additions. Public
EzAgent JSONL, inter-Hub bytes, SQLite schema and user_version are unchanged.
The current backend has 79 concrete operations plus transport cancel: the
original 22, three configuration operations, 30 durable list/detail operations,
21 runtime/audit operations, and three exact actions. The codec and executor have
no generic fallback. Unknown operations fail closed, and no frozen operation is
silently returned as unsupported because an adapter is missing.
The implementation keeps version-1 hello, one same-user AF_UNIX control socket,
one public Hub address and the closed TLS roles. It extends concrete ezhubapi
types in place and does not retain a second codec.
There is no subscription, arbitrary operation, state dump, raw record reader,
route editor, topology-derived trust or hidden repair. The command dashboard
remains the frontend. Only an open pairing screen owns repeated exact checks.
Voice/manual entry means reading displayed values into another operator's
screen. It adds neither audio input nor terminal QR.
Original callable inventory and consumer boundary
These are the original 22 socket operations. Transport cancel is separate.
The owning implementation remains admin.ControlExecutor.Handle and its closed
admin.Manager/service pairing hooks, not an alternate dashboard implementation.
The private backend adds 57 concrete operations without replacing or generically wrapping
these requests. Only the required alias sample fields change two original result
shapes.
| Existing operation | Exact domain target and owner | Dashboard disposition |
|---|---|---|
status | Store AdminStatusPage; optional pairing page | Keep summary, never treat truncation as complete inventory. |
check_pairing | Remote authority + pairing request; service exact recovery owner | Keep screen-owned immediate/sequential checks, unavailable offline. |
register_endpoint | Alias + local socket; staged endpoint credential/store | Existing register; add exact endpoint inspection. |
create_invitation | Purpose + subject + independent claimant lock + lifetime + mode; invitation protocol | Existing card commands; add browse/cancel access for unclaimed client cards by local row. No card replay. |
approve | Subject + selector + invitation revision; ACK-bound client invitation | Existing approval; discover exact row beyond pending summary. |
reject | Same invitation tuple | Existing reject; never approve compromised/conflicted rows. |
cancel_invitation | Same invitation tuple | Existing claimed cancellation; new row cancellation below covers erased/unclaimed selectors. |
revoke | Scope + client + approval revision, endpoint for endpoint scope; authorization registry/store | Existing revoke; expose complete admission/ACL targets and expiry. |
regrant | Exact invitation tuple + optional expiry | Existing fresh regrant; do not revive old application owners. |
publish, withdraw, delete_endpoint | Endpoint ID; local signed publication/retirement | Existing commands; deletion stays destructive retirement, not key reuse. |
transition | Local authority at expected store revision; credential lifecycle | Existing transition; show complete old/new identities and continuity history. |
remove_peer | Remote authority + pairing request; registry/peer manager | Existing local removal; both Hubs must remove before re-pairing. |
approve_peer_transition, deny_peer_transition | Genesis + request + proposal revision + old/new authority | Existing successor commands; exact detail/discovery, no accept-anyway. |
add_hub | Mode + independent inviting check + JOIN input, direct address only; pairing engine | Existing direct/routed commands; preserve Prepared/Accepted and no replay. Unavailable offline. |
set_pairing_alias | Remote authority + request; bounded local sidecar | Existing alias command, independently supported offline; never sign/synchronize alias. |
approve_joining_pairing, approve_inviting_pairing, cancel_pairing | Remote authority + request; running service PairingActions owner | Existing commands; preserve separate consent slots and exact retirement joins. Return unavailable offline. |
cancel_pairing_card | Local invitation row ID, pairing purpose; running service PairingActions owner | Existing cancellation; no unclaimed JOIN disclosure. Return unavailable offline. |
bootstrap remains exclusive offline initialization, not an RPC. pairing open/close, help and exit are frontend actions. The backend now exposes complete
durable browse/detail, live peer/directory/route/session observations, bounded
audit reads, endpoint certificate renewal, explicit higher-binding repair,
client-card row cancellation, and read/replace configuration with limits. The
existing command dashboard consumes configuration, durable, runtime/audit and
exact-action operations, as described in the
command guide. No ACL
editing or arbitrary expiry update was added. Approval/regrant already sets
expiry; changing it still requires the existing revoke/fresh-consent path.
Headers, independent samples and errors
All new requests/results use the existing RPC ID, closed schemas, strict integer
and identity validation, ownership/release, error and joined-cancel rules. Each
normal result has revision, an observed store revision for reads or the proven
commit revision for mutations. Read-only calls never advance the security floor.
Store revision is not authority generation, binding/publication/access revision,
runtime generation, observation sequence, audit position or configuration token.
A runtime result also has runtime_generation, a random nonzero 32-hex daemon
startup ID, sample_sequence, a positive per-owner uint64 incremented for each
visible membership or value change, and sampled_at, Unix milliseconds. Store
revision is sampled separately before the owner read and is labelled as such.
Peer, directory, routing, sessions and budget are independent samples. No result
promises an atomic topology or common observation time. A sequence cannot wrap;
the owner fails closed rather than recycle it. A generation changes on restart,
not on route replacement or store commit. Runtime handles are random nonzero
32-hex display IDs scoped to that generation, never admission capabilities,
wire circuit IDs or physical-link tokens.
The added closed error codes are runtime_unavailable, not_found, cursor_expired,
config_conflict and audit_unavailable. Stale durable revision uses existing
conflict. No error carries raw input, path contents, cursor contents, proof or
secret. not_found is only a read result at an otherwise valid revision/sample;
missing mutation targets remain conflicts. Offline runtime calls return
runtime_unavailable, never an empty or fabricated live inventory. Offline
browse/detail, audit and configuration reads are available under the same local
exclusive lock. Offline-supported durable mutations use the same locked domain
code as online administration, subject to operation-specific owner requirements.
approve_joining_pairing, approve_inviting_pairing, cancel_pairing and
cancel_pairing_card require a running service PairingActions owner and return
unavailable offline, as do check_pairing and add_hub. set_pairing_alias
uses its independent protected sidecar owner offline; durable pairing and card
browse/detail remain available. There is no offline pairing worker, network
check/Add Hub, live limit sample or runtime-effect substitute.
The frozen text's earlier claim of existing offline pairing-decision support
was inaccurate. Both the original and current command offline executors omit
Pairing. This corrects that existing-support claim, not approval for a new
offline owner or a demotion of any mandatory new private operation.
Durable browse and exact detail
Each row family has two concrete operations, not a string-selected collection
executor. list_<family> has limit in 1..16, default 16, and optional after.
The cursor is a closed object {collection,parent_key,revision,last_key}.
collection is the exact plural suffix of the concrete list_ operation, and
parent_key uses the byte-exact encoding below, empty for a top-level family.
They bind pagination only, never select dispatch. Its revision is positive;
last_key is the family's canonical full key below, at most 256 ASCII bytes.
Parent fields are required on every page. A first page has no cursor. A result
has rows, total, effective limit, echoed parent fields, and next, either
null or a complete
DurableCursor object with the result's revision/collection/parent and the last
returned full key as last_key. A runtime page instead returns a complete
RuntimeCursor with its result generation/sequence, never a bare key string.
Rows are strictly ascending, unique and
strictly greater than after.last_key. All eligible rows contribute to total,
including terminal/revoked/retired rows still retained. A full last page has null
next; there is no hidden truncation flag or maximum dashboard page count.
The store projects a bounded page under its cancellable read lock, not an entire
secret-bearing snapshot into the API. If the cursor revision differs from current
store revision, return conflict with the observed revision and no rows. Restart
browsing deliberately. No frozen snapshots, cursor cache or automatic rebasing.
Alias sidecars are separately sampled; alias changes do not invalidate a store
cursor and cannot affect key order or authorization.
Exact cursor keys and derived digests
Every key is an ASCII string. Comparison is unsigned byte-lexicographic, not
locale, case-folded or numeric collation. Composite components are joined by
exactly one ASCII slash byte 0x2f, with no leading/trailing slash, escaping or
whitespace. IDs/digests use their existing fixed-width lowercase hex. Generations
and revisions in keys use exactly 20 decimal digits, left padded with ASCII zero;
path_index uses exactly one digit 0..7. JSON number fields remain integers,
not padded strings. A canonical address is net.JoinHostPort(host,decimal_port)
from the retained validated Address. Addresses have no slash, so no encoding
ambiguity exists. last_key is at most 256 bytes except peer addresses at 512;
parent_key is at most 256 bytes. Their empty string is allowed only for a
top-level parent, never for last_key.
| Collection | last_key components in exact order | parent_key components in exact order |
|---|---|---|
| endpoints, admissions, invitations | endpoint_id; client_id; row_id respectively | Empty |
| endpoint_acls | client_id | endpoint_id |
| endpoint_notices | revoked_revision / notice_digest | endpoint_id |
| pairings, peers, peer_observations | remote_id / pairing_request_id | Empty |
| peer_addresses | address | remote_id / pairing_request_id |
| peer_proposals | genesis / pairing_request_id / proposal_revision | Empty |
| authority_history | authority_generation | Empty |
| authority_resolutions | predecessor_digest | authority_generation |
| authority_rejections | successor_digest | authority_generation / predecessor_digest |
| peer_authority_history | authority_generation | remote_id / pairing_request_id |
| peer_authority_resolutions | predecessor_digest | remote_id / pairing_request_id / authority_generation |
| peer_authority_rejections | successor_digest | remote_id / pairing_request_id / authority_generation / predecessor_digest |
| peer_links, directory_endpoints, routes, sessions | link_id; endpoint_id; origin_root; session_id respectively | Empty |
| directory_conflicts | conflict_digest | endpoint_id |
| directory_origins | origin_id | endpoint_id / conflict_digest, using the single literal - component for the aggregate view with no conflict parent |
| directory_evidence | record_digest | endpoint_id / conflict_digest |
| route_candidates | candidate_id | origin_root |
| session_path | path_index | session_id |
Table semicolons distinguish alternative families, not bytes in a key. All
parents must match the concrete request fields. Cursor collection/parent
mismatch is invalid; it never redirects dispatch. next is null exactly at
the end and an empty collection returns rows=[], total=0, next=null.
Hash output is lowercase 64-hex SHA-256. Domains below are literal ASCII followed
by one NUL byte, not a backslash or printable 0. U16, U32, U64 mean unsigned
big-endian fixed-width binary integers. RAW(hex) decodes exactly 32 bytes.
STR(s) is U16(ASCII byte length) followed by ASCII bytes. No JSON encoding,
hex text, LF or extra separator enters a hash input except where stated.
notice_digest= SHA-256 ofAgentHub/private/notice/v1\0+ RAW(retained tag). The revocation revision remains its separate full-key component.conflict_digest= SHA-256 ofAgentHub/private/conflict/v1\0+ RAW(endpoint_id)- STR(record_kind) + STR(reason) + U16(origin_count) + sorted unique RAW(origin_id)
values + U32(evidence_count) + sorted unique RAW(record_digest) values.
record_kindis endpoint-identity/hosting-binding/publication/revocation-list;reasonis record-conflict/authority-fork from the verified records selection. Counts are nonzero, at most the corresponding retained directory/record bounds. Origins and evidence are the complete set for this conflict, not the gateway's two-origin display. No raw signed evidence enters the private result.
- STR(record_kind) + STR(reason) + U16(origin_count) + sorted unique RAW(origin_id)
values + U32(evidence_count) + sorted unique RAW(record_digest) values.
- Nonempty audit
file_id= SHA-256 ofAgentHub/private/audit-file/v1\0+ U64(device) + U64(inode) + SHA-256(first complete record bytes including LF). Device/inode are unsigned OS stat values, not decimal text or native-endian structs; unrepresentable values failaudit_unavailable. They are never returned separately. Empty files have nofile_id; their sentinel is null.
Literal vectors and their independent checker live in private vectors. These derived values are public local positions/evidence references, never permission tokens.
get_<singular> requires at_revision and the complete key/parent fields. Its
result echoes the exact key, contains one row, and has that revision. A changed
store returns conflict, not the closest replacement. Array members of a detail
are listed separately; no detail embeds an unbounded ACL, invitation history,
notice set, signed lineage or proof. Summary rows contain keys and enum/number
fields only, plus public identities where stated. Long alias/socket values are
in exact detail, not repeated in pages.
| Family / singular | Complete key and required parents | Summary and exact detail fields beyond the echoed key |
|---|---|---|
endpoints / endpoint | endpoint_id | Summary: retired, published, binding_generation, publication_revision, access_revision, acl_total, notice_total. Detail adds endpoint identity, alias, socket, profile, local origin_id, origin_generation, certificate_issued, certificate_expires. No key/certificate filenames or PEM. |
admissions / admission | client_id | Client identity, approval_revision, row row_revision, approved, nullable expiry, first_use, revoked. Detail has the same fields. No SPKI/receipt. |
endpoint_acls / endpoint_acl | Parent endpoint_id; key client_id | Same nonsecret authorization fields as admission, scoped to that endpoint. No endpoint access secret or notice tag. |
endpoint_notices / endpoint_notice | Parent endpoint_id; key revoked_revision plus 64-hex notice_digest | revoked_revision and domain-separated SHA-256 digest of the retained tag, never the tag. Detail is the same nonsecret row. No callable mutation. |
invitations / invitation | Local row_id | purpose, subject_id, phase, invitation_revision, created, expires, nullable completed, nullable claimant identity, owner_approvable. Detail alone adds nullable first_claimant, other_claimant, claim_request_id, and nullable selector for a retained ACKed/unacked client claim actionable through existing commands, plus nullable approval_until. Claimant fields are complete role-derived public identities, not locks. Never return erased selectors or pairing selectors. No lock, JOIN input, Q, ACK/receipt/status key, proof or response buffer. All purposes and terminal rows are included. |
pairings / pairing | remote_id / pairing_request_id | Remote public identity, mode, local_slot, phase, nullable deadline, local_approved, remote_approved, eligible. Detail adds public ceremony_digest, nullable direct_address, nullable conflict, separately sampled alias and alias_token. No Q or consent transcript. |
peers / peer | remote_id + pairing_request_id | Remote public identity, genesis, head_generation, status as active/removed, eligible. Detail adds activated, nullable removed, address_total, nullable fork_first_digest, fork_second_digest, and nullable collision_accepted_id, collision_generation, collision_record_digest. Nullable witness groups are all present or all null. No witness/proof bytes or accept-anyway action. Include removed relationships retained by the store. |
peer_addresses / peer_address | Parent remote + request; key canonical address | Exact retained operator-authorized direct address, at most 512 ASCII bytes per value. This family's cursor allows 512 bytes for last_key. No learned address and no mutation. Never use these addresses as trust evidence. |
peer_proposals / peer_proposal | genesis + pairing_request_id + fixed-width 20-digit proposal_revision | status is exactly pending/approved/denied, with complete old/new Hub public identities. Detail is identical. Exact decision requests remain unchanged. |
authority_history / authority_history_entry | Fixed-width 20-digit authority_generation | Public Hub identity, predecessor_id nullable, accepted, current, decided nullable. Detail adds successor_total, resolution_total, not signed record bytes. |
authority_resolutions / authority_resolution | Parent authority generation; key 64-hex predecessor_digest | chosen_successor_digest, rejected_total, decided. Detail is identical. Digests are nonsecret signed-authority record digests, not invitation proof hashes. |
authority_rejections / authority_rejection | Parent generation + predecessor digest; key successor_digest | Rejected signed-authority successor digest. Detail is identical. No resolution editing or adopt-claimant action. |
Invitation detail's first_claimant and claim_request_id are both present or
both null and project only retained FirstClaimant/ClaimRequestID, never recover
them from erased data. other_claimant is present in compromised/conflicted
rows and null otherwise. Conflicted has all three fields present. Compromised
can have null first/request for an unclaimed leak, or both present after an
earlier claim. Pairing-claimed and approved pairing invitations have first/request
present and other null; cancelled/expired pairing invitations retain that pair
only if it exists in the store. Other client phases have all three null. Identity
roles are Hub authority for pairing purpose and client device otherwise. Summary
identity is a separate current-claimant projection and does not replace these
diagnostic fields. Correspondence enforces purpose, phase and all-or-null groups.
Pairing detail direct_address is present exactly for direct joining-slot rows,
including Prepared/Accepted and retained terminal rows, using their sole durable
DialAddresses element. It is null for inviting-slot or routed rows. conflict
is present exactly for phase conflicted, and contains all of source, observed,
first_id, first_request_id, second_id, second_request_id. Source is exactly
local/authenticated-remote; observed is the retained Unix-second observation.
IDs are complete Hub authority IDs, requests are nonzero 32-hex pairing IDs.
Do not assume the two IDs/requests differ: changed signed lineage can conflict
with the same authority/request. Outside conflicted the entire object is null,
not an object of null fields. Public first/second identities are derived for
presentation from these IDs. No proof, Q, credentials or secret is reconstructed.
Existing store enums define durable purpose, mode, phase and relationship status;
reuse their closed projections, not arbitrary backend strings. Public identities
retain role-derived words/byte/fingerprint correspondence. Retained pairing cards
and terminal notices are discoverable in invitations; do not create a second
card store. Counts for all these families are bounded by the existing store
format and 64 MiB file ceiling, not by status's eight/64 row samples.
Peer accepted trust history is not limited to the current head. Concrete
list_peer_authority_history/get_peer_authority_history_entry,
list_peer_authority_resolutions/get_peer_authority_resolution, and
list_peer_authority_rejections/get_peer_authority_rejection use the local
authority table shapes with required remote_id + pairing_request_id parents,
and the same generation/digest keys. Proposal old/new candidate history is
non-authorizing evidence, not installed accepted history. Saved client Hub
bookmarks, client descriptors and client recovery pending rows remain owned by
the existing client-store UX, not the Hub daemon's configuration API.
No private key/secret-bearing store collection has a raw browse escape hatch.
The durable implementation is store/browse*.go, forwarded by concrete
admin.Manager.List*Context/Get*Context methods and the 30 JSONL adapters in
admin/browse_control*.go. All 15 list/detail families are wired, including
local and peer authority history, resolutions, and rejections. Store projections
copy one bounded public page or exact detail under the cancellable read lock;
the adapter then composes pairing aliases and their independently sampled token
after releasing that lock. These operations preserve the closed wire fields,
target/parent/revision correspondence, nullable groups, identity roles, and
not_found versus conflict mapping. They expose no raw snapshot or generic
collection dispatch.
Independent alias sample identity
Every result containing a pairing alias has required lowercase 64-hex
alias_token, including get_pairing, each status result that carries pairing
aliases, and set_pairing_alias_result. Status has one token for its entire
alias projection; pairing detail has one next to alias. Set-alias returns the
token of the definitely persisted map, even when the Hub revision is unchanged.
The same store revision can legitimately have different alias tokens/strings.
The token is independent of durable cursors, runtime generation and config token.
If an atomic sidecar write returns an error, its alias owner invalidates its cached map and token. The error may follow rename, so unchanged on-disk state cannot be assumed. Further alias samples and writes return unavailable until a new owner strictly reloads the protected canonical file on reopen or restart. This conservative rule applies to any error from the atomic writer, not to validation, revision conflicts or cancellation before persistence starts. It does not alter pairing consent or close existing application sessions.
alias_token is SHA-256 of the protected sidecar's canonical JSON map bytes:
keys sorted unsigned ASCII-lexicographic, Go encoding/json string escaping with
HTML escaping enabled, no spaces and no final LF. Existing keys remain exactly
remote_id + ASCII colon 0x3a + pairing_request_id, 97 bytes; this private
persisted key is not the new cursor's slash-separated key. Keys and values use
the existing ID and NUL-free UTF-8 alias validators. Canonical absence is the
two bytes {} and hashes identically to a present empty map. Reject a malformed,
unsafe or noncanonical sidecar, never manufacture an empty successful sample.
There is no sidecar format migration or new persisted revision column.
Sample map, alias and token under the same alias mutex. Compute/cache the token at validated load or definite canonical write, not by allocating/encoding the whole map for each detail read. The bounded sidecar buffer and cached map remain charged to their owner through retirement. Collect the exact durable projection under its store lock, release it, then take the independently labelled alias sample. Alias writes retain their existing alias-to-store lock order. Readers never claim those independent samples form a transaction. Reads do not prune; stale map members affect the file token but are not displayed if their durable row is absent. Existing locked pruning/writes publish the new map/token together after definite persistence, including restart pruning. Status/detail label this independent sample explicitly. Correspondence checks nonempty token syntax and one token per projection; it must not pretend to derive the whole-file token from one returned alias or enforce equality with the store revision. Set-alias still has the existing exact durable row/revision precondition, not a new alias CAS precondition. A caller that needs the latest display refreshes deliberately. Alias secrets/redaction rules and uncertain sidecar write handling remain with the existing owner; a failure returns no claimed successful alias sample.
Runtime browse and detail
Concrete pairs are list_peer_observations/get_peer_observation,
list_peer_links/get_peer_link,
list_directory_endpoints/get_directory_endpoint,
list_directory_conflicts/get_directory_conflict,
list_directory_origins/get_directory_origin,
list_directory_evidence/get_directory_evidence,
list_routes/get_route, list_route_candidates/get_route_candidate, and
list_sessions/get_session. Each list has the durable list's limit rule,
except route candidates and session paths which have limit 1..8, default eight.
Runtime after is {collection,parent_key,runtime_generation,sample_sequence,last_key}.
The list result uses the same rows/total/limit/echoed-parent/nullable-next envelope as
durable lists, with the additional runtime sample header. Details
require both generation and sequence, plus the full key below. A changed sample
or restart returns cursor_expired with no rows. A page copies only bounded
public values under that owner's lock; it holds no admission/lookup lease after
handler retirement. Repeated churn may require starting over; the UI must say so.
These are live observations, not immutable captured history. An identical route
refresh can retain the selected candidate and path while extending visible
nearest_expiry/expires_at; that value change advances the routing sample
sequence and rejects old continuations and details. Normal route refreshes run
every 20 seconds, independently for each origin. There is no guaranteed
multi-page observation window under continuous updates.
The dashboard invalidates the continuation and requires an explicit fresh
operator read, with no silent restart. The maximum-population test consumer
makes that fresh-read choice explicitly, with at most three whole traversals
per family. Only an exact typed cursor_expired on an incomplete continuation
permits restarting. It logs the discarded sample's generation, sequence,
sampling time and progress, then discards its entire count, last key and cursor.
It accepts only one complete, ordered, correct-total traversal at one generation
and sequence, labelled as a fresh runtime sample. Other errors, joined transport
failures and validation failures terminate immediately. Three expired attempts
fail the test; they do not imply peer admission failure or authorize suppressing
maintenance. Small source/detail controls remain strict. Durable revision
conflicts and audit high-water invalidations keep their separate policies.
| Family | Exact target / owner | Closed row fields beyond target |
|---|---|---|
| Peer observations | remote_id + pairing_request_id; peer.Manager tracked targets/retries | link_total, ready_total, draining_total, dial_state as idle/dialing/backoff/no_address, nullable retry_at, failure_count. Includes tracked peers with no live link. Durable eligible/removed status still comes from the store, not this sample. Detail identical. |
| Peer links | link_id; peer.Manager and reciprocal READY owner | remote_id, pairing_request_id, genesis, authenticated_head, direction as inbound/outbound, state as authenticating/ready/draining/closing, ready, channel_count, lease_count, nullable retry_at. Draining and retained historical heads are distinct from durable eligibility. No TLS cert, nonces or capability. |
| Directory endpoints | endpoint_id; directory.LearnedDirectory plus local catalog projection | published, conflicted, binding_generation, origin_total, conflict_total, nullable origin_id, origin_root, origin_generation, publication_revision, access_revision. Null selected origin/revisions on conflict. Detail adds public endpoint identity if uniquely verified, never raw SPKI/evidence. Availability is a separately labelled gateway sample, not directory truth or ACL access. |
| Directory conflicts | Parent endpoint_id; key conflict_digest, domain-separated digest of kind + sorted complete record digests | record_kind, reason from existing records conflict enums, origin_total, evidence_total, nullable maximum_binding_generation from the complete verified contributing bindings/dependencies. Detail identical. All conflicts are paged, not gateway's two-origin explanation. Evidence bytes and proofs are not returned. |
| Directory origins | Parent endpoint + optional exact conflict digest; key full origin_id | Full Hub public identity, record_total, nullable maximum_binding_generation. List all distinct retained origins contributing to the row/conflict. Record-level differences for the same origin are in directory evidence, not collapsed into an arbitrary winner. No network address. |
| Directory evidence | Parent endpoint + exact conflict digest; key record_digest | record_kind, nullable origin_id, origin_generation, binding_generation. Project all contributing verified record digests and their public generation metadata, never raw records/proofs. Detail identical. This permits exact higher-binding repair input even when two witnesses share one origin. |
| Routes | origin_root; routing.Table read projection | reachable, candidate_total, nullable selected_candidate_id, nullable nearest_expiry. Detail identical. Reachability does not imply peer consent, endpoint publication or ACL permission. |
| Route candidates | Parent origin_root; key candidate_id, local display handle | selected, eligible, rank in 0..31 in the table's selection/alternative order, next_hop_root, nullable link_id, nullable expires_at, path, an ordered array of 1..8 complete root IDs including the local root. Self-route has null link/expiry. Detail identical. No sequence-authentication material, admission token, lease or editable metric. |
| Sessions | session_id; service retained entry/origin registry and circuit observer | role as entry/origin, purpose as application/endpoint_authorization/hub_pairing, endpoint_id or target_hub_id according to purpose, phase, nullable terminal_class, joined, recovery_episode, attempt, nullable grace_deadline, nullable attachment_id, path_total. Detail adds nullable last_gateway_status, last_gateway_code, last_remaining_ms, and gateway_sample_kind, null or emitted. Only an entry's successfully sent local gateway status supplies these fields, with existing closed gateway status/code enums. Origin/restricted owners have null fields. Values are latest local samples, not client receipt evidence or event history. |
Route origin/next-hop/path roots are stable genesis-root IDs, not current
authority heads. Directory origin IDs and peer authenticated heads retain their
separate names/roles. Runtime retry_at, expires_at, nearest_expiry and
grace_deadline are nullable Unix-millisecond display projections of the owner's
fixed deadlines. They cannot renew security time or replace monotonic deadline
arbitration. Durable store times remain Unix seconds.
Client TunnelStatusObserver remains a client-local observation. The Hub
cannot sample another process's received status, caller-loss classification or
transport Joined bit. Service entry projection records only successful local
status emission; it never fabricates receipt or reads inner application JSONL.
Session phase is the closed enum preparing/live/recovering/terminal. Preparing
applies only before circuit-observer handoff. Every phase transition advances
the registry sample sequence, including preparing-to-live and preparing-to-terminal.
terminal_class is null outside terminal, then
joining/clean/failed/caller_lost/resource_pressure from causal terminal arbitration.
Resource pressure is broad local or explicitly received resource evidence, not
proof of the exact origin queue subtype. This local terminal_class is distinct
from the emitted gateway terminal sample. Following explicit user approval of
Hub-to-client exit feedback, that sample's closed terminal code union is
circuit_failed or resource_limit, with zero remaining time. Only causal
entry pressure emits resource_limit. It is a local completed-write sample, not
receipt evidence. Lost terminal delivery stays generic; clients cannot infer
pressure from transport loss or circuit_failed. See the
approved gateway contract.
Before observer handoff, attempt and
attachment_id are null, recovery_episode/path_total are zero, and Joined is
false. A failed preparation enters terminal and remains until its owner joins;
there is no synthetic live phase. Literal preparing and handoff cases are required.
Session attachment paths use list_session_path/get_session_path_root, parent
session ID plus runtime generation/sequence, with fixed-width path_index 0..7
as key and complete root_id as row. An attachment ID changes on replacement;
session ID, retained byte edges, inner TLS and application owner do not. Relay
forwarders are not endpoint sessions. Restricted pairing carriers can be shown
as purpose hub_pairing only while owned, without pretending they are normal peer
links or application sessions. Registry removal follows Joined; observe terminal
and Joined separately. The API adds no session kill, route install or repair-on-read.
get_limits is online-only and takes no target. Its result contains the runtime
header and active_config_token, data_limit_bytes, control_limit_bytes,
data_used_bytes, control_used_bytes, data_peak_bytes, control_peak_bytes,
required active circuit_admission with global, per_client and
per_endpoint, and a fixed array, strictly unsigned ASCII-lexicographic by
resource, of every
resource's resource, count_limit,
bytes_limit, per_key_limit, key_bytes_limit, count_used, bytes_used,
count_peak, bytes_peak. Budget samples all counters under its lock; it does
not promise simultaneous directory/session counts or disclose per-key maps.
Circuit policy is immutable startup state, not a read of subsequently saved
configuration. Saving a replacement does not change this active sample.
get_configuration below works offline and reports effective finite defaults.
The configuration/limits private slice is implemented by the concrete
ezhubapi types and client methods, admin.ControlExecutor online/offline
dispatch, and service/configuration_control.go. Budget.Snapshot captures all
budget limits, usage and peaks under one lock. For this nonpaged owner,
sample_sequence increments for each sample, not each admission change, and
uint64 exhaustion fails closed rather than wrapping. Existing leases can still
release. Store revision is sampled before and separately from the budget.
Bounded audit reader
read_audit has optional after, and limit 1..8, default 8. A first call
captures an upper complete-record position; subsequent calls keep that high-water
mark. The closed cursor contains nonnull file_id, offset, nonnull
upper_file_id, upper_offset. Results always echo effective limit and contain upper_file_id and
upper_offset too. IDs use the literal audit-file hash above; offsets are uint32
at most 1 MiB. A cursor offset is the first byte of the next unread record, or
the byte just after LF at end-of-file. A result record's offset is also its
exclusive end, the first byte after its LF; the first record has offset equal
to its full LF-inclusive byte length, never zero. Offset zero in a cursor means
read that nonempty file from its first byte. Nonzero offsets must be complete
record boundaries, not arbitrary seeks. upper_offset is the exclusive end of
the last included complete record in upper_file_id, positive for a nonempty
high-water. No caller path, raw tail, filter or native stat data is accepted.
Read oldest retained nonempty file to newest, in rotation order, then increasing
offset within each file. records contain file_id, offset and the existing
closed nonsecret AuditEvent. next is null or a complete AuditCursor object,
never a key string. If unread included data remains, it names the exact next
nonempty file at offset zero, or the current file at the exclusive end of the
last inspected record. EOF is not a separate row. The result also has separately
observed revision and retention_gap false. Correspondence checks the full
high-water echo, next-unread progress and the requested record count; it does
not compare file hashes lexicographically to guess chronology. Same-file
cursors cannot exceed the captured upper offset. Record offsets are positive,
strictly increasing within each file, and files occur in contiguous groups
without recurrence. A continuation's records from its request file must be in
the initial group and advance beyond after.offset. No record or cursor in the
upper file can pass upper_offset, and no file group follows the upper file.
A nonnull next stays at the last returned exclusive end in that file, or
moves to an unseen file at offset zero. It cannot return to an earlier group.
A nonempty terminal page ends exactly at the upper file/offset; an empty
terminal continuation is valid only if its request already names that position.
A first captured empty log retains its separate null/zero sentinel.
These checks enforce every ordering fact represented by the page and request. Opaque file hashes cannot independently prove rotation chronology between previously unseen files, identify an omitted file, or prove an LF boundary without the protected files. The protected reader owns those checks. Empty scan-bounded pages must advance their cursor, without changing the high-water mark; they do not fabricate record rows as evidence.
A valid empty active file is skipped when older files contain records. The upper position is the newest nonempty file's captured complete length, not a hash of an absent first record. If the entire retained log is empty, return records=[], next=null, upper_file_id=null, upper_offset=0, retention_gap=false. This is the only null/zero high-water sentinel; it cannot occur in a cursor. Subsequent append requires a new first call, not continuation of the empty result. When older files exist and the active file is empty, later first append is beyond the captured upper and excluded. A completed nonempty read retains its upper in the result even when next=null.
Online capture takes the audit writer's short metadata lock only to sample protected file identity/length after its complete write, then releases it before reading. Offline capture uses the same protected-file validation under the local exclusive lock. Include only that captured length, and validate each inspected record's LF framing/schema. An unexpected partial captured record is corruption, not a smaller invented high-water. Derive first-record IDs outside the writer lock with bounded reads. Header/first-record inspection charges the same 64 KiB scan budget; at most five 1 KiB first records are examined.
A call examines at most five protected file headers, 64 KiB of record data and
64 records, and returns at most eight 1 KiB records. It may return an empty page
with an advancing cursor if the scan bound is reached. Append beyond the upper
position is excluded. Rotation retaining the exact inode/first-record identity
continues; eviction or replacement returns cursor_expired, with no invented
continuity. The UI starts a new read and reports the retention gap. Invalid,
partial, overlong or secret-shaped records return audit_unavailable, not raw
bytes or skipped corruption. Current five-file retention and 1 KiB record schema
remain authoritative. Secure open, owner/mode/type checks and no-follow rules
match the audit writer. Readers cannot hold the writer lock during scanning,
block rotation, repair audit files or open auth files. Online uses cancellable
bounded reader workers; offline uses the same reader under the store lock.
New exact mutations
All requests below carry existing expected_revision, take the same cancellable
store writer/registration barrier online and offline, and return definite commit
results only. No service restart, listener dial or consent decision is implicit.
| Operation / concrete request | Additional request fields | Concrete result beyond header |
|---|---|---|
cancel_client_card / CancelClientCardRequest | row_id, invitation_revision | row_id, invitation_revision resulting row revision, purpose, subject_id, phase equal cancelled. Only admission/endpoint cards, never pairing; exact local row recheck under lock, terminalization and owner retirement use the existing invitation domain. It also handles unclaimed cards without reconstructing a selector. |
renew_endpoint / RenewEndpointRequest | endpoint_id, expected_certificate_issued | endpoint_id, endpoint identity, certificate_issued, certificate_expires. Same key/ID, binding, publication and ACL epochs. Reserve issuance at expected store revision, prepare then activate at the reserved revision without rebasing. Add a context-aware RenewEndpointContext; no caller certificate/algorithm/lifetime parameters. |
repair_endpoint_binding / RepairEndpointBindingRequest | endpoint_id, expected_binding_generation, observed_conflict_generation, next_binding_generation, confirm_stopped_clone true, conflict_reference | endpoint_id, local origin_id, origin_generation, binding_generation, publication_revision, published equal true, echoed conflict_reference. next_binding_generation must equal max of local and explicitly observed conflict generation plus one, with checked overflow. Both generations are positive. |
Repair is a deliberate local endpoint-owner operation. The screen explains that all cloned writable copies must stop first; confirmation records operator intent, not proof of network-wide shutdown. The operator selects the intended existing local endpoint key and enters/confirms the highest conflicting binding generation shown on the conflict screen or on another operator screen. Offline uses that same explicit input, never guesses absent runtime evidence.
conflict_reference is required and is a closed object with runtime_generation,
sample_sequence, conflict_digest online, or exactly null offline. The outer
endpoint_id binds its target. Online null is invalid; offline refuses a nonnull
reference with runtime_unavailable, not a bypass. The online adapter acquires
the shared repair domain's cancellable store writer/registration barrier at the
submitted store revision, then immediately before signer/preparation work invokes
DirectoryObservationReader.ValidateRepairReferenceContext. Under the directory
owner's lock, that method compares generation, sequence, endpoint and the complete
conflict digest/evidence set, and checks observed_conflict_generation equals the
maximum verified binding generation in that displayed conflict, including its
hosting-binding dependencies for publication/revocation/authority-fork evidence.
Conflict rows therefore include nullable maximum_binding_generation. The
operator must see this value and the exact evidence reference. Online repair
cannot validate a null maximum; return invalid without guessing or substituting
the local binding generation. Mismatch of the reference returns
cursor_expired with no preparation, durable write or success effect. A valid
directory sequence with an incorrect supplied maximum is invalid.
The successful validation under the directory lock is the cut point. Release
that lock before signing/I/O; do not block directory updates until commit or
hold an admission lease. Evidence arriving after the cut can produce a later
conflict, even before this commit finishes. Evidence changed before the cut,
including substituted origins/digests at the same maximum generation, cannot
pass. A writer-lock wait therefore cannot turn old consent into a fresh sample.
The adapter enforces store-to-directory validation lock order; no directory
update callback may acquire the store lock while holding its lock.
admin.Manager.RepairEndpointBindingContext owns the common writer/barrier and
invokes the service-supplied one-use validation callback while that ownership is
held, before preparation. The callback returns only bounded verified public
metadata. Offline supplies explicit entered generation through its locked
adapter. The operation never accepts a generic skip-validation flag
from an online caller. Cancellation retires that validation before ACK.
Under the exact store revision/binding check, validate the retained endpoint and current local authority signers, author the higher dual-signed hosting binding and matching published record, advance origin/publication revision and commit once. Do not transfer identity, accept remote authority, change ACL/access revision, or rotate the endpoint key. A changed runtime conflict sample requires the UI to redisplay and reconfirm, not silently increase the submitted generation. New evidence after the successful validation cut can create another conflict; the result never claims global repair. Reads, ordinary publish, authority transition and renewal do not invoke repair. Emit bounded nonsecret commit audits, with existing record domains only.
store/repair_endpoint.go and admin/repair_endpoint.go implement that common
domain transaction and registration barrier. The Manager signature accepts
store.EndpointBindingRepair plus store.ValidateEndpointRepair, a one-use
context-aware callback returning store.RepairValidation with only
MaximumBindingGeneration. It returns store.EndpointBindingRepairResult and
the definite-commit EffectEndpointBindingRepaired effect. The callback receives
no secret state or signer. admin.OnlineRepairActions and
directory.LearnedDirectory.ValidateRepairReferenceContext implement the exact
runtime reference/evidence comparison at that cut. admin.OfflineRepairActions
enforces the null-reference rule. The adapter echoes the reference, maps changed
evidence to cursor_expired, and dispatches the definite commit audit. The
domain callback is not a JSONL skip-validation flag. The repair-only transition
allowlist and current-lineage-head signer checks are documented in
storage.
Existing revoke/regrant/access-expiry semantics are unchanged. Manager revocation now rejects an endpoint ID in admission scope and requires one in endpoint scope, rather than discarding or reinterpreting that target. Client ID, approval revision and store revision remain exact. Regrant still requires an existing revoked epoch and a fresh ACKed client invitation; approval/regrant may set the existing optional access expiry, with denial at expiry equality. No arbitrary expiry editing or ACL replacement operation is added.
The new closed audit event names are client_card_cancelled, endpoint_renewed,
endpoint_binding_repaired and configuration_replaced. They use the existing
AuditEvent fields and scope/domain validation, with no new persisted fields.
Record client-card cancellation as invitation scope with subject endpoint when
applicable, renewal/repair as endpoint scope with endpoint/store revision, and
config replacement as service scope with store revision. Never log
selectors, file tokens, JOIN input, paths or submitted configuration.
Configuration replacement
get_configuration has no additional request fields. Its result has revision,
config_token, configuration, restart_required, and nullable
active_config_token. Online compares the saved document with the daemon's
startup token; offline has null active token and restart_required false. The
configuration is the fully default-expanded closed document defined in
configuration. No raw YAML,
auth values, private paths or environment dump is returned.
The independent public DTO is converted privately to config.Config for the
same complete Validate rules used by YAML and both save adapters. The
limits.circuit_admission object contains required integer global,
per_client and per_endpoint values. Each accepts positive int64 values;
protected YAML omission selects 524,288 for each omitted field. Complete private
objects supply all three. These are restart-applied local policies, not circuit
wire negotiation. The global policy bounds independent process-wide logical
circuit and adapter counters without allocating maximum-sized storage.
Trusted-key client and endpoint policies intersect resource budgets and prepaid
registry metadata. Entry and origin count as logical circuit owners; transit
forwarding does not. Endpoint observations do not take a second global token.
Supported defaults, viable resource minima and supported maxima come from the
configuration owner, not duplicated concrete floors. The command dashboard
displays the complete minimum, default and maximum profiles, saved/active
tokens, restart state and fixed structural bounds. A local edit below any
minimum is rejected without changing the draft. A valid reduction below defaults
warns about reduced concurrency before save. See the
dashboard commands.
replace_configuration / ReplaceConfigurationRequest carries
expected_revision, expected_config_token, and a complete typed
configuration, never patch keys or YAML. ReplaceConfigurationResult echoes
previous_config_token, the new config_token, the default-expanded
configuration, and restart_required. expected_config_token is exactly
SHA-256 of the current protected config file bytes, lower 64-hex, including
comments/whitespace. It is not a store revision, semantic hash, runtime generation
or permission token. Even a semantic no-op must match the current bytes. Encode
one deterministic current YAML document; its hash is the result token. A byte
identical no-op returns the same token/revision without a write or success audit.
Hold the same exclusive administration lock for revision check, protected config
read/token check and atomic owner-only replacement using temp, fsync, rename and
directory fsync. A token mismatch returns config_conflict and observed store
revision, with no write; the client explicitly reloads before a new decision.
Config replacement does not change Hub store revision. It cannot be one atomic
transaction with an external file editor; only protected regular files and the
cooperating locked writer are supported. Recheck file identity/token immediately
before rename; refuse detected external replacement. Uncertain post-rename
persistence returns persistence_uncertain and stops the online service without
a success result/audit, just as store uncertainty does. No rollback claim.
Every config change applies at next daemon start, including inbound and limits. Do not hot-shrink reservations, restart the daemon or disconnect applications. The online result accurately reports whether saved and active tokens differ; offline changes remain saved intent. Config-file absence/corruption does not permit implicit defaults/replacement. Exclusive bootstrap remains its owner.
Payload headroom, correspondence and implemented interfaces
Keep the current 1 KiB hello/cancel, 64 KiB ordinary and 512 KiB status line ceilings, including LF; JSON depth 16 and values 8,192 remain unchanged. New summary rows have a maximum encoded size of 2 KiB, except peer addresses at 3,200 bytes and route candidates at 4 KiB with a maximum list limit of eight. A page has at most 4 KiB metadata; 16 ordinary rows therefore use at most 36 KiB, leaving 28 KiB ordinary-line headroom. Eight candidates also use at most 36 KiB. An endpoint detail allows 6x JSON escaping of the existing 4,096-byte socket and 256-byte alias plus 4 KiB other fields, at most 30,208 bytes, leaving over 34 KiB. Invitation and pairing details including all retained diagnosis identities/conflict fields, direct address and maximum escaped alias plus token have a 12 KiB complete-frame ceiling, leaving 52 KiB. No new diagnosis fields are hidden to fit this bound. Peer address pages have 16 rows of at most 3,200 bytes plus 4 KiB metadata, at most 55,296 bytes, leaving 10 KiB. Audit's eight records with positions and envelope use at most 16 KiB, leaving 48 KiB. Configuration and limits results each have a 24 KiB encoded ceiling, leaving 40 KiB. These are hard producer/decoder bounds, not estimated typical sizes. Store alias/socket ceilings stay intact; never truncate valid strings to fit.
The codec enforces these producer/decoder bounds together with maximum uint64 widths, identity forms, JSON depth/value limits and complete cursor metadata. Status retains its supported row counts and 512 KiB ceiling. Any future shape correction must be documented here rather than dropping a collection, hiding rows, trimming identities or shrinking existing store limits. The server charges raw encoding, the pipe's marshaled waiting/writer copy, decoded rows, scan storage, queue storage and retained client results through their separate owners. All leases retire on success, error, cancellation, malformed correspondence, EOF and shutdown. These are owned-storage bounds, not a total Go allocator or RSS ceiling. Library and service tests own result accounting and retirement; selection follows the test policy.
Client correspondence extends beyond RPC ID/type: echo parent/full target, exact
revision or runtime generation/sequence, cursor and limit, role-derived public
identities, sorted unique keys, totals and next-key progress. Nullability and
purpose-specific targets are closed unions. Do not accept a sibling endpoint,
old link, replacement pairing, wrong purpose or cursor from another collection.
Results own their bounded copies until ReleaseResult; no borrowed owner pointers.
Transport cancellation joins projection/reader/config/staging work before ACK.
A definitely committed mutation can accompany cancellation or ErrJoinTimeout;
display and release it without replay. Read failures never launch fallback work.
The implementation uses concrete List*Request, Get*Request and matching
*Result types for every table family above, ReadAuditRequest,
GetLimitsRequest, GetConfigurationRequest, the three new domain mutations,
and ReplaceConfigurationRequest. The session path family uses ListSessionPathRequest
and GetSessionPathRootRequest; limit is 1..8, default eight. It defines closed
DurableCursor, RuntimeCursor,
AuditCursor, RuntimeGeneration, ObservationSequence, ConfigToken and
AliasToken, RepairConflictReference and separate display handle types in
pkg/ezhubapi; both-side schemas and originating-request correspondence cover
them. store owns cancellable typed page/detail projections
and RepairEndpointBindingContext; admin.Manager owns renewal, client-card
cancellation and repair effects. ControlExecutor receives typed runtime,
audit-reader and config-owner interfaces, not a raw executor. service composes
peer/directory/routing/session registries, audit reader and active config sample;
admin.NewOfflineClient receives service.NewOfflineRuntime for protected audit
reads while live inventory remains unavailable. Offline configuration and alias
owners use the same locked administration boundary. config owns effective
validation, deterministic encoding, exact file token and locked replacement.
The existing command dashboard consumes configuration, durable, runtime/audit
and exact-action types. The
command guide describes the
consumers. Store,
admin and service
tests own domain and adapter regressions.
Implemented private backend accounting boundary
All 57 private backend handlers have closed DTOs, codecs, correspondence, client methods,
and ControlExecutor dispatch. Online composition binds durable store readers,
peer/directory/route/session owners, the protected audit reader, configuration,
alias, repair-reference, renewal, and exact client-card retirement owners.
Offline composition retains durable reads, offline-supported mutations with the
PairingActions exceptions above, configuration, aliases, and protected audit
through service.NewOfflineRuntime; other runtime calls return
runtime_unavailable rather than an empty inventory.
Each ordinary handler admits four times its concrete LF-inclusive result ceiling
plus 4 KiB before allocation or effects. A configured Options.Reserve must
admit that amount; without an adapter the profile is a bounded no-op reservation.
Shipped dashboards install a finite local budget on the client and both offline
transport endpoints. The lease owns
bounded projection and serialization work plus the raw terminal while queue
admission waits. The pipe's marshaled waiting/writer copy and the caller's
decoded result retain independent leases.
Directory browse/detail and online repair also reserve 1,536 KiB of independent
directory_control scratch before complete bounded conflict projection and
reference validation. Malformed protected YAML parsing is admitted separately
through the snapshot owner online or config's finite local pool offline/startup.
All exhaustion paths map to private resource_limit.
The fixed active resource array has 40 rows, including the two non-configurable
tunnel/frame owners. The YAML and configuration DTO retain exactly 38
configurable rows. Budget.Snapshot captures limits, usage and peaks under one
admission lock; store revision is a separate observation. Impossible count/byte
relationships are rejected by the common configuration validator before saving.
Dashboard warnings concern valid concurrency reductions, not permission to save
a nonfunctional profile. The existing command dashboard also implements durable,
runtime/audit and exact-action consumers; neither backend nor consumer evidence
establishes final populated-lifecycle or broad acceptance.
Command dashboard consumer
The existing ez-agent-hub --config command loop consumes every durable and
runtime/audit operation through its typed online/offline caller. There is no
new transport, fullscreen UI or client bookmark owner. The
command guide owns syntax,
parent/key field help, exact mutation review and offline behavior.
durable_dashboard.go dispatches the closed 15 durable list/detail pairs and
reviewed mutations. Endpoint deletion and peer successor approval/denial require
matching displayed details, complete identities, the loaded store revision,
and a one-use exact request token. Invalid/forked proposals cannot acquire that
review. runtime_dashboard.go dispatches the ten runtime list/detail pairs and
protected audit, with copied sample/high-water continuations. The configuration
view preserves the exact byte token and distinguishes saved intent from active
startup limits, usage and peaks.
Ordinary command preflight only rejects changed administration revision/authority. A Hub security-floor-only persistence update does not advance that revision; normal claimant waiting and unchanged pairing checks therefore do not invalidate reviewed consent merely because wall time moves. Actual invitation, pairing, authority, deadline and other administration changes still conflict. The exact request, target and invitation revision are rechecked without rebasing. Preflight does not rebuild the request at a fresh revision. Conflict, unavailable preflight or uncertain write requires explicit displayed status and a new operator command; reviewed mutations consume their decision before submission and require a new exact detail. Authority rotation does not silently install an unseen refreshed status into the next command. Lost retirement acknowledgment can accompany a definite result; the consumer releases and displays that result without replay.
No status/browse/configuration/audit refresh dials a peer or application. The removed application reachability helper was a connect side effect, not a health or trust fact. Explicit open pairing views retain their separate screen-owned checks, cancellation and joined retirement. Independent alias tokens are labelled separately from store revisions. Runtime eligibility, links, routes, sessions, immutable attachments, terminal phase and Joined remain distinct.
Service integration tests cover all 79 operation shapes through production AF_UNIX dispatch and their exact disposition. A dispatch matrix with explicit stale/missing outcomes is not a replacement for successful multi-Hub lifecycle or broad capacity acceptance.
Committed card cancellation and carrier joins
A definite card-cancellation commit emits its synchronous committed audit before carrier retirement. Persistence uncertainty emits no commit. Retirement still ignores loss of RPC interest and must join the exact outer lifecycles before a successful terminal or cancellation acknowledgment. It does not detach a grant epoch, release live capacity, or substitute a timeout for joined cleanup.
The fixed owner set signals transport aborts independently, so one blocked abort
cannot prevent cancellation of other exact owners. Each owner's done follows
outer cleanup and any started abort callback. Production tests exercise direct
and routed endpoint carriers, and full started-service direct admission/endpoint
shutdown with blocked writes, caller cancellation/EOF and concurrent stop. An
arbitrary permanently stuck non-production callback is not forcibly terminated;
no false join or successful cancellation is reported for such an owner.
Service tests own multi-Hub routed shutdown
composition separately from the codec and single-owner checks.
Capacity work extends the approved private capacity values without changing EzAgent
application JSONL. Configuration adds the four resource rows listed in the
production owner map.
Runtime inventory accepts up to 256 peer-link rows. Session totals use native
int internally and nonnegative JSON integers, not a fixed 2,064-row or uint16
ceiling. Actual session populations intersect configured admission and metadata
budgets; restricted carriers retain their separate 16-owner process allowance.
Pages stay bounded to 16 rows and session paths to eight. Route candidate views
remain the selected route and best 31 alternatives, even when the table retains
256 peer-link contributions per remote origin.
Per-link runtime channel and lease counts remain integer fields but now admit 256 channels and 512 leases; internal counters are 16-bit rather than silently saturating at 255. The larger mux/route-ticket defaults provide mandatory relay capacity headroom; they do not remove the 8,192-channel acceptance target.
Result admission and offline commit audit
All 79 ordinary operations admit projection and raw-terminal storage before
handler entry. Each uses four times its concrete LF-inclusive result ceiling
plus 4 KiB, including decoder overhead. Status reserves 2,101,248 bytes, ordinary
64 KiB results 266,240 bytes, and smaller families use their distinct profiles.
Cancellation uses its separate connection-prepaid ownership. Shipped online
clients and both in-memory offline endpoints install a finite API-owned
LocalResultBudget; delivered decoding ownership survives client close until
ReleaseResult. A denied
projection returns resource_limit without invoking its domain handler. The
pipe charges its waiting/writer copy separately, and the client retains delivered
results until ReleaseResult, even after client close. Result validation rejects
illegal field lengths and row counts before allocating their JSON encoding.
The operational control_frame floor is now four owners / 3 MiB; the previous
2 MiB floor counted raw status instead of its admitted projection.
The shipped offline dashboard opens the protected audit writer while holding the
store owner, unless its embedding caller supplies a committed-effect sink. Online
and offline paths share service.CommittedAuditEvent, with no new event or wire
field. Definite mapped effects are audited synchronously before their terminal
reply. An audit failure after commit stops further offline commands, preserves
the committed revision in audit_unavailable, and reports that no rollback or
replay occurred. The writer closes after joined client/server shutdown. These
records remain best-effort audit facts, not an invented complete event history.
Signed production result coverage
Library, store and service tests own the codec/ownership matrices and signed domain controls. Populated durable, trust/history and directory/runtime controls cover successful branches in the production private API, not only stale/missing refusals. Independent legal maximum profiles preserve the endpoint, total-ACL, invitation, peer/history and learned-catalog ceilings. Small controls retain cancellation/ACK, real output expiry, held decoded storage, Terminal versus Joined, exact release and same-connection refill. Maximum hooks use complete ordered typed pagination rather than repeating the full lifecycle for every row.
These additions do not change the 79-operation contract, cancellation profile, wire fields, offline parity or bounded pages. Focused ownership checks, maximum profiles and shipped dashboard checks remain distinct validation scopes under the test policy.
The 16-row page size bounds delivery copies and retained result storage. It is an engineering choice, not a product population or security limit. Candidate and path pages retain their separate eight-row bounds. Maximum consumers allow at most three fresh whole traversal attempts under runtime churn, discarding partial results rather than mixing samples. That fixture retry bound is also an engineering safeguard, not a promise of successful live traversal under continuous change. No limit is changed by this clarification.