Phase 1: optimistic front door with typed not-native-safe verdicts - #5
Open
Kiran01bm wants to merge 6 commits into
Open
Phase 1: optimistic front door with typed not-native-safe verdicts#5Kiran01bm wants to merge 6 commits into
Kiran01bm wants to merge 6 commits into
Conversation
…ute-and-introspect) The DDL-understanding trade-off is decided: classification parses via wasilibs/go-pgquery (Wasm libpg_query; cgo pg_query_go is the API-compatible escape hatch), shadow-table DDL and checkpoint fingerprints come from execute-and-introspect on an engine-owned scratch database (pg_sprite_scratch pre-provisioned, or CREATEDB to self-provision — verified in preflight), and refusals use both layers. Updates CO-7/ST-2/ST-6, the TCB dependency list, and the low-level design; supersedes the pg_query_go + AST-surgery assumption.
migrate gates statements through go-pgquery (ALTER TABLE only; index maintenance is pointed at CONCURRENTLY), size-guards the table via pg_table_size over the partition tree, attempts the change under SET LOCAL lock/statement budgets, and ends in a structured verdict — executed-natively, or refused with a typed reason and exit code 2. The verdict seam is what Phase 11 maps to ExecutionModeBlocked.
Closes the two behavioral coverage gaps from the Phase 1 coverage review: the status command's live-session output (pid/state/query fields against a held pg-sprite session) and the lock-budget refusal wording, which were previously untested paths.
…flag Establishes the observability posture early: stdout carries only command output, diagnostics go through log/slog to stderr, errors are logged once at the entry point, and credentials are never logged. sloglint/forbidigo enforce the mechanical half; --debug wires the previously unreachable pgx statement tracing in pkg/dbconn plus migrate lifecycle events.
Log text and human-facing prose are no longer a test surface (rule added to AGENTS.md, aligned with SchemaBot's observability guidance). The lock-vs-statement budget distinction was only visible in prose, so the verdict gains a typed machine-readable cause field, and status gains --json so its tests can assert structured session fields.
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
marked this pull request as ready for review
August 5, 2026 09:35
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1 — the optimistic front door. Stacked on
kiran01bm/ci-foundations.What
migrate --alterruns easyALTER TABLEchanges directly under strict lock/statement budgets (pkg/executorbounded optimistic attempt) and refuses everything else with a structured, machine-readable verdict (exit code 2):pkg/verdictwith typed reasons, safer-idiom pointers, and an optionalcausefield.pkg/preflighttable-size guard;statuscommand.wasilibs/go-pgquery, Wasm) + execute-and-introspect on a scratch schema — never AST transformation.log/slog,--debugstatement tracing; CLI tests assert typed outcomes, never wording.Why
A working, safe-by-refusal executing path end to end before any planning intelligence — the thin slice the later phases deepen.