Skip to content

chore: Measure cold-build index deferral against equivalent finished ar… - #4924

Merged
Sinity merged 2 commits into
masterfrom
batch/polylogue-20260912-113845-85b4c3f6/integration
Sep 12, 2026
Merged

Sinity merged 2 commits into
masterfrom
batch/polylogue-20260912-113845-85b4c3f6/integration

Conversation

@Sinity

@Sinity Sinity commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Batch polylogue-20260912-113845-85b4c3f6 on base e21f2bc8a264.

polylogue-bp12n.7 Measure cold-build index deferral against equivalent finished archives

  • On a pinned immutable input slice compare memoization+bulk with indexes retained against the same path with index deferral; compare shard transport separately where available. The old A/B/C/D/E matrix
  • Time the complete operation, including index recreation, required FTS/derived finalization and commit/checkpoint obligations. Finished archives must have the same declared schema/index set and canonic
  • Record all parse/write failures; offered, ingested, refused, deferred and output populations reconcile over the same interval. Missing outputs or swallowed exceptions invalidate a speedup verdict.
  • Refuse deferral on a non-empty archive. Omitting boundary CREATE INDEX or losing a logical row makes the check red. Include a bounded large-parent/shared-prefix stratum; size-sorted sampling with a by
  • One small decisive comparison and focused regressions, not full corpus per arm/PR. The integrated scale witness stays with 74kj3/623q. Amend the existing harness, not a new benchmark framework.

@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: f94c4892-a6c5-4aa9-8865-7ca31b8bcf99


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 12, 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-12T12:01:07.741026Z 98fd495 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 merged commit deafe54 into master Sep 12, 2026
3 checks passed
@Sinity
Sinity deleted the batch/polylogue-20260912-113845-85b4c3f6/integration branch September 12, 2026 11:57

@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: 98fd495cc1

ℹ️ 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 polylogue/sources/revision_backfill.py Resolved
Comment thread polylogue/sources/revision_backfill.py Resolved
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]>
@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):

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

@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 bf68918):

  • P1 polylogue/sources/revision_backfill.py:2469: Fixed on master (checked at bf68918): The finished-build benchmark calls the replay with an owned inactive generation (tests/benchmarks/test_finished_build_measurement.py:537-542), exercising the cold-build branch (polylogue/sources/revision_backfill.py:3817).
  • P1 polylogue/sources/revision_backfill.py:2498: Stale: The replay now measures emptiness and refuses a nonempty owned generation before opening it (polylogue/sources/revision_backfill.py:3806-3823); the only caller that passes an owned generation is the benchmark harness, which uses a fresh destination (tests/benchmarks/test_finished_build_measurement.py:537-539). (checked at bf68918)

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