Skip to main content

Module damage

Module damage 

Source
Expand description

A zone of the shared transcript store that SQLite reports as corrupt (SQLITE_CORRUPT, “database disk image is malformed”).

Until now that was a WARN line per failed append: on one machine a single agent’s zone logged 218,133 of them over thirteen days while nothing told the user and every line kept being sent to the damaged pages (docs/analysis/RCA_UPGRADE_0_59_30_TO_0_59_34_ISSUES_2026_10_19.md §6). Now the first corrupt error on a zone, from an append, a tail read or an index rebuild:

  • marks the zone damaged for the rest of the process: appends to it skip the shared store (the block’s own copy keeps being written) and readers use the block’s own copy instead;
  • records one incident for the user and tells the agent once.

Only the shared store’s zones are marked: a block’s own store is a per-channel file and is not touched by this.

Structs§

Damaged
The zones found damaged, in the order they were found.

Constants§

EVENT_INCIDENT_RECORDED
The broker event that shows a recorded incident in every open window now; the window shows what is in incidents.jsonl again when it starts.
FRAMES_ZONE
The key under which damage to the frame table is marked. It is found by a sum over the whole table (history.usage), not by a read of one zone, so it belongs to no agent: a zone’s own read finds it only when that zone’s frames are on the damaged pages.
GLOBAL_MEMORY_ZONE
The key under which Global Memory’s record in the shared store is marked.
INCIDENT_KIND
The kind of the incident (agentmux_common::incidents::Incident::kind).

Functions§

agent_note
What the agent is told, once.
damaged_count
How many zones have been found damaged in this process.
global_for
The shared transcript store, unless zone of it was found corrupt in this process: a reader with a copy of its own to fall back to asks this instead of agent_session::global_transcript_store().
incident_for
The incident for a damaged zone, as the user is told about it.
install_broker
Attach the broker (bootstrap), so an incident reaches the open windows when it is recorded.
is_corrupt
Whether e is SQLite saying the database file is corrupt.
is_damaged
Whether zone of the shared store was found corrupt in this process.
memory_zone
The key under which an agent’s memory record in the shared store is marked. The record spans several zones (its files, its bundle, its claims), none with a copy of its own to fall back to, so it is marked as a whole.
note_corrupt
If e is a corrupt-database error from op on zone of the shared store, marks the zone damaged and, the first time, records the incident and tells the agent. Returns whether e was one, so a caller can fall back to the block’s own copy instead of treating it as a transient failure.
note_corrupt_text
note_corrupt for a reader that has already turned the error into text (the segment log, the archive and snapshot code return String errors): SQLite’s own wording for a corrupt file is what is looked for.
note_if_shared
note_corrupt when fs is the shared store itself, which a reader of either store (the index code takes a store and a zone) cannot tell otherwise; false, and nothing marked, for any other store.
write_incident
Writes the incident to incidents.jsonl in dir unless an unacknowledged one for the same agent is already there (a restart finds the same damage again).