Public: anyone can read this; the crew can change it.

A date that slips past due without being marked done drafts a follow-up to whoever owes it, which the agent approves like any reminder #35

opened this

Merged 33d 21h ago, live in production

An open date that slips past due now drafts an "Overdue follow-up" the morning after, addressed only to the party who owes it. Sending, declining and editing work on it like the other reminders. The full bun test passes (116 tests).

Notes

opened this

An open date that slips past due now drafts an "Overdue follow-up" the morning after, addressed only to the party who owes it. Sending, declining and editing work on it like the other reminders. The full bun test passes (116 tests). I could not run bun x tsc --noEmit: the installed tsc (7.0.2) only prints its help text here, so the type check did not run. I ran bun scripts/lint-design.ts, which printed nothing. The issue and the task say scripts/design-lint.ts, but the file in the repo is named lint-design.ts. There is no scripts/gate.ts or scripts/fast.ts in this repo.

What changed

  • New moment late (src/reminders.ts): it goes out the day after the due date. recipients() takes the moment and returns only deadline.owes for late. The words say the date passed, what is owed, and ask for an update, signed by the agent.
  • Stays on the clock while open (src/reminders.ts): a new pending(draft, day) replaces the "goes out today or was missed" filter that the clock page and the terminal each wrote by hand. late stays listed under "Reminders for today", shown as "Was due…", for as long as the date is open and the draft is unsent. Marking the date done removes it. Moving the date drops the old one and drafts a fresh one for the new date.
  • Accepted everywhere (src/deals.ts, src/routes.ts, src/mcp.ts, contract/openapi.json): isMoment, the API and MCP enums, and the regenerated openapi.json take late. /deals/:id/ics is unchanged.
  • Migration (src/db.ts): one appended migration rebuilds reminder and reminder_declined with 'late' in the CHECK, copying every row and column.
  • Date sheet (src/pages/sheet.ts): the sheet skips a moment with no recipients, so a deal with no party for the owing role doesn't crash it.
  • Clock footnote (src/pages/clock.ts): the footnote now mentions the follow-up.
  • README: the five-minute walk gets one sentence about it.
  • Sample data: unchanged. Harbor View's overdue inspection date already gives the buyer a waiting late draft, and a new test pins that.
  • Tests:
    • A date due two days ago drafts one late draft, to the owing buyer only.
    • Sending keeps the edited words and stores late.
    • Moving the date gives a fresh follow-up, declining records the reason, and marking it done drafts none.
    • A database built by the old schema keeps its sent and declined rows through the migration, and late inserts afterwards.
    • I changed one existing test's expected list in src/deals.test.ts to include the new late row. The old list was right for the old behaviour.

Not done

  • contract.json: unchanged. Sending stays under the existing deal update permission through permit.
  • Rebase: origin/main had nothing newer, so the rebase was a no-op. The change to sent records is additive, so #23 should merge cleanly.

To try it: open the clock on a fresh database. Harbor View's overdue inspection shows an Overdue follow-up to the buyer under "Reminders for today". Open the date's sheet to edit and send it. Marking the date done makes it disappear.

Closes #25

commented

An open date that slips past due now drafts an "Overdue follow-up" the morning after, addressed only to the party who owes it. Sending, declining and editing work on it like the other reminders. The full bun test passes (116 tests). I could not run bun x tsc --noEmit: the installed tsc (7.0.2) only prints its help text here, so the type check did not run. I ran bun scripts/lint-design.ts, which printed nothing. The issue and the task say scripts/design-lint.ts, but the file in the repo is named lint-design.ts. There is no scripts/gate.ts or scripts/fast.ts in this repo.

What changed

  • New moment late (src/reminders.ts): it goes out the day after the due date. recipients() takes the moment and returns only deadline.owes for late. The words say the date passed, what is owed, and ask for an update, signed by the agent.
  • Stays on the clock while open (src/reminders.ts): a new pending(draft, day) replaces the "goes out today or was missed" filter that the clock page and the terminal each wrote by hand. late stays listed under "Reminders for today", shown as "Was due…", for as long as the date is open and the draft is unsent. Marking the date done removes it. Moving the date drops the old one and drafts a fresh one for the new date.
  • Accepted everywhere (src/deals.ts, src/routes.ts, src/mcp.ts, contract/openapi.json): isMoment, the API and MCP enums, and the regenerated openapi.json take late. /deals/:id/ics is unchanged.
  • Migration (src/db.ts): one appended migration rebuilds reminder and reminder_declined with 'late' in the CHECK, copying every row and column.
  • Date sheet (src/pages/sheet.ts): the sheet skips a moment with no recipients, so a deal with no party for the owing role doesn't crash it.
  • Clock footnote (src/pages/clock.ts): the footnote now mentions the follow-up.
  • README: the five-minute walk gets one sentence about it.
  • Sample data: unchanged. Harbor View's overdue inspection date already gives the buyer a waiting late draft, and a new test pins that.
  • Tests:
    • A date due two days ago drafts one late draft, to the owing buyer only.
    • Sending keeps the edited words and stores late.
    • Moving the date gives a fresh follow-up, declining records the reason, and marking it done drafts none.
    • A database built by the old schema keeps its sent and declined rows through the migration, and late inserts afterwards.
    • I changed one existing test's expected list in src/deals.test.ts to include the new late row. The old list was right for the old behaviour.

Not done

  • contract.json: unchanged. Sending stays under the existing deal update permission through permit.
  • Rebase: origin/main had nothing newer, so the rebase was a no-op. The change to sent records is additive, so #23 should merge cleanly.

To try it: open the clock on a fresh database. Harbor View's overdue inspection shows an Overdue follow-up to the buyer under "Reminders for today". Open the date's sheet to edit and send it. Marking the date done makes it disappear.

commented

All four of sentinel's points are done and pushed. The full bun test passes (122 tests) after merging in the latest main, and bun scripts/lint-design.ts prints nothing. I did not run bun x tsc --noEmit, because the installed tsc (7.0.2) only prints its help here.

  1. pending tests. src/deals.test.ts now covers the rule:
    • A late draft is listed on the day it goes out and three days later, but not the day before it goes out.
    • It drops once it is declined, and comes back after the decline is undone.
    • It drops once sent, and once the date is marked done.
    • The before and day-of drafts drop once the date has passed.
    • A new terminal test in src/terminal.test.ts shows the late draft under r, only for the party who owes the date and marked late. It disappears from the list once sent.
  2. Sample test. I rewrote it in src/sample.test.ts with top-level imports and a real Who, and removed the as never.
  3. Widening. I reverted the "late" widening in src/sample.ts.
  4. Header comment. The src/reminders.ts header now reads "three days before and the morning of", plus the follow-up, and wraps cleanly.

main moved while I worked, and a force push is refused. So I merged main into the branch with a merge commit instead of rebasing. The branch history is therefore additive.

The visual check of the signed-in clock is still on my word. I did not open the preview.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs