Historical Switchboard Archive
Historical acceptance record: the execution results, draft-PR instructions and release blockers below describe the original review, not a new test run or the status of the current release. The 15 November 2026 documentation pass checked current source statically; it did not rerun these benchmarks or establish live Core-storage/browser acceptance. Current operator guidance is in Operations and Settings.
This replaces the earlier current-configuration diagnostics design. Settings owns bots, credentials, access, pending admissions and current health. Archive shows historical received-work and reply outcomes only, through the existing host header, calendar, search, list and reader.
Data and scope
GET /archive is an operator-authenticated, no-store route. It returns safe historical delivery metadata and explicit retained-history coverage. Records include their captured bot identity/name, transport, direction, outcome, available dates, chat/route, agent and turn identifiers, and sanitized outcome codes. It does not copy frozen submission bodies, text, image bytes, credentials, message answers or work artifacts. The reader says so explicitly; this is not a transcript or a fabricated artifact repository.
archive-history-v1 is independent from replay buffers. Terminal observations (succeeded, delivered, failed, interrupted, unknown) are upserted by connection plus delivery ID, so repeated polling/reconciliation does not inflate counts. An updated outcome replaces the previous one, rather than pretending each observation is separate work. Nonterminal submissions and current configuration are excluded.
Existing retained terminal records are imported idempotently, without deleting or rewriting legacy buffers. Old versions retained up to 200 deliveries per bot, and deleted bots' records may already be gone; unavailable history cannot be reconstructed. Imported names reflect the available registry at import, not a claim about an unknowable historical name.
Retained terminal history survives bot deletion and service restart. After draining a bot for removal, unfinished inbound records (including legacy Telegram records with frozen submission but no accepted turn ID despite a delivered label) receive a historical bridge-interrupted observation and in-flight sends an unknown outcome, with connection_stopped_for_removal. This says the bridge stopped, not that Core was canceled, a send failed, or registry deletion succeeded. Replay inputs are untouched; if deletion fails and work later resumes, its new outcome supersedes this observation. This remains a retained history, not a complete audit log of every accepted input. Removal drains the worker, then preserves retained terminal records before deleting transport settings. If preservation fails, deletion stops with the disabled bot and its buffers retained; the closed worker is removed from cache so reconfiguration can create a fresh worker.
Retention is at most 10,000 records and 8,000,000 serialized record bytes, newest dated records first. Coverage exposes the limits and whether trimming occurred. Counts are matching retained records, not lifetime counts, unique turns, messages, conversations or bots. Inbound work and outbound reply records may refer to the same turn. There is no count of work that was never observed.
Failure and safety behavior
Transport replay state is committed before best-effort history capture. Archive failures must not change provider offsets, submission idempotency or delivery ambiguity handling. Snapshot reads retry capture of retained buffers. A persisted gap flag, when storage permits saving it, warns that history may be incomplete; a total storage outage followed by process death cannot guarantee that warning survives. An unsupported history version or malformed envelope/record exposed by Core is rejected without rewriting that value or returning its fields. This is not a guarantee of preserving all on-disk corruption: Core can return the supplied fallback when its own storage decoder cannot recover a value; Switchboard cannot distinguish that from an absent key. An archive startup failure does not stop transport workers.
Snapshot buffer reads execute inside the history queue. A snapshot cannot replace an existing record on an equal or absent timestamp; ordered transport writes can, allowing genuine equal-clock outcomes to advance. Capture uses a serialized shared history writer to avoid lost updates across concurrent bot workers in the single active mod host. Multiple processes writing the same settings store are not supported; Core exposes get/set rather than cross-process compare-and-swap. Existing provider queues and bounded retry buffers are unchanged. No live provider calls or destructive migration are needed.
UI behavior
- Native host categories: All work, Received work, Reply outcomes. Bot choices come from historical records, including deleted bots.
- Search and bot/category/date filters apply to the full retained snapshot before pagination; dates use the host timezone, including DST. Undated records are available without a date filter.
- No manual refresh control. Visible, idle ten-second polling retries automatically. Initial failure remains unknown rather than false-empty; later failures clearly mark retained data stale.
- Selection, stable record identity, reader scroll and focus are preserved. Active text selection defers replacement. Unmount aborts requests, removes listeners and clears polling; late reads cannot repaint.
- The existing native list/reader classes are used without nested management cards, additional style sheets or invented records. Older hosts without header controls still see history and the selected reader; interactive host filters require the native header contract.
Verification
Executed in the cloud workspace: npm run build and git diff --check pass. All 278 non-Core tests pass, including 45 persistence/history regressions and 96 Archive/Settings UI checks. npm test passes those 278 tests but fails its three Core-fixture tests because the sibling current Burrow-Backend checkout is absent (ERR_MODULE_NOT_FOUND); no Core/PostgreSQL integration pass is claimed.
Independent source review verified the current Burrow-UI Archive header/update contract and native layout classes, plus current Backend settings-store compatibility. The ledger rewrites a whole settings value for genuine terminal changes. In-memory 10,000-record measurements are below; actual Core storage/load performance is not verified and remains a release blocker. Nonterminal and timestamp-only updates now avoid ledger reads/writes unless retrying failed capture. Core settings has no cross-process compare-and-swap; timed-out route calls may leave an already-issued settings write running. The store has no conflicting 8MB per-value cap; the ledger serializes same-host writes, while Core owns runtime exclusivity. There is no rendered-browser screenshot or running-host visual acceptance from this workspace. No user computer, live bot/model API, credentials, installation, merge or deployment was used. The existing release workflow runs only on main pushes/manual dispatch, not this draft branch. Fake-DOM tests exercise behavior and hierarchy but do not establish rendered layout or accessibility-tree acceptance. Live Telegram, Discord and model APIs are outside these tests.
PR review corrections and performance measurements
The review at 3666934 found stale same-timestamp snapshot regression, unresolved legacy Telegram input being presented as successful on removal, and slow 10,000-record filtering. The fixes add source reads inside the history queue, conservative snapshot ties, delta-aware authority for actual outcome changes, and transport-specific removal uncertainty. Legacy labels are preserved during import; only an actual bridge stop creates the removal observation. Persisted envelope/record validation rejects unexpected fields (including private submission payloads), nonterminal rows, duplicate IDs, invalid values and unsupported versions before returning or rewriting data.
The list now keeps concise matching-outcome counts and a retention warning; detailed scope explanations live in the reader. Timezone formatters and searchable/date metadata are indexed per snapshot/zone, not rebuilt per search keystroke or date filter. Coverage-only changes update the reader without losing selection or scroll.
Reproduce the UI path with node scripts/benchmark-archive.mjs (optionally pass an older archive.js path). This executes the real mount/update code against a minimal DOM, not a browser layout engine. At 10,000 synthetic long-title records on Node 24.22.1, baseline search took 1,306–1,479ms and date filters 867–2,139ms. Fixed warm search took 2–4ms and date filters 1–3ms; a concurrent-load rerun's first operations took 23ms and 29ms. Initial indexing ranged 122–383ms and timezone rebuilding 91–623ms across these runs. Shared-machine noise is substantial; snapshot/zone indexing can still be noticeable. Chromium could not launch in this cloud runtime, so browser rendering/layout and end-to-end interaction timings remain unverified here.
A separate cloned in-memory settings benchmark at 10,000 records measured direct ledger capture at approximately 172–185ms per operation and ~2.93MB per changed full-value write. A later heavily loaded actual-service run measured 20 queued operations at 0.78ms/op and 20 timestamp-only operations at 7.59ms/op with zero ledger I/O, but its one terminal transition took 15,987ms and wrote 3,846,746 bytes. A separate reproducible direct-capture run during the same slowdown averaged 4.24s across 10 terminal changes (~3.64MB/write). These adverse results are disclosed rather than treated as outliers that can be ignored. They are CPU/in-memory observations, not Core/PostgreSQL/disk/network acceptance. The hot-path comparison uses only bounded primitive history metadata, never frozen input/image bodies. The service now skips all ledger I/O for unchanged/nonterminal/timestamp-only updates, with regressions proving that behavior and retry recovery. Genuine outcome changes still incur full-value persistence. Reproduce direct ledger capture with node scripts/benchmark-history.mjs; this intentionally bypasses the service no-op skip. Keep this PR draft until actual Core storage/load profiling establishes acceptable terminal-event throughput and UI/indexing responsiveness, or a crash-safe storage design is separately implemented and tested. This is not release-ready based solely on these benchmarks.
Failed-write ordering recovery
Failed captures retain bounded, sanitized ordered observations alongside the shared in-process writer queue. Later captures (including another bot's write) and snapshot retries apply those observations with their original ordering authority, so a same-timestamp delivered outcome replaces an already-persisted succeeded outcome. Snapshot-only rows still cannot win timestamp ties. Pending observations clear only after successful persistence and use the same record/byte retention limits; no frozen inputs or image bodies are queued. The persisted history-gap warning remains after recovery.
Regressions cover failed snapshot retries, nonterminal-write recovery, multiple failed transitions, cross-bot/instance recovery, stale snapshot rejection, and restart after a successful retry. These observations are in-memory, not a durable write-ahead log: process death before successful recovery can still lose ordering evidence and history; the gap warning documents that limitation. Existing Core load and rendered-browser release gates remain unchanged.