codenib.storage
¶
Wiki-only database boundary.
This module exposes the pluggable :class:WikiStore contract and its supported
SQLite implementation. Repository indexes remain manifest-bound file artifacts;
this namespace does not provide a generic catalog, CAS, or backend registry.
Classes:
| Name | Description |
|---|---|
SQLiteWikiStore |
A short-connection, transactional SQLite store for Wiki envelopes. |
WikiStore |
Minimal persistence boundary consumed by AgentWiki. |
WikiStoreCorruptionError |
Persisted Wiki data failed an integrity or decoding check. |
WikiStoredEntry |
One complete Wiki cache envelope and its stable identity. |
WikiStoreError |
Base error for a Wiki store operation. |
WikiStoreSchemaError |
The database does not implement the supported Wiki schema. |
WikiStoreValidationError |
The caller supplied an invalid Wiki entry or query. |
SQLiteWikiStore
¶
A short-connection, transactional SQLite store for Wiki envelopes.
Methods:
| Name | Description |
|---|---|
generation_guard |
Own one entry generation after a bounded file-lock acquisition. |
Source code in codenib/wiki/sqlite_store.py
generation_guard
¶
Own one entry generation after a bounded file-lock acquisition.
Successful FileLock.acquire is the cross-process linearization
point. A timeout leaves the existing owner untouched, and this process
releases only a lock it acquired successfully.
Source code in codenib/wiki/sqlite_store.py
WikiStore
¶
Bases: Protocol
Minimal persistence boundary consumed by AgentWiki.
Methods:
| Name | Description |
|---|---|
read |
Read one entry, returning |
publish |
Atomically insert or replace one complete entry. |
scan |
Return entries in stable ID order, optionally filtered by repository. |
generation_guard |
Serialize generation of the same entry across processes. |
read
¶
read(entry_id: str) -> WikiStoredEntry | None
publish
¶
publish(
*,
entry_id: str,
repository_id: str,
envelope: Mapping[str, Any],
if_absent: bool = False
) -> WikiStoredEntry
scan
¶
scan(*, repository_ids: Collection[str] | None = None) -> tuple[WikiStoredEntry, ...]
generation_guard
¶
WikiStoreCorruptionError
¶
Bases: WikiStoreError
Persisted Wiki data failed an integrity or decoding check.
WikiStoredEntry
dataclass
¶
One complete Wiki cache envelope and its stable identity.
WikiStoreError
¶
Bases: RuntimeError
Base error for a Wiki store operation.
WikiStoreSchemaError
¶
Bases: WikiStoreError
The database does not implement the supported Wiki schema.
WikiStoreValidationError
¶
Bases: WikiStoreError, ValueError
The caller supplied an invalid Wiki entry or query.