Skip to content

Chronicle

Chronicle — the audit trail for every Nexus action. SQLite-backed, queryable, exportable for compliance.

Red-team round 2 (R2-4): the kernel only ever appends, but the ledger is a file owned by the user, so any process running as them could edit it. Each row now carries chain, a SHA-256 over the previous row’s chain and this row’s fields, and verify() walks it. Editing, deleting or reordering a chained row breaks the chain at that row. Rows written before chaining existed are reported as legacy, not as tampering. Truncating the newest rows, or rewriting the whole chain from the start, can only be caught against a head recorded somewhere else: head() returns it for that.

  • Version: 0.1.0
  • Class: Chronicle

log(self, source: str, action: str, payload: dict[str, Any] | None = None) -> str

Section titled “log(self, source: str, action: str, payload: dict[str, Any] | None = None) -> str”

The newest chain value and how many rows lead to it. Record it somewhere this process can’t write to (a commit, a printout, another machine) to catch truncation.

Walk the chain in insertion order. ok is False at the first row whose chain doesn’t follow from the row before it, with that row’s event_id.

query(self, source: str | None = None, action: str | None = None, since: str | None = None, until: str | None = None, limit: int = 100) -> list[dict[str, Any]]

Section titled “query(self, source: str | None = None, action: str | None = None, since: str | None = None, until: str | None = None, limit: int = 100) -> list[dict[str, Any]]”