Skip to content

Plain-language handover

Handover notes

What the README says, written for the person who owns the content: how it is loaded, how to add or approve a document, and how to run the test. Engineering detail lives in the README and on How it works.

How the content is loaded

Every training document lives in one library (5 current documents and 42 approved lines in this demo). Each document has a name, a version number and a status: draft, approved or superseded.

  • Only the newest approved version of each document is ever searched. Older versions stay for history and are never used in answers.
  • Each section starts with one line that explains why the method works, then the exact lines to say or write. Every line has a permanent ID, such as OBJ-1.2, and every answer shows which line it used.
  • On your app the library is in Postgres. The database itself refuses two approved versions of the same document, so there is always exactly one current version.

How to add or approve a document

  1. Add the new document, or the new version of an existing one, as a draft. Drafts are never shown to reps.
  2. Read it through in the draft view. Each line that reps should say word for word goes in as its own line.
  3. Approve it. Approving marks the previous version as superseded in the same step, so there is never a moment with two current versions.
  4. Run the 30-question test (below). If the score drops, the new wording changed an answer reps relied on: check it before publishing.

In this demo the library is a code file (src/lib/content/library.ts): adding a defineDocument entry to its one list is all it takes, and the README has the exact steps.

How to add an approved answer

The answer bank holds the trainer's approved answers to the most common questions (20 in this demo). An entry points at a line in the library by its ID, so the wording always comes from the approved document. To add one, pick the line, add a few ways reps ask for it, and run the test. Never paste the test questions themselves into the bank: the test would then only measure that it can recognise its own questions, and a check stops it.

How to run the test

The test asks the coach 30 questions (on your app, the 30 you already use) and checks that each answer contains the approved line word for word. It also asks reworded questions it has never seen and off-topic questions it should decline.

  • Run it with pnpm eval. It prints every question, the line used, and the decision.
  • Publishing stops if the score falls below 24 out of 30, drops from the last approved run, or if more questions get a wrong approved line than before.
  • On Replit the test runs inside the publish build, so pressing Publish cannot ship a change that fails it. After an approved change, record the new score with pnpm eval --update-baseline.
  • A separate check fails the build if any approved line can no longer be found by the search: the “content silently blocked” kind of bug.

What I need to start

  • A log export with one failed request, headers included, to see which limit the 429s hit and whose key it is.
  • Your 30 test questions and the lines a good answer must use.
  • Access to the Replit project, and which key the AI integration uses.