lilith-platform.live/codebase/@features/api
Natalie 0364073fc5 fix(prospect-cockpit): duplicate-send guard on cockpit_send (anti-spam)
A coworker agent fired the same outreach template 4x in ~97s to a prospect
(2026-06-29 incident). macsync's outbox only dedupes *identical* bodies per
recipient per UTC day; it does not stop a rapid burst of *different* bodies and
gives the caller no clear signal. Add a pre-enqueue cooldown guard to
/:handle/send: a second send to the same handle inside PROSPECT_SEND_COOLDOWN_MS
(default 60s) is refused with a structured 409 duplicate_send. A human can
override with force=true (cockpit 'send again'); agents omit it and stay guarded.

- send-guard.ts: pure, total evaluateSendGuard() + resolveSendCooldownMs()
- __tests__/send-guard.test.ts: 10 bun:test cases (incident shape covered)
- prospect-cockpit.ts: read last_outbound_contact_at, evaluate, 409 on hold

Pure logic verified (9/9); tsc clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 08:55:57 -04:00
..
config
scripts docs(lilith-platform): Wave 1 prospector packages migration + restructure references (from parallel docs slice) 2026-06-28 17:43:09 -04:00
src fix(prospect-cockpit): duplicate-send guard on cockpit_send (anti-spam) 2026-06-29 08:55:57 -04:00
tests/processors
.dependency-cruiser.cjs
.env.development feat(quinn.admin): serve main-branch dev preview on black without SSO 2026-06-21 23:38:06 -05:00
bunfig.toml
package.json
tsconfig.json