Repository navigation
Fix main's CI (tests leave the v10 control schema behind) + round-2 review fixes for the key tables - #110
Conversation
Tests that manage their own schemas now drop the v10 control schema twin (a second run on the same server failed with 'schema already exists'); key issuance reads the tenant row FOR SHARE so it cannot race a deletion; --expires-days 0 means 'expires now'; the rollback SQL quotes the control schema (v10_rollback_sql); a repeated 'deleted' keeps the first deleted_at. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7ad9b81a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…x round 3) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b680f05d2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def quote(name: str) -> str: | ||
| return '"' + name.replace('"', '""') + '"' | ||
|
|
||
| return V10_ROLLBACK.replace("__CONTROL__", quote(control_schema_name(schema))).replace("__LEDGER__", quote(validate_schema_name(schema))) |
There was a problem hiding this comment.
Avoid recursive placeholder substitution in rollback SQL
When a valid ledger schema contains the literal __LEDGER__ (for example, foo__LEDGER__bar), the second replacement also rewrites that substring inside the already-substituted control-schema identifier, producing malformed SQL such as "foo"foo__LEDGER__bar"bar_control". Consequently, v10_rollback_sql() cannot roll back every schema accepted by validate_schema_name(); construct the two statements independently or use collision-proof formatting rather than sequential global replacements.
Useful? React with 👍 / 👎.
Main's CI is red on #107's and #108's merge commits. Cause (reproduced locally): tests that create and drop their own schemas (
test_block_anchors,test_pg_replay) did not drop v10's new<schema>_controltwin, and CI runs the suite twice on the same Postgres server, so the second pass fails withschema "jarvis_control" already exists/"restored_control" already exists. These fixes were finished just after the merges, so they are not in main yet.Test fix (the red CI)
Those two tests now drop the control schema twin. Verified by running the schema-managing test files twice on one server in whole-suite Postgres mode (149 passed each pass, 0 leftover control schemas; without the fix the second pass fails exactly as in CI).
Four Codex findings on #107 (round 2), all valid, each with a test that fails when the fix is removed
BEFORE INSERTtrigger reads the tenant rowFOR SHARE, so a transition todeleting/deletedwaits for an uncommitted insert (then revokes that key) and an insert waits for an uncommitted transition (then is refused). A two-thread test holds each side open in turn (and cleans up after itself).--expires-days 0meant "never": it now means "expires now", omitting it still means no expiry, negative is refused.pg_schema.v10_rollback_sql(schema)quotes it as v10 created it (tests migrate and roll back a mixed-case schema).deletedoverwrote the firstdeleted_at: nowcoalesce(deleted_at, now()).Not deployed; the live box is still on v9 (no migration has run there). Drill (v9 -> v10, key tenants, rollback) was re-run on the fixed code earlier: 52/52.
🤖 Generated with Claude Code