An indexer passes every freshness and throughput check while writing empty or malformed accounts. In the incident this project came out of, green liveness hid empty Kamino payloads for 158.91 hours. karat67 shapes the exact bytes your index stored, reconciles them against chain, and exits non-zero when they disagree.
One decision point, karat67::gate::check_account, is what
the CLI, the Carbon processor hook, the MCP tool, and this page all
call. None of them can reach a verdict the others would not.
The exact indexed bytes against the account registry: an 8-byte Anchor discriminator that resolves to a known type, then that type's declared length, exactly. Obligation 3344, UserMetadata 1032, Reserve 8624, LendingMarket 4664.
A non-Pass shape returns alone. The fetcher is never invoked, so no RPC call goes out and nothing downstream can paper over bytes that are already wrong.
Shape passing earns the fetch. The same key comes back through
getMultipleAccounts and the bytes are diffed. Equal
bytes pass. A mismatch within the slot-lag window is skipped with
its reason, never passed. Beyond the window, or with no write
slot, it fails.
Indexed slots against getBlocks over the same range,
which catches the gap a per-account check cannot see: rows that
are individually correct and collectively missing.
Exit 0 only when the result set is non-empty and every status is Pass. Skipped is not Pass, so a check that could not run still exits 1, and the readout says which of the two happened.
Shape needs no RPC and no secrets, so it runs in CI as it does in this
tab. Reconcile and completeness stay opt-in behind
KARAT_RPC_URL.
name: Shape check (offline)
on:
push:
branches: [main]
pull_request:
jobs:
shape:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install karat
run: cargo install --locked --git https://github.com/SGDlab67/karat67 karat67
- name: Shape check, no RPC
run: karat shape --account-type Obligation --len 3344
karat67 is not on crates.io yet, so both snippets install from GitHub.
cargo add karat67 --git https://github.com/SGDlab67/karat67