Skip to content

Prove protected modern-browser custody and dispatch recovery - #466

Merged
chayapats merged 11 commits into
mainfrom
jit/408-protected-browser-proof
Nov 18, 2026
Merged

chayapats merged 11 commits into
mainfrom
jit/408-protected-browser-proof

Conversation

@chayapats

@chayapats chayapats commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #408
Refs #397, #392, #409

The protected browser could leave a failed reconciliation read blocking later recovery, and cancelled/denied native navigation could still commit an error page after takeover. This change settles missing-verifier recovery reads as unknown while retaining the original effect uncertainty/charges, and retains the native input lease until actual browser I/O/frame settlement. Shutdown starts native browser close before waiting for input scopes while retaining broker/continuity custody.

The selected s16-modern-browser/v1 feasibility profile and ADR 0079 now include real reference evidence: a Linux controller with separate root-administrable QEMU working VM, actual protected password/TOTP and fetch/XHR hydration, exact approved effect once, pipe-only Chromium, protected-cookie/mount/socket attempts and external manager inventory. A separate service receives a real POST before controller/browser SIGKILL; restart remains unknown until protected HTTP read-back verifies the exact body hash and count without replay. The updated S15 contract describes the same recovery/lifecycle semantics. Package canonicalization also reuses repeated string validation only within one synchronous traversal and secret-registry revision, preserving credential checks and exact command hashes while avoiding repeated scans of identical resource bytes.

Validation

Final head: c5f9a6f92b34873d8373df9607e6ac5909cb8172. Browser engine/gateway, native tests and reference runner bytes are unchanged from the physically tested 9b5a31e1d007001415b7d91cb6c38bcfcb0f8bad. Additional final code changes are limited to per-traversal skill string validation, a process-local secret-registry invalidation revision and its regression test; fingerprint matching/redaction and all limits remain unchanged.

  • bun install --frozen-lockfile, bun run typecheck, bun run upstream:check, git diff --check: passed. All 20 changed-document local links resolve.
  • Browser/VM/POLICY deterministic suites at the unchanged browser sources: 258 pass, 0 fail, 1,504 assertions across 13 files.
  • Exact local shard 3 with the original 30-second test limit: 856 pass, 4 opt-in skips, 0 fail, 10,649 assertions across 52 files (168.88s). This includes the maximum 2 MiB package case under the previously populated credential registry.
  • Cache/connection tests: 30 pass, 291 assertions; browser/disclosure/package/credential/settings regressions: 85 pass, 457 assertions. Newly registered secrets invalidate validation both between calls and during one traversal; small command identities remain byte/hash compatible.
  • bun test --timeout 30000 tests/ops-service-package.test.ts: 150 pass, 0 fail, 825 assertions (reverified after the cache change).
  • Actual native conformance/crash plus controlled legacy regressions on macOS arm64 and Linux arm64: 13 pass, 0 fail, 238 assertions on each platform. Excalidraw external-public-site case filtered out.
  • JIT_S15_ARM64_EVIDENCE=1 bun run s15:evidence:arm64: all nine physical cases passed at 9b5a31e1; combined Linux native run exit 0; both disposable test VMs verified stopped. Exact build/configuration hashes and sanitized outcomes are in docs/evidence/s16-protected-browser-reference.md; installation details/raw receipts remain ignored.

Native commands: JIT_BROWSER_LIVE=1 JIT_BROWSER_EXECUTABLE=<installed-chromium> bun test --timeout 60000 tests/s16-browser-conformance.test.ts tests/s16-browser-crash.test.ts, then bun test --timeout 60000 tests/s15-browser-live.test.ts -t 'actual navigation|approved name' with the same environment.

CI at the earlier 038a18b9 head exposed a 30-second timeout only in the existing maximum-package test on both architectures. The repeated-string fix above addresses that path without raising timeouts or weakening assertions. Final-head typecheck, all 12 x64/arm64 test shards and the deterministic aggregate passed (14 successful checks). Primary review of c5f9a6f9 found no blocking issue; main has no required review rule and there are no unresolved inline findings. The earlier Greptile approval applies only to 038a18b9 and is not counted as final-head approval.

Boundaries and remaining delivery

This completes bounded #408 feasibility, not S16-AC06/07 product acceptance. Under S16-D09, public/trusted sites use the working VM browser and its accepted session residual. #409 retains asynchronous intent/request binding and protected modern-browser product integration; unknown semantics still refuse. The optional paired reference topology does not attest default nested Linux KVM, hypervisor/browser exploit resistance, hardware power loss, live accounts/devices or owner-host adoption (#431/#432). #397/#392 remain open.

No S14 default, S15 opt-in selection, installed policy, schema, historical private scope or owner-host configuration changes. No copied upstream source/assets or new dependency; the existing immutable Rakazo/Apache-2.0 audit remains in ADR 0079. No model inference, owner credentials, real payment or production deployment.

…recovery

Browser reconcile without a read-only verifier returned unknown but left the durable recovery lane active, blocking later verified read-back. Return unknown with finished read settlement instead of throwing before any read, so missing verifiers stay unknown without preventing a later verifier. Invalid payloads follow the same unknown path.

Add deterministic coverage: armed dispatch reconciles only through read-only service verification without resend, owner statements do not clear continuity, continuity file stores only action references, and redirect/download refuse without following or arming recovery.
@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

This PR strengthens protected-browser recovery and native input settlement, and records bounded reference-host evidence without enabling a new runtime default.

  • The protected browser waits for old navigation work before accepting new input.
  • Recovery reads can finish as unknown while the original effect stays protected.
  • The protected-browser reference run records its VM boundary and recovery evidence.

No actionable issues were found.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Effect dispatched] --> B[Controller process lost]
  B --> C[Restart retains unknown effect]
  C --> D{Protected verifier available?}
  D -->|No| E[Recovery read settles as unknown]
  E --> C
  D -->|Yes| F[Read service receipt]
  F --> G{Exact outcome verified?}
  G -->|No| C
  G -->|Yes| H[Clear matching uncertainty]
  C -. No effect replay .-> C
Loading

Reviews (1) · Last reviewed commit: "docs(browser): select reference-proven p..." · Reviewed by Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 18, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review November 18, 2026 03:39

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@chayapats chayapats left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewed head c5f9a6f92b34873d8373df9607e6ac5909cb8172.

The browser retains native input settlement independently of remote transport settlement, and reconciliation without a verifier leaves the original effect unknown while permitting a later read-only verifier. The reference/native evidence applies to the unchanged browser/runner sources. The final package cache is scoped to one synchronous traversal and invalidates on secret registration, including registration during traversal; it does not change fingerprint matching, command hashes or input limits. The corresponding regression tests and the original full shard pass.

Typecheck, all 12 x64/arm64 test shards and the aggregate deterministic check succeeded on this head. The earlier Greptile approval covers 038a18b9 only; it is not counted as an approval of this later patch. Main has no required review rule, and there are no unresolved inline findings. Primary review found no blocking issue. Merge is eligible under the owner's instruction to review and decide after checks pass. This remains bounded #408 feasibility, with #409/#397/#392 and live owner-host acceptance separately outstanding.

@chayapats
chayapats merged commit 7431400 into main Nov 18, 2026
14 checks passed
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.

[Frontier] [BROW16-01A] Prove a modern browser mediation contract

1 participant