Skip to content

fix: consolidated bot review follow-up sweep (7 findings across 6 merged PRs)#1144

Merged
joeharris76 merged 8 commits into
developfrom
chore/pr-review-followup-sweep-7
Jul 18, 2026
Merged

fix: consolidated bot review follow-up sweep (7 findings across 6 merged PRs)#1144
joeharris76 merged 8 commits into
developfrom
chore/pr-review-followup-sweep-7

Conversation

@joeharris76

Copy link
Copy Markdown
Owner

Description

Late-landing chatgpt-codex-connector bot review follow-ups. Each PR listed below was already merged before its review completed, so all fixes are consolidated into this one sweep branch off develop per the established review-followup pattern. (A 7th finding, on PR #1139, was found already fixed by concurrent work on that PR's own branch — verified adequate and replied+resolved there directly, not duplicated here.)

Findings fixed

  1. test(joinorder): full-archive cardinality, FK-integrity, and encoding assertions #1128tests/integration/test_joinorder_full_archive.py: a broad except Exception converted a checksum/manifest integrity failure into a silent pytest.skip, defeating the point of a suite that exists to catch corrupted canonical data — narrowed to true availability failures (DownloadError/ImportError/OSError). Also fixed the UTF-8 fidelity check: DuckDB's ~ operator is regexp_full_match, not a contains-match, so it only matched rows consisting entirely of one non-ASCII character (empirically confirmed it matched zero rows even on data containing "Amélie"); switched to regexp_matches() and recomputed the pinned counts/hashes against the real archive (title.title: 5 → 155075 rows).
  2. chore(todo): seed auto-revert incident TODOs (fix landing, signature attribution, medium PR lane, placeholder safety) #1130_project/DONE/auto-revert-incident/active/fix-session-isolation-placeholder-rows.yaml: this completed item's scope_limit only named the fallback path's test file, but the primary path actually taken (landing fix(throughput): preserve first_row when padding cursor rows; count raw-cursor rows inside the timed window #1117 as-is) touched connection_wrappers.py + its unit test file — added for an accurate audit trail.
  3. ci(develop-post-merge): signature-aware auto-revert — stop blaming innocent merges for persistent red #1136.github/workflows/develop-post-merge.yml + scripts/post_merge_signature.py: (a) the current-run signature check only required at least one signature.json to exist, not all four expected gate artifacts — a crashed/cancelled gate's missing artifact no longer silently diffs a partial signature; (b) a gate that fails for a reason junit never records (e.g. pytest-cov's --cov-fail-under gate — every testcase passes, the job still fails) produced an empty-but-"clean" signature that could silently suppress a real revert — added a --job-failed flag that falls back to a job-failure descriptor when the job failed and junit found nothing.
  4. fix(platforms): make placeholder cursor rows unmistakable (has_real_rows + one-time warning) #1137benchbox/core/tpch/power_test.py, benchbox/core/tpcds/power_test.py: the TPC power-test harnesses called cursor.fetchall() solely to count/discard rows, tripping PlatformAdapterCursor's new placeholder-materialization warning on every query for a normal run. Routed all four call sites (both power tests' per-query counting, TPC-DS warm-up, TPC-DS _execute_query) through platform_result["rows_returned"]/row_count() first, falling back to fetchall() only for cursors with no reported count.
  5. chore(todo): create uat-hardening batch — 12 TODOs from the 2026-07-10 UAT infrastructure review #1138 — two _project/TODO/uat-hardening/planning/*.yaml files: verification commands defined success as "no grep hits", but grep exits 1 on no match and 0 on a match — both gates had the pass/fail logic backwards. Fixed the exit-code inversion in both.
  6. fix(throughput): return from the executor without blocking on a hung stream #1141benchbox/core/throughput/runner.py: executor.shutdown(wait=False) left cancel_futures at its default False, so when max_workers < num_streams, a still-queued (never dispatched) stream could start executing once a worker freed up — well after execute() had already returned and counted it as timed out. Added cancel_futures=True, which only cancels not-yet-started futures (already-running/leaked ones are untouched, preserving the documented can't-forcibly-cancel-a-running-thread invariant).

Testing

Every fix follows the same discipline: read the actual bug, add/extend a regression test, verify it fails without the fix (git stash the fix, confirm failure, git stash pop, confirm pass), lint/format, then targeted + broader suite runs.

  • tests/integration/test_joinorder_full_archive.py — 117 passed against the real ~GB canonical archive (locally cached), including a new fixture-level test proving the exception narrowing and reproducing the exact bug (assert cursor.fetchall() == [(7,)] type reproduction of the old buggy ~ match returning zero rows on "Amélie").
  • tests/unit/test_post_merge_signature.py — 28 passed (25 original + 3 new), including simulating both the missing-artifact and coverage-only-failure scenarios end-to-end.
  • tests/integration/test_tpc_power_tests.py + tests/integration/test_tpcds_power_test.py — 43 passed, including new caplog-based tests proving zero placeholder warnings fire on the count-only paths.
  • tests/unit/core/throughput/test_runner.py — 25 passed, including a new test with max_workers=1, num_streams=2 proving a queued stream never starts even after its worker frees up (confirmed the old code did start it, ~2s later, without the fix).
  • Full uv run -- python -m pytest tests/unit/ — 24238 passed, 5 failed (all 5 confirmed pre-existing: the sandbox's root-user bypassing filesystem permission checks the tests expect to fail; zero diff overlap with this branch).

Public Contract Check

  • No public contract surface changes — internal fixes, CI workflow, TODO bookkeeping, and test corrections only.

Documentation

Code Quality

  • ruff check / ruff format --check clean on every changed file.
  • Regression test added or extended for every code-level finding.

Artifact Hygiene

  • I did not commit raw screenshots, browser reports, generated logs, benchmark outputs, or temporary binary artifacts.

Notes

No CODEOWNERS-gated paths touched — enabling squash auto-merge.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 6 commits July 11, 2026 19:37
…1128 review)

archive_dir's broad `except Exception` converted a checksum/manifest
integrity failure into a silent pytest.skip, defeating the point of a
suite that exists to catch corrupted canonical data. Narrowed to
DownloadError/ImportError/OSError (true availability failures); a
ChecksumMismatchError now propagates and fails the test.

DuckDB's `~` operator is regexp_full_match, not a contains-match, so
the UTF-8 fidelity check only selected rows consisting entirely of one
non-ASCII character - a manual DuckDB check confirmed it matched zero
rows even on data containing "Amélie". Switched to regexp_matches()
and recomputed the pinned UTF8_FIDELITY counts/hashes against the real
archive with the corrected query (title.title: 5->155075 rows, etc.).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKw2UhgHuzYPo3y5MfarD6
…aceholder-rows (#1130 review)

The primary path (w0/w1, actually taken) landed #1117 as-is rather
than the fallback test-only rewrite, so this completed item's
scope_limit only naming the fallback's test file understated what was
actually authorized/touched. Added the two paths #1117 changed
(connection_wrappers.py + its unit test file) for an accurate audit
trail; no scope reopened, both were already merged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKw2UhgHuzYPo3y5MfarD6
…in develop-post-merge (#1136 review)

Two gaps in the signature-aware auto-revert decision:

1. The current-run artifact check only required at least one
   signature.json to exist (compgen -G glob match), not all four
   expected gate artifacts. If one gate crashed/timed out before its
   always()-run signature step could upload, the diff still ran on
   the remaining three - a missing gate's real failure was silently
   excluded instead of forcing fail-open. Now checks each of the four
   expected signature-<job> directories explicitly.

2. fast-test/medium-test's signature emission trusted the junit XML
   unconditionally: a job can fail for a reason junit never records
   (e.g. pytest-cov's --cov-fail-under gate - every testcase passes,
   the step still fails), producing an empty-but-"clean" signature
   that made the diff see no new failures and silently suppress a
   real revert. Added a --job-failed flag to
   scripts/post_merge_signature.py's build command: when the job
   failed and the junit-derived signature is empty, it falls back to
   a job-failure descriptor instead of trusting the false-clean junit.
   A job that failed WITH real testcase failures keeps the more
   precise junit signature.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKw2UhgHuzYPo3y5MfarD6
… review)

TPC-H/TPC-DS power test harnesses called cursor.fetchall() solely to
count/discard rows (result_count is the only consumer), which now
trips PlatformAdapterCursor's placeholder-materialization warning on
every query for a normal validation-mode run - noise that defeats the
warning's purpose of flagging genuine VALUE-dependent placeholder
consumption.

- tpch/power_test.py, tpcds/power_test.py: `_query_result_count`
  checks platform_result["rows_returned"] first (never materializes)
  and only falls back to fetchall() for cursors with no reported count
  (raw DB-API cursors, test doubles).
- tpcds/power_test.py's warm-up loop drains via row_count() when
  available, falling back to fetchall() only for cursors without it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKw2UhgHuzYPo3y5MfarD6
#1138 review)

Both verification commands defined success as "no grep hits" but grep
exits 1 on no match and 0 on a match - the gates had the pass/fail
logic backwards, so a future implementer's scripted verification
would report success/failure exactly opposite of the real outcome.

- uat-execute-path-unification.yaml: `grep ... && echo FOUND || echo
  CLEAN` always exits 0 regardless of which branch prints - the FOUND
  branch now exits 1.
- uat-resume-retirement-artifact-durability.yaml: both "no hits =
  success" pipelines now invert their exit status with `!`, matching
  the `! grep -q ...` idiom already used elsewhere in this TODO tree.

Verified empirically against the real repo (dead code still present -
correctly reports FOUND, exit 1) and simulated clean/dirty/filtered
cases for the resume-reference gates.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKw2UhgHuzYPo3y5MfarD6
…ocking shutdown (#1141 review)

executor.shutdown(wait=False) left cancel_futures at its default False,
so when max_workers < num_streams, a future still QUEUED (never
dispatched to a worker) at the timeout deadline would start executing
once a worker eventually freed up - well after execute() had already
returned and counted that stream as timed out. That created extra,
unexpected DB work overlapping with whatever phase ran next.

cancel_futures=True closes the gap: it cancels only futures that have
not started running (Python's documented ThreadPoolExecutor.shutdown
semantics), leaving already-running (leaked/abandoned) futures
untouched - the can't-forcibly-cancel-a-running-thread invariant is
unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKw2UhgHuzYPo3y5MfarD6
@joeharris76
joeharris76 enabled auto-merge (squash) July 11, 2026 20:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ecb2848ea

ℹ️ 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".

Comment thread benchbox/core/tpch/power_test.py Outdated
claude added 2 commits July 12, 2026 01:25
#1137's fix routed count-only power-test paths through
row_count()/rows_returned to avoid a placeholder-materialization
warning, but for raw DB-API cursors without platform_result,
_query_result_count still falls back to fetchall() - and that
fallback call had moved to after connection.commit(). Some drivers
with unbuffered SELECT results reject or invalidate commit() while
rows are still unread, which would misrecord successful power
queries as failures.

Restores the pre-#1137 drain-before-commit ordering in both
tpch/power_test.py and tpcds/power_test.py::_execute_one_query
while keeping #1137's benefit (no eager fetchall() when
rows_returned is already available).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKw2UhgHuzYPo3y5MfarD6
Catches this stale review-followup-sweep branch up with develop so CI
can run again (was mergeable_state=dirty with zero CI runs).
@joeharris76
joeharris76 merged commit e797a4d into develop Jul 18, 2026
23 checks passed
@joeharris76
joeharris76 deleted the chore/pr-review-followup-sweep-7 branch July 18, 2026 02:54
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.

2 participants