Labs
Static analysis only: REA parses the code as text and never runs it. Runtime behavior comes from the extension's own end-to-end test in real Chromium. Analyzed at commit 37215c58.
Ask is the submit button of form #ask, so a click, Enter in a field or Cmd/Ctrl+Enter in the text box all reach one handler. It stops the page reload, shows a busy state and disables the button.
REA saw: function node at popup.js:165; the listener itself is an unknown (dynamic-call) because the $() helper hides the receiver
The three selects become a context object, written to chrome.storage.local without waiting, so the next open remembers them.
REA saw: unknowns at 125 and 126: unresolved receiver for .value and chrome.storage
The URL defaults to the deployed app. The code is whatever the student typed in Settings, or nothing.
REA saw: awaited task at popup.js:176
With a code set, the popup first POSTs it to /api/access/validate with credentials included. The server answers with a signed, httpOnly, SameSite=Lax session cookie; a refused code stops here with the server's own words.
REA saw: endpoint node new URL("/api/access/validate", url), mechanism call:fetch, confidence exact; constructs-request plus method, headers, body and credentials fields at 131
POST with JSON body { context, input } and the cookie. No secret travels in a header any more.
REA saw: endpoint node new URL("/api/tutor", url), call:fetch, exact; supplies-request-field method, headers, body, credentials at 138
zod checks the context against the tutor schema and caps input at 8,000 characters. Anything else is a 400 with a readable error.
REA saw: boundary node safeParse at route.ts:30; return sites at 32
screenInput decides allow, refuse or crisis. Refuse and crisis return HTTP 200 with only a guard object, and every one of those carries a notice the popup shows.
REA saw: export-return-shapes for screenInput: /notice present and literal on every refuse and crisis branch
guardedObject asks guardAi to admit the call. The tutor needs student tier; a caller without a session is public and gets 403 tier_required. Then per-minute, per-user and global spend counters are checked.
REA saw: export-return-shapes for guardAi: { ok: false, response } at guard.ts:60-66 and at 93
The model returns a structured object for the chosen mode. screenOutput checks the JSON; a blocked answer becomes a refuse notice.
REA saw: route endpoint "tutor" at route.ts:47; return sites at 58 and 63
teach-back sends evaluation and a score summary, first-principles a principle map, lesson-plan a plan, everything else a turn. All carry guard, mode and subject.
REA saw: return sites at route.ts:69, 72, 75, 77 and POST export-return-shapes
Errors and notices become callouts, a score line shows for teach-back, and the first present body field is rendered as headings, lists and label/value pairs. Text only: no innerHTML anywhere.
REA saw: response consumer json at 144; function nodes render (85) and el; coerces String in el
A dead server shows "Could not reach the server", and the button comes back in finally whatever happened.
REA saw: unknowns at 155 and 157 (unresolved receivers)
The first REA pass found the popup sending x-admin-code to whatever server URL the student saved. The code is now exchanged once at /api/access/validate for an httpOnly cookie, the same sign-in the website uses.
Refuse and crisis answers succeed with only a guard notice. By design: the student always gets words, and every such branch carries a notice.
The text box and the right-click path both cut at 4,000; the server accepts 8,000. Harmless, but two numbers for one rule.
Raw enum labels, one gold style for errors and notices, camelCase keys in answers, no focus rings. Redesigned with human labels, separate callouts and a card layout.
Student tier or higher. getPrincipal takes the signed session first, then the admin header, then the dev cookie, else anonymous public. Public callers get 403 { error: "This feature requires student access", code: "tier_required" }, which the popup shows verbatim.
Yes: 12 of 12 passed on 37215c58 (2026-10-21). tests/e2e/extension-tutor.spec.ts loads the unpacked extension in Chromium against the demo server and drives sign-in, a refused code, a crisis guard notice, an answer, inert markup and a dead server.
Still open in REA terms: the schema object is built in lib/tutor and reaches the route as req.schema, which static analysis reports as an unknown value.




| Folder | Files | Unknowns | Evidence id |
|---|---|---|---|
| extensions/tutor | 3 | 457 | ev_4c5950dedee1fafb… |
| app/api/tutor | 1 | 98 | ev_20a23cd01d660c65… |
| app/api/access/validate | 1 | 147 | ev_08fc5d8b53207f66… |
| lib/tutor | 10 | 1,191 | ev_52ceab06ad8e028b… |
| lib/budget | 5 | 602 | ev_ea315b2094acce90… |
| lib/security | 27 | 1,778 | ev_0a039271295841e2… |
| lib/ai | 44 | 6,172 | ev_c3b653fdbad0682e… |
Each run is npx -y rea-agents@latest analyze-javascript-application <folder> --artifact-format directory --format json. An unknown is a place REA refused to guess, not a bug. Full report and spec: REPORT.md, SPEC.md.