Repository navigation
feat: add opt-in loopback webhook hints with at-most-once epochs - #133
Conversation
OBenner
left a comment
There was a problem hiding this comment.
Final architecture review (arch) — ACCEPT for the wire/contract surface (PR #133, HEAD e213e6e).
Reviewed src/relay/webhook-nudger.ts in full against the final v1.1 contract (strict at-most-once, single HTTP attempt per reserved event, epoch reservation before any network work incl. cap-dropped events, 5-minute debounced epochs with reset only on actually-empty backlog, identifier-only 8-field payload, loopback-only literal addresses with deny-own-port, outcome telemetry never a delivery claim, bounded rate/audit per security M1/M4/M5/M6). Implementation matches the contract point by point; the docs commit e213e6e honestly records the at-most-once correction and the dropped-epoch semantics.
Design doc docs/design/2026-11-17-webhook-nudge.md is present in this PR as agreed (docs-with-code). Explicit v1 non-goals (remote URL, startup/session_rebound events, token authentication) are recorded with return triggers — nothing silently dropped.
No wire/protocol/schema changes; no new dependencies; verify 122 files / 1084 tests + build green. Ready for CTO final. (Self-approve is unavailable from this account; verdict recorded as COMMENT per our convention.)
Adds an operator-enabled loopback webhook for newly committed message hints. Configure
webhooks: {enabled: true, url: ...}only in gitignoredsynloq.local.yaml; shared manifests reject the field. Send/reply dedup replays emit nothing, and exporter failures never change durable send/ACK results.Implements the final architecture contract: one HTTP attempt per event with no retries, reservation before network, five-minute recipient epochs reset only by an actually empty unacknowledged backlog. Payload contains only fixed identifiers, reservation timestamp and relay boot UUID. Numeric loopback, explicit port, own-relay-port rejection, no redirects/DNS/proxy/auth headers; TLS verification stays enabled. Queue/rate/deadline bounds and saturated counters prevent an exporter failure from creating an audit flood. Doctor exposes a bounded historical counter snapshot with observation time.
Validation: full
pnpm verifyPASS (122 files / 1084 tests),git diff --checkPASS. New tests cover real HTTP transport, payload/header hygiene, absolute timeout/abort, post-commit send/reply observation, dedup and observer failure, delivered-but-unacknowledged epochs, rate/audit limits, shutdown and doctor snapshots.Refs #117. The design document is included with the implementation. Explicit v1 non-goals: remote endpoints, lifecycle startup/rebound events, raw-token configuration, multiple endpoints and delivery guarantees. One unauthenticated local hint endpoint; no dependencies, relay wire changes, DB migrations, live endpoint activation or Claude stand changes. Publication requires operator approval; merge remains with CTO.