Skip to content

feat: add browser capture sync - #395

Merged
Sinity merged 1 commit into
masterfrom
feature/feat/browser-capture-sync
Apr 24, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/feat/browser-capture-sync

Conversation

@Sinity

@Sinity Sinity commented Apr 24, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a local-first browser capture path for web LLM sessions. Browser-observed ChatGPT and Claude.ai sessions now flow through a typed Polylogue capture envelope, a localhost receiver, normal inbox artifacts, source dispatch, parsing, and archive storage.

Closes #312.

Problem

ChatGPT and Claude.ai sessions required manual exports, so browser-hosted model work was disconnected from Polylogue's normal archive/query/product surfaces. The extension also needed archive-aware feedback rather than blind background upload.

Solution

  • Added polylogue.browser_capture typed envelope models, deterministic inbox artifact naming, receiver status/archive-state helpers, and a local HTTP server.
  • Wired browser-capture envelopes into artifact taxonomy, provider detection, source dispatch, and parser lowering so they ingest as normal conversations.
  • Added polylogue browser-capture status|serve and generated command/docs surfaces.
  • Added a static Manifest V3 extension under browser-extension/polylogue-browser-capture/ with ChatGPT and Claude.ai adapters, background transport, badge state, receiver configuration, capture/check controls, and a popup UI.
  • Documented setup, privacy/local-only transport, endpoint contract, and provider-adapter expectations.

Verification

  • pytest -q tests/unit/sources/test_browser_capture.py tests/unit/browser_capture/test_receiver.py → 9 passed
  • pytest -q tests/unit/browser_capture/test_receiver.py tests/unit/sources/test_browser_capture.py tests/unit/cli/test_click_app.py::TestCliMetadata::test_all_subcommands_registered tests/unit/cli/test_terminal_snapshots.py → 20 passed
  • node --check on all extension scripts plus python -m json.tool on the manifest → passed
  • Headless Chrome screenshot rendered browser-extension/polylogue-browser-capture/src/popup.html without clipped controls after CSS fix
  • devtools render-all --check → sync OK
  • devtools verify → all checks passed
  • pre-push devtools verify --quick → all checks passed

Problem: ChatGPT and Claude.ai web sessions required manual exports, which left browser-hosted model work outside the normal Polylogue archive and product surfaces.

What changed: Add a typed browser-capture envelope, local receiver, parser/dispatch integration, conversation-artifact taxonomy support, and a static MV3 extension with ChatGPT and Claude.ai adapters plus a polished status/capture popup.

Verification: devtools verify passed. Focused checks: pytest -q tests/unit/sources/test_browser_capture.py tests/unit/browser_capture/test_receiver.py; node --check extension scripts; headless Chrome popup screenshot rendered without clipping.

Closes #312
@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 31 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 31 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a08d15c3-e17d-4c45-b6cf-bf01ee4f5fb5

📥 Commits

Reviewing files that changed from the base of the PR and between f6aad25 and f4623ec.

📒 Files selected for processing (27)
  • browser-extension/polylogue-browser-capture/README.md
  • browser-extension/polylogue-browser-capture/manifest.json
  • browser-extension/polylogue-browser-capture/src/background.js
  • browser-extension/polylogue-browser-capture/src/common.js
  • browser-extension/polylogue-browser-capture/src/content/chatgpt.js
  • browser-extension/polylogue-browser-capture/src/content/claude.js
  • browser-extension/polylogue-browser-capture/src/popup.html
  • browser-extension/polylogue-browser-capture/src/popup.js
  • devtools/docs_surface.py
  • docs/README.md
  • docs/browser-capture.md
  • docs/cli-reference.md
  • docs/test-quality-workflows.md
  • docs/verification-catalog.md
  • polylogue/browser_capture/__init__.py
  • polylogue/browser_capture/models.py
  • polylogue/browser_capture/receiver.py
  • polylogue/browser_capture/server.py
  • polylogue/cli/click_command_registration.py
  • polylogue/cli/commands/browser_capture.py
  • polylogue/lib/artifact_taxonomy_support.py
  • polylogue/sources/dispatch.py
  • polylogue/sources/parsers/browser_capture.py
  • tests/unit/browser_capture/test_receiver.py
  • tests/unit/cli/__snapshots__/test_terminal_snapshots.ambr
  • tests/unit/cli/test_click_app.py
  • tests/unit/sources/test_browser_capture.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/browser-capture-sync

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 and usage tips.

self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(raw)))
if _origin_allowed(origin, self.server.config):
self.send_header("Access-Control-Allow-Origin", origin or "null")
return
origin = self.headers.get("Origin")
self.send_response(HTTPStatus.NO_CONTENT.value)
self.send_header("Access-Control-Allow-Origin", origin or "null")

@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: f4623ec51f

ℹ️ 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 commented Apr 24, 2026

Copy link
Copy Markdown
Owner Author

Live browser debug validation added after opening the PR:

  • Chrome DevTools MCP/CDP attached to the logged-in Chrome profile.
  • Authenticated ChatGPT and Claude.ai pages opened successfully.
  • Adapter-style selectors extracted synthetic two-turn fixtures from each live page without reading existing private chat text.
  • Receiver accepted both envelopes with HTTP 202.
  • Isolated acquire+parse stored both as browser-capture conversations with expected provider ids and adapter metadata.
  • Direct page-context fetch to localhost was blocked by the live page environment, confirming the extension background transport is the correct architecture.

@Sinity
Sinity merged commit c97b609 into master Apr 24, 2026
12 of 13 checks passed
@Sinity
Sinity deleted the feature/feat/browser-capture-sync branch April 24, 2026 01:14
@Sinity

Sinity commented Apr 28, 2026

Copy link
Copy Markdown
Owner Author

🤖 Post-hoc audit note: this PR received bot review feedback verified against current HEAD as part of #544. 2 finding(s) confirmed still present → tracked in #550.

@Sinity
Sinity requested a review from Copilot May 1, 2026 00:44
@Sinity
Sinity requested review from Copilot and removed request for Copilot May 1, 2026 01:05
@Sinity
Sinity removed the request for review from Copilot May 1, 2026 02:15
Sinity added a commit that referenced this pull request May 7, 2026
## Summary

Adds a local-first browser capture path for web LLM sessions. Browser-observed ChatGPT and Claude.ai sessions now flow through a typed Polylogue capture envelope, a localhost receiver, normal inbox artifacts, source dispatch, parsing, and archive storage.

Closes #312.

## Problem

ChatGPT and Claude.ai sessions required manual exports, so browser-hosted model work was disconnected from Polylogue's normal archive/query/product surfaces. The extension also needed archive-aware feedback rather than blind background upload.

## Solution

- Added `polylogue.browser_capture` typed envelope models, deterministic inbox artifact naming, receiver status/archive-state helpers, and a local HTTP server.
- Wired browser-capture envelopes into artifact taxonomy, provider detection, source dispatch, and parser lowering so they ingest as normal conversations.
- Added `polylogue browser-capture status|serve` and generated command/docs surfaces.
- Added a static Manifest V3 extension under `browser-extension/polylogue-browser-capture/` with ChatGPT and Claude.ai adapters, background transport, badge state, receiver configuration, capture/check controls, and a popup UI.
- Documented setup, privacy/local-only transport, endpoint contract, and provider-adapter expectations.

## Verification

- `pytest -q tests/unit/sources/test_browser_capture.py tests/unit/browser_capture/test_receiver.py` → `9 passed`
- `pytest -q tests/unit/browser_capture/test_receiver.py tests/unit/sources/test_browser_capture.py tests/unit/cli/test_click_app.py::TestCliMetadata::test_all_subcommands_registered tests/unit/cli/test_terminal_snapshots.py` → `20 passed`
- `node --check` on all extension scripts plus `python -m json.tool` on the manifest → passed
- Headless Chrome screenshot rendered `browser-extension/polylogue-browser-capture/src/popup.html` without clipped controls after CSS fix
- `devtools render-all --check` → sync OK
- `devtools verify` → all checks passed
- pre-push `devtools verify --quick` → all checks passed
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

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.

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.

[feat] Chrome extension — bidirectional sync for web LLM sessions

2 participants