fix: harden the Postgres persistence tier#146
Open
FlyM1ss wants to merge 3 commits into
Open
Conversation
- #135: give the agent twin a lazy-migration path (ALTER ... ADD COLUMN IF NOT EXISTS for the five columns the SQLite store accreted), so a redeploy migrates an existing external_agents table instead of 500ing on the missing column. New @pg_only test recreates the pre-migration table to force the migrate path. - #137: close five @pg_only coverage gaps (claim/reclaim, raw scopes default, last_used_at touch-on-use, listing ORDER BY, widen-path nbytes). Each mutation-verified to fail under its targeted bug. - #138: bump CI Postgres 16 -> 18-alpine to match prod Neon 18.x. Verified on a local postgres:18-alpine: full suite 1113 passed, 5 skipped, 0 failed with the live tier enabled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Keep the local throwaway-DB recipe on the same major version #138 pins CI and prod to, so the tier is exercised against prod's dialect everywhere. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses self-review findings on this PR: - migration test now seeds a real legacy row before re-running _init_schema and asserts the ADD COLUMN NOT NULL DEFAULT backfills agent_type/scopes on it -- the actual prod scenario (a populated pre-migration table, scopes being an authz input), not just an empty table gaining columns - ordering test swaps the fixed 6-item iterator for an unbounded itertools.count clock: a change in create_agent's _utcnow_iso call count now surfaces as a clean assertion failure, not StopIteration - bump the remaining postgres:16-alpine -> 18-alpine references in this workstream's plan/spec docs to match the shipped CI (#138) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Pushed
Verification: full non-pg suite green locally (1095 passed / 23 skipped / 0 failed). The Out of scope, flagging: |
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.
Batch B of the agent-persistence follow-ups — three issues, one tier.
ALTER … ADD COLUMN IF NOT EXISTSfor the 5 folded columns). Without it, a future column added only toCREATE TABLEno-ops on prod's existing table →UndefinedColumn500s the whole agent surface while/healthstays green. New@pg_onlytest recreates the pre-migration table to force the migrate path (RED before the fix, GREEN after). Scoped to the agent twin deliberately: it's the only twin with a folded migration history; version/strategy shipped complete and keep their documented convention.@pg_onlycoverage gaps closed: claim/reclaim, rawscopesdefault (read straight from the column, since_public_agent'sor DEFAULT_SCOPESmasks a wrong empty default),last_used_attouch-on-use, listingORDER BY, and widen-pathnbytes. Each was mutation-tested — inject the targeted bug, confirm the test goes red, revert.16 → 18-alpineto match prod Neon 18.x.Verified on a local
postgres:18-alpine: full suite 1113 passed / 5 skipped / 0 failed with the live tier on.