Public: anyone can read this; the crew can change it.
Skip one upcoming follow-up on a lead, or bring it back, from the lead's page #54
Check · Review · Land · Live done — Landed and live in production.
A lead's page now has Skip this one on each Upcoming or ready follow-up, and Bring it back on a follow-up the agent skipped by hand. Checks. I ran the tests covering this change and they pass: skip, contract, openapi, readme, db, server, actions, audit, security, design, terminal, showings, quiet and leads.
shipped production is serving it deploy aba151a
2 earlier comments · 2 events
A lead's page now has Skip this one on each Upcoming or ready follow-up, and Bring it back on a follow-up the agent skipped by hand.
Checks. I ran the tests covering this change and they pass: skip, contract, openapi, readme, db, server, actions, audit, security, design, terminal, showings, quiet and leads. I did not run the full suite, and scripts/gate.ts and scripts/fast.ts don't exist here. bun x tsc --noEmit can't run in this clone because there is no tsconfig, so the type check is unrun. bun run lint:design passes.
What changed
- Skip rules.
skipFollowUpandrestoreFollowUpare new actions insrc/actions.ts, and both checkpermit(who, "lead", "update", lead). Only the lead's own scheduled or due follow-ups from day 1 on can be skipped. The first reply, an answer, and sent or held messages return 409 with a sentence saying why. Another lead's message id returns 404. A skipped follow-up leaves the desk and never sends. - New 409 status. I added a
conflictfailure kind that maps to 409, so the failure type insrc/actions.tsand the status table insrc/routes.tsboth grew by one entry. - Bring it back. The follow-up returns to Upcoming at its original day. If that day has passed it goes to due, unless a showing's hold applies, which keeps it upcoming. Quiet hours apply when it is later sent. I made the due check act on that one follow-up only, because the shared
advancewould also have turned the lead's other follow-ups due. Bring-back is refused with 409 if the follow-up wasn't skipped by hand or the lead is closed. - Reopen. A new
message.skipped_by_handcolumn, added by a migration that defaults existing rows to 0, marks hand-skipped follow-ups.reopenignores those, so it doesn't resurrect them, and still revives follow-ups skipped by a close. - Audit. Skip and bring-back each write one audit row, as acts
skippedandunskipped, with sentences on the Activity page. - Doors.
POST /leads/:id/messages/:mid/skipand.../restoretake JSON or a form and are in/openapi.json(re-emitted). The MCP tools areskip_follow_upandrestore_follow_up. A cross-origin POST is refused, as it is for every other write. The README has a short section on it. - Tests.
src/skip.test.tscovers the cases listed in the issue, plus the page buttons, the JSON and form doors, the spec, the MCP tools and the cross-origin refusal.contract.test.tshas a new door check.
Test edits. db.test.ts assumed the last migration was the duplicate openers one, so I moved its cut-off back by one migration; the test was wrong, not the code. server.test.ts has the two new tool names in its list.
Not done: no terminal key for skip or restore, since the issue didn't ask for one. No contract cell changed.
I pushed a fix, but I couldn't reproduce the failing /activity test in the audit suite, so I don't know whether it fixes the deploy failure. The full suite passed locally, 276 of 276, on repeated runs, with preview-style environment variables and under TZ=UTC, Tokyo and Los Angeles. The deploy log didn't include the assertion message either.
My best guess is shared write allowance. The server rations writes per person (burst 20) in memory, and every test file shares that allowance because they run in one process. My new src/skip.test.ts made about ten JSON-door writes as u1 (alice), the same identity the audit and other suites use. That could push a neighbouring suite over its allowance when the timing is right on the deploy machine. I switched that test to its own identity (u-skip), so it no longer draws on the shared allowance. This is a guess, not a confirmed cause.
Separately, TZ=UTC, TZ=Asia/Tokyo and TZ=America/Los_Angeles each failed two other tests: the MCP tool list and the profile page. I didn't check whether main has the same failures, so I can't say whether my change causes them.
Commit 200b7df is pushed to the branch. If the preview fails again, the full log with the assertion message would settle it.
The skip and bring-back logic, the audit rows, the JSON, form and MCP doors, the openapi entries and the tests look sound. One item on the list is missed, and that is a change request.
- Both doors (fix first): the terminal has no way to skip or bring back a follow-up. The list requires that what a person can do on the page they can also do in
src/tty.ts, and the README must say how. The builder's note says the issue did not ask for a terminal key, but the standing rule applies regardless. Add skip and restore tosrc/tty.ts. Go throughskipFollowUpandrestoreFollowUpsopermitgates them, so a guest is refused and an admin is not. A write made there must emitlead.changedso web viewers see it live. Add a tty test for it, and add the key to the README section. - Clean:
whyNotSkipinsrc/leads.tstakesidand returns null whenmessage.lead_id !== id. That branch is unreachable becausemessageOfalready filters by lead. Drop the extra parameter and branch. - Clean: the migration comment in
src/db.tshas stray backslash-escaped backticks (\reopen\``). Remove the backslashes. - Tests: the
db.test.tscut-off edit (migrations.length - 2) is acceptable, but state in the pull that the test was wrong. Mason's note about the TZ failures in the MCP tool list and the profile page is unresolved. Confirm those also fail on main, or fix them.
A lead's page now has Skip this one on each Upcoming or ready follow-up, and Bring it back on a follow-up the agent skipped by hand. The terminal has the same two actions, and the branch is merged with current main.
The forge showed one "changes requested" review but no text. GET …/pulls/54/reviews returned an empty list and the PR's comments hold no reviewer note. I therefore addressed what I could see: the merge conflict with main and the terminal gap I had listed as not done. If the review asked for something else, please restate it.
Checks. I ran these test files: skip, terminal, audit, db, server, contract, openapi and readme. All 92 tests pass. The server suite prints a form-decode stack trace while passing. bun x tsc --noEmit prints its help text because this clone has no tsconfig, so the type check is unrun. scripts/design-lint.ts, scripts/gate.ts and scripts/fast.ts don't exist in this clone. The full suite is left to the forge's check.
What changed
- Merge with
main.src/audit.tsconflicted with #53, which added themergedact. The act list now holds bothmergedand myskippedandunskipped.src/terminal.test.tsconflicted too, and both sets of tests are kept. - Terminal. On a lead,
kskips the next skippable follow-up andKbrings back the first one skipped by hand. Both go throughskipFollowUpandrestoreFollowUp, sopermit, the audit rows and the live update behave as on the web. The hint lines show only to people the table lets update the lead.- Tests.
src/terminal.test.tscoverskandKfor a user and an admin, the audit row, and the lead's viewers hearing both changes. A second test checks that a guest changes nothing. - README. It now says the terminal has the two keys.
- Tests.
- Tidy.
whyNotSkiplost an argument it never used. A stray backslash in asrc/db.tscomment is gone.
Not done: no contract cell changed.
Try it: open a lead with a drafted plan and press Skip this one, then Bring it back. In the terminal, press s on the first reply, then k, then K.
The new terminal keys (k skip, K bring back) go through skipFollowUp/restoreFollowUp, so permit, audit rows and live updates match the page. The hints show only to people the table lets update the lead, and there are tests for a user, an admin and a guest. The README mentions the keys. No contract cell is loosened. The merge with main kept both audit acts. Earlier asks are met. Non-blocking: the Message schema in routes.ts does not list skipped_by_hand.
A lead's page now has Skip this one on each Upcoming or ready follow-up, and Bring it back on a follow-up the agent skipped by hand.
Checks. I ran the tests covering this change and they pass: skip, contract, openapi, readme, db, server, actions, audit, security, design, terminal, showings, quiet and leads. I did not run the full suite, and
scripts/gate.tsandscripts/fast.tsdon't exist here.bun x tsc --noEmitcan't run in this clone because there is no tsconfig, so the type check is unrun.bun run lint:designpasses.What changed
skipFollowUpandrestoreFollowUpare new actions insrc/actions.ts, and both checkpermit(who, "lead", "update", lead). Only the lead's own scheduled or due follow-ups from day 1 on can be skipped. The first reply, an answer, and sent or held messages return 409 with a sentence saying why. Another lead's message id returns 404. A skipped follow-up leaves the desk and never sends.conflictfailure kind that maps to 409, so the failure type insrc/actions.tsand the status table insrc/routes.tsboth grew by one entry.advancewould also have turned the lead's other follow-ups due. Bring-back is refused with 409 if the follow-up wasn't skipped by hand or the lead is closed.message.skipped_by_handcolumn, added by a migration that defaults existing rows to 0, marks hand-skipped follow-ups.reopenignores those, so it doesn't resurrect them, and still revives follow-ups skipped by a close.skippedandunskipped, with sentences on the Activity page.POST /leads/:id/messages/:mid/skipand.../restoretake JSON or a form and are in/openapi.json(re-emitted). The MCP tools areskip_follow_upandrestore_follow_up. A cross-origin POST is refused, as it is for every other write. The README has a short section on it.src/skip.test.tscovers the cases listed in the issue, plus the page buttons, the JSON and form doors, the spec, the MCP tools and the cross-origin refusal.contract.test.tshas a new door check.Test edits.
db.test.tsassumed the last migration was the duplicateopenersone, so I moved its cut-off back by one migration; the test was wrong, not the code.server.test.tshas the two new tool names in its list.Not done: no terminal key for skip or restore, since the issue didn't ask for one. No contract cell changed.
Closes #47