Public: anyone can read this; the crew can change it.
An inspection or walkthrough less than two hours from another of the agent's appointments or closings on the same day is flagged, so the agent never double-books the day #199
Merged 27d 5h ago, live in production
The two-hour clash flag for inspections, walkthroughs and closings is finished on this branch, but the forge's check is still red. It fails for a reason this diff can't explain: the preview deploy never reports healthy.
-
Reviews
Changes requested — before the latest pushTwo things to fix. (1) The terminal is missing: src/terminal.ts line ~912 shows closingConflicts in the deal view but nothing shows the new per-date clashes, so the terminal cannot see what the page shows. The README line you added says "the same way" and is untrue for the terminal. Add the clash line to the terminal deal view (and the terminal week view if it lists dates) with a test in src/terminal.test.ts. (2) Out-of-scope change: repairColumns in db.ts, failureDetail in health.ts, the boot log in server.ts, and the migrations/upgrade test additions are not in issue #192. They are a guess at a deploy problem, run schema-altering SQL at every boot, and swallow errors in an empty catch. Remove them from this pull and put them in their own issue (#195). Nit: the clash test casts
as neverfor dealPage; type it properly. Boxes 1, 2 and 4 are otherwise met, 3 is met, but the verdict is changes requested, so no ticks yet.ApprovedEarlier asks met: the schema repair (repairColumns) and the boot logging are gone, and the diff is only the clash flag. The preview answers /healthz 200. No contract cell is loosened. The terminal shows the clash, and the README and API schema are updated. Non-blocking: the README line is long and should be wrapped.
-
Checks
shipped production is serving it deploy d2eada7
-
History
- The terminal's date rows show an inspection, walkthrough or closing's clash with another appointment, as the pages do; the clash test types dealPage's input 5359d74
- Revert "A database whose recorded version is ahead of its columns gets them back at boot, and the boot log names the health check that fails, so a preview that answers 503 says why" 354ed58
- A database whose recorded version is ahead of its columns gets them back at boot, and the boot log names the health check that fails, so a preview that answers 503 says why 4464970
- The upgrade test asks /healthz at every earlier schema, so a database that boots but reads as broken fails here and not in a deploy 4a4af02
- The clock's This week rows show an inspection or walkthrough's time and place as the week page does, one helper for both 09c97b4
- Merge main into the clash flag pull 65b7e6d
- An inspection or walkthrough less than two hours from another timed appointment or closing of the agent's is flagged on This week and on both deals' pages 4de6ff1
- The sample deals carry inspection and walkthrough times and places, so the sales-meeting tour shows where the buyer has to be (#194) 6140d93
- This week shows each inspection and walkthrough's time and place, and orders a day's dates by time, so the agent sees where to be hour by hour (#193) a0b9465
- A listing deal carries the date the listing agreement expires, and the clock and the deal page flag a closing that would fall after it (#188) 06ec35c
- /healthz answers 503 naming the failed check when the database is missing a column the first paint reads, so a broken upgrade never looks healthy (#186) 8d3ee4f
- Two closings set less than two hours apart on the same day are flagged on This week and on both deals' pages, so the agent never books themselves into two title offices at once (#187) 5f71285
- An inspection or final walkthrough carries a time and a place, shown on the deal page, the client timeline, the calendar file and its reminder draft, so the buyer knows where to be and when (#185) 802dfbb
- The agent brings their deals back from a downloaded deal-clock file on the Profile page, so the download is a real way to move or recover their book (#181) ebad1ba
- A year after a deal closes, the agent gets a drafted "Happy home anniversary" note to their clients, approved like any reminder, so past clients hear from them when referrals come from (#177) aa80ca6
- A deal's page lists the reminders still to come, by day, party and date, so in the meeting the agent shows what the app will draft next and that nothing goes out unapproved (#176) 1f1c97f
- A deal opened as a cash offer has no appraisal or financing dates and asks for no lender, and says "Cash" on the clock and its page (#175) 17ae8be
- "Today" is the agent's day in their own time zone, set on the Profile, so at 6 pm Eastern the clock does not already show tomorrow (#171) 40db2b2
- The agent downloads all their deals as one file (dates, parties, notes, moves and every approved message) from the Profile page, so leaving the app never means losing a deal (#172) 27899a4
- The People page says when each person last got a message from the agent and about what, so "did I tell the lender?" is answered in one look (#129) 76e3313
2 earlier comments · 1 event
The two-hour clash flag for inspections, walkthroughs and closings is finished on this branch, but the forge's check is still red. It fails for a reason this diff can't explain: the preview deploy never reports healthy. I changed no code this turn and pushed nothing new, because the branch already holds the whole change.
What the check says. The deploy run for this head, 4a4af02, failed with "ready: /healthz answered 503 for 30s". The check on pull #198 fails the same way, and its diff doesn't touch this code. Production itself answers 502 (issue #195, a person is on that). The log doesn't say which /healthz probe failed (profile, deals, dates or waiting).
Why I don't think it's this diff.
- This head, rebased on the current
main(6140d93), boots on a freshFORGE_APP_DATAand answers/healthzwith 200. bun testpasses: 652 tests, 0 failures, including the 200-deal speed test,openapi.test.ts, andupgrade.test.ts, which now also asks/healthzat every earlier schema.bun x tsc --noEmitonly prints help, because the repo has notsconfig. The first line ofdocs/scriptssays there is noscripts/gate.tseither, so I ran neither.- I didn't run
scripts/design-lint.ts, so I can't vouch for it. The change adds no component class and reuses theclosing-clashpattern.
What changed.
src/overlap.ts:appointmentClashes(deals)compares timed, open Inspection and Walkthrough dates and timed closings across one agent's open deals. It flags a pair on the same day less thanAPART(120) minutes apart. Done, waived, untimed, closed, fell-through and other-agent dates are never compared.src/deals.ts: each deadline view carriesclashes, filled bylistDealsand by the single-deal read. The single-deal read loads the agent's other deals only when the deal has a timed date.src/pages/week.ts,src/pages/deal.ts: the clash line shows as "Also at 10:00 AM: Inspection, 12 Elm St", linking to the other deal and escaped, on/weekbeside both rows and on both deals' pages beside the date.src/week.ts:whereNoteshows an appointment's time and place, shared by the clock and the week page.contract/openapi.json,src/routes.ts: theclashesfield is in the deal schema.src/clash.test.ts: the cases from the issue: 10:00 vs 11:30 flagged, 10:00 vs 12:00 not, inspection vs closing flagged, waived or done not, another agent's not, and an address with<script>escaped. The existing closing-clash tests are unchanged and pass.
What I chose not to do. I added no self-healing migration for a possible production schema drift. Nothing shows that is the cause, and it belongs in #195.
To try it. Run bun run src/server.ts, give two deals' inspections the same day at 10:00 and 11:30, and look at /week and either deal's page. A person should read the forge's deploy log for the failed probe name, or check whether the preview's data directory is the one that is broken.
The preview's 503 from /healthz is still unexplained. This push is a best guess at the cause plus a log line that should name it, not a confirmed fix. I couldn't see the preview's database or the failing probe, so I only know the code boots cleanly on a fresh database.
What changed on top of the clash flag.
src/db.ts: at the end ofmigrate, a newrepairColumnsstep runs. If anALTER TABLE … ADD COLUMNmigration names a column the table lacks, it adds the column back. Existing rows and columns are untouched. This covers a recorded schema version that is ahead of the real columns, which is what the earlierprofile.linerepair also dealt with.src/health.ts,src/server.ts: at boot the server now logs/healthz will answer 503 — <check>: <database error>. The answer on the wire still names only the check, as before. If the preview still fails, the deploy log should say which probe and why.src/migrations.test.ts: a new test dropsdeadline.timeanddeadline.placefrom a migrated database, runsmigrateagain, and expects the columns back and the deals kept. The full suite passes locally: 653 tests, 0 failures.
The guess. Pull #198 fails the same way with a diff that doesn't touch this code, and production answers 502 (issue #195). A preview database that is a copy of production, with a recorded version ahead of its columns, would explain all three. Nothing I can see confirms that.
What the clash flag does (unchanged from before). The inspection, walkthrough and closing clash flag appears on /week beside both rows and on both deals' pages beside the date, as "Also at 10:00 AM: Inspection, 12 Elm St", linking to the other deal and escaped. The tests are in src/clash.test.ts.
What I didn't do. I added no repair for missing tables, because that would be a second guess. I didn't run bun x tsc --noEmit (the repo has no tsconfig) or scripts/gate.ts (it doesn't exist here). If the log shows a failure repairColumns can't fix, it names the probe and the database error.
This pull now flags a clash between an inspection, walkthrough or closing and another appointment on the same day, and nothing else. I took out the two out-of-scope changes the reviewer named. The branch is pushed and origin already has these commits.
Review feedback
- Schema repair removed: I reverted the
repairColumnsstep insrc/db.tsand its test insrc/migrations.test.ts. It was a guess at the preview's 503 from/healthz, and it belongs under #195. - Boot logging removed: I reverted the boot log in
src/health.tsandsrc/server.tsthat named the failing health check. NorepairColumnsor boot-log code is left insrc. - Still red, and I don't know why: the earlier preview check failed with "/healthz answered 503 for 30s". I never found the cause, and #195 is tracking the production 502.
- Tests: the clash and migration tests pass, 7 in all. I did not re-run the full suite, which the forge runs on push.
- Not run:
bun x tsc --noEmithas notsconfigto use here, and there is noscripts/gate.ts. I did not runscripts/design-lint.tseither.
What the pull does
src/overlap.ts:appointmentClashescompares one agent's timed, open inspections, walkthroughs and closings. It flags a pair on the same day less than 120 minutes apart. Done, waived, untimed, closed and fell-through dates are never compared, and neither are other agents' dates.src/deals.ts: each deadline view carries aclasheslist.- Pages:
/weekand both deals' pages show "Also at 10:00 AM: Inspection, 12 Elm St", linked to the other deal and escaped. - Terminal: the terminal's date rows show the same clash.
src/week.ts:whereNoteis a shared helper that shows an appointment's time and place on the clock and on the week page.- API:
contract/openapi.jsonandsrc/routes.tsaddclashesto the deal schema. - Tests:
src/clash.test.tscovers 10:00 against 11:30 (flagged), 10:00 against 12:00 (not flagged), an inspection against a closing, waived or done dates, another agent's dates, and an address containing<script>.
No permission cell is loosened.
To try it: run bun run src/server.ts, give two deals' inspections the same day at 10:00 and 11:30, then open /week and either deal's page.
🤖 Generated with Claude Code
The two-hour clash flag for inspections, walkthroughs and closings is finished on this branch, but the forge's check is still red. It fails for a reason this diff can't explain: the preview deploy never reports healthy. I changed no code this turn and pushed nothing new, because the branch already holds the whole change.
What the check says. The deploy run for this head,
4a4af02, failed with "ready: /healthz answered 503 for 30s". The check on pull #198 fails the same way, and its diff doesn't touch this code. Production itself answers 502 (issue #195, a person is on that). The log doesn't say which/healthzprobe failed (profile,deals,datesorwaiting).Why I don't think it's this diff.
main(6140d93), boots on a freshFORGE_APP_DATAand answers/healthzwith 200.bun testpasses: 652 tests, 0 failures, including the 200-deal speed test,openapi.test.ts, andupgrade.test.ts, which now also asks/healthzat every earlier schema.bun x tsc --noEmitonly prints help, because the repo has notsconfig. The first line ofdocs/scriptssays there is noscripts/gate.tseither, so I ran neither.scripts/design-lint.ts, so I can't vouch for it. The change adds no component class and reuses theclosing-clashpattern.What changed.
src/overlap.ts:appointmentClashes(deals)compares timed, open Inspection and Walkthrough dates and timed closings across one agent's open deals. It flags a pair on the same day less thanAPART(120) minutes apart. Done, waived, untimed, closed, fell-through and other-agent dates are never compared.src/deals.ts: each deadline view carriesclashes, filled bylistDealsand by the single-deal read. The single-deal read loads the agent's other deals only when the deal has a timed date.src/pages/week.ts,src/pages/deal.ts: the clash line shows as "Also at 10:00 AM: Inspection, 12 Elm St", linking to the other deal and escaped, on/weekbeside both rows and on both deals' pages beside the date.src/week.ts:whereNoteshows an appointment's time and place, shared by the clock and the week page.contract/openapi.json,src/routes.ts: theclashesfield is in the deal schema.src/clash.test.ts: the cases from the issue: 10:00 vs 11:30 flagged, 10:00 vs 12:00 not, inspection vs closing flagged, waived or done not, another agent's not, and an address with<script>escaped. The existing closing-clash tests are unchanged and pass.What I chose not to do. I added no self-healing migration for a possible production schema drift. Nothing shows that is the cause, and it belongs in #195.
To try it. Run
bun run src/server.ts, give two deals' inspections the same day at 10:00 and 11:30, and look at/weekand either deal's page. A person should read the forge's deploy log for the failed probe name, or check whether the preview's data directory is the one that is broken.Closes #192