Skip to content

chore: Preserve declared Codex event fields through archive reads - #4881

Merged
Sinity merged 4 commits into
masterfrom
batch/polylogue-20260912-064103-ae6af779/integration
Sep 12, 2026
Merged

Sinity merged 4 commits into
masterfrom
batch/polylogue-20260912-064103-ae6af779/integration

Conversation

@Sinity

@Sinity Sinity commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Batch polylogue-20260912-064103-ae6af779 on base 3901323aeb81.

polylogue-q0vka Preserve Codex response phase and turn identity

  • 1. payload.phase and internal_chat_message_metadata_passthrough.turn_id survive provider-shaped parse/write/public-read tests on response_item and event_msg routes, including the named message, reason
  • 2. Existing metadata.turn_id and observed direct turn_id remain supported; conflicts have a documented authority or explicit ambiguity rule.
  • 3. user_message.local_images and text_elements receive retained attachment/reference and placeholder-range representations or field-specific justified exclusions; provenance, byte availability and pat
  • 4. Clean and incremental replay agree. Mutants dropping phase, passthrough turn correlation or retained image-reference evidence fail production-route tests.
  • 5. Land with z1rdw before runtime pinning; 74kj3/i3i5k own fresh-generation population evidence.

polylogue-z1rdw Preserve declared Codex event fields through archive reads

  • 1. Provider-shaped examples for every named current event family preserve meaningful timing, turn, model/context-window, goal/budget/status, delegation, search and error fields or carry a reviewed fie
  • 2. Detection, parsing, ordinary writer, clean/incremental replay and public event reads agree; changing retained semantic evidence changes the relevant identity.
  • 3. Opaque signatures/source coordinates do not become duplicated public content; no generic payload dump substitutes for extraction.
  • 4. Mutations dropping lifecycle timing, goal content, delegation linkage or search/error content fail end-to-end regressions.
  • 5. Run focused Codex event-stream/parser tests and ordinary replay parity before 74kj3 pins the runtime; candidate population evidence belongs to 74kj3/i3i5k.
  • 6. The full field table in Design is covered, including entered_review_mode/exited_review_mode nested target and review_output fields, view_image_tool_call.path, inter_agent_communication_metadata and

polylogue-ooufe Bind schema sampling and verification to the selected archive

  • Two independent synthetic archives with distinct blobs are sampled and verified by explicit location while ambient defaults point at the other archive; only selected content contributes.
  • A selected archive whose index generation is outside its durable root still yields its source population.
  • Missing selected source/blob evidence produces an attributable failure or incomplete outcome, never a clean zero population or a scan of ambient session files.
  • Add production-route cases to devtools test tests/unit/core/test_schema_generation.py tests/unit/schemas/test_operator_commit.py and the corpus-verification tests; devtools verify. Removing explicit s

@coderabbitai

coderabbitai Bot commented Sep 12, 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: Advanced

Run ID: a026e56c-6c18-4412-8820-6153a9392e40


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.

@Sinity
Sinity merged commit e2c9602 into master Sep 12, 2026
3 checks passed
@Sinity
Sinity deleted the batch/polylogue-20260912-064103-ae6af779/integration branch September 12, 2026 07:11
Sinity added a commit that referenced this pull request Sep 14, 2026
…batch (#5040)

Triage of the sources/ingest/schema share of the 58 failures from the
first
complete full-corpus run (job 650). **All 16 classified and fixed: 602
passed,
0 failed** across the owned files.

## Two campaign-blocking product defects

Both would have damaged the final archive build silently. Filed as
`polylogue-gjfsx` and `polylogue-0zhhc`.

### 1. Ingest admitted Hermes SQLite page images that replay refuses

`test_binary_payload_parse_parity.py` ×2, `test_revision_backfill.py`
×2.

Replay refuses anything that is not the declared logical export; the
daemon's
per-raw ingest route still parsed page images into sessions.

**Would corrupt a from-scratch build:** a reindex mints a *second*
source
authority for content the archive already holds under its logical
revision.
CLAUDE.md states the rule directly — *"A mutable SQLite source is the
one
material that is not its own bytes… that export's blob hash is the
member's
logical revision. A page image cannot be proven against a live database
and
re-snapshots on every commit."*

Fixed by gating `_hermes_sqlite_marker_payload` on
`is_declared_logical_export`.
The fixtures were retargeted to real logical exports rather than
relaxing the
production check — the check is what makes the revision provable.

### 2. One excised file aborted an entire reingest batch


`test_excision.py::test_reingest_batch_skips_excised_file_without_aborting`.

Two acquire-time excision gates raised different exception classes. The
orchestrators catch only `ContentExcisedError`, so the policy gate's
bare
`ExcisionPolicyError` escaped, rolled back the in-flight batch and
re-raised.

**Would silently truncate a from-scratch build:** excision markers
survive an
`index.db` rebuild by design, so a rebuild over a tree containing one
excised
file drops every unrelated session in that batch and every file after it
— and
reports success. Fixed at the raise site; refusal semantics unchanged.

## A verification hole, restored

The retryable-SQLite-lock guard has been **vacuous since #4924**
(`polylogue-6e9d5`). A drifted stub raised `TypeError` instead of the
injected
lock, so the two tests proving *"a lock must not advance or poison a
cursor"*
never exercised it. Production was never wrong — but
cursor-advance-past-unwritten-data
was unverified, and the rebuild runs heavy concurrent writers, which is
exactly
the condition the guard exists for. The stub is now signature-agnostic
and
cannot drift.

## No parse, conservation, or identity defect exists

Two tempting wrong conclusions were checked and rejected:

- `Provider.GEMINI == Provider.UNKNOWN` is documented **forward**
provider-wire
normalization, not an Origin reversed into a guessed Provider. The test
  hand-maintained a token list that omitted most real aliases.
- The claude-code "duplication" was a **measurement artifact** — the
parser
emits each wire value exactly once, proven by counterfactual; the
planted side
was blind to `text`/`thinking`/tool-argument positions the observed side
counted. Fixed by **symmetry rather than suppression**, which
strengthened the
check: claude-code checked bodies 42 → 221, with no generated bytes
changed.

## Remaining classifications

**STALE-TEST ×6** — convergence-debt rows deliberately retired by #5027
(pending
is now `required − valid` derived from the durable relation, so the
backlog is
not lost), Codex envelope support landed by #4881, the provider-token
list.
**TEST-INFRA ×5** — drifted stub, measurement asymmetry.
**ORDER-DEPENDENT ×0** —
the one candidate was Hypothesis nondeterminism, disproved rather than
assumed.
None carry rebuild risk.

## Verification

```
devtools test <11 owned files>   602 passed, 0 failed
devtools verify --quick          exit 0
```

## Residual, flagged not fixed

`ConservationResult.to_dict()` emits findings as strings while
`tests/infra/wire_support.py` deserializes them as objects — latently
broken for
any non-conserved cached receipt.

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

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved archive ingestion and replay consistency by validating
logical exports and rejecting unsupported raw database images.
* Preserved conservation failures and detailed findings when restoring
saved support data.
* Improved handling of content-excision violations with clearer error
details, including the affected content and source path.
* Enhanced recovery and retry behavior for deferred indexing and sidecar
ingestion.
* Improved recognition of common provider aliases during data
processing.

<!-- 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