← SkillSafe / Append-Only Audit

Can this event store fork a stream, or this projection count an event twice?

Paste or drop the event-sourcing code behind one service - the Postgres schema, the event store written with asyncpg, the services that append to it and the projectors that build read models. Your browser reads every file and checks it: an events table with no UNIQUE (stream_id, version), appends with no expected version or outside a transaction, UPDATE or DELETE on events, reads with no ORDER BY, sequence gaps a subscriber can skip, checkpoints saved before the apply or outside the read model's transaction, SET total = total + $1 that doubles on replay, handler errors logged and skipped, rebuilds that never clear the table. Free, before you sign in, and nothing is uploaded. Then pick a lane: the store audit or the projection audit gives exact edits for each finding, or the fix lane writes the whole fixed files - and the page re-checks all three.

The companies and values in the examples are invented. The first is a store audit (it also carries a saved fix run of its edited code, one click after the audit), the second a projection audit, the third is ready on both audits (switch lanes to see the second), the last a fix run; each comes with a saved model reply, so you can see the whole page without signing in or spending a credit.

Paid run

The store audit rates the schema, the appends and the reads, confirms or dismisses every store flag below, adds what rules cannot see, and gives exact before/after edits for each finding - which the page applies to your paste and re-checks.

nothing pasted yet
Drop the .py and .sql files, or the package folder (they are joined into one paste, each keeps its path), or
Paste the event store and projection code to price the run.

What this does, and what it does not

The check is a reading of the text, not a database: nothing is run. Each Python file is lexed so strings, f-strings and comments are never mistaken for code, its indentation is rebuilt so each class, function, loop, with block and try/except has its exact extent, and every SQL statement - in a .sql file, in a string, or in a module constant followed to the execute or fetch call that runs it - is read with the function, the connection and the transaction it runs in. The schema tells the page which table holds the events, whether (stream_id, version) is unique and whether the global position is a sequence. Each flag carries the catalogue id it comes from and the line it points at. Checks only see what you paste: a store or a schema that is not pasted, the isolation level, and how many projector instances run are outside the check (noted, not assumed), and your tests against a real Postgres remain the ground truth.

The paid lanes see your paste and the page's facts. Every quote and edit they return is checked against your paste, every edit and every returned file is put back and re-checked, and a reply that repeats a credential from your paste is called out. A paste stays in this browser unless you run a lane. Derived from two agent skills by Seth Hobson (wshobson/agents, MIT): @wshobson/event-store-design and @wshobson/projection-patterns. Sources are listed in llms.txt.