Skip to content

test(uvai): harden hybrid workspace browser boundary verification - #2684

Draft
groupthinking with Codex wants to merge 2 commits into
mainfrom
codex/test-uvai-add-browser-boundary-verification
Draft

groupthinking with Codex wants to merge 2 commits into
mainfrom
codex/test-uvai-add-browser-boundary-verification

Conversation

@Codex

@Codex Codex AI commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Canonical issue

Linked by system issue automation.

Outcome

This PR closes the remaining test gap between helper-only coverage and real DOM/sandbox behavior in the hybrid workspace prototype. It adds deterministic browser-boundary evidence for edited content flow, parent-page escaping, sandbox confinement, and credential-surface checks while keeping /studio as canonical.

Scope

  • Included:
    • Browser boundary expansion: apps/hybrid-workspace/browser.test.mjs now asserts Embed/Summarize/Extract/Escalate/Ask/terminal paths on the live DOM.
    • Live model propagation checks: repeated Monaco fixture edits must drive updated preview + summary from current model state (not starter constants).
    • Escape and hostile-content checks: lesson/editor hostile markup and closing-script patterns stay escaped in parent thread rendering.
    • Sandbox policy checks: iframe remains sandbox="allow-scripts" only; no same-origin/top-nav/popups/download capabilities; parent DOM/storage access blocked.
    • Credential boundary checks: verifies no key/token leakage via window, storage, query string, thread receipts, or sensitive outbound requests.
    • Machine-readable receipt path: browser test emits exact-head JSON receipt when RECEIPT_PATH is set.
    • CI artifact retention: .github/workflows/hybrid-workspace-boundary.yml uploads the receipt artifact keyed to PR head SHA.
    • Dependency resolution hardening: hybrid tests resolve jsdom/playwright via apps/web package context to match declared dependency ownership.
    • Prototype status record: README updated to keep this surface explicitly prototype-only and subordinate to /studio.
  • Explicitly excluded:
    • Live Monaco CDN compatibility certification.
    • Production Gateway/provider invocation.
    • Any deployment, routing, or canonical-surface integration change beyond test/documentation evidence.

Risk

  • Risk level: low
  • Failure mode:
    • Over-strict browser assertions could fail on benign runtime/environment differences.
    • Receipt artifact expectations could fail CI if path/env wiring regresses.
  • Rollback:
    • Revert test/workflow/README changes in this PR; no runtime product path or production state is mutated.

Verification

List exact automated and manual checks, tied to the current head SHA.

  • Current head: 4c12587
  • Focus:
    • node apps/hybrid-workspace/logic.test.mjs
    • node apps/hybrid-workspace/browser.test.mjs
    • VERIFIED_HEAD=<sha> RECEIPT_PATH=/tmp/hybrid-boundary-receipt.json node apps/hybrid-workspace/browser.test.mjs
  • Focused tests
  • Required CI
  • Review threads resolved

Production evidence

Not applicable for this cut: fixture/browser-test-only boundary verification. No deployment, provider execution, or production activation is part of scope.

Agent handoff

  • One canonical issue is linked
  • No competing PR implements the same issue
  • Acceptance criteria are satisfied
  • Required checks pass on the current head
  • Human decision is requested only for product, security, irreversible infrastructure, or production approval

Security dependency evidence

Not applicable: no advisory-driven dependency update in this PR.

// Representative boundary assertions added in browser.test.mjs
assert.equal(await page.locator('#preview').getAttribute('sandbox'), 'allow-scripts');
const sandboxTokens = (await page.locator('#preview').getAttribute('sandbox')).split(/\s+/).filter(Boolean);
assert.deepEqual(sandboxTokens, ['allow-scripts']);
const sandboxRuntime = await preview.locator('body').evaluate((body) => {
  const out = {};
  try { body.ownerDocument.defaultView.parent.document.body.dataset.cross='1'; out.parentDom = 'allowed'; } catch { out.parentDom = 'blocked'; }
  try { body.ownerDocument.defaultView.parent.localStorage.setItem('x', '1'); out.parentStorage = 'allowed'; } catch { out.parentStorage = 'blocked'; }
  return out;
});
assert.deepEqual(sandboxRuntime, { parentDom: 'blocked', parentStorage: 'blocked', popup: 'blocked' });

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Nov 16, 2026 4:01pm UTC

Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
@Codex Codex AI changed the title [WIP] Add browser-boundary verification for the hybrid workspace test(uvai): harden hybrid workspace browser boundary verification Nov 16, 2026
@Codex
Codex AI requested a review from groupthinking November 16, 2026 16:01

This branch was successfully deployed

1 active deployment
Preview — 4c125876 Deployed Nov 16, 2026 by vercel[bot]
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.

test(uvai): add browser-boundary verification for the hybrid workspace

2 participants