Skip to content

fix: aistudio transform fails most stored payloads on ambiguous attachm… - #4644

Merged
Sinity merged 3 commits into
masterfrom
feature/packet/polylogue-gmb3o
Sep 4, 2026
Merged

Sinity merged 3 commits into
masterfrom
feature/packet/polylogue-gmb3o

Conversation

@Sinity

@Sinity Sinity commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

Preserve sessions whose attachments have ambiguous message-owner coordinates, and retain those attachments as typed-unowned evidence.

Problem

Stored aistudio-drive payloads can contain multiple messages resolving to the same owner coordinate (0, 0). The content hash and writer previously raised MessageOwnerAmbiguityError, causing otherwise parseable sessions to fail materialization. The bead's four named sessions were among the affected payloads.

Solution

The session content hash records an ambiguous attachment without a guessed message anchor. The writer retains the attachment row with no attachment_refs row, allowing its evidence and ref_count = 0 state to remain queryable. Strict revision ownership remains fail-closed. Regression tests cover hash degradation and the production writer path.

Verification

PATH="$PWD/.venv/bin:$PATH" ./.venv/bin/python -m devtools verify --quick passed all declared quick gates.

The focused devtools test selection was queued as pueue task 564, but the shared pytest group was paused and the selection was canceled without a test result.

Residual risk

The four live payloads and the complete focused pytest selection were not rerun in this lane. The quick gate does not execute pytest.

@Sinity
Sinity enabled auto-merge (squash) September 4, 2026 00:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 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-04T00:59:37.221779Z f95481a 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.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 83a697ed-eb7a-49c5-bbe6-c8bc9dc21f4b


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 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: f95481a413

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

@Sinity
Sinity merged commit 35d6348 into master Sep 4, 2026
3 of 4 checks passed
@Sinity
Sinity deleted the feature/packet/polylogue-gmb3o branch September 4, 2026 01:02
Sinity added a commit that referenced this pull request Sep 5, 2026
…4692)

## Summary
Fixes seven root causes from the 2026-09-05 master corpus reds (106
failed / 20,455 passed), profile/delegation/storage cluster:

- fix(storage): select the input_row_count the profile record reads (`no
such column: total_input_tokens`)
- fix(storage): insight presence counts views, not only tables
(`threads`/`delegations`/`actions` are views; exports withheld every
row)
- fix(storage): retain an ambiguous-owner attachment as typed unowned
(PR #4644 dropped it before its row was written; bead polylogue-c9qxh)
- fix(maintenance): absent stats for an empty table are not missing
coverage
- test: supply parent-dispatch evidence delegation resolution now
requires; read profile totals and ingest seams at their current
locations; follow embedding reuse and the declared content-hash
partition; classify new index tables and satisfy the threads view
dependency

## Verification
Lane batches: `450 passed` (batch 1620), then `5 failed, 664 passed in
654 s` (batch 1628) on the listed cluster plus touched modules.
`devtools verify --quick` green after one typing fix by the coordinator.

## Residuals (deliberately not fixed, with reasons)
- `test_session_revision_projection_golden_hashes`: message-level hash
drift unexplained by any diff in the identity modules; regenerating
would launder a possible identity regression.
- `assert_readable_archive_layout` still raises the pre-migration
`SchemaVersionMismatchError` on skew (#4626 half-landed); flipping it
changes MCP error codes; needs a caller audit.
- `test_refresh_thread_reorder_only_touches_changed_span`: #4630 made
`_refresh_thread` a no-op; design decision, not a patch.
- `test_insights_status_plain`, two `test_reindex_campaign` tests,
`test_full_reindex_and_incremental_convergence_have_equal_derived_models`:
still red in batch 1628.
- `perf_floors` and `codex_804` timed out under five-lane host
contention.

Beads: polylogue-7r19s, polylogue-xtstx, polylogue-c9qxh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01DNGJ3awfNrsLaMdHgQZvid

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at 64a9bd0):

  • P1 polylogue/storage/sqlite/archive_tiers/write.py:3859: Fixed on master (checked at 64a9bd0): An ambiguous-owner attachment is recorded as OWNER_AMBIGUOUS (write.py:6534). A metadata-only attachment is persisted as an unowned row through _write_attachment_row (write.py:6570), and tests/unit/storage/test_archive_tiers_write.py:3805 asserts the row exists with no ref.

Resolving every thread listed; confirmed defects are fixed under the named bead.

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