Repository navigation
fix(browser): repair live capture convergence - #2345
Conversation
Problem: live dogfooding diagnostics reported logical table names such as live_ingest_attempt without showing the split archive tier and physical table that carried the rows. That made production drilldown slower and encouraged guessing during runtime investigations. What changed: add an observability_locations block to the daemon workload probe, mapping logical observability surfaces to index/source/ops DB files and physical table names. Also route archive-backed JSONL full ingest through the provider stream parser and remove README setup guidance that referenced an unreleased PyPI package. Verification: devtools test tests/unit/devtools/test_daemon_workload_probe.py tests/unit/sources/test_live_batch_support.py (43 passed). polylogue ops diagnostics workload --json now reports live_ingest_attempt at ops.db/ingest_attempts.
Problem: full replacement of a large existing Codex session in the production archive spent roughly 1032 seconds in archive write. SQLite trace/progress interruption pinned the hot statement to DELETE FROM messages WHERE session_id = ?, after message FTS triggers had already been bypassed. What changed: add runtime-safe indexes for message-reference SET NULL child keys, make full session replacement rebuild the session's message FTS rows explicitly instead of relying on block triggers, and keep append writes on the trigger-maintained path. Verification: production full replacement of the 85 MB Codex JSONL dropped from roughly 1032s to 4.942s after creating the indexes on the live index.db. devtools test tests/unit/storage/test_archive_tiers_write.py -k replacement_clears_old_projection_rows passed. devtools test tests/unit/storage/test_schema_policy_contracts.py -k 'runtime_indexes or matching_version_database_opens_cleanly' passed. devtools test tests/unit/sources/test_live_batch_support.py passed.
Problem: live dogfooding showed the global /api/facets route spending seconds in archive statistics queries over the production archive. Role counts and message facet group-bys scanned more data than the first-paint web route needs.\n\nWhat changed: stats now reads role counts from existing session rollups, adds runtime/canonical indexes for message_type and material_origin, and uses a direct indexed grouping path for unfiltered global message facets while preserving the filtered session-join path. Existing archives receive the new indexes through runtime index repair.\n\nVerification: devtools test tests/unit/daemon/test_web_reader.py -k 'facets_global_returns_origins or facets_response_shape or archive_facets_expose_provider_role_and_material_origin_split'; devtools test tests/unit/storage/test_schema_policy_contracts.py -k runtime_indexes; fresh-process ArchiveStore.stats() against the live archive completed in about 0.81s.
Problem: live dogfooding showed repeated changed-file ingest batches on active large JSONL files. The local watcher is event-driven and must remain live, but events that only extend an incomplete trailing JSONL line should not enter archive ingest until a newline-complete record exists.\n\nWhat changed: the watcher now probes the append window from the current cursor offset. If a JSONL/NDJSON file grew without a complete new record, it records deferred cursor state and skips archive ingest for that event. Completing the line still schedules ingest immediately.\n\nVerification: devtools test tests/unit/sources/test_live_watcher.py -k 'incomplete_append_event_defers_without_ingest_until_newline or partial_trailing_line_keeps_cursor_at_last_newline or append_after_partial_line_reingests_completed_record or reingest_when_file_grows'; ruff check polylogue/sources/live/watcher.py tests/unit/sources/test_live_watcher.py. Patched source daemon stayed event-driven and did not reproduce the old rapid repeated no-op batch series during the sample window.
Problem: browser-capture full artifacts should coalesce with ChatGPT GDPR exports by provider-native conversation id. When a raw ChatGPT payload inside the browser envelope lacked its own id, the parser used the file fallback instead of the envelope session id, which could materialize a duplicate chatgpt-export session.\n\nWhat changed: raw ChatGPT browser-capture delegation now uses the envelope provider_session_id as the ChatGPT parser fallback. Tests cover the parser-level identity and an archive-level sequence that ingests a GDPR export plus a browser full artifact for the same conversation and observes one chatgpt-export session.\n\nVerification: devtools test tests/unit/sources/test_browser_capture.py -k 'raw_chatgpt_without_id or coalesces_with_chatgpt_export or prefers_raw_chatgpt_payload or receiver_artifact_lands_in_archive'; ruff check polylogue/sources/parsers/browser_capture.py tests/unit/sources/test_browser_capture.py.
Problem: live browser-capture smoke showed DOM ChatGPT snapshots materializing native ids like chatgpt:<conversation-id>:<hash>. Those IDs cannot coalesce with GDPR/provider exports, which key ChatGPT sessions by the provider conversation id. Custom GPT routes also failed the native backend-payload guard because only root /c/<id> routes were recognized.\n\nWhat changed: URL-derived browser session ids now use provider-native ids for ChatGPT /c/<id>, ChatGPT /g/<g-id>/c/<id>, and Claude /chat/<id> routes. Capture ids stay provider-prefixed for transport, but session.provider_session_id is now the coalescing key. ChatGPT native capture detection now recognizes custom GPT routes.\n\nVerification: npm test -- --run tests/common.test.js tests/content/chatgpt.test.js; npx eslint src/common.js src/content/chatgpt.js tests/common.test.js tests/content/chatgpt.test.js; npm run build.
Problem: browser-capture raw payload handling was asymmetric. ChatGPT raw artifacts delegated through the normal export parser, but Claude.ai raw artifacts fell back to the lossy DOM-envelope parser, so browser full artifacts and GDPR exports could diverge in identity and message shape. The provider smoke also hid basic local harness failures behind unhelpful errors. What changed: delegate raw Claude.ai browser payloads to the Claude AI parser with the envelope native id as fallback, add archive-level coalescing coverage, include OpenSSL in the devshell, and make browser-extension smoke scripts tolerate Chrome's generated service-worker target URL while reporting missing extension APIs explicitly. Verification: devtools test tests/unit/sources/test_browser_capture.py; ruff format --check polylogue/sources/parsers/browser_capture.py tests/unit/sources/test_browser_capture.py; ruff check polylogue/sources/parsers/browser_capture.py tests/unit/sources/test_browser_capture.py; nix develop --command sh -c 'command -v openssl && openssl version'; npm test -- --run tests/common.test.js tests/content/chatgpt.test.js; npx eslint src/common.js src/content/chatgpt.js tests/common.test.js tests/content/chatgpt.test.js. Deterministic provider smoke still stops at an explicit Chrome/CDP extension API blocker.
Problem: ChatGPT and Claude DOM fallback captures still invented provider-session ids for non-conversation routes, such as the ChatGPT root page. Those ids cannot coalesce with GDPR exports and showed up in live smoke as duplicate-prone native ids like chatgpt:/:<hash>. What changed: supported ChatGPT/Claude URL parsing now returns no session id when the URL lacks a provider-native conversation segment, and buildEnvelope rejects those pages instead of archiving synthetic native ids. Unknown future providers keep the old synthetic fallback until they get explicit identity rules. Verification: npm test -- --run tests/common.test.js tests/content/chatgpt.test.js; npx eslint src/common.js src/content/chatgpt.js tests/common.test.js tests/content/chatgpt.test.js.
Problem: older browser-extension captures used synthetic provider-session ids such as chatgpt:<conversation-id>:<hash> and claude-ai:<conversation-id>:<hash>. Those rows cannot coalesce with GDPR exports, and stale loaded extensions or reprocessed spool artifacts could keep producing the same duplicate-prone shape. What changed: browser-capture DOM parsing now recovers native conversation ids from legacy synthetic browser ids when a real id is present, including the old hyphenated UUID filename-derived pattern. Root-route synthetic ids such as chatgpt:/:<hash> are intentionally not normalized because there is no native conversation id to recover. Verification: devtools test tests/unit/sources/test_browser_capture.py; ruff format --check polylogue/sources/parsers/browser_capture.py tests/unit/sources/test_browser_capture.py; ruff check polylogue/sources/parsers/browser_capture.py tests/unit/sources/test_browser_capture.py.
Problem: source ingestion now normalizes legacy browser-capture session ids before indexing, but deployment-smoke still compared the latest spooled synthetic id literally against the indexed native id. Live smoke therefore reported a false mismatch after the archive had done the right thing. What changed: the browser-capture archive probe mirrors the parser's legacy-id normalization for its comparison, while still reporting the raw spooled id for visibility. Added coverage for a stale spooled id whose indexed row uses the recovered native conversation id. Verification: devtools test tests/unit/devtools/test_deployment_smoke.py -k browser_capture; ruff format --check devtools/deployment_smoke.py tests/unit/devtools/test_deployment_smoke.py; ruff check devtools/deployment_smoke.py tests/unit/devtools/test_deployment_smoke.py.
Problem: legacy browser-capture id normalization only applied to the DOM fallback path. Raw ChatGPT/Claude browser payloads still delegated to the provider parser with the legacy synthetic envelope id as fallback when the raw payload lacked its own native id, so reprocessing stale spool artifacts could preserve duplicate-prone ids. What changed: compute the normalized browser native id before raw-provider delegation and pass that as the parser fallback. Added a regression test for a raw ChatGPT payload whose envelope carries chatgpt:<native-id>:<hash>. Verification: devtools test tests/unit/sources/test_browser_capture.py; ruff format --check polylogue/sources/parsers/browser_capture.py tests/unit/sources/test_browser_capture.py; ruff check polylogue/sources/parsers/browser_capture.py tests/unit/sources/test_browser_capture.py.
Problem: older browser captures for ChatGPT WEB-prefixed conversations encoded /c/WEB:<uuid> routes as synthetic ids such as chatgpt:WEB:<uuid>:<hash> or chatgpt-WEB-<uuid>-<hash>-0. Those still could not coalesce with the native WEB:<uuid> id after the first legacy-normalization pass. What changed: extend browser-capture parser and deployment-smoke normalization to recover WEB:<uuid> from both legacy forms. Added focused parser coverage; deployment-smoke uses the same normalization for stale spool comparisons. Verification: devtools test tests/unit/sources/test_browser_capture.py tests/unit/devtools/test_deployment_smoke.py -k 'browser_capture'; ruff format --check polylogue/sources/parsers/browser_capture.py devtools/deployment_smoke.py tests/unit/sources/test_browser_capture.py tests/unit/devtools/test_deployment_smoke.py; ruff check polylogue/sources/parsers/browser_capture.py devtools/deployment_smoke.py tests/unit/sources/test_browser_capture.py tests/unit/devtools/test_deployment_smoke.py.
|
Warning Review limit reached
More reviews will be available in 26 minutes and 35 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThis PR normalizes legacy provider session IDs in the browser extension and Python parser to enable coalescing of browser captures with GDPR exports, adds scoped FTS trigger management with per-session FTS rebuild during session replacement, defers JSONL ingestion on incomplete trailing records, implements runtime SQLite indexes, adds observability location reporting to the daemon probe, and hardens dev-loop service-worker discovery via manifest-name disambiguation. ChangesBrowser Extension: Conversation ID Extraction and Envelope Validation
Browser Capture Parser: Legacy Native ID Normalization and Coalescing
SQLite Storage: Scoped FTS Rebuild, Runtime Indexes, and Stats Query
Live Ingest: JSONL Deferral and Stream-Record Batch Parsing
Devtools: Observability Locations Probe
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1057b0fc29
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@browser-extension/scripts/dev-loop-browser-smoke.mjs`:
- Around line 206-222: The manifest name verification is currently skipped when
there is only one candidate that matches the expected worker suffix, which can
cause binding to the wrong extension if multiple extensions expose the same
worker filename. Restructure the validation logic so that the manifest name
check (the evaluateJson call checking if manifestName matches
localManifest.name) is always performed before accepting a suffix-matching
worker, rather than only when multiple candidates exist. This ensures the worker
identity is verified consistently regardless of the number of candidates.
In `@browser-extension/scripts/dev-loop-live-provider-proof.mjs`:
- Around line 236-251: In the waitForExtensionWorker function, the suffix-based
candidate check (candidate.url.endsWith(expectedWorkerSuffix)) at line 247
returns immediately without allowing the manifest name disambiguation to run.
Reorder the conditional checks so that when multiple candidates exist, the
manifest name check is performed before the suffix-based fallback check. This
ensures that the more specific manifest name matching can disambiguate between
workers before accepting a match based on URL suffix alone.
In `@browser-extension/scripts/dev-loop-provider-smoke.mjs`:
- Around line 242-257: The suffix match check in the waitForExtensionWorker
function (line 253) returns immediately upon finding a candidate whose URL ends
with expectedWorkerSuffix, without verifying the manifest name first. When
multiple service workers exist, this can incorrectly select a non-matching
worker. Reorder the logic to evaluate and verify the manifest name matches
expectedManifestName before returning on a suffix match, ensuring manifest
identity is checked as a disambiguator when multiple candidates are present.
In `@devtools/deployment_smoke.py`:
- Around line 517-524: The `_browser_capture_probe_native_id(...)` function
duplicates the native-id normalization logic that already exists as
`_legacy_native_id` in polylogue/sources/parsers/browser_capture.py, creating
drift risk between ingest and deployment smoke validation. Extract the shared
normalization logic into a single utility function in an appropriate shared
module and update both `_browser_capture_probe_native_id(...)` and the parser to
call this shared utility instead of maintaining separate implementations. Also
check lines 590-611 as the comment indicates the same duplication pattern
applies there as well.
In `@polylogue/sources/live/batch.py`:
- Around line 119-130: The function _is_stream_record_provider in live/batch.py
contains provider routing logic that should be centralized in the dispatch layer
to prevent policy drift. Move the stream-record provider detection logic (the
file extension checks for .jsonl, .ndjson patterns and the Provider.from_string
lookup against STREAM_RECORD_PROVIDERS) from this location to
polylogue/sources/dispatch.py or the appropriate provider-specific parser, then
have batch.py call that canonical routing function instead of implementing its
own detection logic. This ensures the routing policy stays synchronized with the
looks_like() ordering and prevents different routes from independently claiming
records.
In `@polylogue/sources/live/watcher.py`:
- Around line 510-518: The function has two issues: First, the exception handler
only catches FileNotFoundError but other OSError exceptions from file open/read
operations can escape and break the watcher, so broaden the except clause to
catch OSError instead. Second, when no newline is found in the probed payload
bytes, the function returns True (deferring processing) without checking if the
file has grown beyond the probe window size, which can cause permanent
starvation if a newline exists beyond the probe window. Add logic to return
False (do not defer) when bytes_to_probe is less than (stat.st_size -
start_offset), indicating the file has grown beyond the probe window, even if no
newline was found in the current probe bytes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ece227ea-380e-4551-8417-46721e64f036
📒 Files selected for processing (26)
README.mdbrowser-extension/scripts/dev-loop-browser-smoke.mjsbrowser-extension/scripts/dev-loop-live-provider-proof.mjsbrowser-extension/scripts/dev-loop-provider-smoke.mjsbrowser-extension/src/common.jsbrowser-extension/src/content/chatgpt.jsbrowser-extension/tests/common.test.jsbrowser-extension/tests/content/chatgpt.test.jsdevtools/daemon_workload_probe.pydevtools/deployment_smoke.pyflake.nixpolylogue/sources/live/batch.pypolylogue/sources/live/watcher.pypolylogue/sources/parsers/browser_capture.pypolylogue/storage/fts/fts_lifecycle.pypolylogue/storage/sqlite/archive_tiers/archive.pypolylogue/storage/sqlite/archive_tiers/index.pypolylogue/storage/sqlite/archive_tiers/write.pypolylogue/storage/sqlite/runtime_indexes.pytests/unit/devtools/test_daemon_workload_probe.pytests/unit/devtools/test_deployment_smoke.pytests/unit/sources/test_browser_capture.pytests/unit/sources/test_live_batch_support.pytests/unit/sources/test_live_watcher.pytests/unit/storage/test_archive_tiers_write.pytests/unit/storage/test_schema_policy_contracts.py
💤 Files with no reviewable changes (1)
- README.md
Problem: PR review found duplicate browser-capture identity normalization, duplicate stream-record routing, and two live-smoke/watch edge cases that could pick the wrong extension worker or defer large incomplete JSONL tails indefinitely. What changed: shared browser-capture legacy ID normalization between parser and deployment smoke; centralized JSONL/stream-record routing in dispatch; made incomplete-tail probing OSError-safe and non-starving for tails beyond the probe window; required manifest-name selection before multi-worker fallbacks in browser dev-loop smokes. Verification: devtools test tests/unit/browser_capture/test_receiver_contract.py -k legacy_browser_capture_native_id; devtools test tests/unit/sources/test_live_watcher.py -k large_incomplete_jsonl_append_still_needs_work; devtools test tests/unit/devtools/test_deployment_smoke.py tests/unit/sources/test_live_batch_support.py tests/unit/pipeline/test_parsing_service.py -k 'browser_capture or stream or jsonl or deployment'; devtools verify --quick; npm --prefix browser-extension test -- --run; npm --prefix browser-extension run validate && npm --prefix browser-extension run build; node --check on changed browser-extension dev-loop scripts.
Problem: same-version split archives could be opened through ArchiveStore.open_existing(read_only=True) before a write path had ensured runtime performance indexes, leaving read-heavy surfaces such as facets on stale planner support. What changed: read-only ArchiveStore opens now perform a best-effort same-version runtime-index ensure before switching to the read-only connection. The ensure uses the existing runtime index contract and falls back to ordinary read behavior on SQLite errors. Verification: devtools test tests/unit/storage/test_schema_policy_contracts.py -k 'runtime_indexes or read_only_archive_open'; devtools verify --quick.
…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.
…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.
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
This PR repairs the live Polylogue dogfooding path around large-session ingest, browser-capture identity, archive convergence, and dev-loop observability. It keeps the branch broad because the failures were coupled in production: giant sessions exposed write-path/index issues, browser capture exposed duplicate-prone identity, and deployment smoke needed to report the actual normalized archive state.
Problem
Live production evidence showed several concrete failures:
/api/facetswas slow enough to hurt first-paint/readiness checks;chatgpt:<native-id>:<hash>andclaude-ai:<native-id>:<hash>;Ref #2308. Ref #2304.
Solution
WEB:<uuid>routes.Operational production repair performed after backup:
Remaining #2308 scope:
Remaining #2304 scope:
Verification
devtools test tests/unit/sources/test_browser_capture.pydevtools test tests/unit/devtools/test_deployment_smoke.py -k browser_capturedevtools test tests/unit/sources/test_browser_capture.py tests/unit/devtools/test_deployment_smoke.py -k 'browser_capture'devtools test tests/unit/sources/test_live_watcher.py -k incomplete_appendnpm test -- --run tests/common.test.js tests/content/chatgpt.test.jsnpx eslint src/common.js src/content/chatgpt.js tests/common.test.js tests/content/chatgpt.test.jsnix develop --command sh -c 'command -v openssl && openssl version'devtools workspace deployment-smoke --daemon-url http://127.0.0.1:8766 --receiver-url http://127.0.0.1:8765 --json.agent/scratch/live-dogfood-2026-06-23/source-daemon/16-post-browser-cleanup-smoke.json,ok: true,failures: []devtools verify --quick20260623T215308Z-quick-910724-cd5350f1, exit0Live route timings after cleanup/source daemon restart:
/api/status:0.014s/api/facets:1.033s/api/sessions?query=polylogue&limit=1:3.405sBrowser-capture cleanup evidence is recorded under
.agent/scratch/live-dogfood-2026-06-23/browser-capture/.Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation
Tests