Repository navigation
test(storage): Stop inserting the retired session_events.summary column - #5458
Conversation
PR #5446 retired session_events.summary as a derived column that reproduced from payload_json in 7,403,923 of 7,403,923 live rows. One fixture still wrote it, so the test failed at insert with "table session_events has no column named summary". The event's summary now rides in payload_json, which is where the column was reproducing from in the first place. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
|
Warning Review limit reachedNext included review available in 33 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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. |
## Summary Completes the cleanup of **#5446** (retiring `session_events.summary`). My first repair, **#5458**, fixed one file; three more were still referencing the dropped column. ## What was still broken on master | file | how | |---|---| | `tests/unit/pipeline/test_ingest_batch.py` | `SELECT event_type, summary` + two assertions on `event["summary"]` | | `tests/unit/storage/test_archive_tiers_archive.py` | `SELECT event_type, summary` at two sites + two assertions | | `tests/unit/storage/test_archive_tiers_write.py` | `SELECT … summary …` plus **three** stale `"summary"` keys in its expected rows | All now read `payload_json` — which is exactly what the retired column reproduced from, in **7,403,923 of 7,403,923** live rows. ## Verification ``` devtools test test_ingest_batch.py test_archive_tiers_archive.py test_archive_tiers_write.py -> 265 passed / 265, exit 0 devtools verify --quick -> PASSED exit=0 ``` The write-path file needed three separate passes: each stale `"summary"` key in the expected-row list surfaced only after the previous one was removed, because the assertion compares whole dicts and reports the first differing index. ## How this was found, and what it says about my own process A `gpt-5.6-luna` worker on an unrelated bead (polylogue-3szyi) reported it as an *inherited* baseline failure. That is the second time today a worker with no stake in the file surfaced this regression — the first led to #5458. My #5458 fix was incomplete because I grepped for **writers** (`INSERT`) and stopped. Retiring a column needs a search for **every** reference — reads, expected-row fixtures and assertions included. `devtools verify --quick` cannot catch this: none of these suites are in the quick set. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
## Summary Three tests were red on master and the MCP session-timeline route raised at runtime. Found by a wave-2 worker whose own bead was unrelated. ## Problem `polylogue-kc8eq` retired `session_events.summary` — correctly: it was a write-time render of `payload_json["summary"] or payload_json["text"]`, derivable in 7,403,923 of 7,403,923 live rows, and 178.9 MB of index restating the payload. But the timeline UNION in `polylogue/operations/session_reads.py:245` still selected `e.summary`. Any session timeline read raised. The spec comment justifying the removal asserted the column was **"never selected by the read path."** That was false. The audit behind the retirement grepped writers. This is the third time this retirement has broken something: `#5458` fixed one fixture, `#5465` fixed three more, and this is the first that is a production route rather than a test fixture. ## Solution Move the render read-side with identical semantics — `COALESCE(json_extract(payload_json,'$.summary'), json_extract(payload_json,'$.text'), '')`. Timeline text for a session-event is byte-identical to what the stored column produced. The false comment is corrected in place, naming what actually happened, so the next column retirement doesn't repeat the writers-only audit. ## Verification ``` devtools test tests/unit/mcp/test_session_owner_operations.py \ tests/unit/mcp/test_server_surfaces.py \ tests/unit/archive/query/test_continuation_surface_parity.py -> PASSED exit=0 ``` Red before this change (32 passed / 3 failed), green after. ## Residual Worth stating plainly: master's quick-gate was **green** throughout, because `verify --quick` is static gates only. The affected-test lane that would have caught this had been sitting in a paused pueue group since a `verify_all` failure on 2026-09-22, so no pytest ran on master for over a day. The group is resumed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed an issue that could prevent the session timeline from loading. Session events now display text from their saved details, checking the summary first and falling back to the event text when needed. Existing timeline text remains unchanged. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Summary
Repairs a regression introduced by #5446, which I landed earlier today.
Problem
#5446 retired
session_events.summary— a derived column that reproduced frompayload_jsonin 7,403,923 of 7,403,923 live rows, costing 178.9 MB. One test fixture still wrote it:tests/unit/storage/test_session_profile_derivation.py:462inserted(session_id, source_message_id, position, event_type, summary, payload_json).Solution
The event's summary rides in
payload_json— which is where the retired column was reproducing it from in the first place, so the fixture now writes the shape production actually stores.Verification
Before: 31 passed / 1 failed.
How it was found
A
gpt-5.6-lunaworker on an unrelated bead (polylogue-bp12n.1) reported it as an inherited baseline failure rather than absorbing it or working around it. That is the reporting discipline paying off — the worker had no stake in this file and still surfaced it with the receipt.It also shows the gap in my own landing of #5446:
devtools verify --quickwas green on that branch because the quick set does not run this suite, and the branch's own focused selection did not include it. A retired column needs a grep for its writers acrosstests/as well aspolylogue/.🤖 Generated with Claude Code
https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy