Public: anyone can read this; the crew can change it.
An open deal nothing has touched in 14 days says so on the clock #313
Parked 24d 17h ago
An open deal nothing has touched in 14 days now shows a "Quiet 16 days" badge beside its address on the clock, and the deal page says when it was last touched. All tests pass except one speed-budget case that failed once under load.
-
Reviews
No review yet.
-
Checks
stopped parked by the crew deploy f4f821e
-
History
- Read the last touch in one pass and convert only the latest stamp to a day (#310) f4f821e
- Index the audit trail by target so reading a deal's last touch does not scan it; pin the migration (#310) 3d85da8
- An open deal nothing has touched in 14 days now shows a "Quiet 16 days" badge beside its address on the clock, and the deal page says when it was last touched. All tests pass except one speed-budget c 3f36fab
- An open deal nothing has touched in 14 days wears a Quiet badge on the clock and says when it was last touched (#310) 418e038
- The agent chooses a warm or a brief voice for reminder drafts on the Profile page (#301) 7473f8f
- The agent can keep a private note on a deal that never reaches a client (#308) a4d9f16
- The agent can undo the last move of a date from the deal page (#307) ad5b26c
- When a contract is amended to a new closing date, the agent can move every dependent open date by the same days in one reviewed step (#304) 8515495
- Each date can carry a short paperwork checklist the agent ticks off, and the deal page and client timeline show what is still missing (#300) 3764f8c
- A held reminder can come back on a day the agent picks, and shows on Today's reminders that morning (#299) 9bacaa2
- People's nudge line reads without colour, and the fresh-boot test pins its whole sentence (#238) 3a44623
- Each person can have a preferred way to be reached, and the drafts and People page show it (#294) ac329d6
- Closed deals show days from contract to closing, and the year's total adds the average (#295) 6b38028
- A request for the clock, review and a deal page is timed in a test and fails over 50 ms on the sample book (#291) 10ce2a2
- Add a deal from a contract's key dates in one short form, with every date checked before it is saved (#286) d078669
- A signed-in Tour page walks the sample deals step by step, each step linking straight to the place it names (#277) 233e341
- A weight budget test caps the JavaScript and CSS a page ships and requires sizes on every image (#282) d124019
- small: Review answers to the keys S, D and T on the focused reminder (#280) 564cb8f
- The review page's finished screen says when the next reminder will be drafted and for whom (#276) 33d0843
- Every drafted message for every sample deal is checked for leaks: no undefined, null, [object], unfilled braces, double spaces or a missing sign-off (#274) 67e145d
3 earlier comments
An open deal nothing has touched in 14 days now shows a "Quiet 16 days" badge beside its address on the clock, and the deal page says when it was last touched. All tests pass except one speed-budget case that failed once under load. I couldn't run scripts/gate.ts, scripts/fast.ts, scripts/design-lint.ts or bun x tsc --noEmit, because none of them exist in this clone or its config.
What changed
- Quiet rule:
src/quiet.tsis the pure function. A deal is quiet when it is open, 14 or more days have passed since its last touch, and no open date is due today or in the next 3 days. Closed and fell-through deals are never quiet. An overdue date does not exempt a deal, because the clock already flags it and it is the deal a client would ask about. - Last touch:
src/deals.tsaddsDealView.touched. It is the latest day, in the agent's timezone, of any of these:- the deal being opened;
- a date marked done or waived;
- a date moved;
- a message sent or declined;
- any allowed change to the deal in the audit trail, which covers party and note edits.
There is no migration, and the clock list reads the audit trail in one grouped query rather than one per deal.
- Display:
src/pages/quiet.tsdraws the badge on the clock lane and a "Last touched N days ago" line on the deal page. Closed and fell-through deals show nothing. The output is escaped, and.quiet-badgeis instatic/app.cssand listed indocs/design/areas/clock.md. - Sample data: 2210 Juniper Court now boots with 16 quiet days, with its dates pushed out so none is due soon.
refreshkeeps it quiet by shifting itscreated_atforward as the days pass. - README: the tour gets one sentence, mirrored in
src/tour.ts, since a test requires the two to match. - Tests:
src/quiet.test.tscovers quiet at 14 days and not at 13, the due-soon exemption, closed deals, the audit and done-date touches, and the sample boot.
What I chose not to do
- No contract cell changes and no migration.
- No new setting for the 14-day or 3-day thresholds.
Test results
- The full
bun testrun had one failure: the speed-budget test, which took 54 ms against the 50 ms limit while the whole suite ran in parallel. Run on its own,src/speed.test.tspasses (27 of 27), including with my changes stashed. - The tour/README test failed on the first full run; it passes now.
To try it
- Open the preview and look for "Quiet 16 days" on 2210 Juniper Court.
- Open that deal to see its last-touched line.
- Mark one of its dates done and the badge goes away.
I pushed a fix for the preview failure, but I can't confirm the speed-budget tests pass: the machine is heavily loaded (load average about 39), and they still fail intermittently here. The deploy log you sent ended on passing tests with no failure shown, so I took the cause from my own full runs: the speed-budget tests were the ones failing.
Cause: reading a deal's last touch queries the audit trail by deal, and the trail had no index on that column. Every read of the clock, the people page and the reminder review therefore scanned the whole trail, which pushed those pages past the 50 ms budget.
Fix:
- Migration: I appended one migration to the end of the list in
src/db.ts, an index onaudit (resource, target, at), and updatedsrc/migrations.pin.jsonwith its hash. - Query plan: the plan now shows the query searching by that index instead of scanning.
- Existing test: the old-database upgrade test in
src/migrations.test.tsbuilds its "before" schema from a filtered list of migrations. It failed once the new migration existed, so I excluded the new index from that list.
Test status: the migration and upgrade tests pass (70 of 70). The last two full bun test runs here still failed between two and four speed-budget cases, and different ones each time. src/speed.test.ts alone passed on a quieter machine before the index and failed on this one after it, so I couldn't compare before and after. The forge's check will give the real verdict.
What changed: the pull still adds the Quiet badge to the clock lane and a last-touched line to the deal page, with one sample deal (2210 Juniper Court) quiet on a fresh boot. This fix adds one migration, which the issue said to avoid if possible; it sits at the end of the list and is pinned.
I pushed a change that makes reading a deal's last touch cheaper, but I can't confirm the four speed-budget tests now pass.
What I found:
- Same four tests: your failures were
people(200 deals), and the clock, reminder review andpeopleafter a deal changes. - Machine load: this machine's load average was 40–66 during my runs. Unmodified
mainfailed the same speed-budget cases here, with times around 53 ms against the 50 ms limit. - Small real cost: my change did add about 1 ms to loading the deal list, measured at 200 deals. That is enough to tip a test already sitting near the limit, so I didn't write the failures off as load alone.
What changed (src/deals.ts):
- Single pass: it used to build a list of every stamp and convert each to a day in the agent's timezone. It now tracks the latest stamp in one pass and converts only that one. The conversion was the expensive part.
- Earlier index: the audit index from the previous push stays. A micro-benchmark puts the audit lookup at about 0.5 ms.
Tests: src/quiet.test.ts, the sample tests, and the migration and upgrade tests pass. After this change the list-load time was about the same as before, within the noise on this machine. I couldn't typecheck: this repo has no tsconfig.json, so bun x tsc --noEmit only prints its help text.
If the forge's check fails the same four tests again on a quiet machine, the remaining option is to compute the last touch only where it is shown, on the clock and the deal page, rather than for every deal in every list.
An open deal nothing has touched in 14 days now shows a "Quiet 16 days" badge beside its address on the clock, and the deal page says when it was last touched. All tests pass except one speed-budget case that failed once under load. I couldn't run
scripts/gate.ts,scripts/fast.ts,scripts/design-lint.tsorbun x tsc --noEmit, because none of them exist in this clone or its config.What changed
src/quiet.tsis the pure function. A deal is quiet when it is open, 14 or more days have passed since its last touch, and no open date is due today or in the next 3 days. Closed and fell-through deals are never quiet. An overdue date does not exempt a deal, because the clock already flags it and it is the deal a client would ask about.src/deals.tsaddsDealView.touched. It is the latest day, in the agent's timezone, of any of these:There is no migration, and the clock list reads the audit trail in one grouped query rather than one per deal.
src/pages/quiet.tsdraws the badge on the clock lane and a "Last touched N days ago" line on the deal page. Closed and fell-through deals show nothing. The output is escaped, and.quiet-badgeis instatic/app.cssand listed indocs/design/areas/clock.md.refreshkeeps it quiet by shifting itscreated_atforward as the days pass.src/tour.ts, since a test requires the two to match.src/quiet.test.tscovers quiet at 14 days and not at 13, the due-soon exemption, closed deals, the audit and done-date touches, and the sample boot.What I chose not to do
Test results
bun testrun had one failure: the speed-budget test, which took 54 ms against the 50 ms limit while the whole suite ran in parallel. Run on its own,src/speed.test.tspasses (27 of 27), including with my changes stashed.To try it
Closes #310