Repository navigation
fix(sources): restore browser-capture ID normalization and parser fixes - #4399
Merged
Merged
Conversation
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. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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 |
Sinity
added a commit
that referenced
this pull request
Sep 1, 2026
…es (#4399) ## Summary Repair four red families across the `cli` and `sources` selections: browser-capture synthetic-ID normalization, Hermes named-SQLite admission, Codex unknown response-item preservation, and `MessageQueryRowPayload` repo parity. Regenerated declarations ship with them. ## Problem `legacy_browser_capture_native_id`, its `_UUID_PATTERN`, its `__all__` entry, and its call site were deleted by #4337 — a two-lane batch assembly about contract JSON and deployment smoke coverage, unrelated to browser capture — while all six of its contract tests were left in place. That is what turned them red (`git show 97cddc4 -- polylogue/browser_capture/identity.py`). The other three were independent gaps: an uncheckpointed Hermes WAL row lost at acquisition, a Codex unclassified response item double-counted by the conservation boundary because it declared no `wire_type`, and `repo` populated on the substrate row but dropped at the surface because `_from_row_generic` copies by field name only. ## Solution Restore the deleted normalization (byte-identical to the deleted body, minus a redundant wrapper); hoist `hermes_owned_sqlite_name` above the recognizer guard for `source_only` acquisition; carry the raw provider token on the unclassified Codex event via `_record_type`, a structural `record.get("type")` read with no inference; declare `repo` on `MessageQueryRowPayload`. ## Verification Each fix was reverted in isolation and the covering test run: - browser-capture: 6 failed, 44 passed - Hermes: 2 failed, 141 passed - Codex: 1 failed, with `assert ['codex_unclassified_response_item'] == [...]` naming the mechanism - repo parity: `test_generic_row_declarations_have_explicit_field_parity[MessageQueryRowPayload]` failed, 20 passed `devtools verify --quick` → exit 0, all 18 gates. `devtools render all --check` → exit 0, no `out of sync`. `devtools test tests/unit/sources tests/unit/surfaces` → 2734 passed, 0 failed. ## Residual risk `native_id` derivation for browser captures reverts to the pre-#4337 rule, which collapses `chatgpt:<uuid>:<hash>` to `<uuid>`. That collapse is deliberate convergence from #2345 — the extension minted a fresh synthetic ID per capture, fragmenting one conversation into many sessions. Blast radius on real data is zero: `/realm/state/polylogue/source.db` was last written 2026-08-16, before the regression window opened on 2026-08-27, so no capture was ingested un-normalized and nothing is re-identified on reindex. Normalization happens at parse, not in storage, so replay re-derives the same ID from the same blob. The Hermes exemption is scoped to `source_only` acquisition of two filenames and does not relax parser admission; the recognizer still gates `source_parsing.parse_one_source_path`. Consequence: a named Hermes SQLite whose schema the recognizer cannot classify is now acquired as a Hermes raw and may later fail parse with a typed refusal. The comment at `polylogue/sources/live/batch.py:1972-1975` ("Only the OriginSpec recognizer may admit a candidate") now sits above a guard carrying an exemption; filed separately rather than edited here. Pre-existing and not introduced: the 3-colon-part branch at `identity.py:27-29` returns `parts[1]` for any `provider:X:Y` where `X` has no `/`, without requiring `X` to look like a UUID. Shipped since #2345. The bead stays open. Its "35 red / 25 remaining" figures are stale — the five families it names as still red are green on current master (#4371, #4368, #4375, and the CLI pair), so the remainder must be re-enumerated rather than restated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repair four red families across the
cliandsourcesselections: browser-capture synthetic-ID normalization, Hermes named-SQLite admission, Codex unknown response-item preservation, andMessageQueryRowPayloadrepo parity. Regenerated declarations ship with them.Problem
legacy_browser_capture_native_id, its_UUID_PATTERN, its__all__entry, and its call site were deleted by #4337 — a two-lane batch assembly about contract JSON and deployment smoke coverage, unrelated to browser capture — while all six of its contract tests were left in place. That is what turned them red (git show 97cddc4af -- polylogue/browser_capture/identity.py).The other three were independent gaps: an uncheckpointed Hermes WAL row lost at acquisition, a Codex unclassified response item double-counted by the conservation boundary because it declared no
wire_type, andrepopopulated on the substrate row but dropped at the surface because_from_row_genericcopies by field name only.Solution
Restore the deleted normalization (byte-identical to the deleted body, minus a redundant wrapper); hoist
hermes_owned_sqlite_nameabove the recognizer guard forsource_onlyacquisition; carry the raw provider token on the unclassified Codex event via_record_type, a structuralrecord.get("type")read with no inference; declarerepoonMessageQueryRowPayload.Verification
Each fix was reverted in isolation and the covering test run:
assert ['codex_unclassified_response_item'] == [...]naming the mechanismtest_generic_row_declarations_have_explicit_field_parity[MessageQueryRowPayload]failed, 20 passeddevtools verify --quick→ exit 0, all 18 gates.devtools render all --check→ exit 0, noout of sync.devtools test tests/unit/sources tests/unit/surfaces→ 2734 passed, 0 failed.Residual risk
native_idderivation for browser captures reverts to the pre-#4337 rule, which collapseschatgpt:<uuid>:<hash>to<uuid>. That collapse is deliberate convergence from #2345 — the extension minted a fresh synthetic ID per capture, fragmenting one conversation into many sessions. Blast radius on real data is zero:/realm/state/polylogue/source.dbwas last written 2026-08-16, before the regression window opened on 2026-08-27, so no capture was ingested un-normalized and nothing is re-identified on reindex. Normalization happens at parse, not in storage, so replay re-derives the same ID from the same blob.The Hermes exemption is scoped to
source_onlyacquisition of two filenames and does not relax parser admission; the recognizer still gatessource_parsing.parse_one_source_path. Consequence: a named Hermes SQLite whose schema the recognizer cannot classify is now acquired as a Hermes raw and may later fail parse with a typed refusal.The comment at
polylogue/sources/live/batch.py:1972-1975("Only the OriginSpec recognizer may admit a candidate") now sits above a guard carrying an exemption; filed separately rather than edited here.Pre-existing and not introduced: the 3-colon-part branch at
identity.py:27-29returnsparts[1]for anyprovider:X:YwhereXhas no/, without requiringXto look like a UUID. Shipped since #2345.The bead stays open. Its "35 red / 25 remaining" figures are stale — the five families it names as still red are green on current master (#4371, #4368, #4375, and the CLI pair), so the remainder must be re-enumerated rather than restated.