Public: anyone can read this; the crew can change it.
Put a lead marked qualified or lost back into follow-ups #23
Check · Review · Land · Live done — Landed and live in production.
A closed lead can now be put back in follow-ups from its page, the API, the MCP and the terminal. I ran the actions, terminal, server, audit, openapi, readme and contract tests: 78 pass and the one failure was a stale contract/openapi.json, which I regenerated and re-checked.
shipped production is serving it deploy aba151a
A closed lead can now be put back in follow-ups from its page, the API, the MCP and the terminal. I ran the actions, terminal, server, audit, openapi, readme and contract tests: 78 pass and the one failure was a stale contract/openapi.json, which I regenerated and re-checked. I did not run the full suite or a type check: the repository has no tsconfig.json, so tsc printed help, and scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist here. scripts/lint-design.ts ran with no output.
What changed
- Reopen:
reopeninsrc/leads.tssets the lead tocontactedif a first reply was ever sent, otherwisenew. - Unsent touches: the skipped touches are drafted again with the current profile and the consent rule, so text vs email is decided afresh. Touches already sent stay as history.
- Schedule: days 1, 3, 7, 14 and 30 are counted from the moment of reopening, so nothing comes due in a burst. The first reply of a never-answered lead goes back to a draft.
setStateinsrc/actions.ts: it accepts"open", and only for a qualified or lost lead; an open lead is refused asinvalid. Any other state staysinvalid.- Permission: it goes through the same
update leadcheck as marking a lead closed, socontract.jsonis unchanged. - Audit: the change is recorded through
auditedwith a newreopenedact. The Activity page reads it as "put X back in follow-ups". - Page: a closed lead's page shows "Put back in follow-ups" when the person may update it. The
POST /leads/:id/stateandPATCH /leads/:idroute docs listopen, andcontract/openapi.jsonis regenerated. - MCP and terminal: the
mark_leadtool acceptsstate: "open". In the terminal,oon a closed lead puts it back, and the hint line shows it. - README: the follow-up section says how to reopen.
Tests added: reopen reschedules only the unsent touches and none comes due on the next tick, a never-answered lead comes back as new with its draft, and anon is refused. The page and API reopen, an unknown state returns 422, and o works in the terminal.
Not done: no new dependency, and no contract cell was loosened.
Reopen goes through the same permit-checked setState as marking a lead closed, so no contract cell is loosened. It is audited with a new act, reachable from the page, API, MCP and terminal, and documented in the README. Only a closed lead can be reopened. The unsent touches are rescheduled from now, so none comes due in a burst. Tests cover the schedule, the never-answered case, anon refusal, the page and API path, and the terminal key. No security findings. This review was read from the diff; I did not run the tests or open the preview.
A closed lead can now be put back in follow-ups from its page, the API, the MCP and the terminal. I ran the actions, terminal, server, audit, openapi, readme and contract tests: 78 pass and the one failure was a stale
contract/openapi.json, which I regenerated and re-checked. I did not run the full suite or a type check: the repository has notsconfig.json, sotscprinted help, andscripts/gate.ts,scripts/fast.tsandscripts/design-lint.tsdon't exist here.scripts/lint-design.tsran with no output.What changed
reopeninsrc/leads.tssets the lead tocontactedif a first reply was ever sent, otherwisenew.setStateinsrc/actions.ts: it accepts"open", and only for a qualified or lost lead; an open lead is refused asinvalid. Any other state staysinvalid.update leadcheck as marking a lead closed, socontract.jsonis unchanged.auditedwith a newreopenedact. The Activity page reads it as "put X back in follow-ups".POST /leads/:id/stateandPATCH /leads/:idroute docs listopen, andcontract/openapi.jsonis regenerated.mark_leadtool acceptsstate: "open". In the terminal,oon a closed lead puts it back, and the hint line shows it.Tests added: reopen reschedules only the unsent touches and none comes due on the next tick, a never-answered lead comes back as
newwith its draft, and anon is refused. The page and API reopen, an unknown state returns 422, andoworks in the terminal.Not done: no new dependency, and no contract cell was loosened.
Closes #5