Public: anyone can read this; the crew can change it.
The sample deals' finished dates read "Done on time" or "early", not "22 days late", so the demo shows an agent who keeps their deals on track #160
Check · Review · Land · Live done — Landed and live in production.
Sample dates marked done now read on time or early, not "22 days late". The full `bun test src` run passes. I did not run `bun x tsc --noEmit`: it printed only tsc's help text with no type output, so there is no type-check result.
shipped production is serving it deploy d2eada7
Sample dates marked done now read on time or early, not "22 days late". The full bun test src run passes. I did not run bun x tsc --noEmit: it printed only tsc's help text with no type output, so there is no type-check result.
What changed (src/sample.ts)
- Seed: a done date used to be stamped the day before the samples were set up, whatever its due day. It is now stamped the day before its own due day. If that day is not yet past, it is stamped yesterday, so a done stamp is never in the future.
- Late sample: no sample is meant to show a late date, so nothing in
SAMPLESchanged. - Daily shift:
refreshstill moves the stamp together with the due day, so the gap between them stays fixed. - Restore the sample deals: it goes through the same seeding code, so it gets the same stamps.
- Recognising an untouched sample:
isUntouchednow takes each date's due day (newduesfield onSampleState). It accepts a stamp at exactly 17:00:00.000Z on a day before its due day, or the old stamp from before this fix. A stamp from a person's click has a different time of day, so an edited sample is still left alone. - Databases seeded before the fix: on their next refresh, untouched sample deals that still carry the old stamp are restamped against their own due days. Real deals are not touched. That next refresh is the first day after the stored anchor, so a database seeded today is corrected tomorrow.
Tests (src/sample.test.ts)
- After seed, after a refresh 6 days on, after restore, and on a database with the old stamps then refreshed, no finished sample date is late or in the future. On main the last case fails, because the old stamp makes dates read late.
- A refresh leaves a real deal's finished stamp as it was.
- The existing untouched-state test now passes
dues.
Not done
- The README has no line about late sample dates, so I left it alone.
- I did not touch
contract.jsonor any permission cell.
The worktree has stray untracked dotfiles (.bashrc, .gitconfig and others). I left them out of the commit.
🤖 Generated with Claude Code
Clean. Seed stamps each done date the day before its own due (capped at yesterday), refresh and restore keep it, pre-fix databases are restamped only for untouched sample deals, and real deals are left alone (tested). Tests cover seed, refresh, restore, legacy DB and a real deal. No contract cells touched; no new dependency. The README makes no claim about late sample dates, so it still matches.
Sample dates marked done now read on time or early, not "22 days late". The full
bun test srcrun passes. I did not runbun x tsc --noEmit: it printed only tsc's help text with no type output, so there is no type-check result.What changed (
src/sample.ts)SAMPLESchanged.refreshstill moves the stamp together with the due day, so the gap between them stays fixed.isUntouchednow takes each date's due day (newduesfield onSampleState). It accepts a stamp at exactly 17:00:00.000Z on a day before its due day, or the old stamp from before this fix. A stamp from a person's click has a different time of day, so an edited sample is still left alone.Tests (
src/sample.test.ts)dues.Not done
contract.jsonor any permission cell.The worktree has stray untracked dotfiles (
.bashrc,.gitconfigand others). I left them out of the commit.🤖 Generated with Claude Code
Closes #157