Phase 0: scaffold, dbconn layer, PG 14-18 harness, governance - #3
Conversation
Kong CLI stubs, pgx pool with bounded session timeouts, retry classification, targeted blocker termination, testcontainers harness, plus TCB.md/AGENTS.md so agents know the trusted-core boundary from the first commit.
… in AGENTS.md Mirror spirit's TLS model: embed the AWS RDS global CA bundle, detect *.rds.amazonaws.com endpoints (anchored against subdomain spoofing), default them to verify-full with no plaintext fallback, and honor an explicit sslmode while injecting the RDS roots when verification is requested without a bundle.
…hestrator integration; rename TCB.md to SAFETY.md Ten engine-facing docs move in from the research corpus (design, principles, invariants, TCB model, DDL/version/change-capture references) with descriptive filenames, rewritten cross-links, and a sanitization pass — no company-internal references. The broader research set stays internal. architecture.md is the one-screen codebase map; schemabot-integration.md is the single home for the orchestrator story (everywhere else says "the orchestrator" and points there); SAFETY.md is the generic contributor-facing name for the critical-core partition.
…ecision 5) It already does the hard parts of the declarative front-end (server-canonicalized desired state via a temp database, dependency-ordered plans, hazard annotations, plan validation) and declares shadow-table rewrites out of scope — exactly where our copy-and-swap starts. Recorded as an open decision: wrap it behind the SchemaDiff seam vs build on pg_query_go; adopt its hazard taxonomy and plan-validation idea either way.
Kong-embedded DBFlags (URL/CA/timeouts, env-backed) give every database command the same bounded session defaults; fmt stays offline. Grammar construction is pinned by a test so a bad tag fails in CI, not at first use.
Pool sizing/lifecycle (min/max conns, lifetime+jitter, idle, healthcheck), bounded connect timeout, QueryExecMode for transaction-pooling proxies, statement tracing via tracelog->slog, and a BeforeConnect hook as the RDS IAM-token seam — zero values keep pgx defaults (decisions, not options). Pool config construction is now a pure function so every option's wiring is unit-tested without a server.
Anything not native-safe is refused with a structured verdict (SchemaBot sees ExecutionModeBlocked), never delegated to an external tool. pg-osc stays as studied reference material only; in-house copy-and-swap arrives in Phases 4-7.
Prepares the repo for publication under block/pg-sprite (OSPO prototype path). README carries a prominent not-ready-for-any-use warning; external contributions are explicitly not accepted yet. Community-standard files (CoC, security, governance) inherit from block/.github org defaults.
Reconciles local OSS scaffolding with the generated Block template: keep seeded LICENSE (Block, Inc. copyright) and renovate.json verbatim; clean placeholder cruft from CODEOWNERS and the issue-template config; add Code of Conduct; move CONTRIBUTING to repo root.
Reconciles the generated Block OSS template (LICENSE, CODEOWNERS, GOVERNANCE, issue templates, renovate) with the pg-sprite Phase 0 codebase and design docs. Template placeholders cleaned up; Block, Inc. LICENSE copyright kept verbatim from the seeded repo.
0dcf1c5 to
d68151a
Compare
The action's default binary is built with an older Go than the module targets and cannot load the v2 config; SHA-pinning also satisfies the semgrep and zizmor unpinned-action checks.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Review requested by Armand and performed by his agent — same two lenses used across this stack (#4, #5, #6): pg-sprite as an OSS-first, best-in-class Postgres DDL tool, and pg-sprite as a clean integration target for an orchestrator. Reviewed at head
OSS lens
Integration lens
Verified solidThe version matrix as a gate rather than documentation (PG 14–18, This review was generated by Claude Code (claude-fable-5). |
|
🤖 Adversarial correctness review requested by Armand and performed by his agent — separate from the two-lens pass. Method: attack the code, then verify every candidate finding against a real PostgreSQL / the real config path at head Findings, most severe first1. An RDS hostname with any uppercase letter silently loses TLS verification and gains a plaintext fallback. One capitalized letter turns verify-full-with-the-embedded-RDS-roots into encrypt-without-verifying plus a cleartext fallback — a MITM-able connection to a production database, with no warning anywhere. The same miss happens for the fully-qualified trailing-dot form ( Related, and deliberate but worth a second look: 2. The first backend was terminated; the caller was told the operation failed and learned nothing about it. For a cutover escape hatch, "I killed some of your connections but I'm reporting an error" is the worst possible report — an operator retries, or assumes nothing happened. Fix: collect the pid list first, terminate one at a time (or use a 3. The classification set is right; the missing piece is the contract. Nothing in Probed and heldI expected Reproduction testsFinding 1 —
|
Summary
Phase 0 foundations for pg-sprite: the repo scaffold, the connection layer, the design-doc baseline, and OSS governance. First PR of the foundation stack (see the stack overview in the top PR).
What
migrate/diff/fmt/lint/statuscommand tree with shared DB flags.pkg/dbconn: pgx/v5 pool behind aConfigseam — boundedlock_timeout/statement_timeouton every session, retries, RDS/Aurora auto-TLS via an embedded global CA bundle.internal/testutil).SAFETY.md), TCB model, orchestrator-integration seam.Why
Everything later (planner, executors) builds on a connection layer with bounded sessions and a safety-partitioned repo layout; landing it separately keeps each subsequent phase PR reviewable on its own terms.