🦚 Peacock Unified

🏗️ App Invariants

Layer 2 — application architecture · 1,820 documents

IDDocumentSource
app_invariants__9a4ccb92d0a26361INVARIANT: Topic names provided by clients must be resolved to their immutable and unique Topic IDs before being used in stateful operations like partition assignment. SHADOW: This decouples the…—
app_invariants__03773e1037b8709fINVARIANT: Single-Threaded Event Sourcing Invariant SHADOW: All cluster metadata mutations and state reads must be serialized through a single-threaded KafkaEventQueue to prevent lock contention and…—
app_invariants__33431fd344b02e00INVARIANT: High-Watermark Catch-Up Barrier SHADOW: The MetadataLoader must inhibit the publication of metadata updates to internal publishers until the local replayed offset has reached the quorum…—
app_invariants__64288b3b83034b90INVARIANT: Atomic Metadata Transaction Enforcement SHADOW: Records generated by a single user operation (e.g., CreateTopics) must be marked as atomic and rejected if the resulting batch size exceeds…—
app_invariants__b4887be99ccb3a4bINVARIANT: Registration-Offset Fencing Invariant SHADOW: A broker is strictly prohibited from transitioning from a FENCED to an UNFENCED state until its reported metadata offset is greater than or…—
app_invariants__3ff928ea2812501cINVARIANT: Metadata Version Feature Barrier SHADOW: The system must enforce a strict metadata version floor for specific architectural features (e.g., JBOD/Directory Assignment); attempts to utilize…—
app_invariants__387e7a7f06c3f8cfINVARIANT: Periodic Task Backoff Invariant SHADOW: Any periodic maintenance task (e.g., stale broker fencing) that encounters an exception must be rescheduled with a significant backoff (e.g., 5…—
app_invariants__a51639d8f6eb6d05INVARIANT: Snapshot Batch Alignment Rule SHADOW: The SnapshotGenerator must only emit a snapshot when the current metadata image is aligned with a record batch boundary (isOffsetBatchAligned),…—
app_invariants__28c134015e57057bINVARIANT: Leader Recovery State Monotonicity SHADOW: Transitions from a RECOVERED leader recovery state back to RECOVERING are strictly forbidden; the system can only transition from RECOVERING to…—
app_invariants__cfd6f80c9b712536INVARIANT: Snapshots must be constructed in a mutable temporary state (.part) and atomically transitioned to an immutable, read-only state (.checkpoint) upon completion. SHADOW: Prevents readers or…—
app_invariants__0ebd0b265217b42dINVARIANT: An election is definitively won when granted votes reach a strict majority, and definitively lost when the sum of granted and remaining unrecorded votes falls below a strict…—
app_invariants__d0ab5842532b1d01INVARIANT: The High Watermark (HWM) must advance monotonically, bounded by the log end offset, and log truncation is strictly prohibited below the established HWM. SHADOW: Guarantees that once a…—
app_invariants__ae67842220ebc516INVARIANT: Log appends must be accumulated into pre-allocated, fixed-size memory pools, rejecting new appends if the pool is exhausted or maximum batch limits are reached. SHADOW: Prevents…—
app_invariants__c8c56ef141a295b4INVARIANT: A node in a ResignedState must track unacknowledged voters and cannot fully step down until the quorum acknowledges the resignation or an election timeout expires. SHADOW: Ensures smooth…—
app_invariants__495a8908a253d3b0INVARIANT: Transaction state transitions must strictly adhere to a predefined directed acyclic graph (DAG) of valid previous states. SHADOW: Guarantees the Two-Phase Commit (2PC) protocol's…—
app_invariants__19c4927f60c559bcINVARIANT: Producer ID blocks must be asynchronously prefetched when the current block's utilization reaches a defined threshold (90%). SHADOW: Hides the RPC latency of communicating with the…—
app_invariants__70f145f0b094b03dINVARIANT: Event polling must randomly select from available keys (partitions) rather than strictly FIFO across all events. SHADOW: Provides fair resource allocation across all active partitions,…—
app_invariants__e43cf830ebbaec81INVARIANT: In-memory coordinator state must be snapshotted at discrete log offsets and support deterministic reversion to any previously snapshotted offset. SHADOW: Maintains strict consistency…—
app_invariants__5a83bf6227f59368INVARIANT: A producer epoch is considered exhausted and must be fenced when it reaches Short.MAX_VALUE - 1. SHADOW: Prevents integer overflow in epoch tracking, which could lead to zombie producers…—
app_invariants__2e538fef2e1784c9INVARIANT: Snapshot-based state recovery and offset tracking ensure deterministic restoration of coordinator shards. SHADOW: The system must be able to reconstruct its internal state from a log of…—
app_invariants__0f12cda730e5ae50INVARIANT: Operations scheduled via the coordinator must be uniquely keyed to prevent duplicate execution during retries or rebalances. SHADOW: In a distributed system, network partitions or…—
app_invariants__6925a8d00c2cad86INVARIANT: Event processing must be decoupled from event ingestion to prevent resource exhaustion under high load. SHADOW: By using queues and asynchronous processing, the system maintains stability…—
app_invariants__7d09e4a54234fef8INVARIANT: Coordinator operations must be encapsulated within a result object that bundles state changes and side effects for atomic application. SHADOW: Ensures that either all changes (records and…—
app_invariants__93e098e108e825f9INVARIANT: The system identifies the correct password hashing algorithm at runtime by iterating through a set of supported hashers and checking which one `Understands` the stored hash format, before…—
app_invariants__3f47d4a68423ada9INVARIANT: A user flow's state can be durably persisted by creating a 'continuity container' with a payload and an expiration time. This container is associated with the user via a cookie, allowing…—
app_invariants__1714ccedd65b3c28INVARIANT: Messages are first added to a persistent queue with a 'queued' status. A separate worker process transactionally fetches a batch of these messages, atomically updating their status to…—
app_invariants__9e4c46b2b824434fINVARIANT: A one-time-use code is validated by finding a stored, un-used code that matches a user-provided value via constant-time HMAC comparison, and then atomically marking it as 'used' within a…—
app_invariants__78b31f6bef474536INVARIANT: An outgoing HTTP request is authenticated by applying a dynamically selected authentication strategy based on a configuration type. Each strategy is an isolated module that modifies the…—
app_invariants__77619442b8785349INVARIANT: Transactions must automatically retry on serialization anomalies to guarantee isolation. SHADOW: CockroachDB and Postgres can abort transactions due to concurrent updates (SQL state…—
app_invariants__40191f044b017e51INVARIANT: Schema mutations must be strictly idempotent by verifying prior application state. SHADOW: Before executing a SQL migration, the system queries the migration table to check if the version…—
app_invariants__67014f6ecb3c8e24INVARIANT: Untrusted sub-processes must be strictly bounded by memory limits and concurrency pools. SHADOW: Executing user-provided Jsonnet can lead to OOM or CPU starvation. Using syscall.Setrlimit…—
app_invariants__45637e585dd3d1b2INVARIANT: Remote cryptographic keys must be cached locally to decouple validation from network availability. SHADOW: Fetching JWKS on every request introduces latency and a single point of failure.…—
app_invariants__dd63aedabb2392acINVARIANT: Flow state transitions must be atomic and idempotent via CSRF-protected submission endpoints. SHADOW: Ensures that multi-step identity flows (login, registration, recovery) cannot be…—
app_invariants__f4f215f8e447b4a9INVARIANT: Flow persistence is decoupled from the transport layer via unique, time-bound flow identifiers. SHADOW: Decoupling allows the UI to remain stateless while the backend maintains the…—
app_invariants__b25c29a5717aec4aINVARIANT: API-driven flow execution must support idempotent submission of identity credentials. SHADOW: Prevents duplicate account creation or session issuance when network retries occur during…—
app_invariants__4faf334c42f3f996INVARIANT: Self-service flows are stateful and must be retrieved using their unique flow identifier. SHADOW: Each user interaction initiated via the `/self-service/*` endpoints creates a distinct…—
app_invariants__80742ce947eef2dbINVARIANT: Browser-specific flows rely on cookie-based session management and anti-CSRF tokens. SHADOW: Endpoints prefixed with `/browser/` are designed for interactive web clients. They implicitly…—
app_invariants__d3aaa690c8350e88INVARIANT: Native (API) flows mandate explicit authentication via session tokens or API keys. SHADOW: Endpoints designed for native clients (e.g., mobile apps) do not benefit from browser-based…—
app_invariants__2cd6d7d7ae2217f2INVARIANT: Session integrity is maintained through Authenticator Assurance Levels (AAL). SHADOW: The system enforces different levels of security assurance (AAL1, AAL2) for sensitive operations.…—
app_invariants__54624d635702fb61INVARIANT: Temporal Resolution Parity Buffer SHADOW: Database resolution discrepancies (second vs millisecond) create race conditions in expiration logic. Adding a specific 1-second overhead…—
app_invariants__53f7d2af77a4154bINVARIANT: Authentication Factor Minimum Threshold SHADOW: Total removal of authentication factors (Passkeys/WebAuthn) creates an unrecoverable identity state. Enforcing a minimum active count of 1…—
app_invariants__4a91960899ea00e9INVARIANT: Deterministic Identifier Canonicalization SHADOW: Human inputs for identification (email/phone) are non-deterministic. Strict normalization (case folding/whitespace stripping/E164…—
app_invariants__c4077e519479a3d4INVARIANT: Interruption-Aware Hook Transactionality SHADOW: Synchronous external logic (webhooks) can mutate identity state mid-flow. The system must treat external callbacks as transactional…—
app_invariants__8e7509e8242811c3INVARIANT: Cross-Storage Session Invalidation Parity SHADOW: Session invalidation in hybrid environments (WebView/Native) must achieve parity across disparate storage engines (HTTP Cookies vs…—
app_invariants__172ff5454080cc52INVARIANT: Privileged Transition Guarding SHADOW: Access to static recovery credentials (lookup secrets) or MFA configuration must be gated by a temporal privilege escalation (privileged session max…—
app_invariants__9e23fd9212976871INVARIANT: Cryptographic Token-Payload Consistency SHADOW: Stateless CSRF protection requires strict parity between the signed cookie and the request payload. Any divergence between the environment…—
app_invariants__323069e09ab6766fINVARIANT: API-initiated flows *must* reject requests containing browser-specific HTTP headers (Origin, non-Cloudflare Cookies) unless explicitly disabled, while browser-initiated flows *must* always…—
app_invariants__8b6c4b51df2da36aINVARIANT: Every self-service flow instance *must* possess a finite, non-zero lifespan, automatically transitioning to an expired state upon exceeding this duration and requiring re-initiation for…—
app_invariants__fe2010096a2e7ee3INVARIANT: All external redirection targets originating from a self-service flow *must* be strictly validated against a predefined allow-list of safe URLs to prevent open redirect…—
app_invariants__44dcd78f49135efcINVARIANT: The execution of any self-service flow strategy *must* be explicitly contingent on that specific strategy being enabled in the system's active configuration; otherwise, access is…—