Repository navigation
Agenda import: one paste box for every format, with an AI read and an upload for Pro (#111) - #184
Merged
Merged
Conversation
…upload for Pro (#111) The import dialog had two tabs, EasySpeak Format and Simple Format, and the user had to pick one before pasting. It now has one text box. matchAgendaFormat (packages/shared/agendaImport.js) works out which format a text is in and reads it with that format's own parser, so a paste lands as it did under its tab. A plain list of short lines is still taken one name per line. Text in no known format adds nothing: the dialog says so and offers "Add each line as a speaker", which is what Simple Format used to do with it. Behind the new agenda_ai flag, and for Pro: - "Read with AI" sends a text no format matched to POST /api/agenda/import. - "Upload a photo or file" sends a PDF, a Word or Excel file, a CSV, a text file or a picture. A tall picture is cut into two or three overlapping bands first, because a vision model sees a whole page too coarsely and mixed up its rows. A screenshot pasted into the box, or a file dropped on the dialog, is read the same way. - What comes back is listed for review, each role beside the slot as the agenda worded it, and is added only on confirm. A row whose role is not one of the user's roles is added highlighted, as for Simple Format (#91). A free plan sees both controls locked, opening the upgrade. With agenda_ai or pro off, nothing of them shows. The dialog's body is one component in packages/ui, used by the Zoom app's modal, design B's paste sheet and the web app's modal.
…ext, a document or a photo (#111) Pro, behind the agenda_ai flag. Takes a pasted text no format matched, or an upload: - a photo (one picture, or the bands of a tall one) goes to a vision model; - a PDF, Word or Excel file is converted to text by Workers AI toMarkdown, tried against the formats the dialog reads (only a match on structure counts), and read by the model when none fits; a .csv or .txt is read as it is. The model picks each role by its number in the list the client sent, so it cannot invent one, and the slots the timer does not time (Toastmaster, Timer, Table Topics Master, Sergeant at Arms, chair) are dropped even when it lists them. Workers AI first (Gemma 4 26B through a new AI binding; no retention, no training, 10,000 free neurons a day), then OpenRouter's free models, the Table Topics setup, when it errors or answers nothing usable. Limits: session, flag and Pro entitlement in that order; AGENDA_AI_LIMITER at 10 a minute and a KV counter at 50 model reads a day, both per account; 20,000 characters, 5 MB, 60 rows. Nothing of an agenda is stored or logged.
…e paste box and AI import (#111) - Privacy page: what AI Agenda Import sends and where (Cloudflare Workers AI, OpenRouter as the backup), and that an agenda the app reads by itself is never sent. Four service providers, no longer three. - Documentation page: one box for both formats. - FEATURE_FLAGS.md: agenda_ai. - agenda-import spec: IM-02, IM-05 and IM-06 no longer pick a tab; IM-07 to IM-13 added (EasySpeak in the same box, an unknown format, Read with AI, the file dialog with a PDF and a picture, the free-plan lock, a pasted screenshot), with a sample agenda under fixtures/. Not run yet. - timer-core and new-look reworded where they opened the Simple Format tab; new-look gains NL-24. pro-launch and club-membership note the Upgrade dialog's new line.
- The Worker reads a request body chunk by chunk and stops at the limit, so a body with no Content-Length, or a false one, is not held in memory whole. - Only the first 80,000 characters of a document's text are looked at before it is cut to the 20,000 the reader takes. - The format matcher claims nothing for text with a line over 2,000 characters: the parsers scan a line more than once, and no agenda row is that long.
…ocked screen (#111) The run on 2026-11-30 stopped before the first click: the Mac's screen was locked. No step has run on the one-box dialog yet.
…is locked A locked screen let screencapture write a black file and Zoom launch with no window, so a run deployed and announced itself before it found out. preflight now reports it as a blocker and zoom-up exits 2 before launching Zoom.
#111) The read is meant never to reject. If it ever does, the dialog showed "Reading…" for good; it now shows "That could not be read." and keeps the text.
…ds it in one pass (#111) From the code review of this change: - EasySpeak is known by its own header, by one "1st Speaker" row, or by its other role rows in numbers with no foreign table row beside them. One speaker pasted with the speech details, and speakers with six lines of details each, are EasySpeak again (they had become "Name (Role)" and nothing). A club's own "Speaker 1 <tab> Bob" table is no longer read for its Grammarian alone, and "Role Name" is not EasySpeak's header. - A format that reads nobody claims nothing, so the dialog is never left with a greyed-out Import and no way on. - A schedule whose lines end in "(5-7 min)" is not "Name (Role)". - `strict`, for a file's text in the Worker: only EasySpeak's own header, or "Name (Role)" lines where most roles are the user's, count. - The EasySpeak parser's project-reference pattern backtracked cubically (2 s on 18 KB). hasProjectRef answers the same in one pass; 300,000 random strings agree with the old pattern. Trailing whitespace is trimmed with trimEnd for the same reason. - A text over 20,000 characters is refused before it is sent, as too long, not as "a file over 5 MB". A decoded photo is released on every path.
…#111) From the code review of this change: - An uploaded file's text is matched strictly. A club's own role table and a schedule came back as "Found N speakers" with people missing or junk rows, and a file had no way to the model. `mode=ai` in the form skips the match: the dialog sends it when the user asks for the AI's reading after all. - markdownToPlain and csvToTabbed no longer use patterns that rescan a run from every start (3.2 s and 2.4 s on 80,000 characters; now under 3 ms). - The day's count is written before the model is asked, and the limiter is 6 a minute. The count is still approximate, as KV must be; the comments now say what it can and cannot hold. - Failure logs never carry a raw error, including one with no name. - A paste over the limit answers `text_too_long`.
…s Tab and Escape (#111) From the code review of this change: - A format that claims a paste and reads nobody gets the same ways out as an unknown format: the AI read, or each line as a speaker. - A file a format read offers "Read it with AI" in its review, and sends the same file again. - A 402 shows its message and locks the controls. It no longer opens the upgrade by itself, and on the web the upgrade opens in a new tab: going to /account in the same one unmounted the timer, a running speech included. - A row the reader gave no role never borrows one from its wording ("Custom", "Ice Breaker"), which let it pass for that role with no rules behind it. - Design B: the paste sheet is not drawn while the Upgrade dialog it opened is up, so Escape there cannot close it and wipe the text; and the sheet's Tab loop no longer ends on a hidden file input (the Cards sheet had that too). - The classic dialogs no longer claim aria-modal without moving focus. - Tests state their expected rows instead of reading them back from the matcher under test.
A read is normally 5 s. On the final code's live check one stalled past 35 s and OpenRouter then answered it in 2 s; 20 s keeps the slow-but-working reads (15 to 18 s seen) and halves the wait for a stalled one.
…in the real Zoom client (#111) agenda-import is current on 8ca49d0: IM-01 to IM-11 and IM-13 passed on FLAGS_FORCE "1,new_look=0", IM-08 with agenda_ai off; IM-12 (human) not run. new-look: NL-13 and NL-24 passed on FLAGS_FORCE "1"; the spec stays stale for its other steps. The skill's gotchas gain what the run taught: check each dialog click, pbcopy needs a UTF-8 locale, the file dialog over Zoom.
…between roles by length (#111) A read now sends each listed role's green, yellow and red times beside the role names. Workers AI's model sees them as "1min Role (runs 30 sec to 1 min)": a role a user made had only its name to go by, so one-minute reports landed on "1-2min Role", and a list of names that say nothing got no role at all. Measured on a remote preview against the real models (2026-12-01), same agenda, five reads each way: with a club's own list the three one-minute reports go to "1min Role" (5 of 5; "1-2min Role" before); with names that say nothing 10 of 10 rows get the role of their length (0 of 10 before); with the built-in list nothing changes. The OpenRouter fallback keeps reading by names: its free models took the times as a reason to give every slot a role ("Awards and close" on an evaluation role of the same length). Take a Break's times are left out: they count a break down and say nothing of a slot's length. The privacy page says the role names and times are sent.
… read; stale until rerun (#111) No step's Do or Expect moves. IM-09 gains what to read in the request with the inspector on. The spec is stale again: the change was measured against the real models on a remote preview, and the Zoom rerun is put off.
Contributor
Author
|
zoom — waiting. The daily 17:00 run took the lock on 2026-12-01 but the Mac's screen was locked (preflight), so Zoom could show no window. Nothing was deployed and no flag was changed; no spec ran. Specs this diff touches: agenda-import, club-membership, new-look, pro-launch, timer-core. The PR keeps |
ShuhaoZQGG
marked this pull request as ready for review
December 2, 2026 15:48
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #111
Why
Building the agenda is the slowest part of setting up the timer. The import dialog made the Timer pick a tab (EasySpeak Format or Simple Format) before pasting, and text that fitted neither landed as junk rows. Clubs that keep their agenda as a PDF, a Word or Excel file, or a photo of the printed sheet had to retype it. The Oct 14 demo-night feedback asked for "a pdf or jpeg" instead of text, and #77, #90 and #91 were three rounds of fixes for pasted agendas that did not look the way a parser expected.
What changes
One paste box, free, not flagged.
AI read and upload, Pro, behind the new
agenda_aiflag.agenda_aiorprooff, nothing of them shows.Code.
packages/shared/agendaImport.js:matchAgendaFormat(which format, read by its own parser), the client for the Worker, andprepareAgendaImages, which scales a photo down and cuts a tall one into overlapping bands.packages/ui/AgendaImport.jsx: the dialog body and its steps, one component for all three surfaces.worker/agenda-import.js:POST /api/agenda/import. A document is converted to text by Workers AItoMarkdown, tried against the known formats, then read by a model. Workers AI (Gemma 4 26B) answers first; OpenRouter's free models, the Table Topics setup, are the fallback after an error, an unusable answer or 20 seconds.wrangler.jsonc: anAIbinding and anAGENDA_AI_LIMITER, at the top level and underenv.dev.Security
POST /api/agenda/import. Order of checks: POST only, session (401),agenda_aiflag (404, the same body as a mistyped URL), Pro entitlement of the account or its club (402), then limits.{ role: [green, yellow, red] }in seconds. The Worker keeps them only for a role in the list, and only as three rising numbers of a day at most; it words them into the prompt itself, so no client text reaches the prompt this way. They are the user's settings, not personal data. The privacy page now says the role names and times are sent.agenda_ai_read) has the kind of input, the provider and the outcome.Production impact
agenda_aiexists in PostHog and is turned on, and it needsproon as well.AIbinding and the limiter deploy with the Worker; nothing has to be created first. Workers AI's free allocation is 10,000 neurons a day. A read cost 11 to 15 neurons in the runs below, so about 700 reads a day; past the allocation a read falls back to OpenRouter (1,000 free requests a day, shared with Table Topics).packages/shared/easySpeakParser.js: one pattern became a one-pass function with the same answers (checked on 300,000 random strings). No parsing behaviour changes.Testing
npm test: 3324 passed (167 files), on Node 22.npm run test:e2e: 159 passed. New:e2e/zoom.agenda-import.spec.js(12) ande2e/web.agenda-import.spec.js(4), in real Chromium with the Worker stubbed: the file dialog, a tall photo leaving as two JPEG bands, a pasted screenshot, the AI's reading of a file a format read, the free-plan lock, the dialog at 360 and 400px.npm run test:specs: 18 specs valid.The slanted photo and a forced OpenRouter photo read (Nemotron 3.5 Super VL, one name off) were measured before the review fixes; the picture path did not change after.
Role times, real models, on a remote preview of the dev Worker (2026-12-01). The same sample agenda, read with and without the roles' times:
Code review
An independent review of the first version found these, all fixed here:
/accountin the same tab, which unmounted a running timer.One finding is documented, not removed: the daily count is approximate (see Security).
Evidence (real Zoom client)
Run 2026-11-30 in Zoom 7.2.5 on macOS 26.7.2, this branch at 8ca49d0 deployed to dev (version
a7c62fb3, a full build of that head). Log:test-runs/2026-11-30-111-agenda-import-zoom/run.md(local, with a screenshot per step). No step failed.agenda-importFLAGS_FORCE "1,new_look=0"agenda-importagenda-importagenda-importagenda-import"1,new_look=0,agenda_ai=0"agenda-importnew-look"1"zoom.host with the Zoom session: 8 ×POST /api/agenda/import→ 200.agenda_imported(import_typebulk, easyspeak and ai;sourcepaste and file;provider) and the Worker'sagenda_ai_read(kind, provider, outcome and a count, no content).Findings, none blocking:
Dev runs this branch at its committed values again (version
0c881d22, FLAGS_FORCE "0").agenda-importran green on 8ca49d0 and isstaleagain since the role-times commit (7ec6ec8), which came after this run;new-lookstaysstalefor its other steps.Not verified
agenda-importIM-09 to IM-11 and IM-13, andnew-lookNL-24, are due a rerun on it; this PR carriesneeds:zoom-test. What stands in: the measurement above against the real models, and the browser tests, which check that the dialog sends the times.agenda-importIM-12 (a free plan sees the AI read and the upload locked): a human step that needs a second, free Zoom account.e2e/zoom.agenda-import.spec.jscovers the lock in a plain browser.video-script-zoom-app.mdstill show the two tabs.Also in this PR
.claude/skills/zoom-app-testing:preflight.shreports a locked screen as a blocker andzoom-up.shexits before launching Zoom (a first run that day was blocked by one). Its gotchas gain what the real run taught: check each dialog click,pbcopyneeds a UTF-8 locale, and the file dialog over Zoom.parseEasySpeakTextdrops the General Evaluator and the Ah Counter fromdemo-agenda-easyspeak.txt(7 rows where 9 are due). It did so before this change; the one box imports the same 7. IM-07 and the spec's "Not covered" say so.Look here first
worker/agenda-import.js,handleAgendaImport: the order of the checks, and that nothing a user sends is stored or logged.packages/shared/agendaImport.js,matchAgendaFormatandeasySpeakEvidence: the rules that decide a format. A wrong claim here is a silent mis-import for free users.apps/zoom-app/public/privacy.html, sections 2 and 6: the AI Agenda Import wording, including what it says about OpenRouter's providers and about the role names and times.worker/agenda-import.js,roleLineand the end ofhandleAgendaImport: how a role's times are worded for the model, and that only Workers AI gets them.