Skip to content

fix: demo-org sign-ins, webhook secrets, check type count, idle memory (batch 2026-10-12) - #540

Merged
fclairamb merged 122 commits into
mainfrom
batch/2026-10-12
Oct 13, 2026
Merged

fclairamb merged 122 commits into
mainfrom
batch/2026-10-12

Conversation

@fclairamb

@fclairamb fclairamb commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

What is on this branch

Five specs, each implemented, audited and archived under specs/done/2026/10/:

  1. fix(auth): the demo org and the SaaS default org never file a sign-in membership request. POST /auth/membership-requests answers 403 ORG_NOT_ACCEPTING_REQUESTS for them.
  2. fix(dash0): first-time visitors are no longer told their session expired. They land on the login page without the banner.
  3. fix(webhooks): new webhook signing secrets are whsec_ + standard padded base64, as Standard Webhooks expects. Existing secrets keep signing identically and are shown in standard form.
  4. feat(checkers): the advertised check type count (43) comes from the registry (ExcludedFromTally), a test fails on doc drift, and GET /check-types gains excludedFromTally.
  5. perf: a fresh instance idles at ~31 MiB RssAnon instead of ~141 MiB (argon2id memory returned to the OS, bcrypt seed admin, browser samples created disabled, host-RAM soft cap on small hosts, fresh-boot membench scenario in the nightly). fix(samples): seed only sample checks that work out of the box #537 on main now seeds only a few working samples on a fresh install, so no browser sample is seeded there; test mode still seeds them disabled.

The branch also implemented the VAPID spec (2026-10-12-03), but #539 landed the same spec on main first. The merge keeps main's version and drops this branch's copy.

After merging main: make build-backend lint-back test is green (250 packages), and dash0 typecheck, 2548 unit tests, typecheck:e2e and lint:e2e are green. The full Playwright suite has not run locally; CI runs it.

Operator actions (not run)

Cancel the stale pending requests on prod (status is canceled, not cancelled):

UPDATE membership_requests SET status = 'canceled'
WHERE status = 'pending' AND organization_uid IN
  (SELECT uid FROM organizations WHERE slug IN ('demo', 'default'));

The check type count spec also needs a follow-up PR in fclairamb/solidping-website (CHECK_TYPE_COUNT, step 9 of the spec).

Decided by autopilot

None. No spec had an open question when it was implemented.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.43916% with 209 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.01%. Comparing base (c3428d3) to head (0fb9072).

Files with missing lines Patch % Lines
...er/internal/jobs/jobtypes/job_incident_reminder.go 73.75% 42 Missing ⚠️
server/internal/handlers/auth/handler.go 52.63% 18 Missing ⚠️
server/internal/handlers/checks/service.go 86.66% 14 Missing ⚠️
server/internal/checkers/checkicmp/burst.go 88.18% 13 Missing ⚠️
server/internal/jobs/jobtypes/job_snooze_sweep.go 47.05% 9 Missing ⚠️
...rnal/checkers/checkhttp/config/headerassertions.go 91.66% 8 Missing ⚠️
server/internal/mcp/tools_merged.go 95.18% 8 Missing ⚠️
server/internal/handlers/incidents/service.go 81.57% 7 Missing ⚠️
server/internal/checkers/checkhttp/checker.go 86.95% 6 Missing ⚠️
server/internal/handlers/auth/service.go 80.76% 5 Missing ⚠️
... and 37 more
Additional details and impacted files
@@            Coverage Diff            @@
##           main     #540       +/-   ##
=========================================
+ Coverage      0   83.01%   +83.01%     
=========================================
  Files         0     1197     +1197     
  Lines         0   123358   +123358     
=========================================
+ Hits          0   102406   +102406     
- Misses        0    20944    +20944     
- Partials      0        8        +8     
Files with missing lines Coverage Δ
server/internal/app/server.go 81.53% <100.00%> (ø)
server/internal/checkers/checkbrowser/samples.go 100.00% <100.00%> (ø)
server/internal/checkers/checkerdef/interface.go 100.00% <ø> (ø)
server/internal/checkers/checkerdef/types.go 96.38% <100.00%> (ø)
server/internal/checkers/checkhttp/alias.go 100.00% <ø> (ø)
server/internal/checkers/checkhttp/capture.go 94.23% <100.00%> (ø)
...nternal/checkers/checkhttp/config/statuspattern.go 100.00% <ø> (ø)
server/internal/checkers/checkhttp/samples.go 100.00% <ø> (ø)
...erver/internal/checkers/checkicmp/config/config.go 87.05% <100.00%> (ø)
...ver/internal/checkers/checkicmp/config/validate.go 95.65% <100.00%> (ø)
... and 119 more

... and 1068 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

fclairamb and others added 5 commits October 12, 2026 07:58
…hip request

Replace suppressDefaultOrgJoinRequest with loginJoinRequestSuppressedReason:
the demo org (any mode, new or returning user) and the SaaS default org
(returning users included) end rule 6 in an org-less session with no
membershipPending notice. newlyCreatedUser and its connector plumbing are
removed (no other reader). POST membership-requests now answers 403
ORG_NOT_ACCEPTING_REQUESTS for those orgs.

One-off SQL for prod (not run). The cancelled status value is 'canceled':
UPDATE membership_requests SET status = 'canceled'
WHERE status = 'pending' AND organization_uid IN
  (SELECT uid FROM organizations WHERE slug IN ('demo', 'default'));

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t orgs

Also documents ORG_NOT_ACCEPTING_REQUESTS and fixes the canceled spelling in the orgs API spec.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@fclairamb
fclairamb marked this pull request as draft October 12, 2026 06:12
fclairamb and others added 5 commits October 12, 2026 08:29
RootRedirect sends a session-less visitor straight to login, and a 401 with no token behind it redirects with session_expired=false.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
New secrets are whsec_ + standard padded base64, the form the official
Standard Webhooks libraries decode. Signing accepts both standard and the
legacy URL-safe unpadded spelling, so existing secrets sign byte for byte
as before. Supplied secrets are validated (24 to 64 bytes) and stored
canonical on create and PATCH; GET and rotate re-encode stored secrets
at read time without rewriting storage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fclairamb fclairamb changed the title fix(auth): demo org and SaaS default org never file a sign-in membership request feat: demo-org sign-ins, webhook secrets, VAPID boot order, check type count, idle memory (batch 2026-10-12) Oct 12, 2026
@fclairamb fclairamb changed the title feat: demo-org sign-ins, webhook secrets, VAPID boot order, check type count, idle memory (batch 2026-10-12) feat: demo-org sign-ins, webhook secrets, check type count, idle memory (batch 2026-10-12) Oct 12, 2026
fclairamb and others added 16 commits October 12, 2026 12:20
…onicalization

An echoed-back stored secret (the dashboard PATCHes the whole settings map
it was shown) is not re-validated against the 24 to 64 byte input range,
so a legacy short secret survives an unrelated save.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ExcludedFromTally marks sleep and private-location; AdvertisedCheckTypeCount
returns 43. GET /api/v1/check-types exposes excludedFromTally. A registry test
fails when README or web/docs state another count and pins the README list.
Docs and wiki counts corrected. The solidping-website PR (CHECK_TYPE_COUNT
constant plus CI script) is separate and not part of this repo's change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… serve an unstored key

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Move the VAPID Postgres tests to embedded ports 15800-15801, which no other
package uses (15700/15701 collided with checkjobsvc and checkworker/backend).
Postgres webpush tests pass with -p 1; dash0 test:unit (2547 passed) and
lint:e2e are green.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…rivations

Each argon2id derivation allocates a 64 MiB block that inflated the GC goal
to ~150 MB and stayed resident for minutes on an idle instance. Once no
derivation is in flight, one debug.FreeOSMemory() is scheduled 1 s later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r samples disabled

The seeded admin's password is public, so its argon2id hash (a 64 MiB
transient on every first boot) bought nothing. It is now bcrypt at the
policy's bcrypt cost; the forced password change mints an argon2id hash.

Samples that drive a browser (browser-example-com, js-browser-login) are
created disabled via CheckSpec.NeedsBrowser: on a native install with
Chromium the JS one launched a Chrome every minute against a site that
cannot pass. They have no check job until the user enables them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Duration.Scan reached a per-call regexp.MustCompile for every check period
scanned on the claim path: ~20% of an idle instance's allocations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… limit is set

With SP_RUNTIME_AUTO_MEMORY_LIMIT on (the default), no cgroup limit, no
config and no GOMEMLIMIT, a Linux host with at most 2 GiB of RAM
(MemTotal from /proc/meminfo) gets MemTotal/2 as GOMEMLIMIT, source
"host". On a 1 GB Pi that is 512 MiB: it only bounds bursts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fclairamb and others added 25 commits October 13, 2026 01:58
RegionInfoFor reads the incident's regions snapshot (falling back to the
triggering result's region), the notification job labels it with the
dashboard's emoji and name, and every sender adds a Failing from / Failed
from line. The webhook payload gains data.incident.regions (slugs).

CHANGELOG.md is owned by release-please.
…region saw the failure, so a regional outage reads like a global one
New incident_reminder job: re-notifies the check's channels every
interval (check reminder_interval_seconds, else org parameter
incidents.reminder_interval_seconds, else off) until the incident is
acknowledged, snoozed or resolved. A compare-and-set on
incidents.reminder_count lets exactly one job send per interval.
Scheduled on open, reopen, unack and unsnooze; canceled on snooze.

Changelog: incidents can now re-notify their channels every 15 min to
24 h while open and unacknowledged (off by default).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Still down after 1 h 15 min, not acknowledged (reminder 3)", with
the ack button where the alert has one. Slack posts it as a thread
reply broadcast to the channel (reply_broadcast). New email template
incident-reminder.html. The webhook adds data.incident.reminderCount
(additive). Twilio and PagerDuty opt out via NotifiesReminders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also adds CheckUpdate.ReminderIntervalSeconds / ClearReminderInterval.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…; canceled on ack and snooze

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Null inherits the org default, 0 is off, otherwise 900..86400 s;
anything else is a 400 VALIDATION_ERROR naming the field. PATCH
distinguishes absent (unchanged) from null (back to inherit). Carried
by clone, export v1/v2, import (absent imports as inherit) and diff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
reminderIntervalSeconds on GET/PATCH org settings: always present (0
when unset), range-checked (0 or 900..86400) before any write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Check form: reminder-interval-select in the incident-tracking section
(Org default (1 h) / Off / 15 min ... 24 h), counted in
incidentCustomized. Org settings: reminder-interval-default-select and
reminder-interval-default-save. Strings in en/fr/de/es.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… once, maybe escalates once, then goes silent until recovery

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- incidents: list parameters match the handler (state, checkUid,
  checkGroupUid, memberCheckUid, kind, since/until, with, limit, cursor)
  and the response shape. Drop the MTTR and MTTA metrics, which do not
  exist.
- check-types: the HTTP body is sent with any method, not only
  POST/PUT/PATCH/QUERY.
- check-types: add a real heading for the authenticated RDP logon
  caveat, and point the JavaScript check link at its slug.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
…e (incidents API, MTTR/MTTA, HTTP body, broken anchor)

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
…andler survives test end (batch gate)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
55432 is inside the kernel's ephemeral range, so an earlier outgoing
connection can take it as a source port and docker compose then fails to
bind it (run 38346124209).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fclairamb added a commit that referenced this pull request Oct 13, 2026
Two new specs in `specs/todos/`.

- **06 ovh-sms-dlr-token-consistency**: OVH sends delivery receipts to
one account-wide callback URL. `NewServer` registers it
(`server.go:516-526`) before the JWT secret and base URL are loaded from
the database, so its token is derived from the default secret, while the
handler (`server.go:2290`) derives it from the real one. Every receipt
gets a 404, on every boot. Confirmed with a throwaway test: tokens
differ with nothing set and with `SP_AUTH_JWT_SECRET` set; they match
only with `SP_SMS_OVH_DLR_TOKEN`. Fix: register at the end of
`InitializeSystemConfig`, one token getter for both sides, no token from
the default secret.
- **07 check-worker-default-docs**: docs say `SP_SERVER_CHECK_WORKER_NB`
defaults to 3, the code says 25 (since 2026-07-03). Worse,
`SP_SERVER_CHECK_WORKER_NB` and `SP_SERVER_JOB_WORKER_NB` have no effect
at all (verified: set to 8 and 4, the server runs 25 and 2), and while
set they also hide the dashboard value. Fix the loading, the docs, and
add drift tests (docs defaults vs code, every system parameter env var
takes effect).
- No longer renames or edits specs 01 and 04: #540 implements them and
moves them to `done/`, so touching their `todos/` copies here would
bring them back.

Specs only, no code change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@fclairamb
fclairamb enabled auto-merge (squash) October 13, 2026 07:06
@fclairamb
fclairamb merged commit 9947d0b into main Oct 13, 2026
26 checks passed
@fclairamb
fclairamb deleted the batch/2026-10-12 branch October 13, 2026 07:25
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