lilith-platform.live/codebase
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
..
@features fix(prospect-cockpit): duplicate-send guard on cockpit_send (anti-spam) 2026-06-29 08:55:57 -04:00
@packages infra: repoint @lilith npm registry + Forgejo from dead black to DO cocotte-forge; serve /photos from local disk 2026-06-28 08:09:33 -04:00
config.yaml
package.json
tsconfig.base.json