Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(agent-index): record the blocks a retention-wall skip permanently loses

nirholasc6b6c2c02b1b
diff --git a/api/_lib/migrations/20260902190000_erc8004_history_gap.sql b/api/_lib/migrations/20260902190000_erc8004_history_gap.sql
new file mode 100644
index 000000000..df7386dbe
--- /dev/null
+++ b/api/_lib/migrations/20260902190000_erc8004_history_gap.sql
@@ -0,0 +1,30 @@
+begin;
+
+-- The permanent history gap an EVM crawl leaves when it skips a retention wall.
+--
+-- Keyless public RPCs serve a few thousand blocks and answer anything older
+-- with "history has been pruned" or "archive requests require a personal
+-- token". A cursor parked behind that wall never moves again, so the crawl
+-- resumes at the head instead. That unsticks the chain, but the blocks it
+-- jumped over are gone: no keyless lane will ever serve them, and once the
+-- cursor is at head the chain reports zero backlog and looks perfectly healthy.
+-- The gap then exists nowhere at all.
+--
+-- These columns are that gap, kept as a number. They are written only by a tick
+-- that actually skipped, they accumulate across skips rather than overwriting,
+-- and nothing on the read path depends on them, so a chain that has never hit a
+-- retention wall carries the zero it was created with.
+
+alter table erc8004_crawl_cursor
+ -- Total blocks this chain's crawl has jumped over. Recovering them needs an
+ -- archive provider for that chain, which the keyless failover tail is not.
+ add column if not exists history_gap_blocks bigint not null default 0,
+ -- The block the most recent skip resumed at, so the newest gap's upper edge
+ -- is recoverable without re-reading a cron response that has long rotated
+ -- out of the logs.
+ add column if not exists history_gap_to bigint,
+ -- When that skip happened. A gap that stops growing is a chain that caught
+ -- up; one that grows every few days is a provider that needs replacing.
+ add column if not exists history_gap_at timestamptz;
+
+commit;