🦚 Peacock Unified

🏗️ App Invariants

Layer 2 — application architecture · 1,820 documents

IDDocumentSource
app_invariants__4fb83a0030601f2eINVARIANT: Access to `GlobalFieldsIdsMap` (mapping field names to IDs and metadata) must be mediated by a `RwLock`, ensuring strong read-write consistency across concurrent operations and preventing…—
app_invariants__b9be300bb269b161INVARIANT: The properties of any given field (e.g., `is_searchable`, `is_sortable`, `is_faceted`) must be consistently derived and applied via `Metadata` and `MetadataBuilder`, enforcing the…—
app_invariants__a2df68db40db0856INVARIANT: Document-to-shard assignment for `Shards` must be achieved through rendezvous hashing (`XxHash3_64`), ensuring deterministic distribution of documents across shards for consistent data…—
app_invariants__09e2cde5d86fee2fINVARIANT: All data persisted to LMDB databases must use specialized `heed` codecs (`BEU16StrCodec`, `CboRoaringBitmapCodec`, `ObkvCodec`, etc.) to ensure efficient, type-safe, and consistent…—
app_invariants__437830174a794fb2INVARIANT: The `ClearDocuments` operation must atomically remove all document-related entries across all relevant databases, including FSTs, document IDs, geo-trees, facets, and vector stores,…—
app_invariants__ba62c4f690e4abb5INVARIANT: Any modification to critical index settings that impact document content, indexing, or retrieval logic (e.g., searchable fields, stop words, embedder configurations) must trigger a…—
app_invariants__9e96409101c7f09eINVARIANT: All document ingestion (`Transform`) must generate unique and collision-free internal document IDs using `AvailableIds`, ensuring each document has a distinct identifier within the…—
app_invariants__6017191c3096d354INVARIANT: Incremental updates to documents or index properties must be processed as explicit `DelAdd` operations (deletion and/or addition), ensuring that changes are consistently applied as atomic…—
app_invariants__8bd187e9996d7b46INVARIANT: Large-scale data processing during indexing, including word positions, facet values, and word pair proximities, must be chunked and processed in parallel using `grenad::Sorter` and…—
app_invariants__9b605450a2a37ac3INVARIANT: Documents containing nested JSON objects or arrays must be flattened into a single-level structure during the `Transform` phase, creating new fields for nested paths, to ensure uniform…—
app_invariants__f3d926379c6d11ccINVARIANT: Extraction of vector embeddings must perform diffing against previous states (`VectorStateDelta`), render document prompts, manage external API requests via `EmbedSession`, and handle…—
app_invariants__9f667dff55e3b411INVARIANT: Spin-Yield Backpressure Synchrony SHADOW: Extractors are compute-bound and can generate data faster than the LMDB writer can persist it. The system enforces a spin-loop with mandatory…—
app_invariants__772c0a58bb81d89aINVARIANT: Logarithmic Facet Tree Balancing SHADOW: To maintain O(log N) search performance for range filters and distributions, the facet database must strictly enforce minimum and maximum node…—
app_invariants__92fe8cdd5b249d8dINVARIANT: Isolated Parallel Snapshot Reading SHADOW: During prefix recomputation, threads must utilize nested read transactions tied to the active write transaction. This ensures that parallel…—
app_invariants__ebdc19046cc1ec28INVARIANT: Storage Engine Boundary Enforcement SHADOW: All keys intended for the underlying Key-Value store (LMDB) must pass a strict byte-length validation (MAX_LMDB_KEY_LENGTH - 3). Violating this…—
app_invariants__6f42825f624f5aeeINVARIANT: Deterministic Set Reconstruction SHADOW: Document ID updates via Roaring Bitmaps must follow a specific set-theory priority: (Current - (Deleted - Added)) | (Added - Deleted). This…—
app_invariants__9ccc99f4133a15cbINVARIANT: Proportional Memory Clamping SHADOW: Total indexing memory must be subdivided strictly by the thread count of the parallel pool. Each worker's sorter is clamped to a relative threshold to…—
app_invariants__9da71081508983f6INVARIANT: Ordered Sequential Migration Invariant SHADOW: Migrations must be executed in a strictly defined chronological sequence where the system version is only updated upon the successful…—
app_invariants__817305fa30c72541INVARIANT: User-Provided Vector Preservation SHADOW: The system distinguishes between autogenerated and user-provided vectors using a dual-bitmap EmbeddingStatus. Autogenerated vectors are volatile…—
app_invariants__96a0667881a9abe6INVARIANT: Deadline-Enforced Buffer Refill Throttling SHADOW: In vector searches (VectorSort), the system uses a 'fill_buffer' mechanism that must respect a hard Deadline. If the search duration…—
app_invariants__d4a313a75524c6e0INVARIANT: Version-Gated Upgrade Execution SHADOW: The 'must_upgrade' predicate acts as a hard idempotent gate. Every migration step is mapped to a specific version range. Even if the upgrade…—
app_invariants__41d9dd2374e90a67INVARIANT: Vector Metadata Synchronization Invariant SHADOW: The EmbeddingStatusDelta must be updated in tandem with any physical vector insertion or deletion. The system uses these deltas to…—
app_invariants__6f8eace66150eeddINVARIANT: The query graph MUST maintain a strict acyclic dependency chain from START to END. SHADOW: The graph structure determines the reach of term derivation. If a node loses its predecessors or…—
app_invariants__16607bf5cbb8e8ffINVARIANT: Nodes marked as 'Deleted' must be pruned and effectively bypassed to maintain graph integrity. SHADOW: Deleted nodes represent failed derivations or unreachable search branches. The…—
app_invariants__66e04c74438ebe6cINVARIANT: Interned identifiers MUST resolve to immutable definitions within the bounds of the interner. SHADOW: The system relies on fixed-size interners to provide O(1) access to query nodes. Any…—
app_invariants__eb33fd1156e7444eINVARIANT: Bucket resolution in ranking rules must prioritize document intersections BEFORE attempting expensive union operations. SHADOW: By enforcing specific intersection order (especially in the…—
app_invariants__cf539c049ebc91b7INVARIANT: All proxy headers must be URL-encoded before transmission. SHADOW: Failure to encode query parameters like remote hostnames or index names will corrupt data by introducing invalid…—
app_invariants__2eb24dde534bf6f0INVARIANT: All query parameters extracted from headers must be URL-decoded. SHADOW: Ignoring URL decoding on incoming headers means that any URI-encoded characters will be treated literally, leading…—
app_invariants__9b2e14d03bc92ffbINVARIANT: Numeric query parameters must be parsable as unsigned 64-bit integers. SHADOW: Accepting non-numeric values for quantity or count fields will lead to parsing errors, halting operations…—
app_invariants__d165c4634bea20e7INVARIANT: UUID query parameters must be parsable as UUIDs. SHADOW: Invalid UUIDs will fail network routing and identification, preventing the system from correctly associating requests or states…—
app_invariants__0fffba51183f93a8INVARIANT: When retrieving header values, a fallback mechanism to legacy header names must be employed if the primary header is not found. SHADOW: This ensures compatibility with older versions of…—
app_invariants__4ad35c813bfa0948INVARIANT: The system must correctly identify and handle missing header values by returning `None`. SHADOW: This prevents downstream processing from failing on unexpected `None` values and allows…—
app_invariants__052cbfeb3fb2cff6INVARIANT: The `SetHeader` trait must correctly encode values before setting them. SHADOW: URL encoding ensures that special characters within values like hostnames or task identifiers are treated…—
app_invariants__a6ebf170c6c68373INVARIANT: The `SetHeader` trait must apply a fallback mechanism to legacy header names when setting headers. SHADOW: This maintains backward compatibility by ensuring that header values are also…—
app_invariants__a53d1fd6080244b0INVARIANT: The `DecodeError` enum must capture specific error types for distinct failure points in header processing. SHADOW: Categorizing errors like `InResponse`, `UrlDecoding`, `ParseInt`, and…—
app_invariants__b9d7a5a33a11c160INVARIANT: The `DecodeError::header` method must consistently return the problematic header name regardless of the error cause. SHADOW: Providing the associated header name on any decoding error…—
app_invariants__f81fce20b1916749INVARIANT: PERSISTED_VERSION_LOCK SHADOW: The system mandates a strict parity check between the binary version and the database metadata before the task scheduler loop initializes. Discrepancy…—
app_invariants__2c07c767c4fb07a8INVARIANT: DATABASE_THRESHOLD_ADMISSION_CONTROL SHADOW: Non-reclamation tasks (Add/Update/Settings) are rejected once physical database utilization exceeds a hard 40% threshold of the total map…—
app_invariants__00af74389b1d473eINVARIANT: TERMINAL_TASK_DATA_PURGE_GATING SHADOW: External update files referenced by tasks are only eligible for physical deletion after the task status transition (Succeeded/Failed/Canceled) has…—
app_invariants__b02a819189f723ddINVARIANT: INDEX_LIFECYCLE_ISOLATION SHADOW: An index must be atomically moved from the 'Available' LRU cache to an 'Unavailable' state (Closing/BeingDeleted) before its physical storage parameters…—
app_invariants__3896c421a966ef2eINVARIANT: MONOTONIC_NETWORK_VERSION_GATING SHADOW: Remote topology tasks are rejected if their embedded network version does not perfectly match the active topology change task. This enforces a…—
app_invariants__fbd329be7cfbe174INVARIANT: BIT_PERFECT_ASSET_VERIFICATION SHADOW: No asset (binary or dataset) retrieved from a remote URL or local cache is permitted to influence system state without satisfying a mandatory SHA256…—
app_invariants__d8e92c9cd523720aINVARIANT: Index scheduler state is persisted across restarts via a transactional database. SHADOW: Ensures that the state of index scheduling operations (like upgrades) is not lost if the…—
app_invariants__a981449f7f505515INVARIANT: Index scheduler upgrades are designed to be idempotent, meaning they can be applied multiple times without changing the result beyond the initial application. SHADOW: This prevents issues…—
app_invariants__93760b848a9e8da2INVARIANT: Index scheduler upgrades are applied within a transactional write context, ensuring atomicity. SHADOW: This guarantees that an upgrade operation either completes entirely or not at all.…—
app_invariants__458a109b0a2c7f82INVARIANT: The version of the index scheduler is explicitly tracked and updated after successful migrations. SHADOW: Maintaining an accurate version number is crucial for determining which upgrades…—
app_invariants__feb42d04fd2a1d68INVARIANT: The `must_upgrade` function ensures that an upgrade is only performed if the current version is older than the target version for that specific upgrade. SHADOW: This is a key part of…—
app_invariants__b39cac65bde458c4INVARIANT: The `flatten` function transforms a nested JSON object into a flat map by concatenating keys with a dot separator. SHADOW: This process simplifies complex JSON structures into a more…—
app_invariants__bfe8d1369c2981e1INVARIANT: The `flatten` function's logic for inserting values into the `obj` map uses `entry(key).or_insert(old_val.clone())`, ensuring that if a key already exists, it is not overwritten by a…—
app_invariants__e05e2822d42e8795INVARIANT: The `should_flatten_from_value` function determines if a JSON value should be flattened based on its type and content. SHADOW: This logic dictates when the flattening transformation is…—