feat(notifications): a webhook channel, for agents and automations (#81) #86

Merged
jfro merged 1 commit from feat/81-webhook into main 2026-11-28 16:35:46 +00:00
Owner

What changed

PR #86 adds a Webhook notification channel that POSTs JSON (event, message, report with page and API links) with an optional HMAC-SHA256 signature; 5 new tests fail on main and pass here, mix precommit passes (1254 tests), CI is green, and Send a test from the dev settings page reached a local receiver that verified the signature.

Fixes #81

Red, then green

  • A webhook channel POSTs each notification as JSON with the event and the report (page and API links), signs it with HMAC-SHA256 when a secret is set, sends a null report for tests, records non-2xx answers, and needs an http(s) URL.: bash -c 'source ~/.rmenv; export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; unset ${!FORGEJO_@} ${!GITHUB_ISSUES_@}; MIX_TEST_PARTITION=_81p mix test test/lamplighter/notifications_test.exs'
    • fails on the base (9e21ee0): exit 1
    • passes on the branch (2965097): exit 0

Checks

  • I read the diff (the new Webhook channel, its registration, and the now-public Api.report_json). I ran the full suite on the branch: 1254 tests pass. The signature is a lowercase-hex HMAC-SHA256 of the raw body, sent only when a secret is set. Non-2xx answers and network errors come back as error strings, and retry is off. Not tried: a real receiver, and redirects or very large report bodies. (Prover): bash -c 'source ~/.rmenv; export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; unset ${!FORGEJO_@} ${!GITHUB_ISSUES_@}; cd ~/work/lamplighter-v1-4/wt-81 && MIX_TEST_PARTITION=_81r mix test test/lamplighter/notifications_test.exs', exit 0

Shipping it

  • Goes live when it merges: no. Merging to main deploys nothing; release images are built only when Jeremy runs mise run release and tags a version.
  • Undo: a revert puts it back.
  • Not tried on the real thing: A real receiver such as Fortysix; tested against a local Python receiver and Req.Test stubs.
  • For later: One try per notification with no retries, like the other channels. The payload's top-level url is the dashboard link the other channels use; report.url is the report's own page.

Prover

Passed (Sonnet): I read the diff (the new Webhook channel, its registration, and the now-public Api.report_json). I ran the full suite on the branch: 1254 tests pass. The signature is a lowercase-hex HMAC-SHA256 of the raw body, sent only when a secret is set. Non-2xx answers and network errors come back as error strings, and retry is off. Not tried: a real receiver, and redirects or very large report bodies.

Every command above was run by Fortysix's Basecamp itself, on the branch named.

## What changed PR #86 adds a Webhook notification channel that POSTs JSON (event, message, report with page and API links) with an optional HMAC-SHA256 signature; 5 new tests fail on main and pass here, mix precommit passes (1254 tests), CI is green, and Send a test from the dev settings page reached a local receiver that verified the signature. Fixes #81 ## Red, then green - A webhook channel POSTs each notification as JSON with the event and the report (page and API links), signs it with HMAC-SHA256 when a secret is set, sends a null report for tests, records non-2xx answers, and needs an http(s) URL.: `bash -c 'source ~/.rmenv; export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; unset ${!FORGEJO_@} ${!GITHUB_ISSUES_@}; MIX_TEST_PARTITION=_81p mix test test/lamplighter/notifications_test.exs'` - fails on the base (9e21ee0): exit 1 - passes on the branch (2965097): exit 0 ## Checks - I read the diff (the new Webhook channel, its registration, and the now-public Api.report_json). I ran the full suite on the branch: 1254 tests pass. The signature is a lowercase-hex HMAC-SHA256 of the raw body, sent only when a secret is set. Non-2xx answers and network errors come back as error strings, and retry is off. Not tried: a real receiver, and redirects or very large report bodies. (Prover): `bash -c 'source ~/.rmenv; export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; unset ${!FORGEJO_@} ${!GITHUB_ISSUES_@}; cd ~/work/lamplighter-v1-4/wt-81 && MIX_TEST_PARTITION=_81r mix test test/lamplighter/notifications_test.exs'`, exit 0 ## Shipping it - Goes live when it merges: no. Merging to main deploys nothing; release images are built only when Jeremy runs mise run release and tags a version. - Undo: a revert puts it back. - Not tried on the real thing: A real receiver such as Fortysix; tested against a local Python receiver and Req.Test stubs. - For later: One try per notification with no retries, like the other channels. The payload's top-level url is the dashboard link the other channels use; report.url is the report's own page. ## Prover Passed (Sonnet): I read the diff (the new Webhook channel, its registration, and the now-public Api.report_json). I ran the full suite on the branch: 1254 tests pass. The signature is a lowercase-hex HMAC-SHA256 of the raw body, sent only when a secret is set. Non-2xx answers and network errors come back as error strings, and retry is off. Not tried: a real receiver, and redirects or very large report bodies. Every command above was run by Fortysix's Basecamp itself, on the branch named.
jfro added this to the v1.4 milestone 2026-11-28 16:23:10 +00:00
feat(notifications): a webhook channel, for agents and automations (#81)
All checks were successful
CI / test (pull_request) Successful in 1m15s
2965097cf7
POSTs each notification as JSON to a URL: the event, the message, and
the report as the API gives it with its page and API links, so another
system (like an AI agent) can act on it. An optional signing secret
adds X-Lamplighter-Signature, the HMAC-SHA256 of the body. Any 2xx
counts as delivered. Set it up in Settings → Notifications or with
WEBHOOK_URL and WEBHOOK_SECRET; the channel picker is two columns now
that there are four.

Closes #81
Author
Owner

Settings → Notifications with the Webhook channel; Send a test went to a local receiver that checked the signature (dev):

desktop-webhook.png

desktop-webhook.png

desktop-webhook-sent.png

desktop-webhook-sent.png

390-webhook.png

390-webhook.png

Settings → Notifications with the Webhook channel; Send a test went to a local receiver that checked the signature (dev): **desktop-webhook.png** ![desktop-webhook.png](https://git.knope.dev/attachments/7000f902-945e-404c-932e-88f7a81def79) **desktop-webhook-sent.png** ![desktop-webhook-sent.png](https://git.knope.dev/attachments/4a435d00-9cd7-4ca4-ab5e-25aedd31ff0e) **390-webhook.png** ![390-webhook.png](https://git.knope.dev/attachments/f3052cf6-c5a2-4c38-81b3-c3e5b7222f9d)
jfro merged commit 3dab5eeb50 into main 2026-11-28 16:35:46 +00:00
jfro deleted branch feat/81-webhook 2026-11-28 16:35:46 +00:00
Sign in to join this conversation.
No description provided.