Skip to content

feat(#16): bounded final HA acceptance - #27

Merged
rblake2320 merged 17 commits into
masterfrom
feat/16-final-ha-acceptance
Jul 19, 2026
Merged

feat(#16): bounded final HA acceptance#27
rblake2320 merged 17 commits into
masterfrom
feat/16-final-ha-acceptance

Conversation

@rblake2320

@rblake2320 rblake2320 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Scope

Bounded BPC HA mechanism slice: signed external cutover witness, source pre-commit fencing, three-member durable Redis quorum, signed snapshot import, authenticated tail replay, promotion readiness/activation, and a database-enforced least-privilege mutation boundary.

Executable evidence

  • Three independently initialized PostgreSQL authorities (A, B, control) and three distinct Redis server identities with AOF + appendfsync always.
  • Publisher SIGKILL/restart and lost-ACK reconciliation with measured data-loss RPO 0.
  • In-flight DML loses Redis quorum and is rolled back by the real pre-commit fence.
  • Fresh B snapshot at C, authenticated C+1..N tail, exact applied-history/state verification, promoted B origin at N+1.
  • Signed Redis/readiness/activation evidence binds PostgreSQL lineage and fresh node identity; production custody is non-exportable TPM/HSM.
  • Full pinned bpc_ha catalog/version attestation, transactor-bound readiness, distinct guard/snapshot SPKI custody.
  • Exact runtime credentials on A and B have no direct pair/pending/outbox/evidence DML, ticket-key read, or schema-create authority.
  • One authenticated SECURITY DEFINER append function verifies a single-use DB-clocked transaction/lease/payload/policy-bound ticket before locking, then locks/rechecks/admission-checks/inserts/advances without a caller-controlled lock gap.
  • Every governed append creates a local-mutation proof. A deferred database constraint aborts commit unless the exact outbox tuple's governed local source mutation completes that proof. The append-only authenticated regression reaches COMMIT, is rejected, and authoritative reconciliation proves no checkpoint/outbox/pair state committed.
  • maxPendingRows is bound into the canonical policy, ticket HMAC, and DB recomputation. A valid committed ticket reused with a raised limit fails closed.
  • Approval and rotation are single database-controlled composite actions. Approval locks and exact-compares current pending state, then deletes+inserts atomically. Rotation locks and exact-compares every current-old field, then rotates+inserts atomically. Direct authenticated lower-level mismatched-live-state attempts fail and roll back outbox+DML.
  • Runtime posture rejects effective INSERT/UPDATE/DELETE/TRUNCATE/TRIGGER across pair, pending, all public outbox/evidence, and all bpc_ha authority tables, plus ticket-key access, object replacement, and controlled-function owner/ACL drift.
  • One Redis unavailable remains readable; two unavailable fail closed; majority rollback is rejected against the control witness.

Local exact-head verification at d007e75: workspace tests green (@bpc/server 340/340), package boundary 3/3, and real frozen A/B/control PostgreSQL + three-Redis acceptance green.

Boundary

Draft pending frozen independent review and exact-head hosted CI. Production ticket signing requires a non-exportable HSM/TPM policy key and a closed signer policy that validates every sealed field, current external authority, and independently governed admission/approval-capacity limits. The drill signer is test-only and not exported. Stolen runtime DB credentials are inside the tested database boundary; signer policy/key compromise is a distinct revocation-and-recovery event. No universal-uptime, government-authorization, or certification claim. Issue #16 remains open pending reviewed merge disposition.

Add signed external cutover evidence, durable Redis quorum fencing, fresh snapshot import, promotion readiness binding, and executable crash/partition/rollback drills. Issue #16 remains open pending independent review and hosted evidence.
Govern Redis genesis in PostgreSQL, bind signed fence and readiness evidence to the actual PostgreSQL system identity, require an independent snapshot signer, revalidate FENCED retries, and prove an in-flight mutation fails closed when quorum disappears.
Handle cloned-authority rejection inside the assertion, compare actual public-key fingerprints across guard and snapshot custody, and retain exact governed genesis and promotion bindings.
Expose the enforced transactor deadline, bind it into the signed cutover history, require the source fence binding to match the exact transactor, and remove caller-selected drain arithmetic from the controller.
Pin the full bpc_ha catalog, mint transactor-bound readiness capabilities, re-attest before opening HA authorities, and bind the signed cutover drain window to the exact source transactor deadline.
Bind a node credential key into the signed Redis authority and require a fresh Ed25519 proof on every authoritative transaction. Production custody is explicitly TPM/HSM-backed; software keys remain test-only evidence.
Sign and persist the enforced transaction duration in the source lease chain, prohibit within-epoch changes, require the live source binding to match, and reject cutover fencing when its signed drain window differs.
Require signed single-use admission before authoritative outbox locks, bind signer policy to canonical mutation and DML context, and close checkpoint/fence privilege-drift coverage. Keep signer custody as an explicit external policy boundary.
Make authenticated outbox admission and insertion one atomic database function, verify canonical mutation-to-DML identity and opDigest policy, and fail closed on DML drift across every governed outbox/evidence table.
Sanitize every mutation, recompute its digest, open sealed state, compare complete DML payloads, and reject effective DML or TRUNCATE authority across all governed public and bpc_ha tables.
@rblake2320
rblake2320 marked this pull request as ready for review July 19, 2026 16:37
@rblake2320
rblake2320 merged commit aedf67b into master Jul 19, 2026
4 checks passed
@rblake2320
rblake2320 deleted the feat/16-final-ha-acceptance branch July 19, 2026 16:37
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