Skip to content

test: Stop reading the retired session_events.summary column - #5465

Merged
Sinity merged 1 commit into
masterfrom
fix/session-events-summary-readers
Sep 23, 2026
Merged

Sinity merged 1 commit into
masterfrom
fix/session-events-summary-readers

Conversation

@Sinity

@Sinity Sinity commented Sep 23, 2026

Copy link
Copy Markdown
Owner

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.ai/code/session_01ToWqpkXotr573DiQex5vcy

#5446 retired the column; #5458 fixed one writer. Three more files
still named it:

- tests/unit/pipeline/test_ingest_batch.py SELECTed it and asserted on it
- tests/unit/storage/test_archive_tiers_archive.py SELECTed it twice
- tests/unit/storage/test_archive_tiers_write.py SELECTed it and carried
  three stale "summary" keys in its expected rows

All now read payload_json, which is what the retired column reproduced
from in 7,403,923 of 7,403,923 live rows.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: bff8dd72-2dee-4dd0-8061-ea54253675ff

📥 Commits

Reviewing files that changed from the base of the PR and between 86667f4 and a8239ca.

📒 Files selected for processing (3)
  • tests/unit/pipeline/test_ingest_batch.py
  • tests/unit/storage/test_archive_tiers_archive.py
  • tests/unit/storage/test_archive_tiers_write.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T05:50:10.466647Z a8239ca PR opened
🔒 Security Review ✅ Completed 2026-09-23T05:52:50.837102Z a8239ca PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Sinity
Sinity enabled auto-merge (squash) September 23, 2026 05:48
@Sinity
Sinity merged commit 19b4dcb into master Sep 23, 2026
3 checks passed
@Sinity
Sinity deleted the fix/session-events-summary-readers branch September 23, 2026 06:00
Sinity added a commit that referenced this pull request Sep 23, 2026
…ases (#5467)

## Summary

Produces per-case verdicts for the two writer cases polylogue-asp4b left
unestablished. Test-only; schema closure not applicable.

Produced by a `gpt-5.6-luna` worker.

## Why this exists

`asp4b` AC1 asks that *"each **real remaining** named writer bug has a
discriminating fixture."* Three of its five cases were already fixed at
head. Two — **sibling-append** and **supersession** — were reported
UNESTABLISHED by two separate workers: neither could locate a seam.

"Nobody could find it" is absence of evidence, not evidence of absence,
and closing on it is the closure-by-assertion pattern this campaign's
own audit condemned. So the ask was a verdict per case: either a
discriminating fixture that reproduces the defect, or an argument from
the writer's construction that the case **cannot occur**.

Both are now answered, in opposite directions.

## Sibling-append — cannot occur, by construction

`thread_sessions` keys each membership by `(thread_id, session_id)`. An
append therefore adds exactly one distinct child and preserves every
prior membership; **there is no last-writer choice for a sibling to
make**. Pinned by an assertion that the parent thread holds 3 rows / 3
distinct sessions after two appends, alongside the existing "no
membership rebuild" check.

## Supersession — real, and now pinned

A revised hook claim must leave **exactly one** authoritative parent per
child. The fixture asserts that after revision.

Anti-vacuity **executed**: removing the supersession demotion left
**both** the old and revised parents authoritative. Production code
restored.

## Verification

```
devtools verify --quick                                              ->  PASSED exit=0
devtools test test_archive_tiers_write.py test_topology_hook_authority_conflict.py
                                                                     ->  134 passed / 134
```

The first run of that selection failed on `no such column: summary` — my
own regression from #5446, unrelated to this branch. Rebasing onto
master with #5465 merged cleared it.

AC2-AC4 were already landed at head; the compound owner FK remains at
`archive_tiers_specs.py:94,642`. No production change was needed.

🤖 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

* **Tests**
* Expanded automated coverage for session membership updates, verifying
appended sessions remain distinct and existing memberships are
preserved.
* Added checks confirming revised hook claims are reflected in stored
session links.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sinity added a commit that referenced this pull request Sep 23, 2026
## 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]>
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.

1 participant