🦚 Peacock Unified

🏗️ App Invariants

Layer 2 — application architecture · 1,820 documents

IDDocumentSource
app_invariants__8c5fecd3fe18f0faINVARIANT: All services that manage external resources or persistent state MUST provide a `dispose` mechanism, and this mechanism MUST be invoked upon service deactivation or scope destruction, to…
app_invariants__120cf52686936fffINVARIANT: Recursive object merging operations MUST implement explicit circular reference detection and enforce a finite recursion depth limit to prevent infinite loops, stack overflows, and ensure…
app_invariants__8fd6cd39ba2ae22aINVARIANT: Form submissions MUST enforce a secure and compliant interaction model by validating action URLs against AMP CDN proxies and requiring secure origins, restricting the `target` attribute to…
app_invariants__dee43d19609e7edcINVARIANT: Date and time manipulation functions MUST strictly validate all input arguments for type and range, rejecting invalid inputs by returning an invalid `Date` object (`NaN`) or throwing a…
app_invariants__9bcea1a0f7a96938INVARIANT: The system must maintain an isolated, immutable shadow DOM registry for component lifecycle management. SHADOW: To prevent cross-component CSS or DOM pollution during high-frequency…
app_invariants__a4a50f6ad922908eINVARIANT: All heavy DOM mutations must be scheduled through a batched, microtask-aligned vsync mechanism. SHADOW: Direct mutations trigger synchronous layout calculations, inducing severe reflow…
app_invariants__139c75fbb2372dbcINVARIANT: Component state initialization and DOM attachment must be strictly atomic. SHADOW: If a component is partially initialized before being attached to the document tree, external state…
app_invariants__bcbeb2a8e1372ae4INVARIANT: The core state management relies on a single source of truth, updated via a setState function that accepts either a direct state object, a partial state object, or a function returning the…
app_invariants__15106f735d3abb57INVARIANT: Each state update operation is atomic, meaning it's treated as a single, indivisible unit. This prevents partial updates and ensures that the state transitions are complete and…
app_invariants__047741659f2e4646INVARIANT: State updates are idempotent when using selectors with equality checks. Repeatedly applying the same state update or selector with the same input will yield the same output without…
app_invariants__3e3e377ff52d10e1INVARIANT: The `create` function provides a hook (`useStore`) that subscribes to external store changes using `useSyncExternalStore`, ensuring that React components always reflect the latest state…
app_invariants__34a1a399b891e59dINVARIANT: Middleware functions (like `devtools`, `immer`, `persist`, `redux`, `subscribeWithSelector`) are designed to wrap the core `createStore` logic, allowing for extended functionality without…
app_invariants__749dcc73f7272980INVARIANT: The `createStore` function initializes the state by executing the provided `initializer` function, which receives `setState`, `getState`, and the `api` object. This ensures that the…
app_invariants__9369020aaee7f338INVARIANT: The `useStoreWithEqualityFn` hook, similar to `useStore`, utilizes `useSyncExternalStoreWithSelector` and allows for a custom `equalityFn`. This ensures that components only re-render if…
app_invariants__b81ec710a8eec36fINVARIANT: Manual Referential Integrity Cascade SHADOW: The system lacks intrinsic foreign key triggers; developers must explicitly orchestrate the deletion of dependent records (Judgments,…
app_invariants__8512be1744cf8fb2INVARIANT: Differential State Reconciliation SHADOW: Writes are not blind inserts; the system computes a symmetric difference between the 'desired' client state and 'current' database state. This…
app_invariants__399eebb891136d9eINVARIANT: Cardinality-Limited Transaction Scoping SHADOW: Hard caps on input vectors (e.g., MAX_OPTIONS = 20) are enforced at the reducer entry point. This bounds the execution time of O(N)…
app_invariants__ea645f64a8cf769cINVARIANT: Contextual Subscription Narrowing SHADOW: To survive high-concurrency data streaming, the system transitions from 'Wide' public subscriptions to 'Deep' focused queries via Share Tokens.…
app_invariants__cb32e5c6c96a0f4fINVARIANT: Deterministic Identity Synthesis SHADOW: Identity is not assigned; it is derived through a purely deterministic BLAKE3 hash of OIDC claims (Issuer + Subject). This allows cross-platform…
app_invariants__747289e91b3e1e20INVARIANT: Implicit Defaulting for Majority Judgment Integrity SHADOW: The Majority Judgment system requires a complete matrix of (Voter x Option). On the first interaction, the system atomically…