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

The agent can narrow the clock to deals closing this week, this month or later #314

opened this

Merged 25d 3h ago, live in production

The clock, the printed week (/week) and the /week link now narrow by a Closing choice (Any, This week, This month, Later). Today's reminders (/reminders/today) do not, because I left that out. In this sandbox the closing-window, side and find tests pass, but the speed suite fails.

Notes

opened this

The clock, the printed week (/week) and the /week link now narrow by a Closing choice (Any, This week, This month, Later). Today's reminders (/reminders/today) do not, because I left that out. In this sandbox the closing-window, side and find tests pass, but the speed suite fails. That is the people route, which this pull doesn't touch. scripts/gate.ts doesn't exist in this clone, and bun x tsc --noEmit just printed its help text because there is no tsconfig, so neither ran.

What changed

  • src/closing-window.ts is a small pure module beside src/find.ts.
    • closingFilter validates ?closing= against any, week, month or later.
    • closingIn(deals, today, window) narrows the deals. This week is today plus the six days after, including any closing already past. This month runs to the end of the calendar month and includes This week. Later is everything after.
  • src/routes.ts reads closing on GET / and GET /week. Any other value is refused with 422 and "Closing is any, week, month or later."
  • src/pages/clock.ts, src/pages/week.ts and the new src/pages/closing-window.ts render the choice beside Side. It composes with q and side. Clear resets it, and "Print this week" keeps it. No new JavaScript or CSS.
  • src/closing-window.test.ts tests each bucket on the sample deals dated from today, combination with q, the invalid value, and the boundary day.
  • src/speed.test.ts times /?closing=month and /week?closing=week.
  • The README has a line under Finding a deal, and docs/TECHNICAL.md lists the new module.
  • I removed 23 empty sandbox placeholder files (.bashrc, .claude/*, .gitconfig and the like) that earlier tries had committed. They were the "try 3" files in the parked note. They are not part of the change.

What I chose not to do

  • Today's reminders: the issue asks for them to narrow too, but the review page narrows only by q, and Side doesn't narrow it either. Threading closing through every review form is a separate, larger change, so I left it out.
  • No contract cell changed and there is no migration.

Test status

  • On this machine, people in src/speed.test.ts misses the 50 ms budget. It fails the same way on unmodified main, so it reads as machine load. Earlier runs also failed the clock, the reminder review and the closed-deals clock on the "first time after a deal changes" check, and I did not check those against main.
  • I did not run the other test files or bun scripts/lint-design.ts (the script is scripts/lint-design.ts, and it printed nothing when I ran it).

To try it

  1. Open /?closing=month, or pick a value in the Closing select and press Find.
  2. /week?closing=week shows the narrowed print view.
  3. /?closing=soon returns the refusal.

🤖 Generated with Claude Code

Closes #309

commented

The clock, the printed week (/week) and the /week link now narrow by a Closing choice (Any, This week, This month, Later). Today's reminders (/reminders/today) do not, because I left that out. In this sandbox the closing-window, side and find tests pass, but the speed suite fails. That is the people route, which this pull doesn't touch. scripts/gate.ts doesn't exist in this clone, and bun x tsc --noEmit just printed its help text because there is no tsconfig, so neither ran.

What changed

  • src/closing-window.ts is a small pure module beside src/find.ts.
    • closingFilter validates ?closing= against any, week, month or later.
    • closingIn(deals, today, window) narrows the deals. This week is today plus the six days after, including any closing already past. This month runs to the end of the calendar month and includes This week. Later is everything after.
  • src/routes.ts reads closing on GET / and GET /week. Any other value is refused with 422 and "Closing is any, week, month or later."
  • src/pages/clock.ts, src/pages/week.ts and the new src/pages/closing-window.ts render the choice beside Side. It composes with q and side. Clear resets it, and "Print this week" keeps it. No new JavaScript or CSS.
  • src/closing-window.test.ts tests each bucket on the sample deals dated from today, combination with q, the invalid value, and the boundary day.
  • src/speed.test.ts times /?closing=month and /week?closing=week.
  • The README has a line under Finding a deal, and docs/TECHNICAL.md lists the new module.
  • I removed 23 empty sandbox placeholder files (.bashrc, .claude/*, .gitconfig and the like) that earlier tries had committed. They were the "try 3" files in the parked note. They are not part of the change.

What I chose not to do

  • Today's reminders: the issue asks for them to narrow too, but the review page narrows only by q, and Side doesn't narrow it either. Threading closing through every review form is a separate, larger change, so I left it out.
  • No contract cell changed and there is no migration.

Test status

  • On this machine, people in src/speed.test.ts misses the 50 ms budget. It fails the same way on unmodified main, so it reads as machine load. Earlier runs also failed the clock, the reminder review and the closed-deals clock on the "first time after a deal changes" check, and I did not check those against main.
  • I did not run the other test files or bun scripts/lint-design.ts (the script is scripts/lint-design.ts, and it printed nothing when I ran it).

To try it

  1. Open /?closing=month, or pick a value in the Closing select and press Find.
  2. /week?closing=week shows the narrowed print view.
  3. /?closing=soon returns the refusal.

🤖 Generated with Claude Code

commented

The clock, the printed week and today's reminders now all narrow by Closing (Any, This week, This month, Later). The terminal does not. The closing-window, review, find, side, terminal and speed test files pass here. tsc is not wired in this repo, and the full suite is left to the forge.

Changes since review

  1. Placeholder files. The 23 empty files are no longer in the diff. They came back after my first removal because the sandbox recreates them and the harness's automatic commit picked them up again. I untracked them and added them to .gitignore as a fix for that, so .gitignore is part of this pull (14 lines). Say so if you'd rather handle it another way.
  2. Reminders.
    • /reminders/today?closing= narrows the queue and refuses a bad value with 400.
    • The clock's Review all link carries closing.
    • Skip, the Send, Decline, Tomorrow and Save contact forms, their redirects, and the "Back to the clock" link all keep it, so the queue doesn't change mid-review.
    • Side still doesn't narrow reminders, as before.
  3. Terminal. src/tty.ts and src/terminal.ts have no find or side narrowing today, so there is no narrowing in the terminal to extend. I left it alone: adding find, side and closing to the terminal is its own feature.
  4. Checks.
    • bun scripts/lint-design.ts exits 0 with no output.
    • A tsc run with ad-hoc flags reports only errors in code this pull doesn't touch (missing bun:sqlite types, clock.ts line 126).
    • scripts/gate.ts and scripts/fast.ts don't exist in this clone. The speed suite passed 33 of 33 on this run, after failing earlier on unrelated routes.
  5. Sample-deal test. I replaced the tautological partition test with concrete expectations. The sample deals close in 2, 16, 33 and 40 days. The 2-day deal is the only one in This week and is also in This month, and it is not in Later. The 33- and 40-day deals are in Later and not in This month. A new test covers the reminders: the queue size shrinks, the form carries closing, a bad value is refused, and the clock's Review all link carries it.

The README line now mentions that Review all carries Closing to today's reminders.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs