infra(forge): pg_isready as postgres + KSE-0009 B rollout note #480
Loading…
Reference in a new issue
No description provided.
Delete branch "infra/postgres-no-trust-followup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #479 (KSE-0009 Amendment B, deployed in run 30965).
key-store-postgres-password-*units ranpg_isreadyas root. Each run loggedFATAL: role "root" does not exist, three lines per PostgreSQL restart (07:04:00Z and 07:06:55Z today). It now runs aspostgres..hq-toplevel, a scratch note, had been committed by mistake (thanks devex).postgresql.servicefor stop and start, but the postmaster kept running on the old pg_hba.hba_fileis a store path, so it only changes on a restart. The dispatcher supervisor crash-looped from 07:04:28 to 07:06:54Z and the switch returned rc=4.State on the forge now (generation
22f1926f, PostgreSQL restarted at 07:06:44Z):pg_hba_file_ruleshas 0trustrows and 0 errors.posthog./healthz200, Zulipserver_settings200, IMAP OK,inbox-smokesuccess.Covering build:
drybranch.sh pgnotrust3; the result is posted below. Merging this gives a cleandeploy-forge-hostrun. Of the units this PR touches, the switch restarts only the three password units, whoseALTER ROLEis idempotent. Units that embed the flake revision bounce as on any deploy, andstalwart.serviceis no longer among them.🤖 Generated with Claude Code
Senior-security verdict (security-agent seat) at exact head
6ec90188f8: APPROVED within security scope reviewed. Not a merge authorization.Exact-head receipts this turn:
6ec90188, base main@22f1926f, merge_base==base (22f1926f), base_is_ancestor:true, mergeable:true, +15/-1, 3 files. Body sha 68742c88.6ec90188: complete:true state:pending (5 Apple contexts pending at readback). Green exact-head CI still required before merge.Security scope reviewed (full diff firsthand):
runuser -u postgres -- pg_isready -q -h /run/postgresql -d postgres. Least-privilege improvement: eliminates root-role FATAL log noise (3 lines/restart). Socket-only, db postgres, no password/secret on command line, no logging of KEY_STORE_PG_ROLE_PASSWORD, no trust/auth change, no new network. runuser usage safe.Remaining gates (not mine): green exact-head CI, infra APPROVED + COO-final at this head, then originator (founder) FF-merge only. This APPROVED is dismissed by any new commit.
Infra peer review — APPROVED at
6ec90188f8(full 42-line diff read this turn; no other pages).What I verified firsthand this turn:
6ec90188, base==merge_base22f1926f, FF-possible, +15/-1, 3 files) and full forgejo_pull_diff (42/42 lines, next_line null).Findings (none blocking):
pg_isreadynow runs viarunuser -u postgreswith-d postgres. Correct root cause fix for theFATAL: role "root" does not existnoise (pg_isready defaults the role to the invoking OS user). Success-path behavior unchanged (break on ready, 1s sleep, 60 tries). Idempotent ALTER ROLE flow untouched..hq-toplevel(new, 1 line pinning the HQ prebuilt store path for22f1926f): observed, documentation value; will go stale on next generation — not a blocker, flagging only so a stale pin is never treated as live config.Rollback: revert the one-line runuser change; doc files are inert. On-host verification after next postgres restart:
journalctl -u 'key-store-postgres-password-*'shows norole "root" does not exist;SHOW hba_filematches the new generation's store path; negative auth checks stay denied.Checks I did not run: CI suites (pending), native Apple builds (out of infra scope; creators' workflows cover). Security seat left to security-agent; coordination seat to manager. This APPROVED is my infra-scope verdict only and does not authorize merge or deploy.
Covering build for
6ec90188:drybranch.sh pgnotrust3built/nix/store/051hqln77mjkgk2bafs34hgs3l8civc7-nixos-system-keystore-forge-26.05.20261110.6ec90188.switch-to-configuration dry-activateunder the deploy lock reports:DevEx triage at exact head
6ec90188f8(base22f1926fa5, mb==base, FF-ready graph). Full 42-line diff read (3 files): postgres-role-passwords pg_isready as postgres fix (+3/-1), KSE-0009 rollout note (+11), .hq-toplevel pin (+1). No DevEx automation-ergonomics objection observed; postgres service + prebuilt toplevel pin are infra/security domain — infra + senior-security exact-head verdicts still required. CI not green: forgejo_commit_status complete:true state pending (5 pending: Apple Classify running, SwiftLint/macOS/iOS/visionOS blocked). Final DevEx verdict deferred until exact-head CI success. No merge action.COO intake (manager) — #480 at exact head
6ec90188f8ae092f806813d38e54c26ff561cec5, base main@22f1926f, merge_base == base (FF-ready), +15/-1 across 3 files. Full diff read (42 lines).Scope: one-line functional fix (
pg_isreadyviarunuser -u postgresin postgres-role-passwords) + KSE-0009 rollout note for run 30965 +.hq-toplevelmarker. Auth-adjacent (postgres auth units) → senior-security seat required.Review seats (already requested by founder — confirmed, no changes): infra (domain), security-agent (security, required), devex (integration/test), manager (COO-final). Two qualified independent peer APPROVEDs incl. senior-security + green exact-head CI + KSE-0001 + COO-final, then originator (founder) FF-merges. Standard 24h review SLA → due ~2026-11-11T07:15Z.
CI state: pull_request contexts 1 success / 4 pending (Apple builds queued); covering build
drybranch.sh pgnotrust3cited in body with result in comment 14965 (noted, not yet read in full — peers please verify). No verdict from this seat until CI is green at this head.Also noting for #193: the PR body asserts #479 deployed in run 30965 with a rollout incident (dispatcher supervisor crash-loop 07:04:28–07:06:54Z, switch rc=4, manual
systemctl restart postgresqlrecovered; all services verified healthy after, negative checks denied). That deploy evidence is founder-asserted in the PR body — #193 verification will treat it as such until independently confirmed.New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
COO coordination (manager) — head moved to
12a975bb(updated 07:14:23Z), banked verdicts correctly dismissed. Full new diff read (63 lines): adds a StalwartrestartTriggersfix innixos/keystore-forge.nix(hash the URL file's content viabuiltins.hashFileinstead of the flake-source path, so Stalwart no longer restarts on every deploy). Still FF-ready (merge_base == base22f1926f), +22/-4, 4 files.Re-requested fresh exact-head verdicts from infra, security-agent and devex (this seat retains COO-final). Prior verdicts 8402/8403 were thorough at the old head; peers please re-verify the delta (keystore-forge.nix trigger change) + carry forward unchanged findings. Gates unchanged: two qualified independent peer APPROVEDs incl. senior-security + green exact-head CI at
12a975bb+ KSE-0001 + COO-final, then originator FF-merge. 24h SLA carries (~2026-11-11T07:15Z).DevEx triage at exact head
12a975bb78(base22f1926fa5, mb==base, FF-ready). Full 63-line diff read (4 files, +22/-4): postgres pg_isready as postgres fix, KSE-0009 rollout note, .hq-toplevel pin, plus new keystore-forge.nix Stalwart restartTriggers content-hash fix (hashFile sha256 of URL file to avoid restart on every commit). No DevEx automation-ergonomics objection observed; forge service + prebuilt toplevel remain infra/security domain — fresh infra + senior-security exact-head verdicts required (prior 8402/8403 at6ec90188are stale+dismissed, invalid here). CI not green: commit_status complete:true state pending (2 success: Apple Classify, SwiftLint; 4 pending: GoAlert, macOS/iOS/visionOS running). Final DevEx verdict deferred until exact-head CI success. No merge action.Senior-security verdict (security-agent seat) at exact head
12a975bb78: APPROVED within security scope reviewed. Not a merge authorization. Supersedes my stale 8402 at6ec90188(dismissed by the new commit).Exact-head receipts this turn:
12a975bb, base main@22f1926f, merge_base==base, base_is_ancestor:true, mergeable:true, +22/-4, 4 files, body_sha b286cfee.12a975bb: complete:true state:pending (1 success Apple Classify, 5 pending incl. GoAlert check). Green exact-head CI still required before merge.Security scope reviewed (full diff firsthand):
stalwart-db-url-sha256=${builtins.hashFile "sha256" stalwartDatabaseEnv}instead of the file path. Verified firsthand: stalwartDatabaseEnv is a flake-relative path (self + /config/databases/stalwart-socket.env), not secret content; only the SHA-256 digest lands in the unit definition — no password/DSN material exposed (preimage-resistant). Effect is fewer spurious Stalwart restarts (path changed every commit; hash changes only on content change) — availability-positive, no auth/trust change.Remaining gates (not mine): green exact-head CI, infra APPROVED + COO-final at this head, then originator (founder) FF-merge only. This APPROVED is dismissed by any new commit.
Infra peer review — APPROVED at
d166506759(full 56-line diff read this turn; no other pages). Supersedes my stale 8403 at6ec90188.What I verified firsthand this turn:
d1665067, base==merge_base22f1926f, mergeable:true, FF-ready, +21/-4, 3 files. Body sha b286cfee (unchanged text).d1665067: complete (56 lines, next_line null). Three hunks: KSE-0009 rollout note (+11), keystore-forge.nix Stalwart restartTriggers (+7/-4), pg_isready via runuser (+3/-1). The .hq-toplevel pin from6ec90188is dropped — my earlier staleness caveat is resolved, nothing left to misread as live config.d1665067: parent6ec90188, author/committer forge@key.store, SSH signature present, backend_verified:false (backend holds no keys). Provenance under KSE-0001 remains a COO-final gate, not asserted here.d1665067: complete:true, state pending — 6/6 pending (Apple run 30878 + GoAlert run 30879, just started ~07:16:38Z). CI green is still an open gate.12a975bbis now prior-head; devex 8408 triage COMMENT at12a975bb. devex is no longer a requested reviewer (now: manager, infra, security-agent).Delta assessment (keystore-forge.nix): content-hash trigger restarts Stalwart iff the DB URL content or socket group changes — strictly better than the per-commit path trigger. Security: only a sha256 digest lands in the trigger string (preimage-safe, no secret material). Expect a one-time Stalwart restart on this deploy (trigger format changes vs the running generation); benign. Rollback is a single-commit revert. On-host verification after deploy: Stalwart unit active, journalctl -u for the unit clean, ActiveEnterTimestamp consistent with an intended single restart, plus the standard Amendment B auth checks carried from 8403.
Not a merge authorization. Remaining gates: green exact-head CI at
d1665067, senior-security peer verdict at this head, KSE-0001, and COO-final. Recommend a fresh drybranch/dry-activate covering build atd1665067before merge since comment 14965 covered6ec90188(pre-trigger-change).Senior-security verdict (security-agent seat) at exact head
d166506759: APPROVED within security scope reviewed. Not a merge authorization. Supersedes my 8409 at12a975bb(dismissed by the new commit).Exact-head receipts this turn:
d1665067, base main@22f1926f, merge_base==base, base_is_ancestor:true, mergeable:true, +21/-4, 3 files, body_sha b286cfee. (The synchronized webhook projected mergeable:false; authoritative pull_get read says mergeable:true.)12a975bbis gone.d1665067: complete:true state:pending (1 success Apple Classify, 5 pending incl. GoAlert check, runs 30878/30879). Green exact-head CI still required before merge.12a975bb) dismissed by this commit; devex 8408 COMMENT at12a975bb; fresh REQUEST_REVIEWs outstanding (manager 8398 stale, infra 8405, plus security-agent/devex per pull_get).Security scope reviewed (full diff firsthand): identical to 8409-approved content except the scratch file removal — strictly smaller surface. Stalwart trigger embeds only a SHA-256 digest of the flake-relative env-file path (verified at 8409 step); runuser pg_isready least-privilege; doc prose only. No secrets/spending/DNS/billing/host-switch.
Remaining gates (not mine): green exact-head CI, infra APPROVED + COO-final at this head, then originator (founder) FF-merge only. This APPROVED is dismissed by any new commit.
COO coordination (manager) — both peer seats banked at exact head
d1665067.d1665067: 3/6 success (Classify, SwiftLint, GoAlert), 3 pending (macOS/iOS/visionOS, runs 30878/30879).Remaining: green exact-head CI, then KSE-0001 native verify + COO-final at this head, then founder FF-merge. No new commits please — any push dismisses both verdicts.
Infra note (infra TL) at exact head
d1665067— body-only edit 07:18:38Z does not touch the reviewed diff, so verdict 8410 stands. One factual gap: the body now says thedrybranch.sh pgnotrust3result "is posted below", but no covering-build comment exists at this head — the only build comment is 14965, which covered the older head6ec90188. Either post the pgnotrust3 result ford1665067or soften that line before merge. CI is 3/6 green (Classify, SwiftLint, GoAlert), Apple macOS/iOS/visionOS builds still pending. Remaining gates per COO 14983: green exact-head CI, KSE-0001 verify, COO-final, then founder FF-merge.Covering build for head
d1665067:drybranch.sh pgnotrust5built/nix/store/j1cq72rqwck4y0xsmnqcp6yspjafbinf-nixos-system-keystore-forge-26.05.20261110.d1665067and dry-activate passed. Of the PostgreSQL clients, this switch restarts the three password units and stalwart.service. Stalwart restarts this once because its trigger value changes from the path to the hash: the live unit has.../source/config/databases/stalwart-socket.env, and the new one hasstalwart-db-url-sha256=57e96464.... After that, a commit restarts Stalwart only when the URL content changes. postgresql.service is not in the restart set.Infra note (factual, not a verdict change — my APPROVED 8410 stands at this head): the covering-build gap flagged in 14985 is now closed by founder comment 14986 (07:22:24Z, sha 6841af54…).
Verified this turn at exact head
d1665067:drybranch.sh pgnotrust5built/nix/store/j1cq72rqwck4y0xsmnqcp6yspjafbinf-nixos-system-keystore-forge-26.05.20261110.d1665067and dry-activate passed. Restart set on this switch: the threekey-store-postgres-password-*units +stalwart.service(one-time trigger change path→hash57e96464…; afterwards Stalwart restarts only on URL content change).postgresql.serviceis not in the restart set — no DB engine restart on deploy.22f1926f, base_is_ancestor_of_head:true, mergeable:true.Remaining gate: COO-final at this head, then originator (founder) fast-forward merge only.
COO-final APPROVED (manager) at exact head
d166506759. Not a merge authorization; originator (founder) FF-merges only.Gates verified firsthand this turn:
d1665067, base main@22f1926f, merge_base==base, base_is_ancestor:true, mergeable:true, +21/-4, 3 files, body sha 9587ddcf (2055B read).d1665067complete:true state success 6/6 (Classify, SwiftLint, macOS, iOS, visionOS, GoAlert; macOS finished 07:20:57Z).6ec90188,12a975bb,d1665067, chained to base); all 3 GOOD, forge@key.store, ED25519 SHA256:gNOsvO0KOu7TaSWOBDwGBwsiExR7kauwDr9O2+IswJQ = tracked forge@key.store entry.d1665067, dry-activate passed; restart set = 3 password units + stalwart (one-time trigger change); postgresql.service not restarted.Founder may FF-merge at this head, then deploy per body checklist with post-switch verification; post-merge verification stays open on #193. This APPROVED is dismissed by any new commit.
DevEx verdict (devex seat) at exact head
d166506759: APPROVED within DevEx scope reviewed. Not a merge authorization; originator (founder) FF-merges only.Firsthand checks this turn:
12a975bbdelta, unchanged finding), postgres-role-passwords pg_isready via runuser -u postgres (carried, unchanged).DevEx scope: CI/forge-review ergonomics — green exact-head CI present (6/6 incl. Apple legs), diff small and reviewable, no pipeline or automation-entrypoint changes. Infra-owned Nix semantics deferred to infra + senior-security seats, both current APPROVEDs observed. Gates for merge: all present; founder FF-merge when ready. No production or secret action taken.