The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Prepare Harness OS preview 14 and automatic latest download link (#756)
Dee3f1c9acef180
diff --git a/.github/workflows/os.yml b/.github/workflows/os.ymlindex 1379dc91d..d67bff7c3 100644--- a/.github/workflows/os.yml+++ b/.github/workflows/os.yml@@ -413,6 +413,9 @@ jobs:if: ${{ inputs.publish_run_id != '' }}runs-on: ubuntu-24.04timeout-minutes: 30+ concurrency:+ group: harness-os-publication+ cancel-in-progress: falsepermissions:contents: writeactions: read@@ -438,7 +441,7 @@ jobs:path: os/release-input/dsh-machinesrun-id: ${{ inputs.dsh_run_id }}github-token: ${{ github.token }}- - name: Verify prior evidence, publish preview and verify public downloads+ - name: Verify prior evidence, publish release and verify public downloadsenv:GH_TOKEN: ${{ github.token }}OS_TEST_RUN: ${{ inputs.publish_run_id }}diff --git a/docs/naming-system.md b/docs/naming-system.mdindex b64d255ab..b9bb0818d 100644--- a/docs/naming-system.md+++ b/docs/naming-system.md@@ -107,7 +107,7 @@ configuration where it affects a decision.| Disk unlock prompt | **Enter your password** || USB install action | **Install Harness** || USB startup | Open **Install Harness** directly; no trial choice or network step. |-| First installed boot | **Connect to Wi-Fi to get started** when disconnected, then the agent workspace. |+| First installed boot | **Connect to Wi-Fi** when disconnected, then the agent workspace. || USB session label | Omit from the single installation footer. || Connect another execution machine | **Connect a computer** || Installer title | Omit the redundant heading; label the action. |@@ -115,7 +115,7 @@ configuration where it affects a decision.| Installer action | **Install Harness** || Installation completion | **Harness is installed.** || Completion actions | **Shut down**, **Back to Harness** |-| Defer installed Wi-Fi setup | **Set up later** |+| Work offline during Wi-Fi setup | **Super+t** opens a terminal; no separate skip action. || Apply available OS/runtime releases | **Update** || Update needs a reboot | **Updated. Restart when ready.** || Update completion actions | **Done**, **Restart** |diff --git a/os/DEVELOPMENT.md b/os/DEVELOPMENT.mdindex 2a93f5e8d..58c34c056 100644--- a/os/DEVELOPMENT.md+++ b/os/DEVELOPMENT.md@@ -431,6 +431,9 @@ opens the existing full-page Wi-Fi form when disconnected. Working Ethernet or asaved connection skips that form; connection success advances automatically toOpenCode on the left and two terminal panes on the right. Later launches restorework. The standard hn footer and shared Ctrl+b shortcuts remain intact.+First use and Super+w share the same Wi-Fi page, without a separate welcome+tagline or skip button. Super+t opens a terminal during setup; it does not mark+network setup complete or require starting a cloud agent while disconnected.OpenCode reads the packaged guide through its global`~/.config/opencode/AGENTS.md`, linked to `/usr/share/harness-os/guide.md`.diff --git a/os/INSTALL.md b/os/INSTALL.mdindex 021b5d9dc..b127ee2a8 100644--- a/os/INSTALL.md+++ b/os/INSTALL.md@@ -1,6 +1,6 @@# Install Harness on a ThinkPad-These instructions are for **0.1.0-preview.13**, using a Mac to prepare the USB.+These instructions are for **0.1.0-preview.14**, using a Mac to prepare the USB.The USB opens the installer directly. Installation begins only when you choose **Install Harness**in the installer; it erases the entire selected disk.@@ -21,20 +21,20 @@ compute still need testing on the actual hardware.## 2. Download and verify on the Mac-From the [preview 13 release](https://github.com/autonomous-ai/openharness/releases/tag/os-v0.1.0-preview.13),+From the [preview 14 release](https://github.com/autonomous-ai/openharness/releases/tag/os-v0.1.0-preview.14),download both files into the same folder:-- `harness-0.1.0-preview.13-x86_64.iso`-- `harness-0.1.0-preview.13-x86_64.iso.sha256`+- `harness-0.1.0-preview.14-x86_64.iso`+- `harness-0.1.0-preview.14-x86_64.iso.sha256`If they are in Downloads, open Terminal and run:```shcd ~/Downloads-shasum -a 256 -c harness-0.1.0-preview.13-x86_64.iso.sha256+shasum -a 256 -c harness-0.1.0-preview.14-x86_64.iso.sha256```-The result must say `harness-0.1.0-preview.13-x86_64.iso: OK`.+The result must say `harness-0.1.0-preview.14-x86_64.iso: OK`.If it does not, download the files again before flashing.## 3. Flash the USB@@ -119,7 +119,8 @@ disk. Changing the account password later does not change the disk password.There is no cloud account that resets the disk password.First boot opens OpenCode on the left and two terminal panes on the right.-If disconnected, Wi-Fi opens first; you can connect or choose **Set up later**.+If disconnected, Wi-Fi opens first. **Super+t** opens a terminal if you need to+work offline or fix networking.Subsequent launches restore your existing work. **Super+w** opens network setup from anypane. Ethernet connects automatically when available.diff --git a/os/README.md b/os/README.mdindex 321ea5a97..a9a36565b 100644--- a/os/README.md+++ b/os/README.md@@ -11,7 +11,7 @@ audience, not its name.Product names and interface copy follow the [Naming System](../docs/naming-system.md).-**Preview 12:** the USB opens the installer directly. Installation works offline.+**Preview 14:** the USB opens the installer directly. Installation works offline.After shutdown, remove the USB and boot the installed disk. If disconnected,the Wi-Fi page opens first and advances automatically when connected; Ethernetskips that step. OpenCode starts on the left with two real terminals on the right.@@ -32,7 +32,7 @@ a confirmation or password prompt. Running agents and terminals stay alive.The update checker records release ancestry so a source-built runtime cannot bereplaced by an older public CLI with a higher development version number.-[Download preview 13](https://github.com/autonomous-ai/openharness/releases/tag/os-v0.1.0-preview.13)+[Download Harness](https://github.com/autonomous-ai/openharness/releases/tag/os-latest)· [Mac → USB → ThinkPad installation guide](INSTALL.md)· [Standalone HTML/CSS landing page](../website/public/os/README.md)· [Development feedback loop and Mac support targets](DEVELOPMENT.md)diff --git a/os/lock.json b/os/lock.jsonindex 6802652da..80e595706 100644--- a/os/lock.json+++ b/os/lock.json@@ -1,8 +1,12 @@{- "version": "0.1.0-preview.13",+ "version": "0.1.0-preview.14","arch_snapshot": "2026/10/01","architecture": "x86_64","upgrades_from": [+ {+ "version": "0.1.0-preview.13",+ "arch_snapshot": "2026/10/01"+ },{"version": "0.1.0-preview.12","arch_snapshot": "2026/10/01"diff --git a/os/network.py b/os/network.pyindex 7c554ae08..f6589fde4 100644--- a/os/network.py+++ b/os/network.py@@ -3,15 +3,12 @@import argparseimport cursesimport os-from pathlib import Pathimport subprocessimport timeimport uuidimport unicodedataWORDMARK = ('█ █ ▄▀█ █▀█ █▄ █ █▀▀ █▀ █▀', '█▀█ █▀█ █▀▄ █ ▀█ ██▄ ▄█ ▄█')-INSTALL = 10-OFFLINE = 11def nmcli(*args, secret=None, wait=8):@@ -151,8 +148,8 @@ def fit(text, width):class NetworkPage:- def __init__(self, screen, first_use=False, live=False):- self.screen, self.first_use, self.live = screen, first_use, live+ def __init__(self, screen, first_use=False):+ self.screen, self.first_use = screen, first_useself.networks, self.wired, self.selected, self.message = [], [], 0, ''screen.keypad(True)screen.timeout(800)@@ -192,9 +189,7 @@ class NetworkPage:self.top = max(1, (height - 26) // 2)for row, text in enumerate(WORDMARK):self.line(row, text.center(self.width), accent=True)- if self.first_use:- self.line(3, 'The operating system built by agents, for agents.'.center(self.width))- self.line(6, 'Connect to Wi-Fi to get started' if self.first_use else 'Connect to Wi-Fi')+ self.line(6, 'Connect to Wi-Fi')return heightdef refresh(self):@@ -266,17 +261,15 @@ class NetworkPage:checked = time.monotonic()rows = [('wifi', network) for network in self.networks] + [('rescan', None)]rows += [('wired', device) for device in self.wired]- if self.first_use:- rows += [('install' if self.live else 'offline', None)]self.selected = min(self.selected, len(rows) - 1)height = self.begin()try:curses.curs_set(0)except curses.error:pass- # Scroll networks only. Rescan, Ethernet and the offline escape stay- # below the list, even when a scan finds dozens of access points.- visible = max(1, min(10, height - self.top - 14 - len(self.wired) - (2 if self.first_use else 0)))+ # Both entry points share the same layout. Super+t remains available+ # from the compositor when setup cannot finish without a terminal.+ visible = max(1, min(10, height - self.top - 14 - len(self.wired)))offset = max(0, min(self.selected, len(self.networks) - 1) - visible + 1)networks = self.networks[offset:offset + visible]for index, value in enumerate(networks, start=offset):@@ -288,9 +281,6 @@ class NetworkPage:for index, device in enumerate(self.wired):self.line(bottom + 2 + index, 'Ethernet ' + device[0],self.selected == len(self.networks) + 1 + index)- if self.first_use:- self.button(bottom + 3 + len(self.wired), 'Install without connecting' if self.live else 'Set up later',- self.selected == len(rows) - 1)self.line(height - self.top - 2, self.message or ('' if self.networks else 'No Wi-Fi networks found. Rescan or use Ethernet.'))self.screen.refresh()try:@@ -305,12 +295,8 @@ class NetworkPage:self.selected = (self.selected + 1) % len(rows)elif key in ('r', 'R'):self.refresh()- elif key in ('i', 'I') and self.first_use and self.live:- return INSTALLelif key in ('\n', '\r', curses.KEY_ENTER):kind, value = rows[self.selected]- if kind in ('install', 'offline'):- return INSTALL if kind == 'install' else OFFLINEif kind == 'rescan':self.refresh()continue@@ -343,7 +329,7 @@ def main():# workspace. Ordinary Wi-Fi and the password field still handle it as# their existing Back action. wrapper restores the terminal on exit.curses.raw()- return NetworkPage(screen, args.first_use, Path('/etc/harness-live').exists()).run()+ return NetworkPage(screen, args.first_use).run()return curses.wrapper(page)diff --git a/os/onboarding.py b/os/onboarding.pyindex 25060662a..257873cba 100644--- a/os/onboarding.py+++ b/os/onboarding.py@@ -10,13 +10,9 @@ def welcome():if live:os.execv('/usr/lib/harness-os/open-install', ['open-install'])return- while True:- # The installed first-use page advances as soon as connected.- result = subprocess.run(['sudo', '/usr/bin/python3', '/usr/lib/harness-os/network.py', '--first-use'])- if result.returncode == 0:- break- if result.returncode == 11:- break+ # The installed first-use page advances as soon as connected.+ result = subprocess.run(['sudo', '/usr/bin/python3', '/usr/lib/harness-os/network.py', '--first-use'])+ if result.returncode != 0:raise SystemExit('Could not open Wi-Fi. Press Super+w to try again, or Super+t for a terminal.')pane = os.environ.get('TMUX_PANE', '')try:diff --git a/os/tests/fast_update_vm.py b/os/tests/fast_update_vm.pyindex 2b2032cc4..d2d735324 100644--- a/os/tests/fast_update_vm.py+++ b/os/tests/fast_update_vm.py@@ -169,9 +169,14 @@ assert (root/'heartbeat').stat().st_mtime_ns != beforevm.command('test "$(systemctl --user show harness-daemon -p MainPID --value)" != "$(cat /tmp/fast-original-daemon)"')alive('cli-update')checks.append('Super+u alone activates a separate CLI release while the same OpenCode and terminal processes remain alive')- vm.command('systemd-run --user --collect --unit=harness-test-rollback /usr/bin/python3 /usr/lib/harness-os/live_update.py rollback')- vm.command('for n in $(seq 1 120); do test "$(harness version)" != 999.0.1 && '- 'systemctl --user is-active --quiet hn-screen && exit 0; sleep .5; done; exit 1', timeout=90)+ # The version pointer changes before the services restart. Waiting only for+ # that version plus is-active can observe the old screen during teardown.+ # Wait for rollback itself (including screen readiness and view restoration)+ # and propagate its actual result before checking the surviving workspace.+ vm.command('systemd-run --user --wait --collect --unit=harness-test-rollback '+ '/usr/bin/python3 /usr/lib/harness-os/live_update.py rollback', timeout=180)+ vm.command('test "$(harness version)" != 999.0.1 && '+ 'systemctl --user is-active --quiet hn-screen')alive('after-rollback')checks.append('Rollback restores the prior CLI while retaining the fast hn release, live agent and terminal input')output, _ = vm.command('harness updates status; systemctl --user status harness-update.timer --no-pager; 'diff --git a/os/tests/footprint_vm.py b/os/tests/footprint_vm.pyindex 69a6fdde7..acca6eb7a 100644--- a/os/tests/footprint_vm.py+++ b/os/tests/footprint_vm.py@@ -49,12 +49,15 @@ def main():vm.command('stty -echo')copy_file(vm, json.dumps(config).encode(), '/tmp/install-config.json')vm.command('nmcli networking off')+ install_started = time.monotonic()output, _ = vm.command('harness install --config /tmp/install-config.json --yes-erase-disk', timeout=360)+ result['offline_install_command_seconds'] = round(time.monotonic() - install_started, 3)(folder / 'install.log').write_text(output)vm.command('sync')vm.stop()vm.start(live=False)vm.login_installed(config)+ result['installed_hn_ready_seconds_including_test_login'] = round(time.monotonic() - vm.started, 3)vm.command('printf %s ' + shlex.quote(config['password'] + '\n') + ' | sudo -S -v')vm.command('sudo -n touch /run/harness-footprint-disposable')vm.command('mkdir -p /home/me/footprint-assessment')diff --git a/os/tests/test_network.py b/os/tests/test_network.pyindex 00cde81b5..0a7fc7f5b 100644--- a/os/tests/test_network.py+++ b/os/tests/test_network.py@@ -73,23 +73,26 @@ class Network(unittest.TestCase):self.assertEqual(command.call_count, 1)self.assertEqual(command.call_args.args, ('connection', 'up', 'uuid', 'existing', 'ifname', 'wlan0'))- def page(self, keys, live=True):+ def page(self, keys, first_use=True):screen = Screen(keys)self.enterContext(patch.object(network.curses, 'curs_set'))self.enterContext(patch.object(network, 'connected', return_value=False))self.enterContext(patch.object(network, 'scan', return_value=[WIFI]))self.enterContext(patch.object(network, 'wired_devices', return_value=[['eth0', 'ethernet', 'disconnected']]))self.enterContext(patch.object(network, 'nmcli', return_value=result()))- return screen, network.NetworkPage(screen, first_use=True, live=live)+ return screen, network.NetworkPage(screen, first_use=first_use)- def test_first_page_has_wifi_above_wired_rescan_and_always_visible_offline_install(self):- screen, page = self.page(['\x1b', '\x03', 'r', 'i'])- self.assertEqual(page.run(), network.INSTALL)+ def test_first_page_keeps_wifi_above_wired_and_advances_only_after_connection(self):+ screen, page = self.page(['\x1b', '\x03', 'r', '\n'])+ with patch.object(network, 'connect', return_value=True):+ self.assertEqual(page.run(), 0)text = '\n'.join(text for _, text in screen.lines)- self.assertIn('The operating system built by agents, for agents.', text)+ self.assertIn('Connect to Wi-Fi', text)+ self.assertNotIn('The operating system', text)self.assertLess(text.index('a:network'), text.index('Ethernet'))self.assertIn('Rescan', text)- self.assertIn('Install without connecting', text)+ self.assertNotIn('Install without connecting', text)+ self.assertNotIn('Set up later', text)self.assertNotIn('Quit', text)self.assertNotIn('Activate', text)@@ -116,29 +119,28 @@ class Network(unittest.TestCase):self.assertEqual(page.run(), 0)scan.assert_not_called()- def test_crowded_scan_scrolls_to_last_network_and_keeps_escape_reachable(self):+ def test_crowded_scan_scrolls_to_last_network_and_keeps_rescan_reachable(self):for size in [(24, 54), (45, 160)]:- screen, page = self.page([], live=False)+ screen, page = self.page([], first_use=False)screen.size = sizenetworks = [dict(WIFI, ssid=f'network-{i:02}') for i in range(23)]- # 23 networks, Rescan, Ethernet, Set up later. Move directly to the- # last network, escape its password, then wrap to Set up later.- screen.keys = iter([curses.KEY_DOWN] * 22 + ['\n', '\x1b', curses.KEY_DOWN, curses.KEY_DOWN, curses.KEY_DOWN, '\n'])+ # Move to the last network, escape its password, then close the+ # on-demand form. Rescan remains visible while the list scrolls.+ screen.keys = iter([curses.KEY_DOWN] * 22 + ['\n', '\x1b', '\x1b'])with patch.object(network, 'scan', return_value=networks), patch.object(network, 'connect', return_value=False) as connect:- self.assertEqual(page.run(), network.OFFLINE)+ self.assertEqual(page.run(), 1)self.assertEqual(connect.call_args.args[0]['ssid'], 'network-22')for frame in screen.frames:names = [text for _, _, text, _ in frame if text.startswith('network-')]self.assertLessEqual(len(names), 10)if names:self.assertTrue(any('Rescan' in text for _, _, text, _ in frame))- self.assertTrue(any('Set up later' in text for _, _, text, _ in frame))def test_open_network_failure_does_not_ask_for_a_nonexistent_password(self):- screen, page = self.page(['\n', 'i'])+ screen, page = self.page(['\n', '\x1b'], first_use=False)with patch.object(network, 'scan', return_value=[dict(WIFI, security='--')]), \patch.object(network, 'connect', return_value=False), patch.object(page, 'password') as password:- self.assertEqual(page.run(), network.INSTALL)+ self.assertEqual(page.run(), 1)password.assert_not_called()def test_wide_and_control_characters_fit_the_terminal(self):diff --git a/os/tests/test_onboarding.py b/os/tests/test_onboarding.pyindex 1ea58cc22..125657aa1 100644--- a/os/tests/test_onboarding.py+++ b/os/tests/test_onboarding.py@@ -38,14 +38,6 @@ class Onboarding(unittest.TestCase):command.assert_not_called()execute.assert_called_once_with('/usr/lib/harness-os/open-install', ['open-install'])- def test_installed_system_can_open_workspace_offline(self):- with tempfile.TemporaryDirectory() as temp, patch.object(onboarding.Path, 'is_file', return_value=False), \- patch.object(onboarding.Path, 'home', return_value=Path(temp)), \- patch.object(onboarding.subprocess, 'run', side_effect=[result(11), result()]), \- patch.object(onboarding.os, 'execv') as execute:- onboarding.welcome()- execute.assert_called_once_with('/usr/bin/hn-os', ['hn-os', 'try'])-def test_failed_layout_request_does_not_mark_first_use_complete(self):with tempfile.TemporaryDirectory() as temp, patch.object(onboarding.Path, 'is_file', return_value=False), \patch.object(onboarding.Path, 'home', return_value=Path(temp)), \diff --git a/os/tests/test_publication.py b/os/tests/test_publication.pyindex 573b2ad2b..151bf30dc 100644--- a/os/tests/test_publication.py+++ b/os/tests/test_publication.py@@ -3,7 +3,9 @@ import importlib.utilimport jsonfrom pathlib import Pathimport tempfile+from types import SimpleNamespaceimport unittest+from unittest.mock import patchspec = importlib.util.spec_from_file_location('hn_publish', Path(__file__).parents[1] / 'tools/publish.py')publish = importlib.util.module_from_spec(spec)@@ -11,6 +13,71 @@ spec.loader.exec_module(publish)class PublicationGuards(unittest.TestCase):+ def test_only_numbered_previews_and_official_versions_can_publish(self):+ self.assertTrue(publish.is_preview('0.1.0-preview.13'))+ self.assertFalse(publish.is_preview('0.1.0'))+ for value in ['latest', '0.1', '0.1.0-beta', '0.1.0-preview', '../0.1.0', None]:+ with self.subTest(version=value), self.assertRaises(ValueError):+ publish.is_preview(value)++ def test_pointer_uses_verified_versioned_downloads_and_only_moves_its_own_tag(self):+ for existing, version, prior in [(False, '0.2.0', '0.1.0'), (True, '0.2.0', '0.1.0'),+ (False, '0.1.0-preview.14', '0.1.0-preview.9'),+ (True, '0.1.0-preview.14', '0.1.0-preview.9')]:+ with self.subTest(existing=existing, version=version):+ manifest = dict(version=version, source_commit='a' * 40,+ iso={'name': f'harness-{version}-x86_64.iso'})+ release = {'html_url': f'https://github.com/owner/repo/releases/tag/os-v{version}'}+ endpoint = 'repos/owner/repo/releases/tags/os-latest'+ state = {'draft': False, 'prerelease': publish.is_preview(version),+ 'html_url': 'https://github.com/owner/repo/releases/tag/os-latest',+ 'body': '<!-- harness-os-latest:' + json.dumps({'version': prior, 'source_commit': 'old'}) + ' -->'}+ previous = SimpleNamespace(returncode=0 if existing else 1,+ stdout=json.dumps(state), stderr='' if existing else 'HTTP 404')+ calls = []+ def github(*args):+ calls.append(args)+ if args[:2] in [('release', 'create'), ('release', 'edit')] and '--notes-file' in args:+ state['body'] = Path(args[args.index('--notes-file') + 1]).read_text()+ if args == ('api', endpoint):+ return json.dumps(state)+ if args == ('api', 'repos/owner/repo/git/ref/tags/os-latest'):+ return json.dumps({'object': {'sha': 'a' * 40}})+ return ''+ with patch.object(publish.subprocess, 'run', return_value=previous), patch.object(publish, 'gh', side_effect=github):+ result = publish.publish_latest_pointer('owner/repo', manifest, release)+ self.assertEqual(result['status'], 'published')+ self.assertIn(f'/releases/download/os-v{version}/harness-{version}-x86_64.iso', state['body'])+ self.assertIn(f'/releases/download/os-v{version}/INSTALL.md', state['body'])+ self.assertIn(release['html_url'], state['body'])+ latest = [c for c in calls if '--latest=true' in c]+ self.assertEqual(latest, [] if publish.is_preview(version) else [+ ('release', 'edit', 'os-v' + version, '--repo', 'owner/repo', '--latest=true')])+ mutations = [c for c in calls if c[:3] == ('api', '--method', 'PATCH')]+ self.assertEqual(len(mutations), int(existing))+ if mutations:+ self.assertEqual(mutations[0][3], 'repos/owner/repo/git/refs/tags/os-latest')++ def test_preview_or_late_older_publication_cannot_replace_the_official_pointer(self):+ manifest = dict(version='0.1.0-preview.14', source_commit='a' * 40)+ old = {'body': '<!-- harness-os-latest:{"version":"0.1.0","source_commit":"old"} -->'}+ with patch.object(publish, 'gh') as github, patch.object(publish.subprocess, 'run', return_value=SimpleNamespace(returncode=0, stdout=json.dumps(old))):+ self.assertEqual(publish.publish_latest_pointer('owner/repo', manifest, {})['status'], 'official-release-retained')+ github.assert_not_called()+ manifest['version'] = '0.9.0'+ old = {'body': '<!-- harness-os-latest:{"version":"0.10.0","source_commit":"old"} -->'}+ with patch.object(publish.subprocess, 'run', return_value=SimpleNamespace(returncode=0, stdout=json.dumps(old))), patch.object(publish, 'gh') as github:+ self.assertEqual(publish.publish_latest_pointer('owner/repo', manifest, {})['status'], 'newer-release-retained')+ github.assert_not_called()++ def test_unknown_pointer_or_rewritten_version_fails_before_any_public_mutation(self):+ manifest = dict(version='0.1.0', source_commit='a' * 40)+ for body in ['unmanaged release', '<!-- harness-os-latest:{"version":"0.1.0","source_commit":"different"} -->']:+ with self.subTest(body=body), patch.object(publish.subprocess, 'run', return_value=SimpleNamespace(returncode=0, stdout=json.dumps({'body': body}))), patch.object(publish, 'gh') as github:+ with self.assertRaises(ValueError):+ publish.publish_latest_pointer('owner/repo', manifest, {})+ github.assert_not_called()+def test_nvidia_requires_exact_image_authenticated_offline_install_and_reboot(self):manifest = {'source_commit': 'source-one', 'iso': {'sha256': 'image-one'},'hardware': {'nvidia': {'kernel': 'exact-kernel', 'driver_version': '615.71.09',diff --git a/os/tests/test_publish_update.py b/os/tests/test_publish_update.pyindex d95945b47..052999f42 100644--- a/os/tests/test_publish_update.py+++ b/os/tests/test_publish_update.py@@ -29,6 +29,16 @@ class PublicationGuards(unittest.TestCase):def test_exact_package_and_complete_receipt_can_be_prepared(self):self.assertEqual(publish.validate(self.bundle, self.receipt, self.run)['source_commit'], 'a' * 40)+ def test_official_bundle_can_migrate_a_preview_through_its_existing_feed(self):+ self.fixture.manifest['requires_os_version'] = '0.1.0'+ self.fixture.manifest['upgrades_from'] = [self.fixture.base]+ self.fixture.make_package()+ (self.bundle / 'SHA256SUMS').write_text(''.join(publish.digest(path) + ' ' + path.name + '\n' for path in+ [self.fixture.package, self.bundle / 'package-manifest.json', self.bundle / 'apply-update.py']))+ self.assertEqual(publish.validate(self.bundle, self.receipt, self.run)['requires_os_version'], '0.1.0')+ # The original installed updater must accept the explicit migration too.+ test_runtime_update.update.validate_bundle(self.bundle, self.fixture.base)+def test_failed_stale_or_missing_native_scopes_cannot_advance_the_feed(self):for field in ['update', 'fast_updates', 'system_channel']:bad = copy.deepcopy(self.receipt)diff --git a/os/tests/test_release_update.py b/os/tests/test_release_update.pyindex a80fd5c91..34eddaaa3 100644--- a/os/tests/test_release_update.py+++ b/os/tests/test_release_update.py@@ -74,6 +74,16 @@ class ReleaseChannel(unittest.TestCase):with patch.object(update.subprocess, 'check_output', side_effect=['harness-os 0.1.0pre4.r3-1', '-1']):self.assertFalse(update.discover(self.url + '/metadata.json')['available'])+ def test_existing_feed_discovers_an_official_release_without_reconfiguring_the_client(self):+ self.manifest['requires_os_version'] = '0.1.0'+ self.manifest['upgrades_from'] = [self.base]+ self.manifest['package'].update(name='harness-os-0.1.0-1-x86_64.pkg.tar.gz', version='0.1.0-1')+ self.publish()+ result = update.discover(self.url + '/metadata.json')+ self.assertTrue(result['available'])+ self.assertEqual(result['version'], '0.1.0-1')+ self.assertEqual(self.metadata['channel'], 'preview')+def test_missing_channel_is_empty_but_invalid_or_truncated_channel_is_an_error(self):self.assertIsNone(update.discover(self.url + '/missing'))original = copy.deepcopy(self.metadata)diff --git a/os/tests/vm.py b/os/tests/vm.pyindex 7fe8e0a79..a80138840 100644--- a/os/tests/vm.py+++ b/os/tests/vm.py@@ -374,8 +374,33 @@ def check_graphical_keyboard(vm, name):"""Prove the installed graphical surface accepts input and renders output."""started = time.monotonic()vm.command('pgrep -x labwc >/dev/null && pgrep -x foot >/dev/null')+ # A running renderer or the daemon's discovery endpoint can precede the+ # first graphical frame. The saved workspace must actually be visible+ # before sending its shortcut; otherwise early keystrokes can be lost.+ deadline = time.monotonic() + 30+ while time.monotonic() < deadline:+ vm.screenshot(name + '-ready')+ visible = subprocess.check_output(+ ['tesseract', str(vm.folder / (name + '-ready.png')), 'stdout', '--psm', '11'],+ text=True, stderr=subprocess.DEVNULL, timeout=10)+ if 'me@harness' in re.sub(r'\s+', '', visible):+ break+ time.sleep(.25)+ else:+ raise RuntimeError('The graphical workspace did not render before keyboard input.')+ previous, _ = vm.command('hn display-message -p "HN_PREVIOUS_PANE=#{pane_id}"')+ previous_pane = re.search(r'HN_PREVIOUS_PANE=(%\d+)', previous)+ if not previous_pane:+ raise RuntimeError('Keyboard probe could not identify the original pane.')vm.keys('ctrl', 'b')vm.keys('shift', 't')+ # New terminal is asynchronous. Require both a newly focused pane and its+ # empty shell prompt before typing, rather than sleeping for a guessed time.+ vm.command('for n in $(seq 1 60); do '+ 'current=$(hn display-message -p "#{pane_id}"); '+ 'if test "$current" != ' + shlex.quote(previous_pane[1]) ++ ' && hn capture-pane -p | grep -Eq ' + shlex.quote(r'^\[me@harness [^]]*\]\$$') ++ '; then exit 0; fi; sleep .25; done; exit 1', timeout=25)marker = 'keyboard-' + name + '-ready'vm.type_probe('echo ' + marker)vm.keys('ret')@@ -466,11 +491,22 @@ def check_first_use(vm, user, folder, installed=False):assert defaults.get('update') == 'disable', 'The packaged agent must remain managed by system updates'if installed:vm.command('test ! -e /etc/harness-live && test "$(id -un)" = me')- vm.command('for n in $(seq 1 40); do hn capture-pane -p | grep -q "Connect to Wi-Fi to get started" && exit 0; sleep .5; done; exit 1', timeout=30)+ vm.command('for n in $(seq 1 40); do hn capture-pane -p | grep -q "Connect to Wi-Fi" && exit 0; sleep .5; done; exit 1', timeout=30)vm.screenshot('installed-network-first')vm.command('! pgrep -u 1000 -x opencode')vm.keys('esc')- vm.command('hn capture-pane -p | grep -q "Connect to Wi-Fi to get started"')+ vm.command('hn capture-pane -p | grep -q "Connect to Wi-Fi"')+ # Networking must never trap the owner. Use the compositor shortcut,+ # then prove real keyboard input reaches a shell while still offline.+ vm.keys('meta_l', 't')+ # capture-pane trims trailing cells, including the prompt's last space.+ vm.command("for n in $(seq 1 30); do hn capture-pane -p | grep -Eq '^\\[me@harness [^]]*\\]\\$$' && exit 0; sleep .25; done; exit 1", timeout=15)+ vm.type_probe('echo offline-terminal-ready')+ vm.keys('ret')+ vm.command('for n in $(seq 1 30); do hn capture-pane -p | grep -qx offline-terminal-ready && exit 0; sleep .5; done; exit 1', timeout=20)+ vm.screenshot('installed-offline-terminal')+ vm.keys('ctrl', 'd')+ vm.command('for n in $(seq 1 30); do hn capture-pane -p | grep -q "Connect to Wi-Fi" && exit 0; sleep .5; done; exit 1', timeout=20)else:vm.command('test "$(uname -n)" = harness && test "$(id -nu 1000)" = me && test -f /etc/harness-live')vm.command('nmcli networking off')@@ -817,12 +853,14 @@ if status:vm.screenshot('install-03-ready')# Finishing password entry only focuses Install. No disk has changed yet.vm.command('test "$(lsblk -n -o TYPE /dev/vda | wc -l)" -eq 1')+ install_started = time.monotonic()vm.keys('ret')if progress_status == 0:progress = wait_screen('Preparing the disk|Setting up encryption|Copying Harness|Setting up your account', timeout=30)assert 'Keep this computer powered on' not in progress and 'Installing Harness' not in progressvm.screenshot('install-04-progress')output = wait_screen('Harness is installed', timeout=900)+ install_seconds = round(time.monotonic() - install_started, 3)vm.screenshot('install-05-complete')if direct:assert 'Back to Harness' not in output@@ -833,6 +871,8 @@ if status:output, _ = vm.command('cat /var/log/harness-install.log 2>/dev/null', check=False)(folder / 'installer-commands.log').write_text(output)assert config['password'] not in output, 'Installation diagnostics must not contain the password'+ # This includes input delivery and success-screen observation, not form entry.+ return install_secondsdef check_installer_cleanup(vm, folder):@@ -996,7 +1036,7 @@ def main():(folder / 'trial-project.html').write_bytes(vm.read_file(trial_project))vm.command(user('sh -c ' + shlex.quote('mkdir -p "$HOME/.config"; printf trial-only > "$HOME/.config/hn-trial-credential"')))vm.command('nmcli networking off')- install_interactively(vm, config, folder, direct=direct)+ result['install_action_to_success_seconds'] = install_interactively(vm, config, folder, direct=direct)result['checks'].append('Keyboard disk selection, encryption checkbox, masked password entry and a single Install action work on the guest terminal')result['checks'].append('Offline installer completed on disposable disk')if config['encrypt']:diff --git a/os/tools/build-package.py b/os/tools/build-package.pyindex 6bd0513a7..c0b987f30 100644--- a/os/tools/build-package.py+++ b/os/tools/build-package.py@@ -124,8 +124,8 @@ def main():commit = git(source, 'rev-parse', 'HEAD')timestamp = int(git(source, 'log', '-1', '--format=%ct'))lock = json.loads((source / 'os/lock.json').read_text())- if lock['architecture'] != 'x86_64' or not re.fullmatch(r'\d+\.\d+\.\d+-preview\.\d+', lock['version']):- parser.error('Expected a versioned x86-64 OS preview.')+ if lock['architecture'] != 'x86_64' or not re.fullmatch(r'\d+\.\d+\.\d+(?:-preview\.\d+)?', lock['version']):+ parser.error('Expected a versioned x86-64 OS release or numbered preview.')version = lock['version'].replace('-preview.', 'pre')if args.development:# Shallow CI checkouts all have a revision count of one. Use the sourcediff --git a/os/tools/publish-update.py b/os/tools/publish-update.pyindex c8e131491..1326498ea 100644--- a/os/tools/publish-update.py+++ b/os/tools/publish-update.py@@ -12,6 +12,8 @@ from urllib.request import urlopenimport zipfileREPO = 'autonomous-ai/openharness'+# Preserve the installed previews' feed URL/schema so their next update can+# migrate directly to an official release without reflashing.CHANNEL = 'os-preview-updates'@@ -30,8 +32,8 @@ def validate(bundle, receipt, run):spec.loader.exec_module(updater)manifest = json.loads((bundle / 'package-manifest.json').read_text())updater.validate_bundle(bundle, {'version': manifest['requires_os_version'], 'arch_snapshot': manifest['arch_snapshot']})- if not re.fullmatch(r'\d+\.\d+\.\d+-preview\.\d+', manifest['requires_os_version']):- raise ValueError('Only explicitly versioned previews can use this channel.')+ if not re.fullmatch(r'\d+\.\d+\.\d+(?:-preview\.\d+)?', manifest['requires_os_version']):+ raise ValueError('Only explicit OS releases or numbered previews can use this channel.')versions = manifest['runtime'].get('versions', {})if set(versions) != {'hn', 'cli'} or any(not isinstance(value, str) or value.startswith('999.') for value in versions.values()):raise ValueError('The public package must contain production runtime versions, never private fixtures.')@@ -115,7 +117,7 @@ def main():# assets only after that release exists; never replace its ISO or manifest.release = json.loads(gh('api', f'repos/{REPO}/releases/tags/{tag}'))if release['draft']:- raise ValueError('Publish the validated OS preview before advancing its update feed.')+ raise ValueError('Publish the validated OS release before advancing its update feed.')existing = {asset['name']: asset for asset in release['assets']}missing = []for path in assets:diff --git a/os/tools/publish.py b/os/tools/publish.pyindex 9073dca50..d11006770 100644--- a/os/tools/publish.py+++ b/os/tools/publish.py@@ -1,5 +1,5 @@#!/usr/bin/env python3-"""Publish an already-tested preview; never turn an incomplete VM run into a release."""+"""Publish an already-tested OS; never turn an incomplete VM run into a release."""import argparsefrom concurrent.futures import ThreadPoolExecutorimport hashlib@@ -47,6 +47,78 @@ def read(path):return json.loads(path.read_text())+def is_preview(version):+ if not isinstance(version, str) or not re.fullmatch(r'\d+\.\d+\.\d+(?:-preview\.\d+)?', version):+ raise ValueError('Expected an explicit OS release or numbered preview version.')+ return '-preview.' in version+++def version_key(version):+ preview = is_preview(version)+ base, _, number = version.partition('-preview.')+ return (*map(int, base.split('.')), int(not preview), int(number or 0))+++def publish_latest_pointer(repo, manifest, release):+ """Advance the OS-only download link after the immutable assets are verified."""+ version = manifest['version']+ preview = is_preview(version)+ tag = 'os-latest'+ endpoint = f'repos/{repo}/releases/tags/{tag}'+ previous = subprocess.run(['gh', 'api', endpoint], capture_output=True, text=True, timeout=120)+ exists = previous.returncode == 0+ if not exists and '404' not in previous.stderr:+ raise ValueError('Cannot inspect the OS latest pointer: ' + previous.stderr)+ if exists:+ old = json.loads(previous.stdout)+ marker = re.search(r'<!-- harness-os-latest:(\{[^\n]+\}) -->', old.get('body', ''))+ if not marker:+ raise ValueError('The existing OS latest release is not a managed pointer.')+ identity = json.loads(marker[1])+ # Once an official OS exists, later previews keep their versioned links+ # and cannot replace that default download.+ if preview and not is_preview(identity['version']):+ return {'status': 'official-release-retained', 'version': identity['version']}+ current = version_key(identity['version'])+ candidate = version_key(version)+ if current > candidate:+ return {'status': 'newer-release-retained', 'version': identity['version']}+ if current == candidate and identity['source_commit'] != manifest['source_commit']:+ raise ValueError('The same OS version cannot point to different source.')+ identity = {'version': version, 'source_commit': manifest['source_commit']}+ prefix = f'https://github.com/{repo}/releases/download/os-v{version}/'+ iso = manifest['iso']['name']+ notes = f'''<!-- harness-os-latest:{json.dumps(identity, separators=(',', ':'))} -->+Harness **{version}** is the latest operating system {'preview' if preview else 'release'}.++[Download the x86-64 ISO]({prefix}{iso}) · [SHA-256 checksum]({prefix}{iso}.sha256) · [Installation guide]({prefix}INSTALL.md)++[Release notes, source and validation]({release['html_url']})++This permanent OS link advances after validation and public download checks. Versioned releases remain unchanged. Once an official OS is available, previews cannot replace that default download.+'''+ with tempfile.TemporaryDirectory(prefix='harness-os-latest-') as temporary:+ path = Path(temporary) / 'notes.md'+ path.write_text(notes)+ if exists:+ # Only this explicitly mutable pointer moves. Versioned tags never do.+ gh('api', '--method', 'PATCH', f'repos/{repo}/git/refs/tags/{tag}',+ '-f', 'sha=' + manifest['source_commit'], '-F', 'force=true')+ gh('release', 'edit', tag, '--repo', repo, '--target', manifest['source_commit'],+ '--draft=false', f'--prerelease={str(preview).lower()}', '--latest=false',+ '--title', 'Harness — latest OS', '--notes-file', path)+ else:+ gh('release', 'create', tag, '--repo', repo, '--target', manifest['source_commit'],+ f'--prerelease={str(preview).lower()}', '--latest=false', '--title', 'Harness — latest OS', '--notes-file', path)+ actual = json.loads(gh('api', endpoint))+ ref = json.loads(gh('api', f'repos/{repo}/git/ref/tags/{tag}'))+ if actual['draft'] or actual['prerelease'] != preview or actual['body'].strip() != notes.strip() or ref['object']['sha'] != manifest['source_commit']:+ raise ValueError('The public OS latest pointer does not match the verified release.')+ if not preview:+ gh('release', 'edit', 'os-v' + version, '--repo', repo, '--latest=true')+ return {'status': 'published', 'url': actual['html_url'], **identity}++def validate_install_guide(manifest, guide):if (f'These instructions are for **{manifest["version"]}**' not in guide ormanifest['iso']['name'] not in guide):@@ -163,8 +235,7 @@ def main():folder = root / 'image'manifest = read(folder / 'manifest.json')version = manifest['version']- if not re.fullmatch(r'\d+\.\d+\.\d+-preview\.\d+', version):- raise ValueError('This publisher only creates explicitly versioned previews.')+ preview = is_preview(version)iso = folder / manifest['iso']['name']if iso.parent != folder or not iso.name.endswith('.iso') or iso.stat().st_size != manifest['iso']['bytes'] or digest(iso) != manifest['iso']['sha256']:raise ValueError('ISO identity does not match its manifest.')@@ -205,7 +276,8 @@ def main():validate_receipts(manifest, dsh_receipts)examples['dsh'] = {'run': dsh_run['html_url'], 'machines': dsh_receipts,'checks': validate_examples(root / 'dsh-machines', 'dsh')}- limitations = ['Physical ThinkPad, Wi-Fi, suspend and NVIDIA hardware remain unverified.',+ limitations = ['ThinkPad installation and use have user confirmation; physical Intel Mac coverage, suspend and NVIDIA rendering/inference remain unverified.',+ 'This release is x86-64. Apple Silicon and Raspberry Pi images are not included.','Account-authenticated Claude/Codex model turns remain unverified. Bundled OpenCode default first-use turns are recorded in the machine evidence; upstream model availability may change.','Timing and memory measurements describe these VMs, not physical laptop power-on time.']validation = {'status': 'passed', 'image_run': image['html_url'], 'machine_run': run['html_url'],@@ -280,11 +352,14 @@ Source: `{manifest['source_commit']}`. [Machine validation]({run['html_url']}).'notes': str(notes), 'files': identities}, indent=2))returnsubprocess.run(['gh', 'release', 'create', tag, '--repo', args.repo, '--target', manifest['source_commit'],- '--draft', '--prerelease', '--title', 'Harness ' + version, '--notes-file', str(notes),+ '--draft', f'--prerelease={str(preview).lower()}', '--latest=false', '--title', 'Harness ' + version, '--notes-file', str(notes),*map(str, assets)], check=True, timeout=900)try:- subprocess.run(['gh', 'release', 'edit', tag, '--repo', args.repo, '--draft=false'], check=True, timeout=120)+ subprocess.run(['gh', 'release', 'edit', tag, '--repo', args.repo, '--draft=false', '--latest=false'], check=True, timeout=120)release = json.loads(gh('api', f'repos/{args.repo}/releases/tags/{tag}'))+ ref = json.loads(gh('api', f'repos/{args.repo}/git/ref/tags/{tag}'))+ if release['draft'] or release['prerelease'] != preview or ref['object']['sha'] != manifest['source_commit']:+ raise ValueError('Published release kind or tag source does not match the verified build.')def verify(asset):expected = identities[asset['name']]with tempfile.TemporaryDirectory(prefix='hn-release-check-') as temp:@@ -298,13 +373,16 @@ Source: `{manifest['source_commit']}`. [Machine validation]({run['html_url']}).raise ValueError('Published asset set differs from the verified build.')with ThreadPoolExecutor(max_workers=3) as pool:checked = list(pool.map(verify, release['assets']))- receipt = {'status': 'passed', 'release_url': release['html_url'], 'source_commit': manifest['source_commit'],- 'finished_at_unix': time.time(), 'verified_public_assets': checked, 'files': identities}- (root / 'publication.json').write_text(json.dumps(receipt, indent=2) + '\n')- print(release['html_url'])except BaseException:subprocess.run(['gh', 'release', 'edit', tag, '--repo', args.repo, '--draft=true'], check=True, timeout=120)raise+ # Pointer failure must not hide an already-verified immutable release.+ latest = publish_latest_pointer(args.repo, manifest, release)+ receipt = {'status': 'passed', 'release_url': release['html_url'], 'source_commit': manifest['source_commit'],+ 'finished_at_unix': time.time(), 'verified_public_assets': checked, 'files': identities,+ 'prerelease': preview, 'latest_os': latest}+ (root / 'publication.json').write_text(json.dumps(receipt, indent=2) + '\n')+ print(release['html_url'])if __name__ == '__main__':