Skip to content

Turning a closing shop's know-how into cards

A multi-tenant web service that records the operating know-how of small business owners who are closing down through a six-axis interview, attaches a quote of the original answer to every card sentence for verification, and publishes the cards anonymously so people preparing to open a business in the same trade can read them.

Client
Personal project (synthetic data)
Role
Planning, design, implementation, deployment
Stack
Python · FastAPI · Supabase · Postgres RLS · procrastinate · Qwen
Turning a closing shop's know-how into cards

By the numbers

Every figure is a measured value with a source. Values from the rebuilt environment are marked as such.

Card grounding ratio · real Qwen, synthetic golden set of 10 cases
1.000
0.345 → 1.000
  • Card grounding ratio (real Qwen, synthetic golden set of 10 cases)Reproducible measurement

    Mean 0.345 → mean 1.0 in all 3 real evaluation runs · minimum 1.0 · leaks 0 · empty axes 0

    scripts/qwen-eval.sh (qwen3.7-flash, API key required), Development log (private), 2026-11-03

  • Keyless regression (recorded replay)Reproducible measurement

    20 passed (10 cassettes, 0 auth headers)

    Recorded replay tests in tests/golden/cassettes/, Development log (private), 2026-11-03

  • Tests (at deployment)Reproducible measurement

    Unit 563, E2E 132 (skip 11)

    Development log (private), 2026-11-03

  • Total self-hosted font sizeReproducible measurement

    1,556KB (threshold 2,048KB or less)

    UI redesign E2E, Development log (private), 2026-11-03

  • Public URL smoke testProduction measurement

    7/7 passed (no login, no writes)

    tests/e2e/test_deploy_smoke.py, Development log (private), 2026-11-03

A book bound with thread and pins

How this project works, redrawn as one machine. Left alone it tours itself; press or drag to take over.

How it was solved

01Problem

An owner who ran a shop for 20 years carries a whole business book in their head, and on the day the shop closes, that book gets thrown out too.

02Principle

Ungrounded sentences are flagged, not hidden, and when a number is low, fix the cause, not the threshold.

Real screens

1. Situation

When a small business closes, its suppliers, the way it handled regulars, its seasonal sales patterns, and its failures go unrecorded. The next shop in the same spot makes the same mistakes, and people preparing to open a business read books and watch videos but never hear the story of "that trade in that neighborhood."

So I had the owner talk through questions on six axes (location, suppliers, menu, pricing, customers, failures), and turned the answers into anonymous "shop legacy cards" searchable by trade and region. I assumed the owner would not type, and that personal and business-name details would be masked automatically. The biggest risk was an LLM-written card containing something the owner never said.

2. Scoping

I decided not to sell commercial-district analysis data, broker key money or real estate, or recruit owners automatically. For the interview engine, I took the handover interview engine I had built earlier and only swapped its question tree for the six small-business axes. Parts that are dangerous to get wrong, such as login, authorization, and token verification, went to proven open source and managed services instead of being built by hand.

To fit the public deployment on a single 512Mi instance, I left out the speech recognition model and kept direct text input. Payments also run on a fake provider in the demo.

3. Build

CategoryWhatRationale
ReusedSupabase login and RLS, PyJWT, procrastinate queue, cryptography, vcrpy, interview engineUse proven pieces where mistakes are dangerous
ModifiedEngine question tree changed to six axes, verification prompt made card-specificParser reused as is
BuiltGrounding verification rules, pre-publication quality gate, 16 staff and public screensA card is published only after passing grounding ratio, axis coverage, consent, and masking checks

Tenant isolation is enforced by RLS policies, not app-level conditions. The app connects with a role that cannot bypass RLS.

4. What broke

Grounding ratio 0.345. Evaluating the synthetic golden set of 10 cases with real Qwen gave a mean of 0.345, with 8 of 10 cases below the threshold. Instead of lowering the threshold or editing the golden set, I dumped the drafts and verification responses. In 47 of 60 axes, the draft merged two or more answers into one paraphrased sentence, and 25 sentences had their evidence numbers dropped by the verifier. Other hypotheses were ruled out because their counts were 0. I changed the draft to "one sentence per answer, in the answer's own wording" and made evidence numbers mandatory. The cost was less polished sentences, which I listed as a limitation.

Key set, still 401. The evaluation script read .env with shell source, which left the key empty. Switching it to read the file the same way the app does fixed it.

A container that failed only on Cloud Run. The empty argument --host "" passed in exec form was dropped, so startup failed. Wrapping the command in a single shell string kept the binding.

5. Results

MetricValueScopeSource
Card grounding ratioMean 0.345 → mean 1.0 in all 3 real evaluation runs · minimum 1.0Reimplementation, synthetic golden set of 10 casesEvaluation script, Development log (private)
Keyless regression20 passed (10 cassettes)ReimplementationRecorded replay tests
TestsUnit 563, E2E 132 (skip 11)ReimplementationDevelopment log (private)
Total font size1,556KB (threshold 2,048KB or less)ReimplementationUI redesign E2E
Public URL smoke test7/7 passedOperationsDeployment smoke test

The 1.0 is measured on synthetic data. There is no quality measurement yet from real owner interviews.

6. If I did it again

I would start with real-user validation. I did not run the 5 real owner interviews or the 3 interviews with people preparing to open a business, and the screens and golden set are all synthetic data. Next in line are a step that polishes sentences while keeping the evidence quotes, speech recognition in production (an API provider or a separate worker), and a public demo account plus moving the DB to the Seoul region.