Joel Stevick

Chapter 6 · section 5 of 6

In production

The deployed rephraser, worker/src/law-rephrase.ts, is the listing above with one more job and three smaller differences: a 128-token cap in place of 1024, no effort setting, and a factory that takes the API key and returns undefined without one. Its rules end with a list of six families of question that no section of a code answers: how soon a failed test can be retaken, how long a permit must be held, what a ticket means, and three more. The model is asked to name the family a question belongs to, or “none”, and the name rides back beside the searches:

export type Searches = string[] & { family?: ProcessFamily }

Chapter 8 is where the family is used: the licensing agency’s own page for that family is added to the pool by name, whether or not any search found it, because a learner’s “how soon can I retake the test” shares neither words nor, reliably, meaning with a page that says “re-examination” or “waiting period”. The rephraser is the one stage that reads the question as a kind of question, and the deployed rules spend three sentences keeping the kinds apart: a rule of the road is “none” even when a permit holder asks it, and a ticket the learner already has is a different family from the fine for an offence.

The deployed model for this job is Haiku, with the same five-second timeout and no retries, and the measurement that justified it is the count in the first paragraph of this chapter: highest posted speed limit answered in 41 of 51 states before the rephraser and 49 after, the two left being the states with no code ingested at all.