Project libraryVolume I / SQL detective

Game · SQL learning · no server

ZeroSQL: Polynya

A browser detective game in which clues are found with SQL queries.

You are an analyst in the police basement of Polynya, a northern town. You look for clues with queries to “Mirror”, the department’s system, and every row you find moves the story forward.

Solo project: idea, product and game design; built with AI agents.

The analyst’s desk in the prologue: a query to the incident log and the result sheet.
01The analyst’s desk in the prologue: a query to the incident log and the result sheet.
13 cases
a prologue, ten cases, an interlude and a finale
75 concepts
of SQL and the archive in the handbook
1,316 lines
voiced · 14 voices
0 servers
SQLite runs in the browser
01 / Story

Polar night.
Someone is waiting for your query.

2 December 2026, polar night. Eight-year-old Misha has not come home from music school; Dasha is waiting out in the frost for an address.

The new analyst of the digital investigations unit sits at “Mirror”: the incident log, cameras, the civil registry, the bank, the access control system — 52 tables, about 55 thousand rows.

Petty incidents add up to a story about the Siyanie company, its owner Granin, a mayoral candidate, the Shield private security firm and Irina, the analyst’s predecessor.

In the finale the sun rises at 12:58, and at 13:00 the archives are finalized. Before that you have to put the board together and send the package. Your choices and findings lead to one of five endings.

The town, the people and the events are fictional. 18+.

02 / Why it matters

You learn SQL
while the investigation goes on.

For those who have never written a query, and for those who write them every day.

01

From scratch, at the right moment

57 lessons from MIRA, each with an example and a try on your own query, and 98 “why it works” breakdowns. Beginner mode makes your colleagues’ hints free.

02

The answer is checked, not the text

Any correct query counts. There is a bonus for an elegant single-query solution. In the debrief you can compare your query with the reference one.

03

No mistake goes unexplained

MIRA recognizes text without quotes, a comma before FROM, comparing NULL with =, JOIN without ON. A typo in a table name gets “did you mean…”.

04

Room to grow

Window functions, recursion, transactions, archive snapshots. After the season comes Zero mode: no hints, no autocomplete, no card index. You study the database structure through sqlite_master.

03 / How it plays

The analyst’s workstation.

On the desk: a card index of tables, an editor with autocomplete, the result sheet, assignments and “Comms”: the radio and the phone. Between queries come scenes with portraits and voice acting, interrogations with prompts in your earpiece, evidence cards and the accusation.

In cases No. 03–10 the morning starts with Dasha’s briefing, and before a new case Nina offers three tasks on the techniques you are weak at. You can note eight oddities in the anomaly notebook before the story even gets to them. Ten recordings from Irina’s voice recorder unlock when the right row appears in a result.

After a solved case

34 achievements and a debrief against the reference.

Your way

Keyboard controls and a no-animation mode. On a phone the desk turns into tabs.

Same archive, different screen

The desk fits in a phone.

Query, result, assignments, card index and comms are separate tabs.

Dasha’s morning briefing on a phone.
09Dasha’s morning briefing on a phone.
The final evidence board on a phone.
10The final evidence board on a phone.
Archive review with Nina on a phone.
11Archive review with Nina on a phone.
04 / Season

Thirteen cases.
From SELECT to the first sun.

Each case adds techniques to the investigation. The handbook has 75 SQL and archive concepts. Open a title to see the topics of the case.

Prologue“Floor Zero”

SELECT, WHERE, comparisons, AND, ORDER BY, LIMIT

Case No. 01“Copper”

OR, IN, BETWEEN, LIKE, IS NULL, DISTINCT

Case No. 02“Minus Forty-One”

aggregates, ROUND, AS, GROUP BY, HAVING

Case No. 03“Hit-and-Run on Polyarnaya”

INNER JOIN, aliases, sorting by several keys

Case No. 04“Dead Soul”

LEFT JOIN, anti-join, JOIN chains, COALESCE, NULL logic

Case No. 05“Number 3312”

subqueries, EXISTS, NOT IN and NULL, CASE WHEN

Case No. 06“Polynya”

dates and times, strftime, julianday, self-join

Case No. 07“The Service Apartment”

WITH, UNION, EXCEPT, INTERSECT

Case No. 08“Ghost in the System”

window functions, ROW_NUMBER, RANK, LAG/LEAD

Case No. 09“Matryoshka”

WITH RECURSIVE, running totals, window frames

Case No. 10“Carbon Copy”

snapshot comparison, string functions, group_concat, GLOB, homoglyphs

Interlude“Draft”

transactions, INSERT, UPDATE, DELETE, CREATE VIEW

Case No. 11“First Sun”

finale: an evidence board with nine required nodes and a package that has to be sent before 13:00

Besides SQL, the handbook covers 13 pieces of “archive” knowledge: local time and UTC, OCR of Cyrillic and Latin letters, −999 instead of a temperature, KUSP numbering (the police incident register) and other quirks of departmental databases.

05 / How it works

The whole game runs in the browser.

There is no server: the site is a static build. The world, the database, the save and query checking all run on the player’s device.

InterfaceNext.js 16 · React 19 · CodeMirror 6

Static export: HTML, JavaScript, WASM and media. The analyst’s desk, scenes, interrogations and the evidence board share one interface.

Game storeZustand · localStorage

Zustand is the single owner of state: profile, season, active case and settings. The save lives in localStorage; the database is not part of it.

Web Worker / separate thread

Case sessionresult checking · story permissions

The result counts, not the query text. Access depends on the story: classified tables, read-only mode, writes only to the tables the case allows.

SQLitesql.js · WebAssembly

Real SQLite with Cyrillic-aware LIKE and lower and an in-game clock. Queries run separately from the interface.

World52 tables · about 55k rows

Deterministic generation from a seed. Built ahead of time as a 1.9 MB gzip file, or the world is generated right in the browser.

CacheIndexedDB

The built world is stored in IndexedDB. If the cache is unavailable, the world can be built again.

A small save, real SQL

The database is rebuilt,
not carried over whole.

The case database is rebuilt from the world, the story patches and the action journal. The save keeps only what is necessary.

Action journal

The player’s action journal, together with the world and the story patches, makes it possible to rebuild the case database.

If a query takes longer than 3 seconds

The worker restarts and restores the database from the journal. The interface is never busy running SQL meanwhile.

The diagram blocks expand without JavaScript.

06 / Quality

Robots play through the season.

Not only the code is tested but the player’s path too — all the way to the final board.

2,978 automated tests in 112 files

The season runs through the game logic in seconds. Every case’s reference queries are checked against the real world.

13 of 13 cases through the interface

A Playwright bot goes through the clicks, queries, interrogations and the finale. Screenshots are taken on desktop and on a phone.

1.69 MB initial JavaScript budget

In the repository the build fails if the budget is exceeded, and case content is loaded on demand.

On every push to main and every pull request, GitHub Actions runs type checking, the linter, the tests and the build.

The figures are taken from the project’s materials, not from a fresh test run on this page.

07 / Technologies

A static site.
A complete system inside.

  • TypeScript
  • Next.js 16 (static export)
  • React 19
  • Zustand
  • sql.js (SQLite → WebAssembly)
  • Web Worker
  • IndexedDB
  • CodeMirror 6
  • Tailwind CSS
  • Vitest
  • Playwright
  • GitHub Actions
  • ElevenLabs (speech synthesis and recognition)
  • ffmpeg
08 / Voice and art

The polar night
has a voice of its own.

1,316 lines, 13 character voices and a narrator. The voices were created in ElevenLabs from descriptions, without cloning real people. The radio, the phone and voicemail sound like different channels.

63 portraits of 12 characters, 17 paintings of locations and the title screen, the desk art. The images were made with AI and refined for the game.

Trailer / 78 seconds

Paintings, the narrator, the game’s music and the real interface. Two vertical clips were cut from the same material.

The video loads only after you press “Watch the trailer”.

09 / Development

How the project was made.

The code was written with the AI agent Claude Code: about 50 thousand lines of TypeScript in the app and 28 thousand lines of tests.

The voices, portraits, location paintings and desk art were made with AI and prepared for the game.

10 / Analysis

The game as a system:
data, process, criteria.

Five business analysis artifacts based on the project’s code and documentation: the data model, the path of a query, a task as a user story, the season in numbers and a decision log. The numbers were recounted against the published version of the game; where a diagram is simplified, it says so next to it.

  1. 10.1Data model
  2. 10.2Query path
  3. 10.3Task as a story
  4. 10.4Season in numbers
  5. 10.5Decision log

10.1 · ER diagram

Data model: 15 key tables out of 52

“Mirror” has 52 tables and about 55 thousand rows. Here is the core of the model: people, incidents, vehicles, money and traces in the system. Some links rest not on keys but on matching values — a licence plate, a KUSP number, a login: the player puts those together themselves.

  • persons is the hub: 21 of the 42 foreign keys in the base world point to it.
  • Keys are declared but not enforced: four staff members without a person record are a task in case No. 04, not a data error.
  • Two layers: the police edit the PDB (police database) but can only read MIRROR. If the two disagree, it was the PDB that was edited: MIRROR has no write access for the police.
  • foreign key: many rows → one
  • key empty in some rows
  • link by value, no key
  • → personsforeign key
  • ≈ vehicleslink by value, no key
  • horizon: rows “from the future” are hidden
  • PDB / MIRROR layer
The “Mirror” data model: the key 15 of 52 tablesFifteen tables and 22 links. persons is the hub: nine foreign keys lead to it — eight lines, with father and mother as one loop. Incidents are linked to people through incident_persons, and to staff and vehicles by foreign keys. The licence plate, the KUSP number and the login link tables only by value, without a foreign key. Four staff.person_id rows find no record in persons; every account has exactly one owner field filled in.father_id, mother_idaddresses — Address directory; MIRROR layer; 900 rows in the built world; 5 columnsaddressesAddress directoryPKidstreethouseapt+ 1 more column900 rowsMIRRORaccounts — Bank accounts; MIRROR layer; 1,300 rows in the built world; 6 columnsaccountsBank accountsPKFKFKidholder_person_idholder_company_idbank+ 2 more columns1,300 rowsMIRRORtransactions — Bank transactions; MIRROR layer; 4,199 rows in the built world; 8 columns; horizon on tstransactionsBank transactionsPKFKidaccount_idtsamount+ 4 more columns4,199 rowsMIRRORregistrations — Residence registration; MIRROR layer; 2,195 rows in the built world; 5 columnsregistrationsResidence registrationPKFKFKidperson_idaddress_idfrom_date+ 1 more column2,195 rowsMIRRORpersons — Person records; PDB layer; 4,301 rows in the built world; 13 columnspersonsPerson recordsPKFKFKidfull_namefather_idmother_id+ 9 more columns4,301 rowsPDBemployment — Employment; MIRROR layer; 1,800 rows in the built world; 6 columnsemploymentEmploymentPKFKFKidperson_idcompany_idposition+ 2 more columns1,800 rowsMIRRORcompanies — Company register; MIRROR layer; 250 rows in the built world; 7 columnscompaniesCompany registerPKFKidnamedirector_person_id+ 4 more columns250 rowsMIRRORstaff — Police HQ staff; PDB layer; 150 rows in the built world; 12 columnsstaffPolice HQ staffPKFKidperson_idloginbadge_id+ 8 more columns150 rowsPDBincident_persons — Incident participants; PDB layer; 1,312 rows in the built world; 6 columnsincident_personsIncident participantsPKFKFKidkusp_noincident_idperson_id+ 2 more columns1,312 rowsPDBvehicles — Vehicle register; MIRROR layer; 1,400 rows in the built world; 12 columnsvehiclesVehicle registerPKFKFKidowner_company_idplateowner_person_id+ 8 more columns1,400 rowsMIRRORplate_reads — Licence plate reads; MIRROR layer; 4,000 rows in the built world; 6 columns; horizon on read_atplate_readsPlate readsPKFKidread_atplatecamera_id+ 2 more columns4,000 rowsMIRRORlogins — System accounts; PDB layer; 169 rows in the built world; 7 columnsloginsSystem accountsPKFKloginstaff_idrole+ 4 more columns169 rowsPDBincidents — Incident log; PDB layer; 2,000 rows in the built world; 13 columns; horizon on reported_atincidentsIncident logPKFKFKidkusp_noreported_atvehicle_idofficer_staff_id+ 8 more columns2,000 rowsPDBaudit_log — Change log; PDB layer; 3,800 rows in the built world; 10 columns; horizon on tsaudit_logChange logPKidtslogintable_namerow_id+ 5 more columns3,800 rowsPDBcameras — Plate recognition cameras; MIRROR layer; 60 rows in the built world; 5 columnscamerasPlate camerasPKidname+ 3 more columns60 rowsMIRROR

People and addresses

personsPDB

Person records · 4,301 rows

  • PKid
  • full_name
  • FKfather_id→ persons
  • FKmother_id→ persons
  • + 9 more columns

registrationsMIRROR

Residence registration · 2,195 rows

  • PKid
  • FKperson_id→ persons
  • FKaddress_id→ addresses
  • from_date
  • + 1 more column

addressesMIRROR

Address directory · 900 rows

  • PKid
  • street
  • house
  • apt
  • + 1 more column

Incidents

incidentsPDB

Incident log · 2,000 rows

  • PKid
  • kusp_no≈ incident_persons
  • reported_at
  • FKvehicle_id→ vehicles
  • FKofficer_staff_id→ staff
  • + 8 more columns

incident_personsPDB

Incident participants · 1,312 rows

  • PKid
  • kusp_no≈ incidents
  • FKincident_id→ incidents
  • FKperson_id→ persons
  • + 2 more columns

Vehicles and cameras

vehiclesMIRROR

Vehicle register · 1,400 rows

  • PKid
  • FKowner_company_id→ companies
  • plate≈ plate_reads
  • FKowner_person_id→ persons
  • + 8 more columns

plate_readsMIRROR

Licence plate reads · 4,000 rows

  • PKid
  • read_at
  • plate≈ vehicles
  • FKcamera_id→ cameras
  • + 2 more columns

camerasMIRROR

Plate recognition cameras · 60 rows

  • PKid
  • name
  • + 3 more columns

Companies and money

companiesMIRROR

Company register · 250 rows

  • PKid
  • name
  • FKdirector_person_id→ persons
  • + 4 more columns

employmentMIRROR

Employment · 1,800 rows

  • PKid
  • FKperson_id→ persons
  • FKcompany_id→ companies
  • position
  • + 2 more columns

accountsMIRROR

Bank accounts · 1,300 rows

  • PKid
  • FKholder_person_id→ persons
  • FKholder_company_id→ companies
  • bank
  • + 2 more columns

Every account has exactly one owner field filled in: a person or an organization.

transactionsMIRROR

Bank transactions · 4,199 rows

  • PKid
  • FKaccount_id→ accounts
  • ts
  • amount
  • + 4 more columns

Staff and traces in the system

staffPDB

Police HQ staff · 150 rows

  • PKid
  • FKperson_id→ persons
  • login
  • badge_id
  • + 8 more columns

4 person_id rows find no record in persons: that is a task in case No. 04.

loginsPDB

System accounts · 169 rows

  • PKlogin≈ audit_log
  • FKstaff_id→ staff
  • role
  • + 4 more columns

audit_logPDB

Change log · 3,800 rows

  • PKid
  • ts
  • login≈ logins
  • table_name
  • row_id
  • + 5 more columns
Fig. 10.1

The key 15 of 52 tables, each with its key columns only. Rows were counted in the built world of the published build, before story patches. Foreign keys are declared, but the database does not enforce them (PRAGMA foreign_keys = OFF).

Source: src/engine/world/schema.ts:6–9, 89–392 · src/data/schema-notes.json · src/data/handbook/c04.json:78–88

Full diagram
As text 22 links and 15 tables

Foreign keys (19) and links by value (3)

  • accounts.holder_person_id → persons — empty in 142 of 1,300
  • accounts.holder_company_id → companies — empty in 1,158 of 1,300
  • companies.director_person_id → persons — empty in 2 of 250
  • employment.person_id → persons — empty in 55 of 1,800
  • employment.company_id → companies — filled in all 1,800
  • incident_persons.incident_id → incidents — filled in all 1,312
  • incident_persons.person_id → persons — empty in 13 of 1,312
  • incidents.officer_staff_id → staff — filled in all 2,000
  • incidents.vehicle_id → vehicles — empty in 1,827 of 2,000
  • logins.staff_id → staff — empty in 2 of 169
  • persons.father_id → persons — empty in 3,059 of 4,301
  • persons.mother_id → persons — empty in 3,059 of 4,301
  • plate_reads.camera_id → cameras — filled in all 4,000
  • registrations.address_id → addresses — filled in all 2,195
  • registrations.person_id → persons — filled in all 2,195
  • staff.person_id → persons — 4 rows with no match in persons
  • transactions.account_id → accounts — filled in all 4,199
  • vehicles.owner_company_id → companies — empty in 1,249 of 1,400
  • vehicles.owner_person_id → persons — empty in 157 of 1,400
  • plate_reads.plate ≈ vehicles.plate — by value, no key: the licence plate; an exact match for 3,879 of 4,000 reads
  • incident_persons.kusp_no ≈ incidents.kusp_no — by value, no key: the KUSP number; for all 1,312 participants it matches the KUSP of their incident
  • audit_log.login ≈ logins.login — by value, no key: the login of whoever made the change; all 3,800 log rows have it in logins

Tables: 15 of 52

  • addresses — Address directory; MIRROR; 900 rows, 5 columns
  • accounts — Bank accounts; MIRROR; 1,300 rows, 6 columns
  • transactions — Bank transactions; MIRROR; 4,199 rows, 8 columns, horizon on ts
  • registrations — Residence registration; MIRROR; 2,195 rows, 5 columns
  • persons — Person records; PDB; 4,301 rows, 13 columns
  • employment — Employment; MIRROR; 1,800 rows, 6 columns
  • companies — Company register; MIRROR; 250 rows, 7 columns
  • staff — Police HQ staff; PDB; 150 rows, 12 columns
  • incident_persons — Incident participants; PDB; 1,312 rows, 6 columns
  • vehicles — Vehicle register; MIRROR; 1,400 rows, 12 columns
  • plate_reads — Licence plate reads; MIRROR; 4,000 rows, 6 columns, horizon on read_at
  • logins — System accounts; PDB; 169 rows, 7 columns
  • incidents — Incident log; PDB; 2,000 rows, 13 columns, horizon on reported_at
  • audit_log — Change log; PDB; 3,800 rows, 10 columns, horizon on ts
  • cameras — Plate recognition cameras; MIRROR; 60 rows, 5 columns

10.2 · Process · BPMN

The path of a query: from Ctrl+Enter to a solved task

What happens after you run a query: access rights, the in-game clock, execution, result checking and the log. Four lanes: the player, the desk, the engine in a separate thread, and SQLite. The row in the query log is written last, so reference queries and secrets do not see the current query.

  • start
  • end
  • step
  • denial or error
  • step only some tasks have
  • decision
  • link between parts
  • timer
  • Web Worker
The path of a query: from Ctrl+Enter to a solved taskTwo parts, four lanes: the player, the desk on the main thread, the engine in a Web Worker, and SQLite. Part 1: the desk passes on the query and the case progress; the engine checks access (if denied, the clock stands still), moves the in-game clock, and SQLite runs the query; an SQLite error is explained in Russian and tasks are not checked. Part 2: checking by the current task’s rule (for 38 of 98 tasks, with a reference query on the same database), side tasks, secrets and the linter, then the row in query_log, last; denials and errors end up there too. If the engine does not answer within 3 seconds, the worker restarts and rebuilds the database from the world cache and the journal. Task solved: MIRA’s conclusion and an evidence card; if not: “Not accepted: …” or an error, and the player edits the query.Part 1 · access, clock, executionPlayeranalyst’s deskDeskmain thread:store, engine clientEngineWeb Worker:case sessionSQLitesql.js in thesame workerWeb WorkernoyesyesnoWrites SQL and presses Ctrl/⌘ + EnterPasses the queryand case progressAccessallowed?“DENIED”or “FORBIDDEN”Game clockticks forwardRuns the queryno rows “from the future”SQLiteerror?Explains the errorin RussianRegistry ofseen valuesBto the logBto the logAto checkingPart 2 · checking and responsePlayeranalyst’s deskDeskmain thread:store, engine clientEngineWeb Worker:case sessionSQLitesql.js in thesame workeryesnoAChecks withthe task’s ruleThe task’sreference queryfor 38of 98 tasksSide tasks,secrets, linterRowin query_logwritten lastBdenial, errorWorkerrestartcached world + journalTasksolved?MIRA’s readout,evidence card“Not accepted: …”or an errorEvidence filedEdits thequery
  1. PlayerWrites SQL and presses Ctrl/⌘ + Enter
  2. DeskPasses the query and the case progress to the enginesolved tasks, seen values, flags: the engine stores no progress
  3. DeskWaits no longer than 3 seconds for the enginethe timer covers all the worker steps below; if there is no answer, the desk restarts the worker: the database is rebuilt from the world cache and the journal, and the query is logged as an error
  4. EngineAccess allowed?
    • no “DENIED”: the table is classified or read-only; “FORBIDDEN”: ATTACH, PRAGMA (except reading the structure), main. and temp.; the query does not run, the clock stands still B
    yes ↓
  5. EngineThe game clock ticks forwardthe query runs on the new clock time
  6. SQLiteRuns the queryrows later than the game clock are hidden by the horizon
  7. EngineSQLite error?
    • yes explains the error in Russian, does not check tasks B
    no ↓
  8. EngineRegistry of seen valuesthe protocol options come from it
  9. EngineChecks with the current task’s rulefor 38 of 98 tasks, with a reference query on the same database
  10. EngineSide tasks, secrets, linter
  11. SQLiteRow in query_log, written lastdenials and errors (B) arrive here too
  12. DeskTask solved?
    • yes MIRA’s conclusion and an evidence card: the evidence is filed
    • no “Not accepted: …” or an error: the player edits the query
Fig. 10.2

Simplified: left out are practice queries (the morning briefing, lessons and Nina’s review bypass the clock and the journal), the final board, the “watchman” of case No. 09 and the query quota. In browsers without Worker or IndexedDB the engine runs on the main thread, with no timeout.

Source: src/engine/runtime/session.ts:6–10, 321–414 · src/engine/runtime/client.ts:44, 362–385 · docs/design/TECH_SPEC.md:136–140 · src/engine/validator.ts:367–416

Full diagram
As text 11 steps
  1. The player writes SQL and presses Ctrl/⌘ + Enter.
  2. The desk passes the query and the case progress (solved tasks, seen values, flags, secrets) to the engine: the engine stores no progress.
  3. The desk waits no longer than 3 seconds for an answer. If the engine stays silent longer, at any of steps 4–10, the desk stops the worker and starts a new one: the database is rebuilt from the world cache and the journal, and the query counts as run with an error and also goes into query_log (next: step 11).
  4. The engine checks access. A table classified by the story, or a write the case does not allow: “DENIED”; ATTACH, PRAGMA (except reading the structure: table_info, table_xinfo, foreign_key_list), the main. and temp. qualifiers: “FORBIDDEN”. The query does not run, the clock stands still (next: step 10).
  5. The game clock ticks forward by the case’s rules; the query runs on the new clock time.
  6. SQLite runs the query; rows later than the game clock are hidden by the horizon views.
  7. An SQLite error gets an explanation in Russian; tasks are not checked (next: step 10).
  8. The values in the result go into the registry of seen values: protocol answers are later chosen only from it.
  9. Checking by the rule of the current main task; for 38 of 98 tasks the rule compares the result with a reference query on the same database. An accepted result is also checked against the next task.
  10. Side tasks, secrets and the linter; then the player’s row goes into query_log, last, so that reference queries and secrets do not see it.
  11. Task solved: MIRA reads out the conclusion and the player gets an evidence card. If not: “Not accepted: …” with the reason, or an explanation of the error, and the player edits the query.

10.3 · Requirements · user story

One task as a user story

Case No. 03, the Taiga’s route. The story, the expected result and seven acceptance scenarios: three correct queries and four typical mistakes, with what the player sees in response.

o3_2 · Case No. 03 “Hit-and-Run on Polyarnaya”concept: table aliases

As a unit analyst, I want to see which cameras recorded К404ТО on the evening of 18 November, and when — from 22:00 to midnight, in time order — so that I can check the theft story: where the “stolen” car was at 23:10, when the woman was hit.

Context
On 18 November at 23:10 a woman was hit at 17 Polyarnaya Street; the driver fled. The same night the director of the Shield private security firm reported the company’s Taiga stolen. The player found the licence plate in the case’s first task.
Done when
there is a reference solution; in the case tests the reference and another correct wording pass, and at least two plausible mistakes fail; the case’s access policy lets the reference through.
Hints
four levels: a nudge from Dasha → a concept from MIRA → a template with blanks → “Irina’s cheat sheet” with one mistake.
Given
Case No. 03 is open, the first task is done, the current one is o3_2; the plate_reads and cameras tables are accessible.
  1. Reference solutionAC1

    When
    Joins the plate reads with the cameras, filters by plate and the 22:00–23:59:59 window, sorts by time.
    SQL query
    SELECT r.read_at, c.name, r.direction FROM plate_reads r JOIN cameras c ON c.id = r.camera_id WHERE r.plate = 'К404ТО' AND r.read_at BETWEEN '2026-11-18 22:00:00' AND '2026-11-18 23:59:59' ORDER BY r.read_at;
    Then
    Accepted. 4 rows in time order. MIRA reads out the conclusion, the player gets the “Taiga’s route” card, and a scene begins.
  2. Different text, same answerAC2

    When
    No aliases, and LIKE instead of BETWEEN.
    SQL query
    SELECT plate_reads.read_at, cameras.name FROM plate_reads JOIN cameras ON cameras.id = plate_reads.camera_id WHERE plate_reads.plate = 'К404ТО' AND plate_reads.read_at LIKE '2026-11-18%' ORDER BY plate_reads.read_at;
    Then
    Accepted. The result is checked, not the text of the query.
  3. Own names and an extra columnAC3

    When
    The columns are renamed and reordered, and direction is added.
    SQL query
    SELECT c.name AS camera, r.read_at AS at, r.direction FROM cameras c JOIN plate_reads r ON r.camera_id = c.id WHERE r.plate = 'К404ТО' AND r.read_at < '2026-11-19 00:00:00' ORDER BY r.read_at ASC;
    Then
    Accepted. The reference columns are matched by name, then by values; extra columns do not get in the way.
  4. False trail: the next nightAC4

    When
    There is no time filter, so the read of 19 November at 03:10 ends up in the result.
    SQL query
    SELECT r.read_at, c.name FROM plate_reads r JOIN cameras c ON c.id = r.camera_id WHERE r.plate = 'К404ТО' no time filter ORDER BY r.read_at;
    Then
    Not accepted. 19.11 at 03:10 is already the next night. You only need the evening of 18.11, until midnight. This is exactly “Irina’s cheat sheet with one mistake” from the fourth hint.
  5. Wrong orderAC5

    When
    The rows are right but sorted by camera name.
    SQL query
    SELECT r.read_at, c.name FROM plate_reads r JOIN cameras c ON c.id = r.camera_id WHERE r.plate = 'К404ТО' AND r.read_at BETWEEN '2026-11-18 22:00:00' AND '2026-11-18 23:59:59' ORDER BY c.name;
    Then
    Not accepted. The rows are right, but the order is wrong. Check ORDER BY.
  6. No camera namesAC6

    When
    The camera’s number instead of its name, without joining the tables.
    SQL query
    SELECT r.read_at, r.camera_id FROM plate_reads r WHERE r.plate = 'К404ТО' AND r.read_at BETWEEN '2026-11-18 22:00:00' AND '2026-11-18 23:59:59' ORDER BY r.read_at;
    Then
    Not accepted. The “name” column is missing (or its values do not match).
  7. Latin letters in the plateAC7

    When
    The plate is typed in Latin letters: K404TO looks no different from К404ТО, but its K, T and O are Latin, not Cyrillic.
    SQL query
    SELECT r.read_at, c.name FROM plate_reads r JOIN cameras c ON c.id = r.camera_id WHERE r.plate = 'K404TO' AND r.read_at BETWEEN '2026-11-18 22:00:00' AND '2026-11-18 23:59:59' ORDER BY r.read_at;
    Then
    Not accepted. Zero rows: Fewer rows than needed. Perhaps the filter is too strict.

The season has 98 tasks: each has a reference solution, 67 have a compound rule, and 20 have a negative criterion, as here.

Fig. 10.3

The “user” is the player’s role in the game: this is how an in-game task is worded, not an interview with a client. All seven scenarios were run against the world of the published version; the messages are the validator’s own words (translated here), and on the assignment card they follow “Not accepted:”.

Source: src/data/cases/case-03-polyarnaya/case.json:113–163, 442–501 · src/__tests__/cases/c03.test.ts:89–92, 128–137 · src/engine/validator.ts:276–284, 367–423

10.4 · Data · chart

The season in numbers

How many new handbook concepts each case brings and how many tables are open in it: from 3 in the prologue to 52 in the finale. Case No. 06 adds the most new tables, seven at once.

  • SQL
  • archive knowledge: time, OCR, KUSP numbering…
  • tables accessible
The season in numbers: new concepts and tables across 13 casesTwo panels with a shared case axis. Top: new handbook concepts in each case, SQL and archive knowledge, from 0 to 8; 62 SQL and 13 archive in total, 75. Bottom: how many tables are open to the player in each case, from 3 in the prologue to 52 in the finale; case No. 06 adds the most new tables, seven; from case No. 10 three archive views are added to them.New handbook concepts, count62 SQL + 13 archive = 75; the finale adds nonePrologue “Floor Zero”: 7 SQL + 1 archive8Case No. 01 “Copper”: 6 SQL + 1 archive7Case No. 02 “Minus Forty-One”: 6 SQL + 1 archive7Case No. 03 “Hit-and-Run on Polyarnaya”: 3 SQL + 1 archive4Case No. 04 “Dead Soul”: 6 SQL + 2 archive8Case No. 05 “Number 3312”: 6 SQL + 1 archive7Case No. 06 “Polynya”: 6 SQL + 1 archive7Case No. 07 “The Service Apartment”: 4 SQL + 0 archive4Case No. 08 “Ghost in the System”: 3 SQL + 1 archive4Case No. 09 “Matryoshka”: 4 SQL + 1 archive5Case No. 10 “Carbon Copy”: 6 SQL + 2 archive8Interlude “Draft”: 5 SQL + 1 archive6Case No. 11 “First Sun”: 0 SQL + 0 archive0Tables accessible in the casefrom 3 in the prologue to 52 in the finalePrologue “Floor Zero”: 3 tables accessible, 3 new3Case No. 01 “Copper”: 6 tables accessible, 3 new6Case No. 02 “Minus Forty-One”: 10 tables accessible, 4 new10Case No. 03 “Hit-and-Run on Polyarnaya”: 14 tables accessible, 4 new14Case No. 04 “Dead Soul”: 19 tables accessible, 5 new19Case No. 05 “Number 3312”: 22 tables accessible, 3 new22Case No. 06 “Polynya”: 29 tables accessible, 7 new29Case No. 07 “The Service Apartment”: 33 tables accessible, 4 new33Case No. 08 “Ghost in the System”: 38 tables accessible, 5 new38Case No. 09 “Matryoshka”: 44 tables accessible, 6 new44Case No. 10 “Carbon Copy”: 47 tables accessible, 3 new47Interlude “Draft”: 50 tables accessible, 3 new50Case No. 11 “First Sun”: 52 tables accessible, 2 new52P12345678910I11cases in order: P — prologue, I — interlude, 11 — finale; the axis is ordinal, not timeThe season in numbers: concepts and tables by caseThirteen rows, one per case: how many new handbook concepts (SQL and archive) and how many tables are accessible. 62 SQL and 13 archive in total; tables, from 3 in the prologue to 52 in the finale.casenew conceptstablesPrologueCase 1Case 2Case 3Case 4Case 5Case 6Case 7Case 8Case 9Case 10InterludeCase 11877487744586036101419222933384447505262 SQL + 13 archive = 75 concepts
Fig. 10.4

The 13 cases of the published version. A concept is credited to the case in whose handbook it first appears. Tables exclude the three archive views arch16_* (from case No. 10), which is why the finale has 52 names, not 55.

Source: src/data/cases/*/case.json (concepts, tables, objectives) · src/data/handbook/c00–c12.json

As text table of 13 cases
CaseSQLArchiveTablesTasks: main + side
Prologue “Floor Zero”7135 + 1
Case No. 01 “Copper”6164 + 1
Case No. 02 “Minus Forty-One”61106 + 3
Case No. 03 “Hit-and-Run on Polyarnaya”31145 + 2
Case No. 04 “Dead Soul”62195 + 2
Case No. 05 “Number 3312”61225 + 2
Case No. 06 “Polynya”61295 + 4
Case No. 07 “The Service Apartment”40336 + 1
Case No. 08 “Ghost in the System”31387 + 3
Case No. 09 “Matryoshka”41445 + 2
Case No. 10 “Carbon Copy”62477 + 2
Interlude “Draft”51505 + 0
Case No. 11 “First Sun”00526 + 4
Total62135271 + 27

10.5 · Decision log · ADR

The decisions the checking rests on

Four rules from the project’s documentation and code: context, decision and consequence. No alternatives are given, because the documents have none.

  1. 01

    A false trail is a separate negative criterion

    A common mistake gives an almost correct result with one extra row, for example a read from the next night.

    DecisionA not rule with its own message: the false-trail value must not be in the result. A compound rule answers with the message of the first check that fails, so in task o3_2 not comes first: the player reads its message rather than the generic “More rows than needed”.

    ConsequenceThe player sees on the assignment card exactly what is wrong, not a generic “doesn’t match”. 20 of the season’s 98 tasks have a negative criterion.

    Source: docs/design/TECH_SPEC.md:88 · src/engine/validator.ts:276–284, 418–423 · src/data/cases/case-03-polyarnaya/case.json:117–133

  2. 02

    Foreign keys are declared but not enforced

    The schema should read like a real departmental database, and the “dirt” in the data should teach.

    DecisionREFERENCES is in the DDL for the schema panel, but the world is built with PRAGMA foreign_keys = OFF.

    ConsequenceFour staff.person_id rows find no record in persons: the first task of case No. 04 is built on this (LEFT JOIN … IS NULL).

    Source: src/engine/world/schema.ts:6–9 · docs/design/GAME_DESIGN.md:1607

  3. 03

    Time is part of the data

    The season runs from 2 December to 11 January, yet there is one world for all the cases: rows for later events are already in the database.

    Decision18 tables have a horizon column. Each open one gets a TEMP VIEW with the same name: rows later than the game clock are hidden. A query that runs moves the clock by the case’s rules: never past the ceiling, and in places with stops.

    ConsequenceIndexes keep working. The horizon cannot be bypassed: the main. and temp. qualifiers, ATTACH and PRAGMA (except reading the structure: table_info and the like) are forbidden by the access policy.

    Source: docs/design/GAME_DESIGN.md:1443 · src/engine/world/horizon.ts:64–68 · src/engine/live.ts:94–116 · src/engine/table-guard.ts:1–12

  4. 04

    Protocol: only what you have seen, checked as a batch

    The player writes up the case conclusion as a protocol with blanks, so the answer options could simply be tried one by one.

    DecisionAn option is available only if it has appeared in the player’s query results. The check confirms the blanks only when at least three are correct (two in the prologue) or all the remaining ones are correct, and it does not say which ones are wrong.

    ConsequenceYou can only accuse someone you found yourself; guessing does not work. Every blank’s answer must appear in the results of the case’s reference queries, and the tests check this.

    Source: src/engine/protocol.ts:6–13, 299–338 · docs/design/TECH_SPEC.md:91

Sources: the project’s code, technical specification and design document. The acceptance scenarios were run against the world of the published version of the game.

In the margins / Try it

The prologue in three queries.

2 December 2026. Misha has not come home from music school; Dasha is waiting out in the frost for an address. Here are 22 entries from the game’s incident log (the data is in Russian, as in the game); a real SQLite starts only when you tell it to.

Runs on your device
SQL · incidents · 22 rowsSQLite not started
Ctrl / ⌘ + Enter

Table incidents — the incident log.

id — record number
kusp_no — KUSP number
reported_at — time reported
kind — type
district — district
address_text — address
description — what happened

The query runs only on your device: SQLite is compiled to WebAssembly, just as in the game itself. Nothing is sent anywhere.

Next: the whole season in “Mirror”.

Play in browser