Skip to content
TauwhoPublic

About

SLEUTH: the haunted cut. A QA workspace that checks every claim in a software demo video against its script, checklist and footage. Kiroween 2026.

Topics

Resources

Contributing

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

268 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SLEUTH

A QA workspace for software demo videos. Give it a script (what you mean to say), a video (what happened) and a checklist (what the demo must show). SLEUTH builds an evidence graph and flags problems as haunted-studio findings. Every match is a candidate. Only a person confirms it.

Built for Kiroween 2026 (Costume Contest). MIT licensed.

Finding Plain English
Ghost No visual evidence
Phantom Dialogue Script line not spoken
Cursed Frame Needs human check
Poltergeist Evidence out of date
Needs Outside Proof Footage cannot prove this

Live: https://sleuth-eight.vercel.app (signed out, you see the read-only demo; "Make an editable copy" starts a guest session).

The SLEUTH dashboard hero: "The cut is haunted.", the real demo coverage and a clue card

The screens

The look is a haunted house at night. Every themed label keeps its plain name beside it.

Screen What it shows Screenshot
Dashboard hero "The cut is haunted.", the demo's real coverage, and a clue card with one real open finding that opens its line desktop, mobile
Findings cabinet One card per finding type, with what it means, how it is found, how to clear it, and whether it blocks the seal desktop, mobile
Claims map The workspace floor plan: one room per script line and checklist item, in four states (covered, candidate waiting, no proof yet, stale after edit), each with its own border and icon desktop, mobile
The Lantern The side panel for the chosen line: what was found, what was not, the limits, and the review actions desktop, mobile
"The final seal" The report: blockers as locked doors, the coverage ledger, and the seal once a person signs off draft, sealed (a rehearsal project, see below)

These screenshots are from the live site on 14 November (scripts/prod-screenshots.ts, signed out, showing the public demo with its seeded results). The sealed report is a rehearsal project made with scripts/seal-rehearsal.ts: its candidates were confirmed by that script through the team account, not by a person watching the clip, and the note on the seal says so.

Night wind is optional ambient sound, made in the browser with the Web Audio API. There are no audio files. It is off until you press "Night wind" in the header. It goes quiet while the demo video plays, and it pauses when the tab is hidden.

Try it in 2 minutes

  1. Open the live site. The public demo project opens with no login.
  2. On the dashboard, click the clue card, or open the demo. Pick a room in the claims map or a line of the script: the clock moves to its evidence and the Lantern opens beside it. Click a marker on the timeline and the sentence lights up.
  3. Press "Make an editable copy". In the Script tab, change one sentence and save. Only that sentence's evidence goes stale (Poltergeist, evidence out of date).
  4. Open "Open the Final Seal report" to see "The final seal" and what still blocks it.

Accuracy

Not measured. We chose not to run an accuracy evaluation before submission (decision D-21). We publish no precision, recall or accuracy number. The harness (pnpm eval, docs/evaluation-protocol.md) is in the repository for a later run.

Uploading your own video checks the speech (Deepgram) and the on-screen text (Tesseract OCR, read on the worker; ADR 0011). The web app starts the free GitHub Actions worker as soon as a job is queued, so a job usually starts within a minute. If that start fails, the 10-minute schedule picks it up (ADR 0009).

How it fits together

flowchart LR
  subgraph Browser
    UI[Next.js UI]
    DemoAPI[Demo mode: in-tab API, scenario replay]
  end
  UI -- "fixture / supabase" --> API[REST API /api/v1]
  UI -- "demo" --> DemoAPI
  API --> Guards[Abuse guards: guest caps, daily budget, CAPTCHA]
  Guards --> Store{Store}
  Store --> Fixture[In-memory golden fixture]
  Store --> Supa[(Supabase: Postgres, Auth, Storage)]
  API -- "job queued: workflow_dispatch" --> Worker
  Cron[GitHub schedule, every 10 min] --> Worker
  Worker[Worker: GitHub Actions] --> Supa
  Worker --> FFmpeg[FFmpeg: audio and frames]
  Worker --> Speech[Deepgram, else local Whisper]
  Worker --> Screen[Gemini for team accounts, else local Tesseract OCR]
  Worker --> Engine[Evidence engine: align and match]
Loading
Part What it does Where
Data modes fixture (memory), supabase (live), demo (the browser answers every call from a scenario, with no network) apps/web/app/api/_lib/data-source.ts, ADR 0010
Demo mode Per-tab state, a scripted job timeline, the scenario's own clip, Reset, the recording view (?rec=1), /demo/preflight, pnpm demo:rehearse apps/web/lib/demo/, features/demo/
Starting the worker The web app starts worker.yml as soon as a job is queued; the 10-minute schedule is the second path worker-dispatch.ts, ADR 0009
Speech Deepgram first; if it fails (credit, outage), faster-whisper on the runner TRANSCRIPTION_FALLBACK=whisper
Screen Gemini only for team accounts on VIDEO_ANALYSIS_OWNER_IDS; everyone else gets Tesseract OCR on the runner, so no visitor frame leaves it LOCAL_OCR=tesseract, ADR 0011, decision D-4
Abuse guards 2 projects and 2 uploads per guest, 50 analyses a day in total, guests removed after 1 day, Turnstile CAPTCHA on guest sign-in docs/deploy-plan.md "Abuse guards"
Delete The owner deletes a project with its stored videos DELETE /api/v1/projects/{id}
Database pool Closed when no request is in flight, so a frozen serverless instance holds no pooler client data-source.ts (releaseStore)
Checks CI: lint, types, unit and property tests, contracts, build, the Postgres suites, and the browser specs in fixture and demo mode. prod-smoke runs against the live site. .github/workflows/

How we used Kiro

Five specs, nine steering files, three hooks and five custom agents drove the build, and property tests written from the specs found three bugs in our own code. MCP servers are configured but disabled, and we did not use Powers. Details with links: docs/submission/kiro-usage.md. The dated log is docs/kiro-engineering-journal.md.

Licence

MIT, see LICENSE.

Five-minute setup (Windows, PowerShell)

You need Node 22 and Git. Run everything in PowerShell on a normal Windows folder, not inside WSL. On macOS the same commands work in a normal terminal (use ; or newlines, not && chains, if you copy the PowerShell ones).

git clone https://github.com/Tauwho/Sleuth
cd sleuth
npm install -g pnpm@10.12.1   # or: corepack enable
pnpm install
pnpm dev

Open http://localhost:3000. No database, keys or Docker are needed: the app reads the golden fixture in memory (SLEUTH_DATA_MODE=fixture, the default).

In a second terminal, run the worker:

pnpm worker          # long-running; Ctrl+C to stop
pnpm worker -- --once   # process the fixture job and exit

The worker claims the fixture job, runs the real pipeline with mock providers, and writes .sleuth-out/analysis-output.json. Delete .sleuth-out/ to run the job again.

If corepack enable fails with EPERM (common with nvm for Windows), use npm install -g pnpm@10.12.1 instead.

Commands

Command What it does
pnpm dev Web app on port 3000
pnpm worker Job worker
pnpm lint ESLint, including package dependency direction
pnpm typecheck TypeScript strict, every package
pnpm test Unit tests (Vitest)
pnpm test:property Property tests (fast-check)
pnpm test:e2e Playwright smoke tests (run pnpm exec playwright install chromium once)
pnpm check:contracts Golden fixture contract test, and docs/api/openapi.yaml matches the Zod schemas
pnpm build Build web, typecheck worker

Layout

apps/web                 Next.js UI and REST routes (app/api/v1)
apps/worker              Job worker (Postgres queue, FFmpeg in Docker)
packages/contracts       Zod schemas and types: the shared shapes
packages/domain          Pure functions: segmenting, hashing, diff, invalidation, review rules
packages/db              Drizzle schema, migrations, seed, fixture store
packages/media           TranscriptionProvider and VideoAnalysisProvider plus mocks
packages/evidence-engine Matching, confidence, explanations
fixtures/golden          The shared contract fixture
docs/decisions           ADRs
.kiro                    Steering, hooks, specs

See .kiro/steering/architecture.md for the dependency rules.

Data modes

  • fixture (default): in-memory golden fixture. Works offline.
  • demo: the browser answers every API call itself from a scenario, with no network, no keys and no database. Each tab has its own state, kept in sessionStorage. Analyses replay a saved run on a fixed timeline, so a recording looks the same every time (ADR 0010). Try it: $env:SLEUTH_DATA_MODE="demo"; pnpm dev. Browser test: pnpm test:e2e:demo. Before recording, open /demo/preflight: it checks the scenario, the video, the fonts, the window size and a clean tab, then "Reset and start recording" opens the recording view (?rec=1: no animations, no reset button; ?rec=0 leaves it). "Reset demo" in the banner forgets this tab's changes. pnpm demo:rehearse proofpay-v1 --repeat 3 plays the walkthrough in apps/web/lib/demo/beats/proofpay-v1.json and fails on the first step that drifts or runs slow.
  • supabase: real Postgres, Auth and Storage; this is what the live site runs. Copy .env.example to .env.local and fill in your own values. Never commit .env* files.

Fixture mode acts as a signed-in user called fixture-user. Send the header x-fixture-user: anonymous to see the signed-out view, or any other name to act as another user. The public demo project is read-only. To get something you can edit, create a project with copyFromDemo: true.

The golden fixture

fixtures/golden/proofpay-demo/ is the contract between frontend, backend and worker. fixtures/golden/build.ts defines it; pnpm tsx fixtures/golden/generate.ts writes the JSON. The contract test fails if the web data source, the database seed mapping or the worker pipeline disagree with it. The fixture has no real footage: ProofPay is an invented product and storagePath is a placeholder.

API

Under /api/v1. Documented in docs/api/openapi.yaml, generated from the Zod schemas (pnpm tsx scripts/generate-openapi.ts). Errors always look like { "error": { "code", "message", "details?" } }.

Database

Migrations come from Drizzle only: edit packages/db/src/schema.ts, then pnpm db:generate. Row Level Security is on for every table. pnpm db:seed loads the demo project (needs DATABASE_URL).

Kiro setup

Everything Kiro reads lives in .kiro/ and is committed.

Path What it is
.kiro/steering/ Rules loaded into chat. Most are always on; frontend.md, backend.md, media.md load by file path; ghost-hunt.md is manual (type /ghost-hunt in chat).
.kiro/hooks/ Automations (Kiro 1.x v1 JSON). They call tools/kiro-hooks/hook.mjs.
.kiro/agents/ Custom agents: frontend-builder, backend-builder, media-builder, and a read-only qa-reviewer. Pick one in the chat agent selector.
.kiro/specs/ Feature specs with requirements, design and tasks.
.kiro/settings/mcp.json Suggested MCP servers, all disabled.

Hooks:

  • Domain or evidence-engine file saved by the agent: that package's unit and property tests run.
  • Contracts file saved by the agent: pnpm check:contracts, workspace typecheck, and a reminder to label the PR contract-change.
  • Spec task finished: typecheck and tests of the packages that changed, then an agent writes a journal entry in docs/kiro-engineering-journal.md.
  • Ghost hunt (manual): /ghost-hunt reviews your diff against ai-safety.md.

File-save hooks fire for changes made by the Kiro agent, not for typing in the editor. CI runs the same checks on every pull request, so nothing depends on a hook. To run a hook's check yourself: node tools/kiro-hooks/hook.mjs test domain (also test evidence-engine, contracts, task-check, ghost-scan).

Turning on MCP servers (optional, your own credentials)

Do not edit the committed file to enable a server. Copy the entry you want into your user-level %USERPROFILE%\.kiro\settings\mcp.json, set "disabled": false, and restart the server from Kiro's MCP panel.

  • Supabase (read-only schema inspection): create a personal access token in your Supabase account and put your project ref in --project-ref=. Set the token as a user environment variable named SUPABASE_ACCESS_TOKEN through Windows Settings, "Edit environment variables for your account". Do not paste it into any file in this repo.
  • Playwright (check the UI in a browser): no credentials. Needs Chromium: pnpm exec playwright install chromium.
  • GitHub (review pull requests): create a fine-grained token with read access to this repo and set it as the user environment variable GITHUB_PERSONAL_ACCESS_TOKEN. Kiro versions differ in how they expand ${VAR} in headers; if the server will not connect, use the gh CLI instead.

Never share tokens in chat, issues or commits. If one leaks, rotate it.

Contributing

See CONTRIBUTING.md.

About

SLEUTH: the haunted cut. A QA workspace that checks every claim in a software demo video against its script, checklist and footage. Kiroween 2026.

Topics

Resources

Contributing

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages