Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion config/releases/0.7.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
"product_version": "0.7.0",
"chromium_version": "159.0.8154.13",
"integration_repository": "BrowserOperator/browser-operator-core",
"required_merged_pr": 115,
"required_merged_pr": 116,
"required_base_branch": "main",
"allowed_mergers": [
"tysonthomas9"
],
"additional_merged_prs": [
{
"repository": "BrowserOperator/browser-operator-core",
"number": 115,
"base_branch": "main"
},
{
"repository": "BrowserOperator/browser-operator-core",
"number": 114,
Expand Down
38 changes: 38 additions & 0 deletions docs/chromium-159-runtime-qualification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Chromium 159 runtime qualification

The shared build driver invokes `package_chromium_release.py --verify-existing`
for both signed DMGs, using hash-verified frozen inputs and an explicitly
installed baseline browser of the same version. Native frontend, AI update
action, executable tools, About callback and actual browser/renderer CPU checks
run from disposable installed copies. Universal includes x86_64 under Rosetta.

The baseline browser version must match its registered version and the candidate
browser version. The active updater is an independent signed product and may
legitimately be older. Its identity, team, version-directory agreement, binary
hash, Current target and launch-agent hashes are captured. The same snapshot
must be restored through the permanent browser's native API after each test,
including on failure. The test never edits live preferences, forces helper
activation or uninstalls an existing helper.

For the visible native toolbar, run `scripts/launch_chromium_toolbar_check.py`
with `--release`, `--frozen-input`, `--installed-updater-baseline` and a new
`--output` directory. It verifies and installs the exact DMG copy, opens a Guest
window with a disposable profile and prints its app path. Then execute
`scripts/verify_chromium_toolbar.cua.js` through the Codex computer-use tool.
Set `releaseToolbarOptions` with that verified app path, engine version and
product version. The script refreshes accessibility selectors after each action,
checks open/close/reopen and opens native About from the 0.7.0 banner. Run it for
each DMG's installed app; retain its output with the CLI verification evidence.
Quit the owned Guest app when finished. The launcher then restores the original
native registration and verifies the helper snapshot. Launcher success alone
does not assert the toolbar actions passed; retain both reports.

This qualifies browser runtime and a real native update check. It does not prove
updater-service self-replacement: a staged 159 helper still requires the real
signed qualification payload before it can replace an active 158 helper. An
empty Omaha catalog returns `noupdate` for that qualifier, so this remains a
separate release gate. Physical Intel hardware and provider conversations also
remain separate from Rosetta and credential-free functional checks.

Release publication, private asset replacement and Omaha promotion remain held
until the owner merges the matching PR stack. No qualification command publishes.
97 changes: 97 additions & 0 deletions scripts/launch_chromium_toolbar_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env python3
"""Launch an exact signed DMG copy for the scripted Guest toolbar check."""
import argparse
import hashlib
import json
from pathlib import Path
import plistlib
import shutil
import subprocess
import tempfile

from chromium_build_input import load
from chromium_macos_arch import verify_architectures, verify_bundle_version, verify_update_channel
from package_chromium_release import smoke_test, validate_mounted_app
from updater.macos_smoke_scope import UpdaterSmokeScope


def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--release', required=True, type=Path)
parser.add_argument('--frozen-input', required=True, type=Path)
parser.add_argument('--installed-updater-baseline', required=True, type=Path)
parser.add_argument('--output', required=True, type=Path)
args = parser.parse_args()
release, frozen = args.release.resolve(), args.frozen_input.resolve()
baseline, output = args.installed_updater_baseline.resolve(), args.output.resolve()
if output.exists():
raise RuntimeError('Toolbar evidence output must be new')
provenance = load(frozen)
manifest_path = release / 'release-manifest.json'
if not manifest_path.exists():
manifest_path = release / 'candidate-manifest.json'
manifest = json.loads(manifest_path.read_text())
if (hashlib.sha256((frozen/'frozen-input.json').read_bytes()).hexdigest() != manifest['source_frozen_manifest_sha256'] or
provenance['version'] != manifest['version'] or manifest['build_settings']['enable_updater'] != 'true'):
raise RuntimeError('Toolbar candidate provenance/updater mismatch')
baseline_info = plistlib.loads((baseline/'Contents/Info.plist').read_bytes())
if baseline_info['CFBundleShortVersionString'] != manifest['version']:
raise RuntimeError('Toolbar baseline must have the same browser version')
dmg = release/'artifacts'/manifest['dmg']
if dmg.parent != release/'artifacts':
raise RuntimeError('Unexpected DMG filename')
with dmg.open('rb') as stream:
if hashlib.file_digest(stream,'sha256').hexdigest() != manifest['sha256']:
raise RuntimeError('Toolbar candidate DMG changed')
node = shutil.which('node')
if not node:
raise RuntimeError('Node is required for native baseline restoration')
output.mkdir(parents=True)
app = output/'installed/Browser Operator.app'
app.parent.mkdir()
mounted = plistlib.loads(subprocess.check_output(['hdiutil','attach','-readonly','-nobrowse','-plist',str(dmg)]))
volume = next(Path(entry['mount-point']) for entry in mounted['system-entities'] if 'mount-point' in entry)
try:
subprocess.run(['cp','-cR',str(volume/app.name),str(app)],check=True)
finally:
subprocess.run(['hdiutil','detach',str(volume)],check=True)
validate_mounted_app(app,manifest['team_id'],output/'gatekeeper-app.txt')
verify_architectures(app,manifest['architecture'])
verify_bundle_version(app,manifest['version'])
verify_update_channel(app,manifest['build_settings'])

def restore_baseline():
evidence = Path(tempfile.mkdtemp(prefix='restore-baseline-',dir=output))
smoke_test(baseline,evidence,node,updater_enabled=True,frontend_checks=False)

with UpdaterSmokeScope(manifest['build_settings'],manifest['team_id'],output,
baseline_app=baseline,restore_baseline=restore_baseline):
with (output/'browser.log').open('x') as log:
child = subprocess.Popen([str(app/'Contents/MacOS/Browser Operator'),
'--guest','--user-data-dir='+str(output/'profile'),'--use-mock-keychain',
'--no-first-run','--no-default-browser-check','--lang=en-US','about:blank'],
stdout=log,stderr=subprocess.STDOUT)
try:
ready = {'application':str(app),'pid':child.pid,'version':manifest['version'],
'architecture':manifest['architecture'],'product_version':provenance['browser_operator_version'],
'dmg_sha256':manifest['sha256'],'publication':'held-until-owner-merge'}
(output/'ready.json').write_text(json.dumps(ready,indent=2)+'\n')
print('Run verify_chromium_toolbar.cua.js for this app, then quit its Guest process:',flush=True)
print(json.dumps(ready),flush=True)
code = child.wait(timeout=1200)
if code:
raise RuntimeError('Toolbar test browser exited with code '+str(code))
finally:
if child.poll() is None:
child.terminate()
try:
child.wait(timeout=20)
except subprocess.TimeoutExpired:
child.kill()
child.wait(timeout=10)
(output/'launcher-report.json').write_text(json.dumps({**ready,'startup_and_trust':'passed',
'native_baseline_restoration':'passed','toolbar_actions':'recorded separately by CUA script'},indent=2)+'\n')


if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion scripts/package_chromium_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def main():
args.installed_updater_baseline = args.installed_updater_baseline.resolve()
baseline_version = plistlib.loads((args.installed_updater_baseline / 'Contents/Info.plist').read_bytes())['CFBundleShortVersionString']
if baseline_version != plistlib.loads((app / 'Contents/Info.plist').read_bytes())['CFBundleShortVersionString']:
raise RuntimeError('Baseline reuse requires exactly the same browser/updater version; use a dedicated clean user for version upgrades')
raise RuntimeError('Baseline reuse requires exactly the same browser version; use a dedicated clean user for browser version upgrades')
if args.updater_enabled and not args.defer_runtime_verification:
from updater.macos_smoke_scope import UpdaterSmokeScope
UpdaterSmokeScope(settings, team, output, baseline_app=args.installed_updater_baseline).require_clean()
Expand Down
20 changes: 16 additions & 4 deletions scripts/updater/macos_smoke_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time
from pathlib import Path
import plistlib
import re
import subprocess


Expand Down Expand Up @@ -65,21 +66,32 @@ def baseline_registration(self):
if not current.is_symlink() or not current.resolve().is_relative_to(self.controller.resolve()):
raise RuntimeError('Expected an existing user updater within its own namespace')
helper = current / (self.product + '.app')
if (current.resolve().parent != self.controller.resolve() or
helper.resolve().parent != current.resolve()):
raise RuntimeError('Baseline updater path escapes its version directory')
helper_info = plistlib.loads((helper / 'Contents/Info.plist').read_bytes())
if helper_info.get('CFBundleIdentifier') != self.appid:
raise RuntimeError('Unexpected baseline updater identity')
helper_version = helper_info.get('CFBundleShortVersionString', '')
if (not re.fullmatch(r'\d+\.\d+\.\d+\.\d+', helper_version) or
any(int(part) > 0xffffffff for part in helper_version.split('.')) or
current.resolve().name != helper_version):
raise RuntimeError('Baseline updater version differs from its installed directory')
subprocess.run(['codesign', '--verify', '--deep', '--strict', str(helper)], check=True)
helper_details = subprocess.run(['codesign', '-dv', '--verbose=4', str(helper)], capture_output=True, text=True, check=True).stderr
if f'TeamIdentifier={self.team}' not in helper_details:
raise RuntimeError('Baseline updater is from another signing team')
registration = json.loads((self.controller / 'prefs.json').read_text())['updateclientdata']['apps']['com.browseroperator.browseroperator']
if (Path(registration['ecp']).resolve() != app or
registration['pv'] != info['CFBundleShortVersionString'] or
helper_info['CFBundleShortVersionString'] != info['CFBundleShortVersionString']):
raise RuntimeError('Baseline app, updater and registration must have the same version and path')
registration['pv'] != info['CFBundleShortVersionString']):
raise RuntimeError('Baseline app and browser registration must have the same version and path')
with (helper / 'Contents/MacOS' / self.product).open('rb') as stream:
helper_hash = hashlib.file_digest(stream, 'sha256').hexdigest()
return {'application': str(app), 'version': registration['pv'], 'helper_sha256': helper_hash,
# Browser and updater are independent native products. An older active
# helper can legitimately serve this browser while a new helper awaits
# self-qualification. Preserve that exact helper, never force promotion.
return {'application': str(app), 'version': registration['pv'],
'helper_version': helper_version, 'helper_sha256': helper_hash,
'current_target': str(current.readlink()),
'launch_agents': {p.name: hashlib.sha256(p.read_bytes()).hexdigest() for p in self.agents()}}

Expand Down
95 changes: 95 additions & 0 deletions scripts/updater/test_macos_smoke_scope.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Ensure release smoke tests never replace an existing updater registration."""

from pathlib import Path
import json
import plistlib
import subprocess
import tempfile
Expand Down Expand Up @@ -120,3 +121,97 @@ def test_outside_dangling_link_is_preserved_and_rejected(self):
with patch.object(scope,'agents',return_value=[]):
with self.assertRaisesRegex(RuntimeError,'escapes'):scope.__exit__(None,None,None)
self.assertTrue((scope.controller/'Current').is_symlink())


class InstalledBaselineTests(unittest.TestCase):
def fixture(self, root):
evidence = root / 'evidence'
evidence.mkdir()
app = root / 'Applications/Browser Operator.app'
(app / 'Contents').mkdir(parents=True)
(app / 'Contents/Info.plist').write_bytes(plistlib.dumps({
'CFBundleIdentifier':'com.browseroperator.BrowserOperator',
'CFBundleShortVersionString':'159.0.8154.13'}))
scope = UpdaterSmokeScope({'browser_operator_updater_config':'"//config/updater/macos-production.gni"'},
'UNITTEAM', evidence, home=root, baseline_app=app, restore_baseline=lambda:None)
helper = scope.controller / '158.0.8127.18/BrowserOperatorUpdater.app'
(helper / 'Contents/MacOS').mkdir(parents=True)
(helper / 'Contents/Info.plist').write_bytes(plistlib.dumps({
'CFBundleIdentifier':scope.appid, 'CFBundleShortVersionString':'158.0.8127.18'}))
binary = helper / 'Contents/MacOS/BrowserOperatorUpdater'
binary.write_bytes(b'signed helper fixture')
(scope.controller / 'Current').symlink_to('158.0.8127.18')
prefs = scope.controller / 'prefs.json'
prefs.write_text(json.dumps({'updateclientdata':{'apps':{'com.browseroperator.browseroperator':{
'pv':'159.0.8154.13','ecp':str(app)}}}}))
return scope, helper, binary, prefs

def signed(self, command, **kwargs):
return subprocess.CompletedProcess(command, 0, stderr='TeamIdentifier=UNITTEAM\n')

def test_older_signed_helper_is_preserved_while_serving_newer_browser(self):
with tempfile.TemporaryDirectory() as temp:
scope, helper, binary, prefs = self.fixture(Path(temp).resolve())
before = prefs.read_bytes()
with patch('macos_smoke_scope.subprocess.run', side_effect=self.signed) as calls:
with scope:
self.assertEqual('158.0.8127.18', scope.baseline['helper_version'])
self.assertEqual('159.0.8154.13', scope.baseline['version'])
self.assertEqual(before, prefs.read_bytes())
self.assertEqual(b'signed helper fixture', binary.read_bytes())
self.assertEqual(Path('158.0.8127.18'), (scope.controller/'Current').readlink())
self.assertFalse(any('--uninstall' in call.args[0] for call in calls.call_args_list))
self.assertTrue((scope.evidence/'native-updater-baseline-restored.json').exists())

def test_mismatched_browser_registration_refuses_before_test(self):
for field, value in [('pv','158.0.8127.18'), ('ecp','/wrong/app')]:
with self.subTest(field=field), tempfile.TemporaryDirectory() as temp:
scope, _, _, prefs = self.fixture(Path(temp).resolve())
data=json.loads(prefs.read_text());data['updateclientdata']['apps']['com.browseroperator.browseroperator'][field]=value
prefs.write_text(json.dumps(data));before=prefs.read_bytes()
with patch('macos_smoke_scope.subprocess.run',side_effect=self.signed):
with self.assertRaisesRegex(RuntimeError,'browser registration'):
with scope:self.fail('must not enter')
self.assertEqual(before,prefs.read_bytes())

def test_wrong_helper_identity_version_or_signing_team_is_rejected(self):
for change, value, error in [('CFBundleIdentifier','other.updater','identity'),
('CFBundleShortVersionString','159.0.8154.13','directory'),
('CFBundleShortVersionString','4294967296.0.0.0','directory'),
('signing-team','OTHERTEAM','signing team')]:
with self.subTest(change=change,value=value), tempfile.TemporaryDirectory() as temp:
scope, helper, _, _ = self.fixture(Path(temp).resolve())
info=helper/'Contents/Info.plist'
data=plistlib.loads(info.read_bytes());data[change]=value;info.write_bytes(plistlib.dumps(data))
def signed(command,**kwargs):
if change=='signing-team' and Path(command[-1]).resolve()==helper.resolve() and '-dv' in command:
return subprocess.CompletedProcess(command,0,stderr='TeamIdentifier=OTHERTEAM\n')
return self.signed(command,**kwargs)
with patch('macos_smoke_scope.subprocess.run',side_effect=signed):
with self.assertRaisesRegex(RuntimeError,error):scope.require_clean()

def test_helper_path_escape_is_rejected(self):
with tempfile.TemporaryDirectory() as temp:
root=Path(temp).resolve();scope, helper, _, _=self.fixture(root)
target=root/'other/BrowserOperatorUpdater.app';target.parent.mkdir();helper.rename(target)
helper.symlink_to(target)
with patch('macos_smoke_scope.subprocess.run',side_effect=self.signed):
with self.assertRaisesRegex(RuntimeError,'path escapes'):scope.require_clean()

def test_current_path_escape_is_rejected(self):
with tempfile.TemporaryDirectory() as temp:
root=Path(temp).resolve();scope, _, _, _=self.fixture(root)
current=scope.controller/'Current';current.unlink();current.symlink_to(root/'outside')
with patch('macos_smoke_scope.subprocess.run',side_effect=self.signed):
with self.assertRaisesRegex(RuntimeError,'within its own namespace'):scope.require_clean()

def test_changed_helper_bytes_fail_exact_restoration_without_uninstall(self):
with tempfile.TemporaryDirectory() as temp:
scope, _, binary, prefs=self.fixture(Path(temp).resolve());before=prefs.read_bytes()
with patch('macos_smoke_scope.subprocess.run',side_effect=self.signed) as calls, \
patch('macos_smoke_scope.time.sleep'):
with self.assertRaisesRegex(RuntimeError,'not restored exactly'):
with scope:binary.write_bytes(b'changed helper')
self.assertEqual(before,prefs.read_bytes())
self.assertFalse(any('--uninstall' in call.args[0] for call in calls.call_args_list))
self.assertTrue((scope.evidence/'native-updater-baseline-RESTORE-FAILED.json').exists())
Loading
Loading