Skip to content

test(mv3): prove real downloads compatibility - #43

Open
seonghobae wants to merge 17 commits into
mainfrom
test/mv3-downloads
Open

test(mv3): prove real downloads compatibility#43
seonghobae wants to merge 17 commits into
mainfrom
test/mv3-downloads

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Buyer-visible gap

Partial implementation of #27. OriginWeave's pinned real-Chromium Manifest V3 lane needed executable proof that the declared downloads surface works through a bounded controlled download rather than a source-text or mock-only assertion.

Implemented boundary

Current exact head 27ce89066ed1473dcd66eb26a2f91becf9df5424:

  • requests the Manifest V3 downloads permission;
  • serves a deterministic fixture payload from a controlled 127.0.0.1 HTTP origin owned by the compatibility runner;
  • executes the real chrome.downloads.download API;
  • uses bounded chrome.downloads.search verification;
  • requires a completed download with the exact controlled URL, expected byte count, and an actual downloaded file;
  • propagates compatibility evidence through the controlled content-script fixture;
  • preserves only an allowlisted download-stage diagnostic token in runner failure evidence; and
  • reduces any unreviewed diagnostic, raw local path, or raw browser error string to bounded generic evidence rather than exposing it.

The loopback fixture origin is test-only. This PR does not authorize arbitrary network downloads, filesystem access, or additional OriginWeave Agent capability.

Review RCA and TDD

CodeRabbit identified that originweaveDownloadsDiagnostic existed in the fixture but the Python runner did not collect it, so a failed download could degrade to only downloads=missing.

The fix was test-first:

  1. commit 669e308358f7488e6899c9fb288c795562aa7f84 added the regression contract requiring runner collection, an exact allowlist, preservation of reviewed stage tokens, and rejection of raw paths/browser errors;
  2. commit 27ce89066ed1473dcd66eb26a2f91becf9df5424 added the narrow runner implementation and requires download-complete-ready on a successful browser pass.

The review thread is resolved as addressed on the current code.

Exact-head evidence

On unchanged head 27ce89066ed1473dcd66eb26a2f91becf9df5424 against protected main 67af7c87589edc2039545af335c95064d9b8391c:

  • Manifest V3 Compatibility run 31355609614: success;
  • CI run 31355609658: success;
  • SAST Semgrep run 31355609648: success;
  • Security Scan run 31355609649: success;
  • GitHub reports the PR mergeable;
  • the previously actionable CodeRabbit inline thread is resolved/outdated after the fix.

The submitted CodeRabbit review is COMMENTED, not an independent formal approval. No predecessor-head check or review is being transferred.

Truth and scope boundary

This PR proves one declared Manifest V3 compatibility capability only. It does not prove full Chrome extension compatibility, extension-to-Agent authority isolation, native messaging, enterprise managed-extension policy, Chrome Web Store behavior, Google services, codecs/DRM, remote-download policy, credentials, arbitrary filesystem authority, or release readiness. Those remain governed by issue #27 and canonical documentation maturity labels.

Partial implementation of #27.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

MV3 호환성 실행기가 historydownloads 표면을 검증합니다. MV3 fixture는 loopback 다운로드와 단계별 진단을 수행합니다. 실패 결과는 제한된 증거와 분류된 오류 유형을 기록합니다.

Changes

MV3 호환성 검증

Layer / File(s) Summary
실행기 표면 검증 및 실패 증거
scripts/ci/run_mv3_compatibility.py
실행기가 historydownloads 상태를 수집하고, downloads: ready를 수렴 조건으로 적용합니다. 실패 결과는 분류된 오류 유형과 제한된 표면 관찰값을 포함합니다. 브라우저 세션은 전용 다운로드 디렉터리와 다운로드 설정을 사용합니다.
MV3 다운로드 실행 및 진단
tests/fixtures/mv3_basic/manifest.json, tests/fixtures/mv3_basic/service_worker.js, tests/fixtures/mv3_basic/content_script.js, tests/fixtures/mv3_basic/download.txt
Fixture가 downloads 권한과 결정적 payload를 사용합니다. 서비스 워커가 다운로드 항목, URL, 바이트 수, 파일 존재 여부를 폴링합니다. 콘텐츠 스크립트는 다운로드 상태와 진단 정보를 문서 데이터 속성에 기록합니다.
다운로드 계약 검증
tests/test_mv3_compatibility_contract.py, tests/test_mv3_downloads_contract.py
계약 테스트가 다운로드 권한, loopback URL, 출처 및 프로토콜 제한, 단계별 진단 토큰, 준비 신호, 민감한 오류 정보 비노출을 검증합니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant 호환성 실행기
  participant MV3 서비스 워커
  participant Loopback HTTP 서버
  participant 다운로드 디렉터리
  호환성 실행기->>MV3 서비스 워커: downloads 표면 검사 요청
  MV3 서비스 워커->>Loopback HTTP 서버: 로컬 payload 요청
  Loopback HTTP 서버-->>MV3 서비스 워커: 다운로드 응답
  MV3 서비스 워커->>다운로드 디렉터리: 파일 저장
  MV3 서비스 워커-->>호환성 실행기: ready 상태와 진단 정보 반환
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 MV3 다운로드 호환성 검증을 추가하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/mv3-downloads

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.

@seonghobae seonghobae changed the title test(mv3): require real downloads compatibility test(mv3): prove real downloads compatibility Aug 10, 2026
@seonghobae
seonghobae marked this pull request as ready for review August 10, 2026 03:40

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@scripts/ci/run_mv3_compatibility.py`:
- Around line 236-237: Update the evidence collection around the document
dataset mapping to include originweaveDownloadsDiagnostic and add that key to
SURFACE_EVIDENCE_KEYS. Apply a dedicated allowlist so only approved diagnostic
tokens, including download-source-rejected, are propagated into
CompatibilitySurfaceError and trial_results; do not expose raw error strings.
Add a contract test covering diagnostic collection and confirming raw errors are
omitted.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d73a2eca-a087-402a-90f4-77b9e198f634

📥 Commits

Reviewing files that changed from the base of the PR and between 67af7c8 and c58bde7.

📒 Files selected for processing (7)
  • scripts/ci/run_mv3_compatibility.py
  • tests/fixtures/mv3_basic/content_script.js
  • tests/fixtures/mv3_basic/download.txt
  • tests/fixtures/mv3_basic/manifest.json
  • tests/fixtures/mv3_basic/service_worker.js
  • tests/test_mv3_compatibility_contract.py
  • tests/test_mv3_downloads_contract.py

Comment thread scripts/ci/run_mv3_compatibility.py Outdated
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