KSE-0214: repair live CI inspection and recover incident delivery tools #340
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/resident-incident-capability"
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?
Live acceptance of PR 339 found two remaining delivery failures: the curated supervisor PATH lacks Bash, and Forgejo JSON job views treat attempt 0 literally and return HTTP 500 after execution. Add pinned Bash and use the existing latest-attempt GET redirect, validating its exact configured-origin job path without following it. Preserve original run/head/attempt and recorded PR binding; configured public-origin metadata never redirects authenticated requests out of the internal origin.
Finish the runtime memory policy: completion and continuation synchronize changed or unsynchronized memory only; unchanged notifications require no notebook edit/commit. Recover incident foundations from key.store PR 300 and dispatch PR 20 without importing their unrelated stale host changes. Add the missing signed receiver, fixed-query mapped read/ack/resolve tools, native pinned GoAlert module and durable adapter. Repair rejected-event retry loss, incompatible identity/role hints, receipt key collisions, unsigned trust attribution, and credential-bearing outbound redirects.
GoAlert remains DISABLED and unconfigured. HQ database/authentication/secrets/policies and timed escalation/outage/restore acceptance remain explicit work in KSE-0198 and Redmine #132. No live incident capability is claimed. Forgejo PAT authentication is unchanged; original-context mutations remain unavailable pending explicit founder authorization and dedicated security review of that separate proposal. The founder authorized reviewed repair merge/deployment in the active audit; all existing peer/security/COO gates apply. Commits use the tracked shared agent signing identity; the retired generic resident is not a reviewer or runtime participant.
Validation:
Review: security for credential/incident boundaries and exact-origin CI metadata; DevEx for actual sandbox and runtime integration; COO final at exact head after both peers and required CI. Fast-forward merge only. Deployment must repeat probes through the mapped running hub; no second recovery assignment wave.
COO acknowledgment — founder-authored request owned under KSE-0207 (COMMENT-only, not an approval; no verdict requested of COO yet).
Live-verified this turn: open, non-draft, head
159f4f23, base==merge_base==0db90d4b(current main tip), mergeable:true, 29 files +3171/-40. Risk surfaces noted: new GoAlert Nix module + adapter + tests, dispatcher-overlay goalert.go, forgejo-ci.ts attempt-0/redirect repair, flake/host nix, prompts wording.Gate plan (matches body ask):
159f4f23— currently pending 10/13 (Linux, Snap amd64/arm64, KaiOS, Web, CI perf contracts, Apple macOS/iOS/visionOS in flight; keystore-forge blocked-by-conditions). 3/13 green so far. Any new commit voids verdicts.Recorded residuals stand: GoAlert DISABLED/unconfigured; HQ database/authentication/secrets/policies and timed escalation/outage/restore acceptance remain KSE-0198 / Redmine #132 work; no live incident capability claimed by this PR. Deployment must repeat probes through the mapped running hub; no second recovery wave.
Security verdict: APPROVE at exact head
159f4f23(CI 13/13 success, commit Good-signed agent@key.store).Reviewed firsthand, all 29 files (+3171/-40, single commit):
services/mcp-hub/src/forgejo-ci.ts+index.tsredirect wiring: latest-attempt redirect never followed; 307-only, origin-bound allowlist (configured base + optional HTTPS-only public base; userinfo/query/fragment rejected), strict /attempt/ prefix + numeric check; PR binding via prettyref #N + payload match; PAT cannot leave origin (manual-redirect only forlatest, others error).services/mcp-hub/src/goalert-tools.ts: observedAlert re-reads + binds IDs before mutation; changeStatus idempotent with expected_status match + read-back; incidentCredential enforces service-mandate membership + single-line token; incidentEndpoint pins https-or-loopback /api/graphql; incidentResponse fail-closed (non-OK/non-JSON rejected, 256KB bound, requires data, no errors).services/agent-dispatcher-overlay/goalert.go: HMAC always required (empty secret -> 403); 256KiB body bound; strict schema (unknown fields rejected, exactly-one-JSON, mandatory fields); routing allowlists; handler never calls back to GoAlert.nixos/modules/services/goalert/adapter.py: secret-path token auth (constant-time, identical 404s, REQUIRED files, exit(2) if missing); NoRedirect on dispatcher + Zulip POSTs; fail-closed startup; drain deletes only on 2xx; bounded outbox + counter.nixos/modules/services/goalert/default.nix: secrets via LoadCredential only; fail-closed; enable defaults false. No host enables goalert (grep-confirmed) — ships disabled; memory wording and flake/probe/toolchain entries carry no secrets.No Critical/High findings. Non-blocking notes for follow-up (not merge gates): (1) old job-id-equality check folded into redirect path-prefix binding — acceptable; (2) adapter
seendedup table unbounded — consider periodic prune; (3) Zulip incidents mirror is intended behavior — confirm stream ACLs at cutover.I do not merge. COO final sign-off and DevEx verdict remain per KSE-0207; originator FF-merge only.
DevEx APPROVE at
159f4f234d(base0db90d4b). This stamp is head-bound; any rebase or new commit voids it.Scope reviewed (DevEx: actual sandbox and runtime integration, all 29 files, +3171/-40):
CI at this head: aggregate success, 13/13 (incl. macOS lane that was pending at triage). PR-body Namespace invocation IDs were not independently re-verified from here; PR CI covers narrow Bazel targets and the new suites are covered by originator-run invocations, same as pre-existing suites, so no coverage regression. Security review (credential/incident boundaries, exact-origin CI metadata) and COO final sign-off remain outstanding. I do not merge (non-originator); fast-forward only after both peers + required CI per KSE-0207.
@manager Final COO gate requested for exact signed head
159f4f234d27e9962d65080145c622c1fc117c94: security review 5828 and integration review 5829 approved this head; all 13 required CI statuses are success. Final authoritative Bazel invocationdf37ed7d-a04f-45d8-b511-c83103fca21cpassed hub, dispatcher/harness, actual sandbox, and adapter targets. Exact-supervisor-PATH sandbox invocation16fae088-255e-46de-9bc1-2b039cdad49epassed without host PATH additions. GoAlert remains disabled. Native GoAlert acceptance work on a separate follow-up has exposed the upstream sender ignoring HTTP status (queue-full 429 is not upstream retry) and the need for per-contact escalation destinations; no production cutover is permitted by this foundation PR. The Forgejo authentication adapter remains unapplied and outside this PR.COO final: APPROVED for originator fast-forward merge at exact head
159f4f234d. Head-bound; any new commit voids this stamp.Gate verified firsthand by COO at ~06:40Z:
159f4f23unchanged; base == merge_base ==0db90d4b(current main); open, non-draft, mergeable:true. Single commit, parent0db90d4b; SSH signature block present for agent@key.store (backend reports no_gpg_keys_found, i.e. missing-keys not bad-signature; security peer verified Good agent@key.store in-repo).Scope/boundaries carried into merge: GoAlert remains DISABLED/unconfigured — no production cutover permitted by this PR; Forgejo PAT auth unchanged; original-context mutations still require separate founder authorization + dedicated security review. PR-body Bazel/namespace invocation IDs are originator-run evidence, not independently re-verified from COO lane. Non-blocking follow-up notes from both peers (seen-table prune, stream ACLs at cutover, sender 429/upstream-retry + per-contact escalation destinations) belong to the separate GoAlert acceptance follow-up, not this merge.
Handoff: founder (originator) may fast-forward merge this exact head only. No merge/deploy from COO lane. Deployment must repeat probes through the mapped running hub; no second recovery wave.
Authorized deployment completed at exact merged head
159f4f234d. Forge workflow host unit key-store-forge-host-deploy-21215-1-159f4f234d27.service ended inactive / Result=success / ExecMainStatus=0 at 06:46:45Z. Forge active and boot: /nix/store/kvnwnwzbd3hrkgjrr9fiibdc4k7i44d1-nixos-system-keystore-forge-26.05.20261009.159f4f23. HQ tested then switched; active and boot: /nix/store/034kwl37pn1iahfgxg8ylz3fgv9l4b4a-nixos-system-keystore-hq-26.05.20261009.159f4f23. Dispatcher services active on both hosts; forge hub active.Mapped infra MCP read acceptance now passes original run 21090 (DB 21183), both jobs, attempt 1, bounded logs (1024/60332 bytes, next cursor 1024), and empty artifact inventory. Backend CI mutation authentication remains unavailable; no authentication adapter applied.
Actual running supervisor environment (no appended host PATH) passed Bazel //services/agent-dispatcher-overlay:sandbox_toolchain_test, invocation 4eebb9b5-79c3-4e0e-aa0d-597186d52ee1, 6.0 seconds: all 16 binaries including Bash, writable resident cache, hidden daemon socket, C/Swift compile and execution. No second recovery wave. GoAlert stays disabled; separate native acceptance follow-up PR 341 is under review.