Skip to content

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

Draft
seonghobae wants to merge 107 commits into
mainfrom
test/mv3-downloads
Draft

test(mv3): prove real downloads compatibility#43
seonghobae wants to merge 107 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. This Draft proves one bounded Manifest V3 downloads contract and hardens WebDriver cleanup, executable/status authority, startup/parser diagnostics, and evidence redaction without widening Agent authority. The current exact head now has successful sandbox-enabled real-Chromium evidence, but its sandbox-helper workflow delta is still in the wrong ownership location and therefore is not protected/canonical release evidence.

Current lineage and ownership

Current contributor head is exact 6f3134d18d3118aab33d28048671dc71a5f47b77, open, Draft, and mergeable. The PR's recorded main base is c789b802fc98a8d7fd8c09d9327f36828054d2a1; protected main has advanced beyond that generation, so a later canonical-owner adoption/restack must use the then-live protected head rather than treating this stale base as current.

The prior product/tree reconstruction at e5db34c57d7b1de61d613a196117ca2cce296bec preserved the valid #43 source/test/docs delta while consuming then-protected workflow blobs. One intervening commit, 6f3134d18d3118aab33d28048671dc71a5f47b77 (fix(mv3): restore sandbox after restack), adds exactly the hosted helper mechanics to .github/workflows/mv3-compatibility.yml: root ownership for the pinned archive's chrome_sandbox, mode 4755, and CHROME_DEVEL_SANDBOX for the real fixture.

Those lines are now executed and useful, but they remain in the wrong ownership location for this scheduled product lane. Protected AGENTS.md forbids scheduled agents from altering workflows, and issue #212 owns the canonical workflow repair. Review 5112764360, issue comment 5540222475, and the later exact-evidence handoff in #212 record this as repair/retarget work, not a Close condition. Preserve the delta until an authorized workflow owner adopts it or an equivalent reviewed implementation, then restack #43 non-destructively onto that canonical generation.

#281 remains a dependent diagnostic-redaction lane and must follow the repaired #43 generation rather than compete as a direct-main writer.

Implemented product boundary

The branch:

  • exercises chrome.downloads.download and bounded chrome.downloads.search against one controlled loopback fixture;
  • requires exact controlled URL, expected byte count, completed state, and downloaded-file existence;
  • allow-lists published diagnostics and excludes raw browser/WebDriver/page-controlled text from evidence;
  • binds reviewed Chrome/ChromeDriver executables and validates ChromeDriver /status identity;
  • bounds startup output and treats malformed/non-authoritative startup records as observations until the deadline;
  • preserves the causal browser-pass failure when cleanup also fails and retains secondary teardown failures only as bounded type evidence;
  • sanitizes WebDriver HTTP/parser, returned browser-version, click mismatch, and fixture-surface diagnostics; and
  • removes --no-sandbox from the real compatibility runner, so an environment that cannot start the pinned browser securely fails rather than weakening the browser boundary.

The download diagnostic distinction remains explicit: after an accepted integer download ID, bounded polling exhaustion is download-timeout; a rejected chrome.downloads.search remains download-not-evaluated.

Hosted RED predecessor

On predecessor e5db34c57d7b1de61d613a196117ca2cce296bec, CI 33740544401 failed because the repository contract required the pinned chrome_sandbox to be root-owned, mode 4755, and exposed through CHROME_DEVEL_SANDBOX. Production coverage independently remained 100%.

Manifest V3 Compatibility 33740544442, job 100601170874, downloaded exact Chrome/ChromeDriver 150.0.7871.129 and failed all three sandbox-preserving browser trials with failure_kind=webdriver_protocol_error, error_code=session not created; repeatability was 0/3. Failure artifact 9915138865 remains causal predecessor RED.

Current exact-head GREEN — leaf implementation only

Exact 6f3134d18d3118aab33d28048671dc71a5f47b77 now has terminal hosted evidence:

  • Manifest V3 Compatibility 33866932365: success; job 101003808036 successfully downloaded the exact Chrome/ChromeDriver pair and executed the real fixture;
  • CI 33866932436: success;
  • Security Scan 33866932442: success;
  • SAST Semgrep 33866932380: success;
  • materializer 33866932446: skipped and not product evidence.

Downloaded artifact 9938906825 (sha256:8644c2d16ce9d91ff7bb46075793b313507d3f37b590965a686f9b05a61ce519) independently reports Chrome 150.0.7871.129, three successful real-browser trials out of three, and the expected bounded surfaces including downloads, real browser click, restart persistence, storage, DNR, tabs/windows, scripting, service worker, bookmarks and history.

This closes the technical feasibility question for the three helper mechanics on this leaf generation. It does not legitimize leaf workflow ownership, transfer GREEN to #148/#288, satisfy an absent CodeQL/current-review/ruleset requirement, or make the stale base protected-current.

Causal repair boundary

Do not repair this lane by restoring --no-sandbox, weakening/deleting the sandbox-helper contract, hiding session not created, or treating the leaf workflow edit as final workflow authority. The required topology remains:

  1. authorized workflow owner adopts the three validated sandbox-helper mechanics, or an equivalent reviewed implementation, in the canonical workflow path;
  2. that protected/canonical generation is verified under its own current checks;
  3. test(mv3): prove real downloads compatibility #43 adopts it non-destructively without force-push or destructive rebase and drops the duplicate leaf authority; and
  4. repository contracts, the three-trial pinned-Chromium fixture, coverage/rustdoc, security/governance checks and any live review/ruleset gates execute on the resulting exact head.

Scope / non-claims

This PR does not prove full extension compatibility, extension-to-Agent authority isolation, native messaging, enterprise policy, Chrome Web Store behavior, Google services, codecs/DRM, remote-download policy, credentials, arbitrary filesystem authority, production browser-adapter authenticity, protected-main delivery, or release readiness. No qualifying independent current-head APPROVED review is claimed. Keep Draft.

The #43 PR-state/evidence writer is released after this update. No source, workflow, ruleset, secret, merge, tag, release or publication mutation was made in this coalescing step.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

MV3 호환성 실행기가 historydownloads 표면을 검증합니다. MV3 fixture는 loopback 다운로드와 단계별 진단을 수행합니다. 실패 결과는 제한된 증거와 분류된 오류 유형을 기록합니다. 바이너리 경로 검증과 세션 정리 예외 전파 계약도 추가되었습니다.

Changes

MV3 호환성 검증

Layer / File(s) Summary
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를 사용합니다. 서비스 워커가 loopback URL에서 다운로드를 시작하고 상태, URL, 바이트 수, 파일 존재 여부를 확인합니다. 콘텐츠 스크립트는 상태와 진단 정보를 문서 데이터 속성에 기록합니다.
실행기 표면 검증 및 실패 증거
scripts/ci/run_mv3_compatibility.py
실행기가 표면 값을 수집하고 허용 목록으로 정규화합니다. downloads: readydownload-complete-ready를 수렴 조건으로 적용합니다. 실패 결과에는 분류된 오류 유형과 제한된 관찰값을 기록합니다. 브라우저 세션은 전용 다운로드 디렉터리와 다운로드 설정을 사용합니다.
바이너리 권한 및 세션 정리
scripts/ci/run_mv3_compatibility.py, tests/test_mv3_binary_authority_contract.py, tests/test_mv3_session_cleanup_exception_contract.py
실행기가 외부 실행 파일과 심볼릭 링크를 거부하고 고정된 바이너리 경로를 허용합니다. 세션 삭제 실패와 ChromeDriver 종료 실패를 분리하고 kill() 폴백을 검증합니다.
다운로드 및 진단 계약 검증
tests/test_mv3_compatibility_contract.py, tests/test_mv3_downloads_contract.py, tests/test_mv3_click_diagnostic_contract.py, CHANGELOG.md, docs/doctoring.md, docs/doctoring/mv3-compatibility.md
계약 테스트와 문서가 다운로드 진단 토큰, 제한된 실패 증거, WebDriver 오류 분류, 클릭 후조건 및 관련 참고문헌을 검증하고 설명합니다.

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

Merge Risk: 🟡 Moderate · up to cbd5d

The PR adds real pinned-Chromium download coverage and fail-closed runner hardening, but an unhandled transport-error path could stop the compatibility run without bounded diagnostics. The required independent approval and security checks are also still outstanding, so the PR should not merge until these items are addressed or explicitly accepted.

Sequence Diagram(s)

sequenceDiagram
  participant 호환성실행기
  participant MV3서비스워커
  participant LoopbackHTTP서버
  participant 다운로드디렉터리
  호환성실행기->>MV3서비스워커: downloads 표면 검사 요청
  MV3서비스워커->>LoopbackHTTP서버: 로컬 payload 요청
  LoopbackHTTP서버-->>MV3서비스워커: 다운로드 응답
  MV3서비스워커->>다운로드디렉터리: 파일 저장
  MV3서비스워커-->>호환성실행기: ready 상태와 진단 정보 반환
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.37% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 제목은 실제 Chromium에서 Manifest V3 downloads 호환성을 검증하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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[bot]

This comment was marked as resolved.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 27ce89066ed1473dcd66eb26a2f91becf9df5424.

  • Head SHA: 27ce89066ed1473dcd66eb26a2f91becf9df5424

  • Workflow run: 31641414172

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["CI script: run_mv3_compatibility.py"]
  S1 --> I1["review and security gate shell path"]
  I1 --> R1["Review risk: CI script: run_mv3_compatibility.py"]
  R1 --> V1["bash -n plus Strix self-test"]
  Evidence --> S2["Test (6 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test (6 files)"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 4be3b77b0652a389fc67637e89562aeccedfff20
  • Workflow run: 32204704738
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 4be3b77b0652a389fc67637e89562aeccedfff20.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: CHANGELOG.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: CHANGELOG.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs (2 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs (2 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["CI script: run_mv3_compatibility.py"]
  S3 --> I3["review and security gate shell path"]
  I3 --> R3["Review risk: CI script: run_mv3_compatibility.py"]
  R3 --> V3["bash -n plus Strix self-test"]
  Evidence --> S4["Test (13 files)"]
  S4 --> I4["regression suite"]
  I4 --> R4["Review risk: Test (13 files)"]
  R4 --> V4["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Scheduled review-feedback autofix for this PR head.

  • Head SHA: 28e79febd47361c5fd41e45db7e1429b179afdd1

@opencode-agent

opencode-agent Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Scheduled review-feedback autofix for this PR head.

  • Head SHA: 28e79febd47361c5fd41e45db7e1429b179afdd1

@opencode-agent

opencode-agent Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Scheduled review-feedback autofix for this PR head.

  • Head SHA: 28e79febd47361c5fd41e45db7e1429b179afdd1

@opencode-agent

opencode-agent Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Scheduled review-feedback autofix for this PR head.

  • Head SHA: 28e79febd47361c5fd41e45db7e1429b179afdd1

Adopt protected main c789b80 as the second parent without rewriting history. Preserve the existing #43 product/test/docs delta and its auto-merged CHANGELOG, but carry protected-main CI and MV3 workflow blobs byte-for-byte so this product writer does not author workflow semantics.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head repair verification: the old #43 branch was 130 commits behind protected main and carried a product-writer-owned workflow delta. I preserved the valid downloads/fixture/test/doctoring/CHANGELOG tree through a non-force two-parent restack onto exact main@c789b802fc98a8d7fd8c09d9327f36828054d2a1. The merge tree carries protected-main .github/workflows/ci.yml and .github/workflows/mv3-compatibility.yml byte-for-byte rather than authoring workflow semantics. Fresh exact compare is ahead 106 / behind 0 with merge base exactly c789b802..., and the PR diff is now 19 product/docs/test files with no .github/** path. Previous head GREEN does not transfer: exact-head CI/MV3/SAST/Security/OSV/Scorecard are newly queued and the one-shot materializer is skipped. Keep Draft until current-head browser/security evidence is terminal.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head repair finding: the source-tree ownership reconstruction is correct, but it exposed an executable contract mismatch that must stay fail-closed. On exact head e5db34c57d7b1de61d613a196117ca2cce296bec, tests/test_mv3_compatibility_contract.py::test_workflow_installs_chromium_sandbox_helper requires the pinned Chrome for Testing chrome_sandbox helper to be root-owned, mode 4755, and exported through CHROME_DEVEL_SANDBOX. The reconstructed branch deliberately carries protected-main .github/workflows/mv3-compatibility.yml byte-for-byte; that live workflow currently contains none of those three requirements. At the same time the product runner correctly no longer passes --no-sandbox.

Do not repair this by deleting/weakening the sandbox contract or restoring --no-sandbox, and do not reintroduce a product-branch workflow mutation from this scheduled writer. Chromium's Linux SUID sandbox documentation for raw builds explicitly uses chown root:root chrome_sandbox, chmod 4755 chrome_sandbox, and CHROME_DEVEL_SANDBOX=$PWD/chrome_sandbox; the repository's own prior exact-head browser evidence also proved this pinned archive/helper combination can run successfully when configured.

Required causal owner repair: land the sandbox-helper setup through the authorized workflow-owner path on protected-main lineage (or a reviewed equivalent sandbox-capable mechanism), then non-destructively adopt that owner delta into #43 and require fresh exact-head repository contracts plus sandbox-enabled real Chromium MV3 execution. Until then #43 must remain Draft. Current queued runs are incomplete evidence, not GREEN.

seonghobae added a commit that referenced this pull request Sep 3, 2026
Adopt #43 exact head as the canonical MV3 compatibility foundation without rewriting #281 history. Preserve the dedicated hostile-diagnostic regression contract while taking the stronger sandboxed downloads/runtime evidence tree from the parent lane.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh hosted execution verifies the canonical workflow mismatch as a real RED, not a queued-runner hypothesis. CI 33740544401 / Rust contracts 100601170828 fails only at Check Python repository contracts: test_workflow_installs_chromium_sandbox_helper requires chrome_sandbox installation and CHROME_DEVEL_SANDBOX, but the protected-main/current-#43 workflow has neither. Rust formatting/check/test/Clippy/rustdoc are skipped after that repository-contract failure. Production coverage 100601171026 independently succeeds, so coverage is not causal. MV3 33740544442 / job 100601170874 then downloads exact Chrome/ChromeDriver 150.0.7871.129, executes the sandbox-preserving runner without the helper, and all 3 real-browser trials fail closed as webdriver_protocol_error / session not created; repeatability is 0/3. Failure artifact ID 9915138865 was retained. Issue #212 comment 5532890884 now carries the exact owner-path RCA. Do not restore --no-sandbox or weaken/delete the contract. Protected-main AGENTS forbids this scheduled writer from workflow changes; authorized workflow ownership must install root-owned mode-4755 chrome_sandbox, export CHROME_DEVEL_SANDBOX, retain harden-runner/egress/pins, then rerun exact-head contracts and pinned Chromium. COMMENT only; no approval or gate weakening.

Signed-off-by: Seongho Bae <me@seonghobae.me>

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head ownership finding on 6f3134d18d3118aab33d28048671dc71a5f47b77: the intervening commit adds exactly the sandbox-helper mechanics required by the hosted #43 RED (root:root, mode 4755, CHROME_DEVEL_SANDBOX) and should be preserved as a valid candidate delta, but it reintroduces .github/workflows/mv3-compatibility.yml into this leaf product PR. Protected-main AGENTS.md and issue #212 explicitly reserve workflow mutation for an authorized workflow-owner path, so this is a repair/retarget finding, not grounds to close or discard #43. Keep the PR Draft and keep the product/browser evidence; have the canonical workflow owner adopt the three-line workflow delta (or an equivalent reviewed repair), then non-destructively restack #43 onto that released/protected workflow generation and rerun repository contracts plus the sandbox-enabled three-trial Chromium fixture. Current exact-head runs 33866932365 (MV3), 33866932436 (CI), 33866932380 (SAST), and 33866932442 (Security) are queued, so no GREEN is claimed for this moved head.

@opencode-agent

opencode-agent Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Scheduled review-feedback autofix for this PR head.

  • Head SHA: 6f3134d18d3118aab33d28048671dc71a5f47b77

Copy link
Copy Markdown
Contributor Author

Cross-lane adoption finding from #288: exact 101470a19b370bd30533ab3db330a882a2c25bc3 copied #70's shared compatibility runner and therefore reintroduced ordinary _run_browser_pass with --no-sandbox, while its Agent Task path stays sandboxed. I added a source-level RED contract on #288 requiring both real-browser paths to preserve Chromium isolation. This confirms #43 commit a45c83e4d8988fe89920ecb6a9eac469815f5b9b is a prerequisite product invariant, not merely historical branch detail. Preserve #43's causal one-line runner fix and have #212 adopt the workflow-only helper setup; do not copy #43's entire downloads/diagnostic tree into #288 just to obtain the invariant. Once a workflow-clean #43 generation is exact-head verified, #288 should adopt that product invariant non-destructively before claiming browser GREEN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants