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

A date that lands on a weekend or a US federal holiday is flagged with the next business day, and moving it there is one tap #95

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

An open date due on a weekend or a US federal holiday is now flagged with the next business day, and one tap moves it there. The relevant test files pass, but I ran no tsc check because the repo has no tsconfig.json. I didn't run the whole suite.

Notes

shipped production is serving it deploy d2eada7

opened this

An open date due on a weekend or a US federal holiday is now flagged with the next business day, and one tap moves it there. The relevant test files pass, but I ran no tsc check because the repo has no tsconfig.json. I didn't run the whole suite.

  • Holidays: src/dates.ts now computes US federal holidays for any year from rules, with no table and no dependency. A Saturday holiday is observed on the Friday before and a Sunday one on the Monday after. A Saturday New Year's Day is observed on Dec 31 of the year before. It exports isHoliday, isBusinessDay and nextBusinessDay.
  • Business-day counting: addBusinessDays steps over holidays as well as weekends. Calendar-day deals are unchanged.
  • The flag: every open date carries nonBusinessDay: { next } | null. It is on the API, in the OpenAPI contract and in MCP get_deal, and a done date never carries it. The sheet and the deal-page row show "Sat, Nov 28 · not a business day · next is Mon, Nov 30", and the This week row shows a short version.
  • One tap: a "Move to Mon, Nov 30" button, shown to anyone who may change the deal, posts to the existing /deadlines/:id/move with the reason "Rolled to the next business day". The move is recorded, audited and drafts the usual date-changed notice. Stored dates are never changed by the flag.
  • Docs and tests: the README has one line on what the flag means and says holidays are skipped. docs/TECHNICAL.md names the field. The new tests are in src/dates.test.ts and src/nonbusiness.test.ts. They cover:

- the full 2026 and 2027 holiday lists, including the observed July 4, Christmas and New Year's Eve cases; - the business-day count skipping Thanksgiving; - the flag in the page, the API, This week and MCP; - the one-tap move recording its reason.

  • One existing test changed: in src/deals.test.ts, "7 business days from Thu Oct 1" now expects Oct 13, because Oct 12 is Columbus Day. The old expectation of Oct 12 was written before holidays were counted, so it was wrong under this issue.
  • Not done: I did not touch the contract.json permissions. I did not add a flag to the clock's marker beyond what the sheet shows. I did not auto-move anything.
  • Existing flaky test: status.test.ts fails when run in the same process as reminders, timeline, review, lead and ics. It fails the same way on the base without my change and passes on its own.
  • Not run: there is no scripts/gate.ts, scripts/fast.ts or scripts/design-lint.ts in this clone. scripts/lint-design.ts ran with no output.

Closes #84

1 earlier comment · 1 event
commented

An open date due on a weekend or a US federal holiday is now flagged with the next business day, and one tap moves it there. The relevant test files pass, but I ran no tsc check because the repo has no tsconfig.json. I didn't run the whole suite.

  • Holidays: src/dates.ts now computes US federal holidays for any year from rules, with no table and no dependency. A Saturday holiday is observed on the Friday before and a Sunday one on the Monday after. A Saturday New Year's Day is observed on Dec 31 of the year before. It exports isHoliday, isBusinessDay and nextBusinessDay.
  • Business-day counting: addBusinessDays steps over holidays as well as weekends. Calendar-day deals are unchanged.
  • The flag: every open date carries nonBusinessDay: { next } | null. It is on the API, in the OpenAPI contract and in MCP get_deal, and a done date never carries it. The sheet and the deal-page row show "Sat, Nov 28 · not a business day · next is Mon, Nov 30", and the This week row shows a short version.
  • One tap: a "Move to Mon, Nov 30" button, shown to anyone who may change the deal, posts to the existing /deadlines/:id/move with the reason "Rolled to the next business day". The move is recorded, audited and drafts the usual date-changed notice. Stored dates are never changed by the flag.
  • Docs and tests: the README has one line on what the flag means and says holidays are skipped. docs/TECHNICAL.md names the field. The new tests are in src/dates.test.ts and src/nonbusiness.test.ts. They cover:

- the full 2026 and 2027 holiday lists, including the observed July 4, Christmas and New Year's Eve cases; - the business-day count skipping Thanksgiving; - the flag in the page, the API, This week and MCP; - the one-tap move recording its reason.

  • One existing test changed: in src/deals.test.ts, "7 business days from Thu Oct 1" now expects Oct 13, because Oct 12 is Columbus Day. The old expectation of Oct 12 was written before holidays were counted, so it was wrong under this issue.
  • Not done: I did not touch the contract.json permissions. I did not add a flag to the clock's marker beyond what the sheet shows. I did not auto-move anything.
  • Existing flaky test: status.test.ts fails when run in the same process as reminders, timeline, review, lead and ics. It fails the same way on the base without my change and passes on its own.
  • Not run: there is no scripts/gate.ts, scripts/fast.ts or scripts/design-lint.ts in this clone. scripts/lint-design.ts ran with no output.
Changes requested — before the latest push

The page, API, MCP and holiday maths look right, but the terminal does not get the feature, and one test is fragile.

  1. (fix first) src/terminal.ts is untouched. A flagged date shows no 'not a business day · next is Mon, Nov 30' in the terminal's dates, week and deal views (see dateLine, around line 578), and nothing there offers the one-tap roll. The m key still moves a date, but you must type the date and a reason. The rule is that what a person does on the page they do in the terminal too. Add the flag to dateLine, and a key on a flagged date that calls moveDeadline with due = nonBusinessDay.next and reason ROLL_REASON (only if permit allows it, as m does). Add a terminal test for both. Add the key to the terminal header comment and to the README line you added.
  1. The 'This week' test in src/nonbusiness.test.ts moves a deadline to the next Saturday from the real clock. It depends on today's date and can fail depending on the day, for example if the Saturday falls outside the week window. Pin the date the way other tests do, or assert on the clock page with a fixed 'on'.
  1. Minor: the README line is long and also edits the 'Count business days' sentence mid-line. Keep it to one tidy line.

No contract.json cell is loosened, which is correct.

commented

All three points from @sentinel's review are addressed and pushed to the same branch. The terminal, nonbusiness, dates, design, openapi, a11y, sheets, deals and amend tests pass. I ran no tsc check, as before.

  • Terminal: dateLine in src/terminal.ts now shows "not a business day · next is Mon, Nov 30 (N moves it)" on a flagged date. That covers the dates, week and deal views, since they share that line.
  • New key: N on a flagged date calls moveDeadline with due = nonBusinessDay.next and the reason "Rolled to the next business day". moveDeadline decides whether the move is allowed, and N also says "Sign in…" or "You may not change this deal" up front, as m does. On an unflagged date it says "already on a business day". I used N because n already opens a new deal.
  • Header and footer: N is in the terminal header comment and in the footer help for the dates and deal views.
  • Shared reason: ROLL_REASON moved from pages/sheet.ts into src/deals.ts, so the terminal doesn't import from a page module.
  • Terminal test: a new test adds a Saturday date, checks the flag text, presses N, and checks the new due date and the recorded reason. It also checks the second press says the date is already on a business day.
  • This week test: the clock-dependent test is gone. weekCard is now exported and tested with a pinned day (2026-11-25). The MCP check is a separate test on a fixed Saturday.
  • README: it is one tidy line again, mentioning N in the terminal. I reverted my edit to the "Count business days to skip weekends" sentence.
Approved

Earlier ask met: the terminal now shows the flag on every date line and N rolls a flagged date through moveDeadline with the shared ROLL_REASON. It checks canChange up front, moveDeadline still asks permit, and the new terminal test covers it. The This week test now pins its day. No contract.json cell is loosened and no new door needs a contract row. Non-blocking: the This week row tests the short wording only through weekCard, not through the rendered clock page.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs