Skip to content

feat(browser): add download denial and disable Optimization Hints - #289

Open
0thernet wants to merge 6 commits into
antithesishq:mainfrom
0thernet:codex/disable-optimization-hints
Open

feat(browser): add download denial and disable Optimization Hints#289
0thernet wants to merge 6 commits into
antithesishq:mainfrom
0thernet:codex/disable-optimization-hints

Conversation

@0thernet

@0thernet 0thernet commented Sep 2, 2026

Copy link
Copy Markdown

Summary

  • add an opt-in --download-behavior deny policy while preserving allow-and-name as the default
  • reject denied downloads with a URL-free error and verify no download file is produced
  • disable managed Chrome Optimization Hints while preserving the existing isolation arguments
  • continuously observe download and bounded Optimization Guide roots so transient artifacts cannot disappear unnoticed
  • retain exact terminal download-content evidence for the existing allowed-download path
  • prepare the workspace as v0.7.3 with changelog and generated CLI reference updates

Why

Strict browser consumers need a fail-closed way to prevent page-initiated downloads. Managed Chrome can also initiate unrelated Optimization Guide model delivery even when generic background networking and component updates are disabled. Together, those behaviors can introduce unowned CRX or model files into a supposedly bounded run.

Validation

  • cargo fmt --all -- --check: pass
  • cargo metadata --format-version 1 --no-deps: pass
  • cargo test -p bombadil-browser: 38 passed
  • real Chrome 152 test_file_download and test_file_download_deny: 2 passed
  • real Chrome 152 test_managed_chrome_avoids_background_optimization_hints_download: passed after 60.52s
  • git diff --check: pass

The combined local browser plus CLI command reached host setup boundaries outside this patch: trunk is not installed and local Zig 0.16.0 is newer than the Ghostty dependency requirement of 0.15.2. The browser crate and relevant real-Chrome paths above passed; repository CI remains authoritative for the Nix and CLI matrix.

@0thernet

0thernet commented Sep 2, 2026

Copy link
Copy Markdown
Author

The approved CI run was cancelled while the Nix build, clippy, unit-test, and browser-test jobs were still running. The format and npm-package jobs had passed, and the PR head remains unchanged at 2fba62c. Could a maintainer rerun the workflow when convenient?

@0thernet 0thernet changed the title fix(browser): disable Optimization Guide background downloads feat(browser): add download denial and disable Optimization Hints Sep 5, 2026
@0thernet

0thernet commented Sep 5, 2026

Copy link
Copy Markdown
Author

The contributor branch is now current at exact head 9d642503963e4b60b659f4eafd293e61a5ee27ca with the related v0.7.3 download-denial work integrated. Local evidence is green: formatting and metadata checks, 38 browser-crate tests, both real-Chrome download paths, and the 60-second Optimization Hints artifact canary. The new exact-head CI run 33941911442 is action_required with zero jobs, so a maintainer must approve that fork workflow before final review/merge.

@0thernet

0thernet commented Sep 7, 2026

Copy link
Copy Markdown
Author

Merged current upstream a192439 into this branch without rewriting history; updated head is dc626213.

The download policy now uses upstream's synchronous CDP driver, and the OptimizationHints flag uses its new Chromium launcher. The default allowed-download behavior, fail-closed denial, URL-free denial error, and artifact observations remain intact. The lockfile also includes the four newly vendored CDP workspace crates at the existing proposed version.

Fresh validation passed:

  • Browser unit tests: 40 passed.
  • Real Chrome 152: allowed/denied downloads, 60-second background-artifact observation, and both upstream back-navigation regressions passed.
  • Transient-artifact observer regression passed; the denial test passed again after a test-only lint cleanup.
  • Locked browser/integration Clippy with -D warnings, Cargo formatting, and upstream-relative diff checks passed.

The full CLI/Nix matrix was not run locally because Nix and Trunk are unavailable. Upstream CI remains authoritative for those checks.

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