Skip to content

docs(adr): 0035 a gateway sends chosen fleet events to webhook destinations - #718

Merged
V3RON merged 5 commits into
mainfrom
feature/707-adr
Oct 20, 2026
Merged

V3RON merged 5 commits into
mainfrom
feature/707-adr

Conversation

@V3RON

@V3RON V3RON commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Proposes ADR 0035 for #707.

  • A new gateway-only module, src/alerts, built by main.ts; not an optional module.
  • Outbound HTTP through a new WebhookPoster port; redirects never followed.
  • Config gateway.alerts.destinations: named destinations, slack or generic, a fixed list of eleven events, https (http on loopback only).
  • Delivery: one send at a time per destination, 10 s per try, three tries, at most 100 waiting, memory only.
  • generic body is the event envelope, signed with X-Simlock-Signature: sha256=….
  • alerts.test admin operation, gateway only.

Numbered 0035: 0032 and two 0033s are taken by open ADR PRs (#626, #702, #704).

Docs only. This PR stays open at the bottom of #707's stack and merges with its last task.

Review

Spec review: 0 blocking, 5 fixed, 0 notes. Code review: skipped. Claims review: skipped.
Rounds: 3. Tokens: n/a.
Assessment: complete.
Fixed: R1 redaction names history.db; R2 secret rule moved to each format; R3 subscribe citation; R4 Slack escaping; R2b secret rule restored in section 5.

Written by an agent.

@V3RON

V3RON commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Runs: 6. Cost USD: 1.3071. Agent seconds: 595.
Tokens input 114, output 24441, cache read 1725264, cache write 182230.

  • review 1 spec: claude-sonnet-5-5 207 s $0.1169
  • review 1 spec: claude-opus-5-5 159 s $0.8689
  • fix 1 implementer: claude-sonnet-5-5 90 s $0.0952
  • review 2 spec: claude-sonnet-5-5 52 s $0.1024
  • fix 2 implementer: claude-sonnet-5-5 60 s $0.0666
  • review fix-check spec: claude-sonnet-5-5 27 s $0.0571
    Finding outcomes: {}. Classes: {}.
{"findings": []}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 20, 2026 06:26
@V3RON
V3RON added this pull request to stack #743 October 20, 2026 07:05
V3RON and others added 5 commits October 20, 2026 10:23
…ations

Co-Authored-By: Claude <noreply@anthropic.com>
…s logged by code, Slack only

Co-Authored-By: Claude <noreply@anthropic.com>
…e uplinks close

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@V3RON
V3RON merged commit 6cef880 into main Oct 20, 2026
26 checks passed
@V3RON
V3RON deleted the feature/707-adr branch October 20, 2026 08:39
V3RON added a commit that referenced this pull request Oct 20, 2026
…destinations (#741)

Closes #719

### Status

Implement: done (22/22 green) Review: round 2 clean, 3 blocking fixed in
round 1 and 1 CI fix Hardware: n/a Gate: waiting for the stack
Next: none until #718 and this PR merge with the stack

## Done when

- [ ] CI is green, dependency-cruiser passes with
`alerts-imports-bus-ports-core-only` and `not-alerts`
(`.dependency-cruiser.mjs`).
- [x] A loopback receiver gets a signed `worker.connected` from a
gateway with a `generic` destination (`gateway-fleet.e2e.test.ts`, "a
worker joining a gateway with a generic destination ...").
- [x] `simlock config set gateway.alerts.destinations
'[...http://n8n.internal/hook...]'` prints the URL error and exits 2
(`config.test.ts`, "loadConfig refuses a bad url ...").
- [x] `docs/CONFIGURATION.md` documents every field, the URL rule, the
eleven events, the headers, the signature check and the retry rule (new
"Alerts" section).

## Assumptions

- Assumption: `workerLabel` for `AlertFormatDefinition.build` —
`createAlerts` has no such option in the spec, so it passes the id
through unchanged; `generic` does not use it, and #720 supplies the real
function.

- Open: the e2e "worker posts nothing" case cannot fail today, since a
worker has no way to receive a poster; the claim holds by construction
in `main.ts`.

## Review

Spec review: 1 blocking, 1 fixed, 0 notes. Code review: 2 blocking, 2
fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 3.5M.
Runs: 13. Cost USD: 6.3443. Agent seconds: 3517.

Assessment: complete

*Written by an agent.*
V3RON added a commit that referenced this pull request Oct 20, 2026
Closes #720

### Status

Implement: done (14/14 green) Review: round 2 clean, fix-check clean (R4
fixed in 3f6a9ac) Hardware: n/a Gate: waiting for the stack
Next: none until #718, #741 and this PR merge with the stack

## Done when

- [ ] CI is green on the final head.
- [x] A Slack destination receives the eleven events as `{"text": ...}`
posts with Slack-escaped worker text (`alerts.test.ts`, the Slack format
cases).
- [x] `docs/CONFIGURATION.md` describes the Slack body and headers,
scoped to Slack destinations.

## Assumptions

- None.

## Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 3 blocking, 3
fixed, 0 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 2. Tokens: 5.6M.
Runs: 13. Cost USD: 3.8631. Agent seconds: 2569.

Assessment: complete

*Written by an agent.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant