The starter kit's tests
The newest run on main of the tests of cascade-starter-kit, read as a
tree of package, capability and situation, each with what it is for and each case linked to its source.
Failures come first within a capability, and the levels that hold one are open.
npm test, node:test over the kit. For an agent: cascade-starter-kit.ctrf.json.
cascade-starter-kit 0.0.0 · commit e1efd2f · unreleased: what main does today, not a compatibility promise
cascade-starter-kit, the app a person starts from on cascade-runtime: a template of React pages over a small server, its two add-ons (a chat with a model, and an MCP server), and `create-cascade-app`, the command that makes an app from them.
Glossary
- ACMG classification (ACMG classifications)
- one of the five values a laboratory gives a variant under the guidelines of the American College of Medical Genetics and Genomics: pathogenic, likely pathogenic, uncertain significance, likely benign or benign.
- add-on (add-ons)
- a folder of files that `create-cascade-app --with` adds to the template: `chat`, a chat with a model, and `mcp`, an MCP server.
- address (addresses)
- here, where a page or a route of the app is reached: a path such as `/pods/alex-rivera/`, with its query.
- Anthropic
- the company that makes the Claude models; one of the providers a chat can use, over its own interface.
- Backspace
- the key that deletes the character just typed.
- base
- of the template, the app with no add-on: its screens, its server, the sample pods and the tool list. Of an address, the path the app is served under, such as `/cascade/`.
- body (bodies)
- what a request sends to an operation at `POST /api/<operation>`: a JSON object holding that operation's inputs, such as `{ "pod": "ines" }` for `waitingWords`.
- box (boxes)
- a panel the app draws over a screen for one task, such as making a pod or showing a connection; closing it shows the screen again.
- bring in (brought in)
- here, to import a hospital's pull into the pod from the connection's box (the button "Bring it into …").
- CapabilityStatement
- FHIR's resource in which a server says what software it is and what it supports, served at `<FHIR base>/metadata`.
https://hl7.org/fhir/R4/capabilitystatement.html - ClinVar
- the public archive, kept by the US National Library of Medicine, of how laboratories classify variants, from benign to pathogenic; one of the reference tables.
cascade:VariantClassifications - ClinVar ID (ClinVar IDs)
- the number ClinVar gives one variant, which a pod holds as `clinvarVariationId`.
- code system (code systems)
- a published list of codes for one kind of thing, such as RxNorm for medicines, LOINC for lab tests and SNOMED CT for clinical findings.
- combination (combinations)
- a medicine with more than one active ingredient, such as a tablet of lisinopril with hydrochlorothiazide.
- compact read (compact reads)
- the whole pod as tab-separated text, which the `ask` tool returns a part at a time when called with `format: "compact"`; each line is one row of a view, its cells separated by tabs.
- connection (connections)
- one sign-in of one person at one hospital's server. `connect()` returns it as a `Connection`, good for one pull; `pod.connect()` stores the pod's record of it.
cascade:ConnectToServer - context
- what an "Ask about this" button sends with a chat's first question: the kind of thing asked about and its identifier, such as a lab change's key.
- counsellor sentence
- the line every variant's entry ends with: "Your clinician or a genetic counsellor can explain what this means for you."
- credit (credits)
- the sentence a reference table's publisher asks to be shown wherever the table's content is, such as LOINC's notice; the app prints it once on each screen that shows what the table says.
- Ctrl+V
- the keys most programs paste with. A prompt that reads the keyboard itself gets nothing from them, so the app says to paste another way.
- demo hospital (demo hospitals)
- a pretend hospital with made-up patients, from the package cascade-sandbox, which an app or a test signs in to and pulls from with no account and no network; Cascade North and Cascade South are two.
- demo person (demo people)
- one of the demo hospitals' made-up patients, offered by name when a pod is made; one person may be at two hospitals.
- directory (directories)
- the list of hospitals an app offers a person to connect to: one row for each hospital, with its name, the vendor of its system, its FHIR base and the places it serves.
- door (doors)
- one way a model reaches the app's tools: the chat, WebMCP in the page, or the MCP server.
- drug class (drug classes, class)
- a group of medicines that work alike or are built alike, such as ACE inhibitors, as the US Food and Drug Administration assigns them.
cascade:DrugClasses - engine
- the part of cascade-runtime that answers questions about a pod and its reference tables, which a page loads after its first screen is drawn.
- expression (expressions)
- here, a variant written out in HGVS notation, such as `NM_000249.3:c.2042C>T`; one variant may have several.
- feed (feeds)
- a published list of the versions of reference tables, which an app reads to find newer ones.
- FHIR base (FHIR bases)
- the URL of a hospital's FHIR server; each record there is at `<FHIR base>/<type>/<id>`.
cascade:serverBaseUrl - Find a hospital
- the screen that lists the hospitals a person can sign in at, each on a card with its sign-in.
- four settings
- the four `.env` lines that choose the chat's model: `CASCADE_MODEL_PROVIDER`, `CASCADE_MODEL_URL`, `CASCADE_MODEL_NAME` and `CASCADE_MODEL_KEY`.
- host (hosts)
- here, the object `podApi(host)` reads its pods, reference tables and hospitals through: `nodeHost()` over folders on Node, another over the browser's own storage in a page.
- hosted
- of a model, run by a provider on the internet, as against on the person's own computer.
- isError
- the flag on an MCP tool's result that says the call failed; the result's text is then the reason.
- key
- here, a model provider's API key: the password an app sends with each request to a hosted model.
- kit (kits)
- a story and the exports it uses, which the vocabulary carries for testing, such as `alex-rivera`.
- lab change (lab changes)
- a difference between one lab test's results before and after the day a medication started or stopped, as `findChanges()` reports it; it says what moved and never why.
- lane
- the strip under a trend's chart that draws each medication's days: prescribed, started, stopped.
- listener
- the local web server, from cascade-sandbox's `serveDemo()`, that answers for the demo hospitals while the app runs.
- lockfile (lockfiles)
- `package-lock.json`: npm's record of the exact version of every package an install takes.
- made app
- an app as `create-cascade-app` leaves it in a new folder: the template, the chosen add-ons, its packages installed and its sample pods loaded.
- manifest (manifests)
- an add-on's `registry-item.json`: its files, the packages it pins and the npm scripts it adds, in shadcn's registry-item shape.
- MCP (MCP client, MCP clients, MCP server)
- Model Context Protocol: an open standard by which an app that runs a model, the MCP client, starts a program, the MCP server, and calls the tools it offers.
- MED-RT
- the US Veterans Health Administration's table of what medicines do and are made of, from which the drug classes come.
- model (models)
- a language model that an app lets answer a person's questions about their records.
- named question (named questions)
- a query the vocabulary carries under a name, such as `pod/My active allergies`.
- nested panel (nested panels)
- a panel that LOINC lists as one of another panel's tests.
- never list
- `NEVER` in `tools.ts`: the PodApi operations no tool may call, such as making an encrypted pod, connecting to a hospital or deleting every pod.
- panel (panels)
- a set of lab tests reported together, such as a thyroid panel.
- pin
- the one address in `app/package.json` naming the build of cascade-runtime the template runs on.
- pod (pods)
- one person's records, and what that person has said about them, kept as files in one folder.
- PodApi
- `podApi(host)` in `pod-api.ts`: every read and write the app makes of its pods and reference tables, as operations that take and give plain JSON. The server, the pages, the commands and the tools all go through it.
- PodApi's sentence
- the sentence `inputRefusal()` returns for an input PodApi refuses, such as `pod must be a string`; a schema over HTTP must refuse with that same sentence.
- provider (providers)
- the service a model is reached at, such as Anthropic, Google Gemini, Groq, or a model server on the person's own computer.
- publisher (publishers)
- of a reference table, the body that issues it, such as the Regenstrief Institute for LOINC; the app's code calls it the table's `source`.
- pull (pulls, pulled, pulling)
- the records one patient has at one hospital, as `pull()` fetched them in one go, with the FHIR base they came from and when; also the fetching itself.
- record (records)
- one thing said about a person's health, such as an allergy, a medication or a lab result.
cascade:Record - redirect URI (redirect URIs)
- the app's own URL to which a hospital sends the person's browser when the sign-in is over.
- reference tables (reference table)
- public code lists, such as RxNorm for medicines, that tell a runtime when two codes mean one thing.
cascade:ReferenceSeries - Refusal
- the error thrown when the package declines a request it understood, such as a name it does not have; it has written nothing.
- relation (relations)
- here, the way MED-RT ties a medicine to a class: its established pharmacologic class, its mechanism of action, its physiologic effect or its chemical structure.
- report
- one laboratory's classification of one of a person's variants, as a pod holds it; `pod.agreement()` compares each with ClinVar. (A hospital server's `serverReport()` is another thing: what the server says of itself.)
- requirement
- whether LOINC lists a test in a panel as required or optional, or under a condition of its own such as `R-a`.
- retired code (Retired code)
- a code its code system no longer uses; the app tags a record that carries one "Retired code".
- review status
- ClinVar's statement of how well a classification is supported, such as `criteria provided, multiple submitters, no conflicts`.
cascade:clinvarReviewStatus - round (rounds)
- in a chat, one turn of the model that calls tools, with their results sent back to it.
- row (rows)
- one line of a table: of a view, what one view entry holds, a cell per column; of a reference table, what it says of one code or variant.
- sample (samples)
- a kit's pod saved as files a web page can read.
- sandbox story (sandbox stories)
- a made-up patient at a demo hospital whose records were written to show one outcome, such as a lab result that falls after a medication starts, with that outcome written down beside them.
- schema (schemas)
- a description, in JSON Schema, of what a tool's input may hold: its properties, the type of each, which are required, and the values or bounds each allows (`enum`, `minimum`, `maximum`).
https://json-schema.org/ - scope (scopes)
- what an app asks a hospital, at sign-in, to let it read, such as `patient/*.read`: every record of the patient.
- screen (screens)
- one page of the app at an address of its own, such as a pod's or a reference table's; moving between screens does not load the page again.
- sealed (seal, seals)
- of a pod or a file, encrypted on disk so that only the secret opens it.
- secret (secrets)
- the six words that open an encrypted pod; `sixWords()` draws them from the EFF long word list, a public list of 7,776 easy-to-type words.
- section (sections)
- one kind of record on a pod's screen, such as Medications or Lab results: a tile that counts its rows, and a table of them.
- series
- one of the reference tables across its versions, such as RxNorm's product ingredients.
cascade:ReferenceSeries - six words
- the words an encrypted pod is sealed with, shown once when it is made; a person proves they kept them by typing words 2 and 5.
- SPARQL
- the W3C query language for data written as statements, as Turtle writes them; `pod.ask()` runs an app's own SPARQL SELECT.
https://www.w3.org/TR/sparql11-query/ - standard error (standard output, standard input)
- a program's second output stream, where it writes what it has to say to a person; cascade-mcp's standard output carries only the protocol.
- statin (statins)
- a medicine that lowers cholesterol, such as atorvastatin.
- step (steps)
- here, one change a person asks the app for from a form on a screen, such as setting a date or making a pod; the screen's route runs it and draws what came of it.
- story pod (story pods)
- a pod of a sandbox story's made-up patient, as against a real person's.
- subject (subjects)
- the person a pod is about.
cascade:Subject - submitter (submitters)
- a laboratory that sent ClinVar its classification of a variant.
- tag
- a word or two the app sets beside a line, a row or a view entry to mark it: `Needs review`, `Differs` or `Retired code`.
- tarball (tarballs)
- a single file that packs a build of a package, which `--tarball` names so that a new app installs it in place of the one the lockfiles were made with.
- target (targets)
- one of the two ways the app is built: the Node target, whose pages call the server, and the browser target, which runs PodApi in the page with no server.
- template
- here, the folder `app/`: the app as `create-cascade-app` copies it, before any add-on.
- tier (tiers)
- a tool's consent level: `free`, a read that runs unasked, or `ask`, a write the person confirms first.
- tile (tiles)
- here, a square on a pod's page for one kind of record, with the count of its rows; a click opens its box.
- tool (tools)
- a function a model may call: a name, a description, a JSON Schema for its input, and the code that runs it.
- tool call (tool calls)
- one run of a tool by a model: the tool's name, the input it was given, whether it succeeded, and what it returned.
- trend
- the screen that charts one lab test's results over time against the days of one medication.
- try/
- the app's browser target as published on the web with the kits' samples, for trying a pod with nothing installed.
- UI message stream
- the Vercel AI SDK's format for a chat's reply as server-sent events: the text as it comes, each tool call and its result.
- Unopened
- the `Refusal` thrown when a pod does not open with the secret given, or with none; its `outcome` gives the reason, such as `incorrect secret`.
- variant (variants)
- a difference in one of a person's genes from the reference sequence, as a genetic test reports it.
cascade:GeneticVariantFinding - verdict
- the column of `pod.agreement()`'s rows saying how a report stands to ClinVar: `agrees` when its classification is among the row's, `differs` when the row holds another, and none when ClinVar cannot say.
- version (versions)
- what a record says at one time; when a source changes a record, the pod keeps the old version and adds a new one. (Of a reference table or the runtime, "version" has its everyday meaning.)
cascade:version - view (views)
- a pod's records of one kind, such as medications, as its judgments leave them: one line for each thing however many sources reported it. A named question such as `pod/My medication history` returns a view's rows.
cascade:View - view entry (view entries, entry, entries)
- one thing in a view, such as one medication or one lab result: the records that are one thing, shown as one. A row names it in `entry`, by an IRI that ends in `#` and 64 hexadecimal digits.
cascade:inEntry - waiting
- of an encrypted pod, asked for but not yet made: PodApi holds its six words until the person types back words 2 and 5, and writes nothing before.
- WebMCP
- a proposed browser API by which a web page offers tools to a model the browser runs (cascade-runtime's "model context" entry names the object).
- What changed
- the part of a pod's screen that draws a card for each lab change, with the results behind it and a link to its trend.
- world's date
- the day the demo hospitals answer as of, which the app can set so a story's later records are not yet there.
- Worth a look
- here, the list at the top of a pod's page of the few things the app would point a person to, each a sentence linking to its entry.
- zod
- the library the server's routes use to describe the shape of a request body and to refuse one that does not fit it.
No entry matches.
Making an app create-cascade-app <folder> 20 passed
`create-cascade-app` copies the template into a new folder, installs its packages and loads the four kits' pods, so a person has a running app with sample records in one command. What it cannot do it says, and it leaves an app that was made in place.
Source create.test.ts
given a folder that is not there yet 8 passed
- passed names the project after the folder in `package.json`7 ms
- passed gives the app the template's dependencies as they are, the pinned cascade-runtime among them5 ms
- passed leaves out the chat's and the MCP server's files and packages3 ms
- passed lists `pods/`, `.env`, `/dist/` and `/dist-browser/` in the app's `.gitignore`2 ms
- passed installs the packages, then loads the four kits' pods into `pods/`, in the kits' order1 ms
- passed prints how to run the app (`npm start`, `npm run browser`, `npm run help`) and a prompt to give a coding agent0 ms
- passed prints each pod as it loads, with the seconds it took0 ms
- passed prints no `npx` command and no `pod:load`0 ms
when the reference tables are set up 2 passed
when a pod does not load 3 passed
- passed removes what the failed load wrote into `pods/`1 ms
- passed prints which pod did not load and why, and names the three that did0 ms
- passed returns 00 ms
when the made app's fixtures cannot be loaded 1 passed
given a folder it cannot use 3 passed
- passed refuses a folder holding a file, writing nothing93 ms
- passed refuses a name with a capital letter, writing nothing34 ms
- passed refuses a name with a space, writing nothing49 ms
given a Node.js too old to run `.ts` files 2 passed
with no folder and no terminal 1 passed
- passed exits 2 with the usage line, asking nothing73 ms
Adding the chat and the MCP server to a new app --with, terminal.choose(), terminal.model() 13 passed
The template's base has no model in it. An add-on, `chat` or `mcp`, is a folder of files with a manifest; `--with` copies its files into the new app and adds its pinned packages and npm scripts, and nothing else.
Source create.test.ts
given `--with chat`, `--with mcp` and `--with chat,mcp` 6 passed
- passed adds exactly the files the named add-ons' manifests list7 ms
- passed adds exactly the packages the manifests pin1 ms
- passed appends the manifests' npm scripts after the template's, and prints each as a command0 ms
- passed adds the chat's route, its window, the `ai` package and `npm run model` for `chat`, and no MCP server0 ms
- passed adds `mcp-server.ts` and `npm run mcp` for `mcp`, and no `ai` package0 ms
- passed returns 2 for an add-on it does not know, naming the two there are, and writes nothing43 ms
given a terminal and no `--with` 4 passed
- passed asks once which add-ons to add, offering `chat` and `mcp`43 ms
- passed adds none when none is chosen, and the chat when it is chosen118 ms
- passed asks nothing when `--with` is given57 ms
- passed returns 2 for a chosen add-on it does not know, and makes no folder1 ms
given a terminal that can set up a model 3 passed
Installing a new app's packages package-lock.json, --tarball 5 passed
The command carries a lockfile for each combination of add-ons, made when it was packed, and installs a new app from the one that fits, so a fresh install takes exactly the versions that were tested. `--tarball` names another build of cascade-runtime than the lockfiles were made with.
Source create.test.ts
given the lockfiles the command carries 2 passed
given `--tarball` 3 passed
- passed writes an address as the app's cascade-runtime dependency, as given106 ms
- passed writes a file as `file:` and its absolute path60 ms
- passed copies no lockfile, installs without one, and says why47 ms
Reading a pod for its screens api.pods(), api.pod(), api.answers(), api.said(), api.trend(), api.classes(), api.panel() 15 passed
PodApi's reads give each screen of a pod what it shows, as plain JSON: first the pod's own rows, which need no reference tables, then what the tables say of them. A screen can so be drawn before the tables have loaded.
Source pod-api.test.ts
api.pods() 1 passed
api.answers({ pod }) 4 passed
- passed returns the pod's rows by named question, and its lab changes, in `answers` and `changes`1 ms
- passed reads no reference table0 ms
- passed returns in `unheld` the versions of the tables the pod was written under that the app does not hold9 ms
- passed returns no `adopting` for a pod whose open had nothing newer to take in0 ms
given a pod that takes in the app's newer tables after it opens, api.answers({ pod, wait }) 3 passed
api.said({ pod, entry }) 2 passed
api.trend({ pod, test, medication }) 2 passed
api.classes({ pod }) 2 passed
api.panel({ pod, panel }) 1 passed
Reading the reference tables for their screens api.held(), api.table(), api.checkTables() 7 passed
The reference tables screen lists the series the app holds, and a check reads the feeds for newer versions. After a check that kept a version, PodApi opens each pod again so its rows are read under the new tables, without asking for an encrypted pod's six words a second time.
Source pod-api.test.ts
api.held() 2 passed
api.table({ id, code }) 2 passed
api.checkTables() 3 passed
Asking a pod a named question, and running a tool on it api.ask(), api.tool() 9 passed
`api.ask()` returns a named question's rows a slice at a time, or the pod's compact read a page at a time, and `api.tool()` runs one of cascade-runtime's lab-change tools, or the app's own `worth_a_look`, on a pod. The tools a model uses from the chat, a web page or an MCP client are built on these two.
Source pod-api.test.ts
api.ask({ pod, question, limit, offset }) 3 passed
- passed returns `limit` rows, and in `total` how many the question has3 ms
- passed returns the rows from `offset` on2 ms
- passed returns `offset` only when it is not 04 ms
api.ask({ pod, format: "compact" }) 2 passed
- passed returns a small pod's compact read whole, with no `next`27 ms
- passed refuses on a host that gives no `compact`3 ms
api.tool({ pod, tool: "find_changes" }) 1 passed
api.tool({ pod, tool: "worth_a_look" }) 3 passed
Making, unlocking, locking and deleting pods api.makePod(), api.waiting(), api.waitingWords(), api.confirmWords(), api.unlock(), api.lock(), api.deleteAll(), api.resetAll(), nodeHost() 43 passed
A pod is made under a name made from a person's name. An encrypted pod is made only once the person has typed back words 2 and 5 of its six words, which shows they kept them; until then the pod is waiting, and nothing is written.
Source pod-api.test.ts
api.makePod({ person }) 7 passed
- passed makes a pod named from the person's name, and returns `made: true`273 ms
- passed returns `made: false`, and makes nothing, for a pod there already is0 ms
- passed loads the host's sample of that name in place of an empty pod, and returns `loaded: true`0 ms
- passed refuses `encrypt: true` for a sample's name with a sentence that says samples are not encrypted, and loads nothing4 ms
- passed refuses `encrypt: true` for a sample that is already loaded, and leaves the pod as it was183 ms
- passed refuses `encrypt: true` for a pod that exists unencrypted, with a sentence that says so221 ms
- passed copies a sample once when two calls ask for it at the same moment185 ms
api.makePod({ person, encrypt: true }) 1 passed
- passed returns `waiting: true`, and makes no pod yet4.67 s
api.waitingWords({ pod }) 4 passed
- passed returns the six words of a pod that is waiting, with the person's name as typed0 ms
- passed refuses once the pod is made0 ms
- passed refuses a second call for the same pod, saying the words are shown once and not saying them, and the pod stops waiting39 ms
- passed gives new words when the pod is made again after that107 ms
api.waiting({ pod }) 2 passed
api.confirmWords({ pod, word2, word5, password, username }) 2 passed
api.unlock({ pod, secret }) 9 passed
- passed opens an encrypted pod with its six words, and returns `opened: true`0 ms
- passed returns `opened: true` for an encrypted pod that is already open, given its own six words0 ms
- passed throws `Unopened` with `incorrect secret` for an encrypted pod that is already open, given other words0 ms
- passed throws `Unopened` with `incorrect secret` for an encrypted pod that is already open, given no words0 ms
- passed answers each of two calls at the same moment by its own secret: the right words open the pod, other words throw `Unopened`2.45 s
- passed keeps one opening and closes the other of two calls at the same moment with the right words1.50 s
- passed opens no pod to check the words of an encrypted pod that is already open3.15 s
- passed returns `opened: true` for a pod that is open and not encrypted, whatever `secret` holds4 ms
- passed throws `Unopened` with `incorrect secret` when `secret` holds no word108 ms
given an encrypted pod that is not open 3 passed
api.lock() 4 passed
- passed closes the encrypted pods this instance holds open and names them, so the pod asks for its words again3.15 s
- passed leaves a pod that is not encrypted open2.33 s
- passed closes nothing, and names nothing, when no encrypted pod is open1.26 s
- passed forgets the six words of a pod that is still waiting for them to be typed back1.76 s
when no request comes for the idle time, `IDLE_LOCK_MS`, 15 minutes 5 passed
- passed is 15 minutes0 ms
- passed keeps an encrypted pod open while each request comes within the time of the one before739 ms
- passed closes the pod when a request comes after the time, before it answers, so the pod asks for its words again3.59 s
- passed closes the pod, and stops its sign-in, though the page asks after its connection every WAIT_MS, as that is no request of the person1.29 s
- passed closes the pod by itself, with no request, when the time has passed at one of its checks703 ms
api.deleteAll() 3 passed
- passed removes every pod, and returns their names in `deleted`19.53 s
- passed forgets the six words of a pod that was waiting0 ms
- passed forgets every connection0 ms
api.resetAll() 1 passed
when the pods of `nodeHost({ folder })` are removed with `{ all: true }` 2 passed
- passed removes the pods' folders and every kept answer1.62 s
- passed keeps the folder of the reference tables0 ms
Connecting a pod to a hospital and bringing its records in api.hospitals(), api.connect(), api.connection(), api.bring() 36 passed
A connection is one sign-in at one hospital and the pull that follows: `api.connection()` says how far it has got and can wait for it to change, and `api.bring()` imports what was pulled into the pod. What goes wrong at the hospital is said on the connection, and an error of the app's own is logged and said in one fixed sentence.
Rule runtime/arrivals.feature A16 Source pod-api.test.ts
api.hospitals({ q }) 1 passed
api.connect({ pod, fhirBase }) 8 passed
- passed returns the connection's number, and in `authorize` where the person signs in9.81 s
- passed asks the hospital for the scopes `launch/patient`, `patient/*.read` and `patient/*.rs`0 ms
- passed writes the hospital server's record to the pod before the first request for the patient5.45 s
- passed writes into that record the client id the host registered0 ms
- passed writes no file at a second sign-in when the server says the same of itself0 ms
- passed says in `notRecorded` that a server answered 404 to `metadata`, and pulls all the same603 ms
- passed says in `notRecorded` that a server's report was refused as no CapabilityStatement, and pulls all the same699 ms
- passed writes no server record to the pod for a report that was refused0 ms
api.connection({ pod, connection, wait }) 6 passed
- passed returns with `wait: "change"` only when the step, the count of requests or the bring-in's part has changed0 ms
- passed returns the count of requests, the patient's name and the sources of the pull once it has pulled0 ms
- passed returns `titled: true` once it has pulled for a pod that was made with a name0 ms
- passed returns nothing of the pulled bundle itself0 ms
- passed returns `step: "failed"` and `failure: "cancelled"` when the person cancels the sign-in16 ms
- passed returns the connection as it is, still `signing in`, after 25 seconds of `wait: true`1.06 s
api.bring({ pod, connection }) 19 passed
- passed returns `step: "bringing in"`, and imports the pull into the pod0 ms
- passed holds one import for one bring-in, so the pod's record of the connect is not among its imports0 ms
- passed reports loading the adapter, converting, saving and judging, in that order, in the connection's `bringing`7.28 s
- passed runs the matcher once on a pull that files records and claims their profile12.75 s
- passed runs no matcher on a second pull of the same records, which files nothing and claims nothing0 ms
- passed runs the matcher again on a retried bring-in whose matcher run failed, though the retry files and claims nothing0 ms
- passed imports a pull once: a second call returns `step: "pulled"`, and the connection has `broughtIn: true`0 ms
- passed titles a pod with no name on file for the person of the record brought in, still so when it is opened again, and leaves a name on file46.75 s
- passed leaves the title of a pod when the import is refused0 ms
- passed claims no profile its owner said is not them, so the pod is not titled and its views leave the record out, though the record is in it0 ms
- passed claims a profile and titles the pod when a bring is tried again after its claim failed, though the second import files nothing0 ms
- passed claims on a retry only the profiles its own pull's import filed, leaving another pull's of the same hospital for the person to answer0 ms
- passed leaves a profile unclaimed when its owner said it is not them after the first claim failed and before the retry0 ms
- passed claims nothing, and tells in the pod's `waiting` what waits, when a bring is tried again on an app opened again over the same folder0 ms
- passed does not retitle a pod, and logs nothing, when the person of the record has no name to give it6.31 s
- passed does not retitle a pod when the name of the person of the record is only a blank given name7.46 s
- passed gives no `patient` when the person of the record has no name, so no screen says whose record it is0 ms
- passed says `Not brought in: …` in `failed`, with `retry: true`, when the import throws an error of the app's own5.54 s
- passed keeps that error's text out of `failed`, and logs it once0 ms
when the pods are deleted or PodApi is closed with a sign-in under way 2 passed
- passed stops the sign-in on `api.deleteAll()`0 ms
- passed stops the sign-in on `api.close()`0 ms
Setting the day the demo hospitals answer as of api.setWorldDate(), worldInstant(), utcInstant(), worldDateSaid(), pulledAsOfSaid(), GET /world-date 27 passed
The world's date is a day the app can set so that the demo hospitals answer as they would have then, which lets a person watch a sandbox story's later records arrive. It is kept as an instant, travels with each connection started under it, and is said in words on the screens.
Source pod-api.test.ts, said.test.ts
api.setWorldDate({ date }) 2 passed
- passed sets the host's world date to the last second of the day given, and returns it in `asOf`6.12 s
- passed clears it when `date` is empty0 ms
given a world's date set before a sign-in at a demo hospital starts 1 passed
- passed returns that date on the connection, in `asOf`1 ms
when a page asks `GET /world-date?back=<path>` 11 passed
- passed redirects to `/pods/a/#world-date` for `/pods/a/`2 ms
- passed redirects to `/pods/a/hospitals?q=north#world-date` for `/pods/a/hospitals?q=north`1 ms
- passed redirects home when no `back` is given1 ms
- passed redirects home for `//evil.test/`1 ms
- passed redirects home for `https://evil.test/`1 ms
- passed redirects home for `/\evil.test/`1 ms
- passed redirects home for `/..//evil.test/`1 ms
- passed redirects home for `/.//evil.test/`1 ms
- passed redirects home for `/%2e%2e//evil.test/`1 ms
- passed redirects home for `/a/..//evil.test`1 ms
- passed redirects home for `pods/a/`1 ms
worldInstant(text) 6 passed
- passed takes a calendar day as the last second of that day in UTC, spaces at either end aside0 ms
- passed keeps an instant that states its timezone as it was given0 ms
- passed returns undefined for a day the calendar does not have0 ms
- passed returns undefined for an instant with no timezone0 ms
- passed returns undefined for a year below 10000 ms
- passed returns undefined for empty text, and for words0 ms
utcInstant(asOf) 2 passed
stepWhenSaid(step) 2 passed
worldDateSaid(asOf) 2 passed
pulledAsOfSaid(asOf) 1 passed
Input PodApi refuses, and the sentence it gives podApi(), Refusal 38 passed
PodApi throws a `Refusal` for input it cannot act on, with a sentence that says what to give in its place and, where it helps, what there is to choose from. Each leaf is one such input; none of them changes a pod.
Source pod-api.test.ts
api.connect() 1 passed
- passed refuses a hospital that is not in the directory2 ms
api.connection() 2 passed
- passed refuses a number that is no connection of the pod1 ms
- passed refuses a `wait` that is neither true nor "change"2 ms
api.bring() 1 passed
- passed refuses a connection that pulled nothing1 ms
api.makePod() 5 passed
- passed refuses a name with no letter from a to z and no digit1 ms
- passed refuses `Con`, a name Windows keeps for a device1 ms
- passed refuses `COM1`, a name Windows keeps for a device1 ms
- passed refuses `lpt9`, a name Windows keeps for a device1 ms
- passed refuses an `encrypt` that is neither true nor false1 ms
api.waitingWords() 1 passed
- passed refuses a pod that is not waiting1 ms
api.waiting() 1 passed
- passed refuses a pod that is not waiting1 ms
api.confirmWords() 3 passed
- passed refuses a word 2 that is not the one given1 ms
- passed refuses a `password` that is not the six words1 ms
- passed refuses a `username` that is not the pod's name1 ms
api.setWorldDate() 1 passed
api.answers() 1 passed
api.pod() 1 passed
- passed refuses a `pod` that is no string1 ms
api.said() 1 passed
- passed refuses an entry the pod does not hold17 ms
api.trend() 3 passed
api.panel() 2 passed
- passed refuses a call that names no panel2 ms
- passed refuses an empty panel1 ms
api.table() 4 passed
- passed refuses a reference table that is not held2 ms
- passed refuses a code the table does not hold3 ms
- passed refuses a `page` given as text1 ms
- passed refuses a `page` that is a fraction1 ms
api.ask() 6 passed
- passed refuses a question that is no named question1 ms
- passed refuses a `limit` of 01 ms
- passed refuses an `offset` below 01 ms
- passed refuses a `format` other than `rows` or `compact`1 ms
- passed refuses `entries` that are not strings1 ms
- passed refuses `entries` without `format: "compact"`1 ms
api.tool() 5 passed
- passed refuses an `input` that is no object1 ms
- passed refuses a tool there is not1 ms
- passed refuses a test the pod lacks, from `find_changes`2 ms
- passed refuses a test the pod lacks, from `lab_series`2 ms
- passed refuses a property `worth_a_look` does not take1 ms
Calling PodApi over HTTP /api/, INPUT_SCHEMAS, refusalOf() 39 passed
The Node server offers each PodApi operation at `POST /api/<operation>`, taking and returning JSON, and the app's own client, `remoteApi()`, calls them for the pages. A refusal crosses with its sentence, and the server turns away a request that does not come from one of its own pages.
Source inputs.test.ts, pod-api.test.ts
- passed has a schema for each operation PodApi checks, and for no other2 ms
given a body PodApi's own check (`inputRefusal()`) would refuse 25 passed
- passed refuses `pods`'s body with PodApi's sentence, and accepts what PodApi accepts3 ms
- passed refuses `held`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `pod`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `answers`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `said`'s body with PodApi's sentence, and accepts what PodApi accepts3 ms
- passed refuses `trend`'s body with PodApi's sentence, and accepts what PodApi accepts2 ms
- passed refuses `classes`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `panel`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `table`'s body with PodApi's sentence, and accepts what PodApi accepts5 ms
- passed refuses `ask`'s body with PodApi's sentence, and accepts what PodApi accepts7 ms
- passed refuses `tool`'s body with PodApi's sentence, and accepts what PodApi accepts4 ms
- passed refuses `makePod`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `waiting`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `waitingWords`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `confirmWords`'s body with PodApi's sentence, and accepts what PodApi accepts2 ms
- passed refuses `unlock`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `lock`'s body with PodApi's sentence, and accepts what PodApi accepts0 ms
- passed refuses `deleteAll`'s body with PodApi's sentence, and accepts what PodApi accepts0 ms
- passed refuses `resetAll`'s body with PodApi's sentence, and accepts what PodApi accepts0 ms
- passed refuses `checkTables`'s body with PodApi's sentence, and accepts what PodApi accepts0 ms
- passed refuses `setWorldDate`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `hospitals`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `connect`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
- passed refuses `connection`'s body with PodApi's sentence, and accepts what PodApi accepts3 ms
- passed refuses `bring`'s body with PodApi's sentence, and accepts what PodApi accepts1 ms
given the app's own client, `remoteApi()`, over the server 5 passed
- passed returns what PodApi returned, after a round trip through JSON20 ms
- passed throws a `Refusal` carrying the sentence PodApi refused with, such as `there is no pod nobody; the pods are ...`, when PodApi refuses5 ms
- passed throws an error that says to open the address the app printed, and not a `Refusal`, when the page holds no launch cookie2 ms
- passed throws `Unopened` with PodApi's `outcome` when a pod does not open5 ms
- passed throws an error that names the operation and the status 500 when PodApi throws anything else133 ms
when a page asks `POST /api/<operation>` 8 passed
- passed responds 404 for an operation there is not146 ms
- passed responds 404 for `close`, which stays in the process4 ms
- passed responds 415 for a body that is not sent as JSON2 ms
- passed responds 403 for a request whose `Origin` is another site3 ms
- passed responds 400 for a body that is no object3 ms
- passed responds 400 for a body over 1 MiB7 ms
- passed responds 500 with one fixed sentence when PodApi throws an error that is no refusal7 ms
- passed keeps that error's text out of the response5 ms
Reaching the demo hospitals from the Node server nodeHospitals() 3 passed
On Node the app serves its demo hospitals from a listener of its own, and `nodeHospitals` gives PodApi the directory, the sign-in and the way back that reach it. With it a made app signs a demo person in and pulls their records with no hospital on the internet.
Source pull.test.ts
given a pod's `connect` to a demo hospital, approved at the listener 3 passed
- passed sends the person to the listener to sign in1 ms
- passed returns from `back(url)` the pod and the connection the hospital's redirect is for1 ms
- passed pulls from the hospital's FHIR base0 ms
Serving pages built from the app as it stands npm start, buildStalePages() 5 passed
`npm start` serves the app's pages from `dist/`, and builds them first when they are missing or stale. A developer who edits a source file or changes a setting sees it at the next start, with no build step to remember.
Source built.test.ts
buildStalePages(app, build, env) 5 passed
- passed runs the build for an app with no `dist/`, and returns true13 ms
- passed returns false, running no build, for pages built since every source was written6 ms
- passed runs the build again when `package.json` was written after the pages4 ms
- passed runs the build again when a setting the pages are built with (`CASCADE_NAME`) differs from the last build's5 ms
- passed returns false for that setting given a second time5 ms
Keeping pods out of development's Vite devOptions() 5 passed
`npm run dev` serves the app's sources through Vite in the server's own process, and a pod is never among what Vite serves or watches: a pod holds a person's record, and a write to one sent to a page's HMR socket names its path.
Source dev-options.test.ts
with the options' `server.fs.deny` 2 passed
with the options' `server.watch.ignored` 1 passed
with the options' `server.hmr` 1 passed
- passed listens on loopback only9 ms
under(folder) 1 passed
- passed reads a character a glob reads as itself0 ms
Answering an address a person opens with the app's page appServer() 16 passed
The app is one page that draws every screen, so the server returns that page for any address a person opens, and a file only at the file's own address. A view entry's id may hold a dot, so the server tells a screen's address from a file's by what the browser says it wants.
Source pod-api.test.ts
appServer({ pages }) 5 passed
- passed returns the app's page for a screen's address with a dot in it, when the browser is navigating3 ms
- passed returns the app's page for that address when the request accepts HTML1 ms
- passed returns a file of the built app at the file's own address4 ms
- passed responds 404 for a file there is not1 ms
- passed responds 404 for an address with a dot in it that asks for no page0 ms
given pages that are a function, as `npm run dev` gives them, and a request that holds no launch cookie 11 passed
- passed responds 403 to GET /pods/probe-plain/clinical/labels.ttl and does not reach the pages1 ms
- passed responds 403 to GET /pods/probe-four/settings/encryption.json and does not reach the pages1 ms
- passed responds 403 to GET /pods/.answers/probe-four/pod.json and does not reach the pages1 ms
- passed responds 403 to GET /@fs/C:/app/pods/probe-four/settings/encryption.json and does not reach the pages1 ms
- passed responds 403 to GET /server/launch.ts and does not reach the pages1 ms
- passed responds 403 to GET /pod-api.ts and does not reach the pages1 ms
- passed responds 403 to GET /src/main.tsx and does not reach the pages1 ms
- passed responds 403 with a page that says to open the address the app printed, to a navigation1 ms
- passed responds 403 to a cookie that is not the launch's1 ms
- passed answers the pages when the request holds the launch cookie1 ms
- passed trades the printed address's token for the cookie, which the page it sends the browser to then holds1 ms
Reading for a screen and running a step routes(), watch() 14 passed
Each screen has a route: its loader reads what the screen shows from PodApi, and its action runs a step, one change a person asks for from a form. `watch` marks the page busy while either runs, and tells a refusal, which the person can act on, from the app going wrong.
Source router.test.ts
given a pod's screen 3 passed
given an encrypted pod that does not open (`Unopened`) 1 passed
given any screen 2 passed
when a step is running 3 passed
- passed sets the page's state to `busy`0 ms
- passed returns from `sayingNow()` the words the form gave for what it is doing0 ms
- passed disables every button1 ms
when a read fails for a reason that is no refusal 2 passed
Moving between screens without loading the page again movesInPlace() 6 passed
A click on a link to one of the app's screens redraws the page in place; every other link is left to the browser. `movesInPlace` decides which, so a file, a download or the hospital's way back is never swallowed.
Source page.test.ts
movesInPlace(link, to, from, base) 6 passed
- passed returns true for the address of a screen under the base1 ms
- passed returns false for a file the app serves and for a route the server answers0 ms
- passed returns false for a path that only starts like a screen's0 ms
- passed returns false for an address outside the base, and for one on another site0 ms
- passed returns false for a download link, and for a link that opens another window0 ms
- passed returns true for a link whose `target` is this window0 ms
Reading a pod as a person's record PodPage 32 passed
A pod's screen draws the record as tiles, one for each kind of record, each of which opens a box of its rows, with Worth a look above them. A row is named by the reference tables once the engine has asked them, and by the record's own text until then.
Source screens.test.ts
given a pod titled for another person than its name says, as a record's person titles a pod made without a name 1 passed
- passed draws the title as the page's heading10 ms
given a pod with allergies and lab results 2 passed
- passed draws a tile for each kind of record the pod holds0 ms
- passed links each row to its entry's screen0 ms
given a box drawn over a screen 2 passed
given rows whose codes the reference tables name 8 passed
- passed says which patient profiles wait for an answer under What needs review, and draws no note when none does35 ms
- passed names a row by the first of its codes the tables name0 ms
- passed names a row by the record's own text where the tables name none of its codes0 ms
- passed tags a row "Retired code" when the code that named it is retired, or with no name its first code with a status0 ms
- passed leaves what replaced a retired code to the entry's screen0 ms
- passed tags "Needs review" the row of an entry that needs review, and its line in Worth a look0 ms
- passed says in Worth a look that the entry was marked as different0 ms
- passed lists a tile's first rows by the same names0 ms
given rows the tables have not been asked about 1 passed
given names from a table that asks for a credit 3 passed
given medications in every state 6 passed
- passed lists them Active, Paused, Unknown, then Stopped0 ms
- passed says each one's state, with the day it stopped or is to stop0 ms
- passed leaves out a medication entered in error0 ms
- passed counts on the tile those not stopped, names them, then counts the stopped0 ms
- passed links "By class" from the Medications tile, and from no other, to the pod's medicines by drug class4 ms
- passed draws no "By class" link for a pod with no medication3 ms
given the statin story's medications 1 passed
given a pod with genetic variants 8 passed
- passed draws a Genetic variants tile beside the others, with how many it holds0 ms
- passed draws a row for each variant that opens its entry, with its gene, its expression and how many reports1 ms
- passed draws the same rows whatever the tables name, a name for another row's code changing none of them4 ms
- passed tags a variant "Differs" only once the tables say a report differs from ClinVar3 ms
- passed keeps what ClinVar says today, and the counsellor sentence, off the pod's screen0 ms
- passed says in Worth a look which report differs from ClinVar today, linking to the variant's entry3 ms
- passed draws no Worth a look card when nothing is worth a look3 ms
- passed draws no Genetic variants tile for a pod with no variant2 ms
Reading one entry of a pod EntryPage, entryOf(), entryId() 43 passed
An entry's screen says what one thing in the record is, which documents it came from, and what else is known of it: what Cascade did with its records, then what the reference tables say of its codes, each sentence with the table and version it is from. `entryOf` gives the screen its content from rows of named questions.
Source screens.test.ts
given a condition two hospitals recorded, its code named and retired by the tables 11 passed
- passed takes the end of an entry's IRI as its address, whatever pod holds it0 ms
- passed names it by the tables' name, with the record's own text as "Recorded as"0 ms
- passed tags it "Retired code"0 ms
- passed gives its kind, and the day it began0 ms
- passed lists a line for each document it came from, oldest arrival first, with the day retrieved, the day arrived and the import0 ms
- passed says what Cascade did: where it recorded it, and that it keeps it as one condition0 ms
- passed says what each table says of its code, each with the table and version it is from0 ms
- passed links its code to that code's page in the table that names it1 ms
- passed links a version to its table0 ms
- passed prints each table's credit once0 ms
- passed links back to the pod3 ms
given the same condition before the tables can say 3 passed
given a condition matched by a table's rows 3 passed
given an entry no tile of the pod's screen shows 4 passed
- passed names it, and gives its kind, from its `entryLabel`0 ms
- passed says what its line in Worth a look says, tagged "Needs review"0 ms
- passed places a record the person entered under their own entries0 ms
- passed gives no column and no code0 ms
given an address of no entry 2 passed
given a lab result whose test LOINC lists in panels 4 passed
when the engine has not yet said what the tables say 2 passed
given a variant two labs reported, once the tables have said 9 passed
- passed names it by its gene and expression, tagged "Differs"0 ms
- passed gives its gene and its expressions0 ms
- passed gives its ClinVar ID, linked to that ID's page in the ClinVar table0 ms
- passed lists the document each report came with, and the report's day0 ms
- passed says a malformed report date as written2 ms
- passed says what Cascade did, each report with its lab and year, what ClinVar says today, then the counsellor sentence0 ms
- passed tags the report that differs "Differs"0 ms
- passed says what ClinVar says today with its table and version1 ms
- passed prints ClinVar's credit once0 ms
given the same variant before the tables can say 2 passed
given a variant only a report names 3 passed
Making a pod NewPod 5 passed
The new-pod box makes a pod for a person: one of the demo people, by name, or a sample, loaded as it is. It offers only what is not there yet.
Source screens.test.ts
given demo people at two hospitals, and two samples 5 passed
- passed offers to encrypt the pod with six words5 ms
- passed lists the demo people once each, family name first, sorted by family name and then given name2 ms
- passed leaves out a demo person who has a pod1 ms
- passed offers each sample not yet loaded, as "Load" and its person's name2 ms
- passed posts a sample's pod name in the field `pod`2 ms
Encrypting a pod with six words SixWords, Unlock 9 passed
An encrypted pod is sealed with six words, shown once when the pod is made, in fields a password manager can save. The open screen asks for them again, and says why when the pod did not open.
Source screens.test.ts
given a new encrypted pod's six words 7 passed
- passed shows the six words numbered, in order0 ms
- passed holds the pod's name as `username` and the words as a `new-password`, for a password manager0 ms
- passed offers a button that copies the words0 ms
- passed says that copying leaves the words in the clipboard, where a history may keep them, and that the page tries to clear it0 ms
- passed asks for words 2 and 50 ms
- passed says whose pod it is0 ms
- passed says what encryption hides and what it does not0 ms
given an encrypted pod that did not open 2 passed
Connecting to a demo hospital ConnectionBox, HospitalsPage 29 passed
A person signs in at a hospital, sees what it has, and brings it into the pod. The connection's box says where that has got to, whose record came back, and, when it failed, what the person can do about it.
Source screens.test.ts
given a pod whose demo person is at two hospitals 3 passed
- passed says to sign in at a hospital, see what it has, and bring it into the pod0 ms
- passed offers a sign-in at each of the person's hospitals0 ms
- passed offers Find a hospital0 ms
given Find a hospital, with three hospitals 6 passed
- passed draws a card for each hospital, with a sign-in0 ms
- passed names the town a hospital is in on its card0 ms
- passed lists the demo people a hospital holds, family name first, sorted0 ms
- passed says where else a demo person is3 ms
- passed says whose pod a hospital's records are brought into, with a link back to the pod0 ms
- passed tells a person to choose the patient on the hospital's own sign-in page, for a hospital with no demo person0 ms
when a hospital is being pulled 1 passed
when a pull has ended 3 passed
given a pulled record and the pod's person 10 passed
- passed names the pod's slug name on the button when no patient and no title are on file2 ms
- passed offers "Bring it into" and the pod's person, with no word on whose record it is, when the record has the person's name0 ms
- passed says whose record it is, and names both people on the button, when only the family name is shared0 ms
- passed warns that the record is another person's, not the pod's, with only a `quiet` button that ends "anyway", when no name is shared0 ms
- passed says that bringing it in makes the pod that person's, when the app has no name for the pod's person0 ms
- passed says whose record it is and that the pod keeps its name, naming the pod's person on the button, when the pod is titled but its title cannot be read0 ms
- passed says whose record it is and that the pod keeps its name when the record names no one to grade, and never makes the pod the record's person's0 ms
- passed grades a record against the title the pod keeps, with no warning for that person's record, when the page shows the pod's name for a title other pods share1 ms
- passed names the title the pod keeps, not the name the page shows, in the warning for another person's record, when the page shows the pod's name for a title other pods share1 ms
- passed grades a record as certain for the kit's copy at another point, which keeps the kit's title1 ms
when a connection has failed 6 passed
- passed says what went wrong for each kind of failure, naming the hospital6 ms
- passed keeps the status code, the error's name and every address out of that sentence6 ms
- passed offers "Sign in again at Cascade North" for the kinds signing in again can help, and for no other5 ms
- passed prints the developer's detail in a smaller line5 ms
- passed says the app's own sentence for a kind, with its own choice of the button, when `failures` gives one1 ms
- passed prints the reason alone, with no sign-in, for a failure of no kind1 ms
Setting the world's date WorldDate 8 passed
The form sets the day the demo hospitals answer as of, and Today clears it. Every screen that offers a sign-in says which day is set, and a pull made under one says so.
Source screens.test.ts
given the world's date set 3 passed
given no world's date 1 passed
given a pulled connection 2 passed
given a screen that offers a sign-in 2 passed
- passed says on a pod's screen which day is set, with the form to change it2 ms
- passed says on Find a hospital which day is set2 ms
Browsing the reference tables TablesNav, TablePage, SourcePage, CodePage 25 passed
The app lists the reference tables it holds, each with its publisher, licence and versions, and searches their codes. A code's screen says what every table says of that code, each with the table and version it is from.
Source screens.test.ts
given the sidebar's list of tables 5 passed
- passed says that the tables are loading, marked busy, until the app has read what it holds0 ms
- passed says "None yet" only after a read that found none0 ms
- passed says that the tables could not be read after a read that failed0 ms
- passed lists each table it holds as a link, the one shown marked as the current page0 ms
- passed ends with "Check now" in every state0 ms
given a table's screen 9 passed
- passed says the version in use, its publisher and its licence0 ms
- passed says when the publisher was last checked for a new version, and when the app last read the feed0 ms
- passed lists a code a search found, tagged "Retired", with what it maps to0 ms
- passed links a found code to that code's screen0 ms
- passed says which of how many codes are shown, with links to the pages before and after that keep the search text0 ms
- passed lists each version with the pods using it, each a link, the version in use marked "current"0 ms
- passed leaves out a pod that is no longer there0 ms
- passed posts a search to the table's own address0 ms
- passed says "None on page 10 of 103 codes." past the last page, with a link back to the last page and none forward0 ms
given a publisher's screen 2 passed
given a code's screen 9 passed
- passed says the code's name and its other names, with the table and version they are from0 ms
- passed says what the code maps to, and which other codes map to the same0 ms
- passed lists a panel's tests in the order given, each with its requirement0 ms
- passed says how many panels the code is itself in, naming those given and counting the rest0 ms
- passed says each drug class of a medicine by its relation, and the ingredient it is classed through0 ms
- passed says why no class is given for a relation0 ms
- passed prints a table's credit beside what that table says0 ms
- passed says a variant's classification as ClinVar's sentence, with the ClinVar table's credit2 ms
- passed links ClinVar's own page for the variant when the table gives one, and no outside page when it gives none2 ms
Seeing a pod's medicines by drug class ClassesPage 8 passed
The screen groups a pod's active medicines under the drug classes the reference tables put them in, and says of each medicine in none why that is, so an absent medicine is not read as "in no class".
Source screens.test.ts
given a pod's active medicines, classed by the tables 5 passed
- passed groups the medicines under each class, with the relation that puts them there0 ms
- passed orders the relations as MED-RT does, `Established pharmacologic class` before `Mechanism of action`0 ms
- passed says the ingredient a medicine is classed through, and none where the entry states the classed code itself0 ms
- passed says the table and version the classes are from, with its credit0 ms
- passed draws one class alone when the address picks one2 ms
given a medicine in no class 3 passed
- passed says that FDA classes a different form of a product's ingredient, which RxNorm does not tie the product to0 ms
- passed says that MED-RT classes single ingredients, for a medicine with no reason of its own0 ms
- passed says that none of the pod's active medicines is in a class, when the tables class none1 ms
Seeing a pod's lab results by panel PanelPage 9 passed
The screen sets a pod's lab results beside the tests of one LOINC panel: which the person has, which required ones they lack. It says what LOINC lists, never that the results were drawn as that panel.
Source screens.test.ts
given a panel, and the pod's results for some of its tests 8 passed
- passed says how many of the required tests the pod has, and names those it lacks0 ms
- passed lists the tests in LOINC's order, each "required" or "optional"1 ms
- passed lists a test's results newest first0 ms
- passed says "No result" for a required test the pod lacks0 ms
- passed lists a nested panel's tests under "Within" and its name, without a test the panel lists itself0 ms
- passed counts a nested panel's required tests among those the pod has and lacks3 ms
- passed says the tables and versions it read, with each one's credit0 ms
- passed says that this does not say the results were drawn as part of the panel0 ms
given a panel, and no results for any of its tests 1 passed
Seeing what changed after a medication PodPage, TrendPage, withImportHistory(), trendInput() 41 passed
What changed, on a pod's screen, draws a card for each lab change: a test's results before and after the day a medication was prescribed, started or stopped. The trend charts that test with the medication's days marked. Both say what moved and never why.
Source screens.test.ts
given a story pod whose cholesterol fell after a statin was prescribed 5 passed
- passed draws one card, saying that the test was lower after the medication was prescribed1 ms
- passed marks the day the prescription was written on the card's chart0 ms
- passed says both means, and how many results each is the mean of0 ms
- passed links each of the six results behind the change to its entry, in a box "Show the 6 results" opens1 ms
- passed links "Open the trend" to the trend's address for the test and the medication0 ms
given a lab change the tables have not yet named 3 passed
given a story pod with no change to show 4 passed
- passed says "Nothing stands out yet." when no medication and test changed together18 ms
- passed counts a medication and test with too few results, with no card, and says how many results before and after0 ms
- passed links that medication and test to their trend0 ms
- passed draws no What changed card for a pod with no lab result, or with no medication history12 ms
given every sentence the app says of a lab change 2 passed
given a pod brought in twice 11 passed
- passed lists the imports in order under "Where this comes from", each with its hospital and how many records it brought in0 ms
- passed gives an import's day as the world's date it was pulled under, else the day it was retrieved where the person is0 ms
- passed gives the day retrieved in the person's own zone, so midnight UTC is the day before in Los Angeles and the same day in Auckland0 ms
- passed counts the records of an import that were a new version of one the pod held0 ms
- passed says which versions of the medication differ, in which import, and what differs between them0 ms
- passed says a value that looks like a date but is none as written, not as `NaN undefined NaN`24 ms
- passed gives the day a new version arrived, where the person is, when its import had no world's date0 ms
- passed prints no IRI and no web address0 ms
- passed never says why0 ms
- passed draws no "Where this comes from" for a pod of one import0 ms
- passed lists the imports with no word of a new version when the medication has one version0 ms
withImportHistory(answers, changes, ask) 2 passed
given a trend 8 passed
- passed describes the chart by its number of results, from the earliest day to the latest5 ms
- passed names the test and the medication by the record's own text, with nothing busy, until the tables name them0 ms
- passed names them by the tables' names, and a medication the tables do not name by its own text0 ms
- passed marks the heading, the chart and the lists to choose from busy while the engine is still naming them0 ms
- passed marks the day a prescription was written, the start of use and the stop once each, the earliest among the medication's entries4 ms
- passed describes the chart with the medication's days0 ms
- passed says each medication's days in its lane0 ms
- passed says that the chart leaves out a result in another unit, and lists it in the table3 ms
given a trend's address 6 passed
- passed draws a marker for each result of the test the address names0 ms
- passed names the test in the chart's title, and marks the test and the medication as the ones chosen1 ms
- passed lists every result in the table0 ms
- passed marks the day the prescription was written, and says in the lane that the start of use is not known0 ms
- passed marks no day when the address names no medication6 ms
- passed picks the strongest lab change's test and medication, from `trendInput()`, when the address names neither0 ms
Asking the chat about what a screen shows AskProvider 7 passed
Where the app has a chat that names a model, a screen draws an "Ask about this" button beside each thing a person might ask of. The button carries a context, which says what it stands beside.
Source screens.test.ts
given a chat that names a model 6 passed
- passed draws a button on each What changed card, its context the lab change's `key`22 ms
- passed draws a button on each Worth a look line, its context the line's entry3 ms
- passed draws a button on the trend, its context the test and the medication4 ms
- passed draws a button on an entry's screen, its context the entry's address2 ms
- passed draws no context of another kind on any of the four15 ms
- passed names each button "Ask about this", in its title and for a screen reader, with an icon and no text18 ms
given no chat 1 passed
What a pod's screen says is worth a look worthALook() 32 passed
Worth a look is the short list at the top of a pod's screen: a sentence for each view entry the pod says needs review, for each report that differs from ClinVar today, and for each pair of medications that share an ingredient. The sentences are the app's; which entries, reports and pairs there are comes from the pod's own answer and from cascade-runtime.
Source said.test.ts
worthALook(answers) 14 passed
- passed says `members disagree on criticality` as `Sources disagree on how severe the Sulfamethoxazole allergy is.`1 ms
- passed says `joined through two kinds of machine sameness` as `Asthma was matched in two different ways.`0 ms
- passed says `judged different, still joined` as `Eczema was marked as different, but is still shown as one condition.`0 ms
- passed says `same code, dates cannot tell` as `Migraine was recorded more than once, and its dates cannot tell whether it is one condition or several.`0 ms
- passed says `joined before, apart under newer tables or rules` as `Acute viral pharyngitis was kept as one condition with another before; newer reference tables or rules no longer match them, so they are shown apart.`0 ms
- passed says `possibly the same medication` as `Lisinopril 10 MG Oral Tablet shares a code with Zestril, which Cascade keeps apart. Cascade cannot confirm that the shared code names one product, so they may or may not be the same.`0 ms
- passed gives each such line its view entry and the tag `Needs review`1 ms
- passed says a row the pod gives twice once0 ms
- passed says two rows of one view entry apart when they need different things, or name different other records0 ms
- passed names a view entry no section shows by the name in its `entryLabel`: `Allergy entry · Latex` is `Latex`, one allergy0 ms
- passed calls a view entry with no name `an unnamed allergy`, and one with no `entryLabel` `An entry`0 ms
- passed names an entry from its label only by a name the label holds, never by `Allergy entry` or by its date0 ms
- passed calls the other medication of a pair `another medication` when its `otherRecordLabel` holds no name0 ms
- passed gives no line for a view entry that nothing says needs review0 ms
worthALook(answers, about) 7 passed
- passed says two medications in two view entries whose codes share an ingredient, naming the ingredient, with no tag1 ms
- passed gives the line the view entry of the first medication it names1 ms
- passed says a pair once for each two view entries, in the order of the Medications section1 ms
- passed says a pair once when the rows of one of its view entries are not adjacent0 ms
- passed says `share the combination` when the shared ingredient's name holds ` / `0 ms
- passed names an ingredient the reference tables do not name by the last part of its code0 ms
- passed begins each sentence with a capital letter1 ms
worthALook(answers, about, said) 2 passed
entryOf(answers, id, { about, held }) 4 passed
- passed says a pair's sentence among what is known of each of its two view entries3 ms
- passed gives each such sentence the version of the table its ingredients were read from, in `from`1 ms
- passed says no such sentence when the version of the table is not held1 ms
- passed says no such sentence of a view entry in no pair1 ms
reviewSaid(row, item) 5 passed
- passed says a sentence, not `name: needs.`, for every value the vocabulary's three What needs review questions bind2 ms
- passed says a sentence for each value the vocabulary builds by CONCAT, built from the query's own pieces1 ms
- passed keeps `name: needs.` for a value built by CONCAT once the query changes a tail of it1 ms
- passed keeps `name: needs.` for a value no one has written a sentence for0 ms
- passed finds the plain values of a query, and an example of each built by CONCAT from its own pieces0 ms
Naming and ordering the rows of a pod's tables codesOf(), codesSaid(), rounded(), compare(), openingOrder() 10 passed
A pod's screen has a section for each kind of record, such as Medications or Lab results, each a table of the pod's rows. These functions choose the codes the app asks the reference tables to name, and how a table's values are rounded and its rows ordered.
Source said.test.ts
codesOf(answers) 2 passed
- passed returns the code of every row a section shows, each once0 ms
- passed returns the one code of a condition0 ms
codesSaid(answers, { tables }) 2 passed
rounded(value) 3 passed
compare(type, a, b) 1 passed
openingOrder(section, rows) 2 passed
- passed returns the lab results newest first0 ms
- passed puts a row with no date last0 ms
Saying what ClinVar says of a variant and of each report variantSaid(), rowSaid(), variantsSaid(), variantReports() 33 passed
A variant's screen says in sentences what each lab's report said of the variant and what ClinVar says today, and tags a report `Differs` when ClinVar's row no longer holds its classification. Each sentence says only what the pod's rows, `tables.variantClassification()` and `pod.agreement()` hold, so a missing date, lab or classification is said as missing.
Source said.test.ts
variantSaid({ variant, reports, says, verdicts, labels, places }) 21 passed
- passed says each report in a sentence, oldest first, an undated one last1 ms
- passed names a report by its year, and by its day when two reports are of one year0 ms
- passed names the lab a report came from when `places` holds it, and no lab otherwise0 ms
- passed says `gives no ACMG classification` of a report that has none0 ms
- passed calls a report with no date `An undated report`, and gives it no `when`0 ms
- passed tags `Differs` a report whose verdict is `differs` against the row and the version of the table ClinVar's sentence was read from0 ms
- passed adds no tag for a verdict about another row or another version of the table0 ms
- passed adds no tag for a verdict other than `differs`0 ms
- passed says a classification in the words of its term when `labels` holds nothing for it0 ms
- passed says the reports, and nothing of ClinVar, when the reference tables have not been asked0 ms
- passed says a row as `ClinVar today says pathogenic/likely pathogenic: criteria provided, multiple submitters, no conflicts, five contributing submitters.`0 ms
- passed says two ACMG classifications as `pathogenic/likely pathogenic` or `likely benign/benign`, whatever order the row holds them in0 ms
- passed says a count of contributing submitters under ten in words, and from ten in figures1 ms
- passed says a row that counts submitters, not contributing ones, as `three submitters`, in words as contributing ones are, and one as `one submitter`0 ms
- passed says `labs that submit to ClinVar disagree` for a row ClinVar marks conflicting, with its other value after `;`0 ms
- passed says a sub-tier after its ACMG classification: `uncertain significance; VUS-high`0 ms
- passed says `classified only as part of a combination` for a row that holds only that0 ms
- passed says `ClinVar today gives no classification` for a row with a review status and no classification0 ms
- passed says `ClinVar, as this app holds it, has no row for this variant.` when the series has none0 ms
- passed says which genes the held series covers when the variant's gene is not among them0 ms
- passed says `This app holds no ClinVar table.` when no series is held0 ms
rowSaid(row) 1 passed
variantReports(answers, said, held) 6 passed
- passed returns each variant's view entry, those the pod's variants question lists first and one only a report names last0 ms
- passed names a variant by its gene and first expression, and one with no gene by its expression alone0 ms
- passed returns in `asked` the gene, expressions and ClinVar IDs the reference tables are asked of0 ms
- passed returns each report's year, lab and tag apart from its sentence0 ms
- passed returns ClinVar's sentence with the series and version it was read from, in `from`0 ms
- passed returns the reports with no tag, and no ClinVar sentence, before the reference tables have been asked0 ms
variantsSaid(answers, { tables, pod }) 5 passed
- passed names a variant by ClinVar's name of the one variation its classification found0 ms
- passed returns the series and version that named it, in `namedFrom`0 ms
- passed keeps the gene as the name when the classification found no variation, found two, or the names table has no row for the one0 ms
- passed keeps the gene as the name, with no `namedFrom`, when the version that named it is not held0 ms
- passed says `ClinVar names this variation …` first among what is known of the view entry, with the version of the table it came from1 ms
Naming pods, people and places as a person says them slug(), personName(), placeOf(), demoPeople(), familyFirst(), gradePerson(), didNote(), waitingSaid() 36 passed
A pod is a folder named from a person's name, and its screens show that name, and the places records came from, as a person would say them rather than as a folder or an import states them. `gradePerson()` grades how surely a hospital's patient is the pod's subject, so the app can warn before another person's records are brought in. `waitingSaid()` says what waits for an answer, so a person is told when a profile's records are in no view.
Source said.test.ts
slug(person) 3 passed
- passed makes a pod's name of lower-case words with a hyphen between them: `Rowan Ellery Marsh` is `rowan-ellery-marsh`1 ms
- passed drops accents and the spaces at either end: ` Zoë Ångström-Lee ` is `zoe-angstrom-lee`0 ms
- passed returns an empty name for a person's name with no letter from a to z and no digit0 ms
personName(pod, titles) 10 passed
- passed returns the name typed when the pod was made, as typed, `O'Brien McDonald` included1 ms
- passed returns the pod's name with a capital on each word when no typed name is held0 ms
- passed returns the pod's name with a capital on each word when the typed name is the pod's name itself0 ms
- passed returns the title as it is when it names another person than the pod's name does, as a pod made without a name is titled for the person of the record brought into it0 ms
- passed returns the pod's name with a capital on each word for each pod but one that shares a title, the one named for the title keeping it, so copies of a kit at two points stay apart0 ms
- passed takes a title as shared when it differs only in case, so a pod named for neither keeps its own name0 ms
- passed takes a title as shared with a pod named for it whose title cannot be read, untitled or sealed, held under its own name0 ms
- passed returns each title as typed when the titles are in a script `slug` empties, as pods titled `李明` and `王芳` are told apart by their titles0 ms
- passed returns each pod's name with a capital on each word when pods share a title in a script `slug` empties, tidied and in any case0 ms
- passed returns the title a pod keeps, as typed, with its words spaced once, from `keptTitle`, and nothing for a pod held under its own name0 ms
placeOf(row) 6 passed
- passed returns the hospital's name when the row has one, whatever its import is called0 ms
- passed drops ` Demo Hospital` from a demo hospital's name0 ms
- passed says `entered by Alex in the Cascade app` as `Alex's own entries`0 ms
- passed says `entered by the person` as `Own entries`0 ms
- passed drops ` export` from the name of an import0 ms
- passed returns `Somewhere unnamed` for a row with neither3 ms
demoPeople(demo) 2 passed
familyFirst(person) 1 passed
gradePerson(subject, names) 6 passed
- passed returns `certain` when a name of the patient is the subject's, whatever its case, spacing or how an accent is written, as one character or a letter and a mark1 ms
- passed returns `certain` when any one of the patient's names is the subject's, a maiden name included0 ms
- passed returns `possible` when only the patient's family name is among the subject's words0 ms
- passed returns `certainly-not` when neither the name nor the family name matches0 ms
- passed returns `certainly-not` for a patient with no family name whose given names are only part of the subject's0 ms
- passed returns undefined when the subject is not given or the patient has no name0 ms
didNote(query, kits) 5 passed
- passed says how many pods were deleted: `Deleted 3 pods.`, `Deleted 1 pod.`0 ms
- passed says `There was no pod to delete.` for a count of none0 ms
- passed names the people whose pods are back after a reset: `Reset: Alex Rivera and Priya Natarajan are back.`0 ms
- passed returns undefined for a count that is no whole number0 ms
- passed returns undefined for a query that says neither0 ms
waitingSaid(who, waiting) 3 passed
Grouping reference tables by publisher, and saying what a check did sourcesOf(), pageNumber(), checkedNote() 8 passed
The reference tables screen lists the series the app holds under whoever publishes them, shows a series' rows a page at a time, and says in one note what a check of the feeds just did.
Source said.test.ts
sourcesOf(held) 2 passed
pageNumber(asked) 2 passed
checkedNote(did, held) 4 passed
- passed says `Checked the feeds: nothing new.` when no feed gave a version0 ms
- passed names the series and version a check kept: `Kept Example vaccine groups, version 2, Oct 8, 2026.`1 ms
- passed says a feed that was not read now and is tried again later, with the reason0 ms
- passed says why a version was refused0 ms
Questions the chat offers before a person types firstQuestion(), suggestedQuestions() 13 passed
An "Ask about this" button sends a first question that fits the kind of thing it sits beside, and an empty chat offers up to four questions. Each is offered only when the pod holds what answers it.
Source said.test.ts
firstQuestion(context) 5 passed
- passed returns `What does this change show?` for a lab change0 ms
- passed returns `What does this trend show?` for a trend0 ms
- passed returns `What is this, and where did it come from?` for a view entry0 ms
- passed returns `What does this flag mean?` for a Worth a look line0 ms
- passed returns undefined for a kind it does not know, a name every object has, such as `toString`, included0 ms
suggestedQuestions(answers, { changes }) 8 passed
- passed offers `Find anything interesting in this pod` first when the pod has a lab change0 ms
- passed offers it too for a pod with a Worth a look line and no lab change0 ms
- passed offers a question for each lab change, with its test and medication as the pod's screen names them0 ms
- passed ends that question `was prescribed`, `started` or `stopped`, by the day the change is counted from0 ms
- passed offers `Which medications have I stopped?` last when a medication of the history has an end date0 ms
- passed offers four at most, the first and the last keeping their places0 ms
- passed offers no question for a change with not enough results0 ms
- passed offers none for a pod with nothing to ask about0 ms
Tools a model may call, by consent tier TOOLS, NEVER 3 passed
The app keeps one list of the tools a model reaches, whichever way it comes in: the chat, WebMCP or the MCP server. Each tool calls PodApi only and has a tier: `free` tools read, `ask` tools write once the person confirms, and the never list names what no tool may call.
Source mcp.test.ts
TOOLS 1 passed
`open_entry` 1 passed
Guarding the server guard(), newLaunch(), GET /?launch=<token> 19 passed
What the server refuses before it answers: a request that names another host, a method it does not serve, and a request to a route that reads a pod that does not carry the cookie the launch's address gave the app's page.
Source pod-api.test.ts
- passed responds 403 to a request whose `Host` is not the server's own address, on `/api/` in JSON and elsewhere as a page1 ms
- passed responds 405 to a method that is neither GET nor POST0 ms
- passed answers a GET on the server's own address that holds the launch cookie0 ms
given a program that names the server's own `Host`, `Origin` and `Content-Type` and holds no launch cookie 11 passed
- passed responds 403 to POST /api/pods, in JSON, and runs no operation1 ms
- passed responds 403 to POST /api/answers, in JSON, and runs no operation1 ms
- passed responds 403 to POST /api/waitingWords, in JSON, and runs no operation1 ms
- passed responds 403 to POST /api/unlock, in JSON, and runs no operation1 ms
- passed responds 403 to GET /tools, in JSON, and runs no operation1 ms
- passed responds 403 to POST /tools/list_pods, in JSON, and runs no operation1 ms
- passed responds 403 to GET /chat, in JSON, and runs no operation1 ms
- passed responds 403 to POST /chat, in JSON, and runs no operation1 ms
- passed responds 403 to a cookie that is not the launch's1 ms
- passed responds 403 to the cookie of another port's launch, which a browser sends to every port of the same host1 ms
- passed does not ask for the cookie at `/callback`, which a hospital's redirect reaches with none1 ms
when a person opens the address the server printed, `/?launch=<token>` 5 passed
- passed answers 303 to `/` with a cookie the page keeps: `HttpOnly`, `SameSite=Strict`, `Path=/`, named for the port and not the token1 ms
- passed keeps the rest of the address, and drops only the token1 ms
- passed sends on a page that holds the cookie already, whatever the spent token it carries, and gives no new cookie1 ms
- passed answers 403 to the token a second time, and gives no cookie, as the token is spent1 ms
- passed answers 403 to a token that is not the launch's, and to none1 ms
Running the read tools over HTTP GET /tools, POST /tools/<name> 11 passed
A page that carries no runtime of its own offers a model the app's read tools by calling the server: `GET /tools` lists them, and `POST /tools/<name>` runs one on a JSON input. Only `free` tools that open no screen are here; a tool that writes or moves the app is the page's own.
Source pod-api.test.ts
when a page asks `GET /tools` 1 passed
when a page asks `POST /tools/<name>` 8 passed
- passed runs `list_pods`, and returns the pods21 ms
- passed runs `reference_table_checks` on a pod with the host's reference tables2 ms
- passed runs `ask` for a pod's compact read6 ms
- passed responds 400, with the tool's refusal in `refused`, for input the tool's schema refuses1 ms
- passed responds 423 with `{ unopened, refused }`, as `/api/` does, for an encrypted pod that is not open3 ms
- passed responds 404 for a tool that writes or moves the app, and for a name that is no tool5 ms
- passed returns a larger pod's compact read in two pages or more, each page's `next` being the input of the one after9.08 s
- passed returns every row of every view once across those pages1 ms
given the reference tables cascade-runtime carries, in place of a stub 2 passed
Choosing the chat's model from settings modelFrom(), modelOf(), CASCADE_MODEL_* 10 passed
The chat add-on reads which model to use from four settings in the app's `.env`: a provider, an address, a model's name and a key. `modelFrom` makes the model the chat calls from them and refuses a set that cannot work, so a wrong setting is said at the start and not at the first question.
Source model.test.ts
modelFrom(env) 8 passed
- passed returns undefined for no settings1 ms
- passed returns a model with its provider, its name and whether it is on this computer1 ms
- passed shows the key in no property of the model0 ms
- passed uses the provider's own default model when no name is set0 ms
- passed throws Refusal for an unknown provider1 ms
- passed throws Refusal for a hosted provider with no key0 ms
- passed throws Refusal for the provider `other` with no address0 ms
- passed throws Refusal for a key with no provider0 ms
modelOf(settings) 2 passed
Checking that a model can call tools checkCallsTools() 25 passed
The chat answers from a pod only through tools, so a model that cannot call one is of no use to it. `checkCallsTools` asks the model to call one small tool, sends the result back as the chat would, and returns either `ok` or a reason a person can act on, which never shows the key.
Source model.test.ts
given a model that calls the tool 4 passed
- passed returns `{ ok: true }` for a call the tool's schema accepts, from an OpenAI-compatible server and from Anthropic75 ms
- passed sends the call's result back in a second request, with what the provider attached to the call2 ms
- passed returns `{ ok: true }` when the second request is answered0 ms
- passed returns a reason naming the second round when that request fails20 ms
given a model that answers and calls no tool, or calls it wrongly 2 passed
given a provider that turns the request down 14 passed
- passed returns that the key was rejected, and what to do, for a 40124 ms
- passed returns that the key was rejected for a 4037 ms
- passed returns that the key was rejected for a 400 whose message names the API key12 ms
- passed returns that the key was rejected for a 400 saying "Invalid Auth key"7 ms
- passed returns that the key was rejected, with the provider's words, from an OpenAI-compatible server9 ms
- passed returns that the key was rejected, with the provider's words, from Anthropic8 ms
- passed returns that the model is busy, and to try again or choose another, for a 42928 ms
- passed returns that the model is busy for a 50314 ms
- passed returns that the model is busy at Anthropic for a 52935 ms
- passed returns that the model is busy at "The model server" for a 503 from a model on this computer11 ms
- passed returns that the model is busy for a 429 sent in the middle of a stream10 ms
- passed returns that the model is busy for Anthropic's `overloaded_error` sent in the middle of a stream6 ms
- passed returns the provider's own message for any other 4005 ms
- passed returns the provider's own message for a 400 that names a property called "key"5 ms
given a model that does not answer 3 passed
given the provider 2 passed
- passed tells a model on this computer or at another address not to think32 ms
- passed sends a hosted provider no such instruction36 ms
Setting up the chat's model from a terminal npm run model, setUpModel(), save(), remove(), secret() 19 passed
`npm run model` asks which provider, which model and its key, checks that the model can call tools, and only then writes the four settings to `.env`. The key is typed unseen, is never printed, and `--off` takes the settings out again.
Source model.test.ts
given a model that passes the check 3 passed
with `--off` 1 passed
given a model that fails the check 2 passed
given a free provider and no key typed 2 passed
save(folder, values) 3 passed
remove(folder) 2 passed
secret(question, terminal) 6 passed
- passed returns what was typed and pasted, without what Backspace removed0 ms
- passed writes a bullet for each character kept, and never the character0 ms
- passed writes the Ctrl+V hint once, however often Ctrl+V is pressed0 ms
- passed erases one bullet for Backspace0 ms
- passed ignores arrow and Delete keys0 ms
- passed turns raw mode off and removes its listener when Enter is pressed0 ms
Answering a person's question with a model POST /chat, GET /chat, chatRoutes() 21 passed
The chat add-on's route takes the page's messages, lets the model read the pod through the app's tools, and streams its answer as the AI SDK's UI message stream. The model's key and address stay on the server, and a failure reaches the person as a plain sentence.
Source chat.test.ts
given a question the model answers by calling `find_changes` 7 passed
- passed streams the tool's call, its result and the answer, in that order2 ms
- passed returns to the page each finding with its sentence, the address of its trend screen and the rows behind it11 ms
- passed returns to the model the finding without its rows0 ms
- passed says each finding in the sentence the app's own screen says, naming the medication as the reference tables do49 ms
- passed names the pod and the address on screen in the model's instructions0 ms
- passed sends the person's question as the only other message0 ms
- passed sends the model's tool call back with what the provider attached to it0 ms
given a chat begun from an "Ask about this" button (`context`) 2 passed
given a model reached over HTTP 3 passed
when a page asks `GET /chat` 2 passed
given no model set 1 passed
- passed returns 503 saying to run `npm run model`1 ms
given a model that declines or fails 3 passed
given an error of the server's own 2 passed
when the request closes before the answer ends 1 passed
- passed aborts the call to the model26 ms
Letting a model use the app's tools from the chat chatTools(), MAX_ROUNDS 16 passed
The chat offers the model the app's one list of tools. A free read runs on the server; a tool that opens a screen or needs the person's consent is handed to the page, which runs it or asks first; and a chat stops after `MAX_ROUNDS` rounds of calls, so a model that loops cannot run on.
Source chat.test.ts
chatTools(api) 4 passed
- passed offers every tool of `TOOLS`, in its order0 ms
- passed runs on the server only the `free` tools that open no screen0 ms
- passed offers no tool an input the never list keeps from tools0 ms
- passed offers each tool that opens a screen with the schema `TOOLS` gives it, `pod` added for a tool of one pod4 ms
when the model asks to run a tool that opens a screen 1 passed
given tool calls that cannot be run 7 passed
- passed returns a tool error for arguments that are not JSON0 ms
- passed returns a tool error for arguments that are no object0 ms
- passed returns a tool error naming a tool the list lacks0 ms
- passed returns a tool error for `find_changes` with no `pod`0 ms
- passed returns a tool error for an `ask` question that is SPARQL0 ms
- passed returns a tool error for a lab test the pod has no result of0 ms
- passed returns no tool result, and gives the model every error in its next turn0 ms
given more rounds of tool calls than `MAX_ROUNDS` 4 passed
- passed ends the chat with an error saying after how many rounds0 ms
- passed hands the page no tool call made past the last round0 ms
- passed counts the rounds of the turns the page sends again: at `MAX_ROUNDS` the model is called once and its call is not handed on9 ms
- passed calls the model not at all past `MAX_ROUNDS`2 ms
Checking a chat request before the model is called POST /chat 33 passed
The route reads a body any page could send, so it holds it to a fixed form before a model sees it: who may speak, how much, and what an "Ask about this" context may hold. A body it turns down is a 400 with the reason, and the model is not called.
Source chat.test.ts
given a body the route refuses 32 passed
- passed returns 400 for a body that is not JSON1 ms
- passed returns 400 for a body over 1,048,576 bytes2 ms
- passed returns 400 for `null`1 ms
- passed returns 400 for an array1 ms
- passed returns 400 for a property it does not take1 ms
- passed returns 400 for a `pod` that is no text1 ms
- passed returns 400 for a `page` on another site1 ms
- passed returns 400 for no messages1 ms
- passed returns 400 for `messages` that is no list1 ms
- passed returns 400 for a message with the role `system`1 ms
- passed returns 400 for a question with no text1 ms
- passed returns 400 for a question that carries a file1 ms
- passed returns 400 for a last message that is the model's1 ms
- passed returns 400 for an answered tool call whose input the tool's schema refuses1 ms
- passed returns 400 for an answered tool call whose output is not what the tool gives2 ms
- passed returns 400 for a tool's output over 100,000 characters1 ms
- passed returns 400 for a tool's error over 100,000 characters1 ms
- passed returns 400 for a question over 100,000 characters1 ms
- passed returns 400 for a `context` that is text1 ms
- passed returns 400 for a `context` with no `kind`1 ms
- passed returns 400 for a `context` of a kind there is none of1 ms
- passed returns 400 for a finding's `context` with a property of another kind1 ms
- passed returns 400 for a finding's `context` with no `key`1 ms
- passed returns 400 for an entry's `context` whose `id` is no text1 ms
- passed returns 400 for a Worth a look `context` with no `entry`1 ms
- passed returns 400 for a Worth a look `context` that carries a sentence1 ms
- passed returns 400 for a trend's `context` whose `medication` is no text1 ms
- passed returns 400 for a `context` key over 200 characters1 ms
- passed returns 400 for a `pod` name over 200 characters1 ms
- passed returns 400 for a `page` over 2,000 characters1 ms
- passed returns 400 for more than 100 messages2 ms
- passed returns 400 for a pod the app does not have1 ms
given a body the route takes 1 passed
Sending the chat's earlier messages with a question sent() 5 passed
The chat window sends each question with the conversation so far, trimmed to what a model can use and to a limit of characters, so a long chat still fits and a half-finished turn does not confuse the model.
Source chat.test.ts
sent(messages, limit) 5 passed
- passed leaves out the earliest messages once the rest reach the limit0 ms
- passed removes from a model's turn its refusals and its tool calls left without a result0 ms
- passed leaves out a model's turn that held nothing else0 ms
- passed keeps a tool call the page answered0 ms
- passed returns, for a turn whose tool the page has just answered, that turn after the question it answers0 ms
Serving the pods to an MCP client npm run mcp, podServer() 13 passed
The `mcp` add-on is an MCP server on standard input and output over the app's pods, for a client such as Claude Desktop. It offers only the free reads, so a model outside the app can read a pod and can change nothing.
Source mcp.test.ts
given a client connected to `podServer(api)` 6 passed
- passed offers the `free` tools that open no screen, and no other1 ms
- passed requires `pod` of every tool but `list_pods`0 ms
- passed offers `ask` the named questions (`QUESTIONS`) and no query of the client's own0 ms
- passed warns in its instructions that a hosted client sends the answers to its provider, and names `worth_a_look` as a first call0 ms
- passed returns the pods' names from `list_pods`7 ms
- passed returns with each finding of `find_changes` the address of the app's trend screen for it143 ms
given input a tool's schema refuses 4 passed
- passed returns a tool error for an `ask` question that is a named question the list leaves out2 ms
- passed returns a tool error for an `ask` question that is SPARQL1 ms
- passed returns a tool error for `find_changes` with no `pod`1 ms
- passed returns a tool error for `timeline` with a property it does not take1 ms
given a pod that fails to open for a reason that is no refusal 1 passed
given an encrypted pod 2 passed
- passed lists the pod10 ms
- passed returns a one-line tool error saying this server does not open it, without its words63 ms
Build and packaging 35 passed
The add-ons' manifests, against their folders and the versions the repository tests 3 passed
Source create.test.ts
The app's AGENTS.md, against the app it describes 3 passed
Source guide.test.ts
given the template 1 passed
Screens App.tsx routes, against the addresses the app takes in place 1 passed
Source page.test.ts
- passed finds every path `App.tsx` routes to be one `movesInPlace` takes1 ms
The app's bundle for each target vite build 8 passed
What the app is built into for each target, read from a build kept in memory. The Node target's pages call the server through its typed client and load the chat window in a chunk of their own; the browser target runs PodApi in the page and draws no chat.
Source bundle.test.ts
given the Node target's bundle 7 passed
- passed holds the typed client of the server's routes1 ms
- passed holds the chat window and assistant-ui1 ms
- passed holds cascade-runtime's check of a tool's input0 ms
- passed holds no other module of cascade-runtime than its check, its terms and its tools, no server code and no PodApi2 ms
- passed keeps zod and the chat window out of the chunk a first visit loads1 ms
- passed keeps the chunk a first visit loads under 500 kB1 ms
- passed names no `.wasm` file in any chunk3 ms
given the browser target's bundle (`--mode browser`) 1 passed
Building try/, when the tables cannot be read looks() 1 passed
Source samples.test.ts
given a table lookup that throws 1 passed
Moving the runtime pin scripts/pin.mjs 5 passed
Source pin.test.ts
lockWithoutRuntime(lock) 1 passed
given a copy of the repository's two files, running node scripts/pin.mjs <commit> 2 passed
pinnedTo(pin, commit, releaseExists) 2 passed
Annotating a red run's failures failure-annotations.ts 5 passed
A node:test reporter for CI: it writes one GitHub `::error::` line for each failing test, so a red run's summary names the test and why, not only an exit code.
Source failure-annotations.test.ts
given a run's `test:fail` events 5 passed
- passed writes one `::error::` line for a failing test, with its name and the first line of its error2 ms
- passed writes nothing for a test that passed, for one that was skipped, and for a parent whose subtests failed0 ms
- passed appends the next line that is not empty when the first ends in a colon, which is where an assertion says what differed0 ms
- passed escapes a percent sign, a carriage return and a line feed as GitHub's workflow commands require, in the test's name too1 ms
- passed writes nothing for a failing test marked `todo` or `skip`, which node does not fail the run for0 ms
Diagnosing a failed step on a watched page shown.ts 8 passed
Source shown.test.ts
- passed keeps the page's text in a failed assertion's message and stack5 ms
- passed puts the diagnosis after the stack's header, not inside it, for a message that is a part of the header3 ms
- passed keeps a thrown value that is not an error as the cause, however it prints1 ms
- passed gives the diagnosis after an error whose stack is undefined0 ms
- passed wraps a frozen error, keeping it as the cause, since its message cannot be changed1 ms
- passed prints the message of a failed step once, with its cause kept0 ms
- passed gives the diagnosis once however many steps nest4 ms
- passed prints a failed assertion under node:test with the diagnosis250 ms
Tripwire: a code system's IRI stem written in a source file 1 passed
Source stems.test.ts
given the sources of `app/`, `add-ons/`, `try/build/` and `create/src/` 1 passed