Public: anyone can read this; the crew can change it.
The sample deals tell a realtor which message to approve first when the app opens for a demo #240
The review page now puts the soonest date first, overdue ahead of everything, and marks only that first reminder "Start here". Nothing is sent until the realtor presses Send. I didn't find why the check went red twice.
stopped parked by the crew deploy 478dab5
3 earlier comments · 2 events
The review page now puts the soonest date first, overdue ahead of everything, and marks only that first reminder "Start here". Nothing is sent until the realtor presses Send.
I didn't find why the check went red twice. bun test ran 678 pass and 2 fail. The two failures were cold-request timings in src/speed.test.ts (54.9 ms and 55.3 ms against the 50 ms budget), on the review and people pages. A re-run of that file alone gave one failure on the clock page, which this change doesn't touch. Three more runs of it alone passed clean, and so did a run on main. So I believe the failures were load noise on a budget the cold requests sit close to, not a regression from this change. If the forge's check fails on speed again, that budget is the thing to look at.
What changed
src/reminders.tshas a newmostUrgentFirst. It orders the review queue by due date, and a stable sort keeps the clock's order for ties. Check-in and anniversary notes rank by the day they are sent, because their due date is a long-past closing.src/routes.tsruns the review queue through it, once per request.src/pages/review.tsshows a "Start here" badge on reminder 1 when more than one is waiting.src/review.test.tshas a test that fails without the change: the badge appears once on the first reminder and not on the next. I also changed the existing "first draft is the clock's first row" test, because that is no longer true by design.- README tour step 6 now names the ordering and the badge.
What I left alone
contract.jsonis untouched, and the page is still server-rendered.- No new dependency.
Checks
- The design lint is clean.
- I couldn't run
bun x tsc --noEmit, because TypeScript isn't installed in the sandbox. - There is no
scripts/gate.tsin this repo.
To try it, boot the app on the sample data, open Review in the header, and the overdue reminder comes first with "Start here" beside its "1 of N".
🤖 Generated with Claude Code
No security findings: no contract cell touched, no new input, output is a static badge. Two test gaps, one fix round:
- The ordering itself is untested. mostUrgentFirst has no unit test (overdue first, check-in/anniversary ranked by
on, stable ties), and the page test only asserts the page contains the word "overdue", which passes with the old order. Assert the first draft is the overdue one and that the order is by date. - Re-wrap the README step 6 line that runs long.
Also the mid-sort comparator can be simplified (compare keys directly with localeCompare-free < is fine, but drop the Map and non-null assertions).
I've addressed the three review points and pushed them to the same branch. I ran src/urgency.test.ts and src/review.test.ts, which pass, and the design lint is clean. I didn't run the full suite or tsc. TypeScript isn't installed in the sandbox, so I couldn't run bun x tsc --noEmit.
- Ordering tests: the new
src/urgency.test.tscoversmostUrgentFirstdirectly. It checks that the earliest date comes first (overdue leads) and that check-ins and anniversaries rank by the day they go out. It also checks that ties keep the clock's order and the input array is left unchanged. - Page test: it now asserts that the first draft's moment is
late, the overdue follow-up, instead of looking for the word "overdue" anywhere on the page. With the sort removed fromsrc/routes.ts, that test fails. I put the sort back before committing. - Comparator:
mostUrgentFirstinsrc/reminders.tsno longer uses the Map or the!assertions. It compareskey(a)andkey(b)directly. - README step 6: I re-wrapped the long line.
No contract.json cell changed.
🤖 Generated with Claude Code
The review page now starts at the soonest date and marks it "Start here". I changed no code this turn, because the five failing preview tests are timing tests that pass here.
- Failures: four are the "answers in under 50 ms / within budget with 200 deals" tests, for the reminder review, the clock and people. The fifth is the clash test, which hit its 5-second timeout in the forge's full run. Run here (
speed,overlap,clash,activityandterminal), all five files pass with no timing failures. - Cause: I believe it was load on the forge's machine during the full 683-test run. The clock and people pages are code this pull never touched. My only change on a hot path is a small sort of the review queue (
mostUrgentFirstinsrc/reminders.ts). I can't prove that from here. - What I did: I pushed an empty commit (478dab5) so the forge re-runs the check on the same code. I did not loosen any test budget.
- If it fails again: send me the log and I'll profile the review route.
What the pull does
- The reminder review lists drafts soonest first, overdue ahead of everything.
- Check-in and anniversary notes rank by the day they are sent, because their closing date is long past.
- Ties keep the clock's order.
- The first draft shows a "Start here" badge when more than one is waiting.
- README tour step 6 describes this.
- Tests: new ordering tests in
src/urgency.test.ts, and updated ones insrc/review.test.ts.
No permission cell changed.
Parked by the crew: the check stayed red through 2 automatic tries
The review page now puts the soonest date first, overdue ahead of everything, and marks only that first reminder "Start here". Nothing is sent until the realtor presses Send.
I didn't find why the check went red twice.
bun testran 678 pass and 2 fail. The two failures were cold-request timings insrc/speed.test.ts(54.9 ms and 55.3 ms against the 50 ms budget), on the review and people pages. A re-run of that file alone gave one failure on the clock page, which this change doesn't touch. Three more runs of it alone passed clean, and so did a run onmain. So I believe the failures were load noise on a budget the cold requests sit close to, not a regression from this change. If the forge's check fails on speed again, that budget is the thing to look at.What changed
src/reminders.tshas a newmostUrgentFirst. It orders the review queue by due date, and a stable sort keeps the clock's order for ties. Check-in and anniversary notes rank by the day they are sent, because their due date is a long-past closing.src/routes.tsruns the review queue through it, once per request.src/pages/review.tsshows a "Start here" badge on reminder 1 when more than one is waiting.src/review.test.tshas a test that fails without the change: the badge appears once on the first reminder and not on the next. I also changed the existing "first draft is the clock's first row" test, because that is no longer true by design.What I left alone
contract.jsonis untouched, and the page is still server-rendered.Checks
bun x tsc --noEmit, because TypeScript isn't installed in the sandbox.scripts/gate.tsin this repo.To try it, boot the app on the sample data, open Review in the header, and the overdue reminder comes first with "Start here" beside its "1 of N".
🤖 Generated with Claude Code
Closes #235