Invariants¶
The AutonomyOps ADK enforces thirteen architectural invariants (INV-01–INV-13). Violating any invariant is a build-breaking failure. CI guardrails and failure injection tests detect violations automatically. No invariant may be relaxed without a signed-off Architecture Decision Record (ADR).
For the machine-readable traceability table (invariant → code module → CI guardrail → FI test), see Traceability → Invariant Map.
Summary Table¶
Inv |
Name |
Enforcement Layer |
FI Coverage |
|---|---|---|---|
INV-01 |
No Shared State |
Startup path check + |
scan-only |
INV-02 |
No Convergence Tracking |
|
scan-only |
INV-03 |
No Leader Election |
|
scan-only |
INV-04 |
Disk Ceiling |
|
FI-C1-01, FI-C2-01, FI-C2-02 |
INV-05 |
Platform Assurance Binding |
|
FI-C1-05 |
INV-06 |
Local-Only Activation |
Scheduler local-only params; code review |
structural |
INV-07 |
Bounded Memory |
cgroup v2 + pool-bounded transport buffers |
via INV-05 FI |
INV-08 |
Idempotent Segment Receive |
Segment ID dedup in local index |
unit tests |
INV-09 |
Authorization Boundary |
mTLS + CRL in transport layer |
FI-C3-02 |
INV-10 |
Mission-Layer Decoupling |
|
FI-C1-03 |
INV-11 |
Deterministic Relay |
Lexicographic comparator, no PRNG in relay path |
structural |
INV-12 |
Bounded Retry |
|
FI-C4-01, FI-C4-02, FI-C4-03 |
INV-13 |
Bounded Per-Peer Ingest Quota |
|
FI-C3-03 |
INV-02 — No Convergence Tracking¶
Statement: No convergence protocol, vector clock, CRDT, gossip, or anti-entropy
mechanism may exist in any edge/ package.
Rationale: Convergence requires shared coordination state, which violates INV-01 and introduces undefined behaviour under network partition. The edge capability is designed for deterministic relay, not eventual consistency.
Enforcement:
edge/ci/scan_prohibited— prohibited symbols:raft,paxos,gossip_convergence,vector_clock,crdt,anti_entropy, and related patterns
INV-03 — No Leader Election¶
Statement: No node may be designated a leader, primary, or coordinator. All nodes are peers with identical role and authority.
Rationale: Leader election is a form of convergence coordination. It also creates a single point of failure incompatible with the autonomous node model.
Enforcement:
edge/ci/scan_prohibited— prohibited election/nomination patternsCode-review checklist sign-off required for any change touching peer selection
INV-04 — Disk Ceiling¶
Statement: Disk usage never exceeds storage.disk_ceiling_bytes after any Write+fsync
returns successfully. The runtime pre-evicts before the ceiling is reached. If pre-eviction
cannot free sufficient space, writes are rejected with ErrCeilingExceeded.
Code modules: edge/storage/localstore.go (ceiling check, WithDiskUsedFunc),
edge/eviction/local.go, edge/storage/recovery.go
Enforcement:
After every
Write+fsync: kernelstatfscheckSynchronous eviction triggered when usage approaches the configured threshold
ErrCeilingExceededreturned if post-eviction space is still insufficient
FI Tests:
FI-C1-01
TestFI_DiskCeiling_ErrCeilingExceededFI-C2-01
TestFI_DiskCeiling_ConcurrentWritesAtBoundaryFI-C2-02
TestFI_DiskCeiling_EvictionFailure_WriteRejectedCleanly
See also: Disk Ceiling
INV-05 — Platform Assurance Binding¶
Statement: High-durability mode requires a validated cgroup v2 memory + CPU controller.
If the platform cannot provide cgroup v2 assurance at startup, the node logs a warning
(edge.assurance.reduced) and refuses to enter high-durability mode.
Code modules: edge/assurance/assurance.go, edge/config/cgroup_linux.go, edge/config/cgroup_other.go
Enforcement:
Startup: cgroup v2 probe; absent →
LogAssuranceReduced()+edge.assurance.reducedlog; high-durability operations refused
FI Tests:
FI-C1-05
TestFI_Assurance_HighDurabilityUnavailableTestFI_Assurance_ReducedEnvelopeLogged
See also: cgroup v2
INV-06 — Local-Only Activation¶
Statement: Activation functions accept only local-state parameters. No remote identifiers, fleet-wide tokens, external coordination primitives, or peer-sourced inputs may appear in activation function signatures.
Code modules: edge/scheduler/local.go, edge/scheduler/scheduler.go
Enforcement: Code review checklist; edge/ci/scan_prohibited (remote-state call patterns)
INV-07 — Bounded Memory¶
Statement: Memory usage is bounded by the configured resource envelope. cgroup v2 enforces this at the OS level when available. Transport layer transfer buffers are pool-bounded and never grow without bound as peer count scales.
Code modules: edge/storage/localstore.go, edge/transport/transport.go (pool-bounded buffers),
edge/quota/localquota.go
Enforcement:
cgroup v2 memory controller (when present, via INV-05)
Load shedding on inbound when approaching memory ceiling
INV-08 — Idempotent Segment Receive¶
Statement: Receiving the same segment ID multiple times is safe and has no net effect after the first receive. Deduplication is handled locally; no peer coordination is required.
Code modules: edge/index/localindex.go, edge/storage/localstore.go
Enforcement:
Segment ID checked against local index before write
Duplicate segment → silently discarded; no error returned to peer
Tests: edge/storage/store_test.go, edge/index/localindex_test.go (unit)
INV-10 — Mission-Layer Decoupling¶
Statement: The edge/ module must not import adk/runtime, adk/policy,
adk/orchestrator, or any mission-layer package. The edge capability operates
independently of whatever agent framework (LangChain, custom, etc.) is running alongside it.
Code modules: edge/ (import isolation enforced at compile time)
Enforcement:
edge/ci/scan_dependencies— import-graph check runs on every PR; fails if prohibited imports foundCompile-time isolation (build will fail if imports are added)
FI Tests:
FI-C1-03
TestFI_MissionDecoupled_NoMissionImportFI-C1-03
TestFI_MissionProcessKill_RelayUnaffectedShell:
FI-C1-03_mission_kill.sh
INV-11 — Deterministic Relay¶
Statement: Relay order and peer selection are fully deterministic for a given local state. No PRNG, wall-clock tie-breaking, or randomized selection is used in the relay path.
Code modules: edge/scheduler/local.go (lexicographic tie-breaking), edge/segment/segment.go
Enforcement:
edge/ci/scan_prohibited— PRNG/random call patterns flagged in relay code pathsStructural: no PRNG import in relay path
INV-12 — Bounded Retry¶
Statement: Each segment-relay attempt increments a monotonic counter associated with that
segment. When MaxRetryCount is reached, the segment enters the EXHAUSTED terminal state
and is never retried again. The counter does not reset on reconnect, timer expiry, or daemon
restart (it is persisted in the local index).
Code modules: edge/retry/retry.go (Tracker, RetryExhausted terminal state)
Enforcement:
RecordAttempt()monotonically increments; no reset pathTerminal
EXHAUSTEDon reachingMaxRetryCount; subsequent calls returnErrRetryExhausted
FI Tests:
FI-C4-01
TestFI_RetryExhaustion_TerminalStateFI-C4-02
TestFI_RetryCount_MonotonicFI-C4-03
TestFI_RetryExhausted_NoBeyondWindowShell:
FI-C4-01_retry_exhaustion.sh
See also: Retries
INV-13 — Bounded Per-Peer Ingest Quota¶
Statement: Ingest from each peer is bounded by a rolling-window token bucket. When the
per-peer quota is exceeded, ErrQuotaExceeded is returned and logged as edge.quota.exceeded.
The peer session remains open; quota exhaustion is not a disconnection event.
Code modules: edge/quota/localquota.go (LocalEnforcer, rolling-window token bucket)
Enforcement:
Per-peer bucket checked on every ingest call
edge.quota.exceededlog entry on breach
FI Tests:
FI-C3-03
TestFI_Quota_EnforcedPerPeerTestFI_Quota_PeerIsolation
Do Not Do¶
❌ Do NOT add a convergence/gossip/CRDT import to any
edge/package —edge/ci/scan_prohibitedcatches this in CI❌ Do NOT designate any node as a leader, primary, or coordinator for any purpose
❌ Do NOT reset a retry counter on reconnect or timeout — INV-12 requires monotonic persistence
❌ Do NOT allow segment exchange before mTLS handshake completes — INV-09
❌ Do NOT import
adk/runtime,adk/policy, oradk/orchestratorfromedge/— INV-10❌ Do NOT use PRNG or wall-clock tie-breaking in the relay scheduler path — INV-11
See Also¶
Traceability → Invariant Map — invariant → code → test linkage table
Architecture → Overview — high-level module map
FI Catalog → Matrix — full FI scenario matrix
Contributing → Invariant Rules — how to write invariant-safe code