Skip to content

Phase 0: scaffold, dbconn layer, PG 14-18 harness, governance - #3

Merged
Kiran01bm merged 13 commits into
mainfrom
kiran01bm/p0-foundations
Aug 6, 2026
Merged

Phase 0: scaffold, dbconn layer, PG 14-18 harness, governance#3
Kiran01bm merged 13 commits into
mainfrom
kiran01bm/p0-foundations

Conversation

@Kiran01bm

Copy link
Copy Markdown
Collaborator

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

  • CLI scaffold (Kong): migrate / diff / fmt / lint / status command tree with shared DB flags.
  • pkg/dbconn: pgx/v5 pool behind a Config seam — bounded lock_timeout / statement_timeout on every session, retries, RDS/Aurora auto-TLS via an embedded global CA bundle.
  • PG 14–18 containerized test harness (internal/testutil).
  • Design docs: vision-level docs, safety partition (SAFETY.md), TCB model, orchestrator-integration seam.
  • OSS governance: Apache-2.0 LICENSE, CONTRIBUTING, CODE_OF_CONDUCT, WIP banner, OSPO-seeded templates.

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.

Kiran01bm added 11 commits July 7, 2026 17:03
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.
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
@Kiran01bm
Kiran01bm force-pushed the kiran01bm/p0-foundations branch from 0dcf1c5 to d68151a Compare August 5, 2026 09:10
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.
@Kiran01bm
Kiran01bm marked this pull request as ready for review August 5, 2026 09:35
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Kiran01bm
Kiran01bm merged commit 1f77bac into main Aug 6, 2026
10 checks passed
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.

3 participants