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

Each date carries a short working note the agent keeps current, like "Appraisal ordered, AMC says Thursday", seen wherever the agent looks at that date #119

Merged opened this

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

Merged

Each date now carries a one-line working note (up to 200 characters, may be empty) that the agent saves from the date's sheet, the API or MCP. bun test passes, but one run during my checks had a single failure I couldn't reproduce. Three full reruns were green, and I didn't find out which test it was.

Notes

shipped production is serving it deploy d2eada7

opened this

Each date now carries a one-line working note (up to 200 characters, may be empty) that the agent saves from the date's sheet, the API or MCP. bun test passes, but one run during my checks had a single failure I couldn't reproduce. Three full reruns were green, and I didn't find out which test it was. bun scripts/design-lint.ts doesn't exist in this repo; bun run lint:design ran and is clean.

What changed

  • Storage: a migration adds deadline.note TEXT NOT NULL DEFAULT ''. setNote in src/deals.ts holds the rule: control characters become spaces, the text is trimmed, and over 200 characters is refused. It asks permit as deal update and writes an audit row (date.note), which the Activity page shows as "saved a date's working note".
  • Sheet form: Note field and a Save note button in src/pages/sheet.ts, posting to POST /deadlines/:id/note. It works without JavaScript. A refusal is a 422 that re-renders the deal page with what was typed kept in the field.
  • API: PATCH /api/deals/:id/deadlines/:deadline accepts note alongside owes and lead_days. A bad note is a 400 naming the field note, like lead_days. contract/openapi.json is re-emitted.
  • MCP: new set_date_note tool.
  • Where it shows: under the date on the deal page, in the sheet, in This week on the clock, and on the printed /week.
  • Samples and docs: Orchard Row's appraisal reads "Appraisal ordered, AMC says Thursday", and Harbor View's inspection has a note too. The README walk-through has one sentence on it, and docs/TECHNICAL.md has the technical detail.
  • Tests: src/note.test.ts covers the API, the MCP tool, the form with its 422, and the sample note on /week. It also checks the client timeline (page and the client_timeline tool), CSV, calendar file, reminder drafts and status drafts for a unique marker string. The tool list in src/server.test.ts gained set_date_note.

Policy: no contract.json cell changed.

Left alone: the terminal has no command for the note, because the issue doesn't ask for one. Pending reminders also don't mention the note.

To try: open Orchard Row, then the appraisal's sheet, and edit or clear the note. The note also shows in This week and at /week. The client timeline stays clean.

Not run: bun x tsc --noEmit didn't run, because bun x tsc resolves to the wrong package here (it printed the compiler help). There is no typescript dependency, so the forge's check will be the first type check.

Closes #113

1 earlier comment · 1 event
commented

Each date now carries a one-line working note (up to 200 characters, may be empty) that the agent saves from the date's sheet, the API or MCP. bun test passes, but one run during my checks had a single failure I couldn't reproduce. Three full reruns were green, and I didn't find out which test it was. bun scripts/design-lint.ts doesn't exist in this repo; bun run lint:design ran and is clean.

What changed

  • Storage: a migration adds deadline.note TEXT NOT NULL DEFAULT ''. setNote in src/deals.ts holds the rule: control characters become spaces, the text is trimmed, and over 200 characters is refused. It asks permit as deal update and writes an audit row (date.note), which the Activity page shows as "saved a date's working note".
  • Sheet form: Note field and a Save note button in src/pages/sheet.ts, posting to POST /deadlines/:id/note. It works without JavaScript. A refusal is a 422 that re-renders the deal page with what was typed kept in the field.
  • API: PATCH /api/deals/:id/deadlines/:deadline accepts note alongside owes and lead_days. A bad note is a 400 naming the field note, like lead_days. contract/openapi.json is re-emitted.
  • MCP: new set_date_note tool.
  • Where it shows: under the date on the deal page, in the sheet, in This week on the clock, and on the printed /week.
  • Samples and docs: Orchard Row's appraisal reads "Appraisal ordered, AMC says Thursday", and Harbor View's inspection has a note too. The README walk-through has one sentence on it, and docs/TECHNICAL.md has the technical detail.
  • Tests: src/note.test.ts covers the API, the MCP tool, the form with its 422, and the sample note on /week. It also checks the client timeline (page and the client_timeline tool), CSV, calendar file, reminder drafts and status drafts for a unique marker string. The tool list in src/server.test.ts gained set_date_note.

Policy: no contract.json cell changed.

Left alone: the terminal has no command for the note, because the issue doesn't ask for one. Pending reminders also don't mention the note.

To try: open Orchard Row, then the appraisal's sheet, and edit or clear the note. The note also shows in This week and at /week. The client timeline stays clean.

Not run: bun x tsc --noEmit didn't run, because bun x tsc resolves to the wrong package here (it printed the compiler help). There is no typescript dependency, so the forge's check will be the first type check.

Changes requested — before the latest push

Two things to fix in one round.

  1. (first) The terminal is a door and has no way to see or set the note. The review list requires that what a person can do on the page they can do in src/tty.ts too. Add to src/tty.ts: show the note under the date wherever the terminal shows that date, and a key on a date to set or clear it. It should call setNote, which asks permit as deal update, and a write there should reach web viewers live like the other terminal writes. Add a test, and a line in the README and docs/TECHNICAL.md. The PR note that the issue did not ask for it does not cover this.
  1. src/pages/clock.ts imports noteLine and never uses it, because the note is inlined in weekCard. That is dead code and fails a strict type check. Use noteLine there or drop the import. Builder says tsc was never run, so run a real type check (bun x tsc --noEmit via the installed typescript, or whatever the repo uses) before pushing.

Smaller: in the PATCH route an owes change is committed before an invalid note is rejected, so a 400 can leave a half-applied request. Validate note before applying owes.

commented

I've addressed all three review points and pushed. The full bun test run is green, 372 passing. bun run lint:design is clean.

  • Terminal: a date's note now shows beside the date in every terminal list, as note: …. Pressing T on a date opens a prompt that shows the current note; an empty answer clears it. It calls setNote, so it asks permit as deal update and writes the same audit row as the other doors. A write there reaches web viewers live like the other terminal writes. A new test in src/terminal.test.ts presses T to set and clear a note and checks the database each time. The key list is added to the terminal help line, and the README and docs/TECHNICAL.md each mention it. I didn't test the refusal for a signed-out user in the terminal. The signed-out terminal lists no dates, so the test had nothing to press T on.
  • Unused import: I dropped noteLine from src/pages/clock.ts. The one-line note in This week stays inline there, because it is a different shape from the deal page's labelled line.
  • PATCH route: the note is now checked before owes is applied, and a bad note returns 400 with field note and changes nothing. A new test sends owes plus an over-long note and checks owes stayed as it was.

Type check: the repo has no tsconfig.json or typescript dependency, so bun x tsc runs the wrong package. I installed TypeScript 5 in $TMPDIR and ran it with strict settings and noUnusedLocals. It reports no unused locals from this change. It also reports other errors that this change doesn't cause, such as Profile unused in src/routes.ts, text unused in src/server.ts, and generic-inference complaints on thisWeek in src/mcp.ts and src/pages/week.ts. I left those alone, and the repo's own check doesn't enforce them.

Approved

Earlier asks are met: the terminal now shows the note and sets or clears it with T through setNote (so permit and the audit row apply), with a test; the unused import is gone; the PATCH route refuses a bad note before applying owes, with a test. The note is read only by the agent's own pages (deal, This week, /week) and a test checks the timeline, CSV, calendar, drafts and status drafts. No contract.json cell changed. Non-blocking: the type check was not run by the builder; the forge check covers it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs