From e31ffa4c0726a7370cd845831fcfc0202f94b026 Mon Sep 17 00:00:00 2001 From: "orbi-build[bot]" <327503608+orbi-build[bot]@users.noreply.github.com> Date: Thu, 3 Dec 2026 11:36:12 -0600 Subject: [PATCH] Repeat source revisions in the Update Kit final receipt --- docs/installation.md | 11 ++++--- skills/update-kit/scripts/update_kit.py | 2 +- tests/test_update_kit.py | 44 +++++++++++++++---------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 061d929a..0a2f2d11 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -47,11 +47,12 @@ evidence; the helper never resets, stashes, cleans, forces, repins or deletes it It fetches only fixed upstream and fast-forwards `main`, then invokes that fetched checkout's `bash install.sh update --no-pull` once, including equal-SHA reinstalls. -`--no-pull` suppresses only the outer installer pull. The receipt reports old, -helper-selected and final SHA. Installer output -owns component outcomes; nonzero/partial failure propagates and successful host -items remain installed, not rolled back. Repair the reported cause and retry only -compatible selected failures. Reload/reopen the current agent session for discovery; +`--no-pull` suppresses only the outer installer pull. After the installer finishes, +the helper repeats the old and helper-selected SHAs alongside the final SHA on one +line, then reports `installer_exit`. Installer output owns component outcomes; +nonzero/partial failure propagates and successful host items remain installed, +not rolled back. Repair the reported cause and retry only compatible selected +failures. Reload/reopen the current agent session for discovery; package refresh does not reload a running agent. The installer can activate Orbi when that component is selected; it does not qualify live delivery. diff --git a/skills/update-kit/scripts/update_kit.py b/skills/update-kit/scripts/update_kit.py index 33073ec4..aba67e37 100644 --- a/skills/update-kit/scripts/update_kit.py +++ b/skills/update-kit/scripts/update_kit.py @@ -291,7 +291,7 @@ def update(source, flags): finally: final = git(source, 'rev-parse', 'HEAD', check=False) final_sha = final.stdout.strip() if final.returncode == 0 else 'NOT_CHECKED' - print(f'final_sha={final_sha}', flush=True) + print(f'old_sha={old} selected_sha={selected} final_sha={final_sha}', flush=True) if final.returncode: print('Final source revision NOT_CHECKED: ' + final.stderr.strip(), flush=True) elif final_sha != selected: diff --git a/tests/test_update_kit.py b/tests/test_update_kit.py index a02c2568..5651c4e0 100644 --- a/tests/test_update_kit.py +++ b/tests/test_update_kit.py @@ -103,7 +103,8 @@ def test_fresh_equal_and_fast_forward_reinstall_literal_argv(self): out = self.success(*flags) self.assertTrue((self.source / 'scripts/install_menu.py').is_file()) self.assertEqual(git(self.source, 'remote', 'get-url', 'origin'), updater.SOURCE) - self.assertIn(old, out) + self.assertIn(f'old_sha=ABSENT\nselected_sha={old}\n', out) + self.assertEqual(out.splitlines()[-2], f'old_sha=ABSENT selected_sha={old} final_sha={old}') self.assertIn('check for updates every run', out) self.assertIn('restart only proven affected active integrations', out) self.assertIn('Selecting Orbi stops, updates and restarts verified local deployments', out) @@ -111,8 +112,7 @@ def test_fresh_equal_and_fast_forward_reinstall_literal_argv(self): new = self.advance() out = self.success(*flags) self.assertEqual(git(self.source, 'rev-parse', 'HEAD'), new) - self.assertIn(old, out) - self.assertIn(new, out) + self.assertEqual(out.splitlines()[-2], f'old_sha={old} selected_sha={new} final_sha={new}') expected = [b'update', b'--no-pull', *(arg.encode() for arg in flags)] self.assertEqual(self.argv(), expected * 3) @@ -132,9 +132,10 @@ def test_secondary_refresh_reports_selected_and_final_sha(self): os.environ['SECONDARY'] = str(self.upstream) with patch.object(updater, '_source_url', return_value=str(snapshot)): out = self.success() - self.assertIn('secondary', out.lower()) - self.assertIn(selected, out) - self.assertIn(final, out) + lines = out.splitlines() + self.assertEqual(lines[-3], f'old_sha={selected} selected_sha={selected} final_sha={final}') + self.assertIn('Secondary source change', lines[-2]) + self.assertTrue(lines[-1].startswith('installer_exit=0;'), out) self.assertEqual(len(self.argv()), 4) self.assertEqual((self.home / 'native-installer-argv').read_bytes(), b'update\0--no-pull\0') @@ -143,8 +144,11 @@ def test_installer_partial_failure_is_not_rolled_back(self): code, out = self.invoke('--skip', 'orbi') self.assertEqual(code, 7, out) self.assertTrue(self.source.exists()) - self.assertIn('final_sha=', out) - self.assertIn('not rolled back', out) + selected = git(self.upstream, 'rev-parse', 'HEAD') + lines = out.splitlines() + self.assertEqual(lines[-2], f'old_sha=ABSENT selected_sha={selected} final_sha={selected}') + self.assertTrue(lines[-1].startswith('installer_exit=7;'), out) + self.assertIn('not rolled back', lines[-1]) self.assertEqual(self.argv(), [b'update', b'--no-pull', b'--skip', b'orbi']) def test_unavailable_final_readback_does_not_claim_a_secondary_change(self): @@ -162,8 +166,11 @@ def unavailable(argv, **kwargs): with patch.object(updater, 'run', side_effect=unavailable): code, out = self.invoke('--skip', 'orbi') self.assertEqual(code, 7, out) - self.assertIn('final_sha=NOT_CHECKED', out) - self.assertIn('fixture readback failed', out) + selected = git(self.upstream, 'rev-parse', 'HEAD') + lines = out.splitlines() + self.assertEqual(lines[-3], f'old_sha=ABSENT selected_sha={selected} final_sha=NOT_CHECKED') + self.assertIn('fixture readback failed', lines[-2]) + self.assertTrue(lines[-1].startswith('installer_exit=7;'), out) self.assertNotIn('Secondary source change', out) def test_preview_has_no_writes_or_probes(self): @@ -381,14 +388,17 @@ def local_transport(argv, **kwargs): raise SystemExit(m.main(sys.argv[3:])) ''' command = [sys.executable, '-B', '-c', program, str(HELPER), str(self.upstream)] - for flags in (['--skip', 'orbi'], ['--only', 'pi,tx']): + selected = git(self.upstream, 'rev-parse', 'HEAD') + for flags, old, exit_code in ((['--skip', 'orbi'], 'ABSENT', 0), + (['--only', 'pi,tx'], selected, 0), + (['--skip', 'orbi'], selected, 7)): result = subprocess.run([*command, *flags], cwd=self.root, capture_output=True, - text=True, timeout=30, env=dict(os.environ)) - self.assertEqual(result.returncode, 0, result.stdout + result.stderr) - self.assertIn('pi installed; codex skipped', result.stdout) - self.assertIn('selected_sha=', result.stdout) - self.assertIn('final_sha=', result.stdout) - self.assertIn('installer_exit=0', result.stdout) + text=True, timeout=30, env=dict(os.environ, INSTALL_EXIT=str(exit_code))) + self.assertEqual(result.returncode, exit_code, result.stdout + result.stderr) + lines = result.stdout.splitlines() + self.assertIn('pi installed; codex skipped', lines[-3]) + self.assertEqual(lines[-2], f'old_sha={old} selected_sha={selected} final_sha={selected}') + self.assertTrue(lines[-1].startswith(f'installer_exit={exit_code};'), result.stdout) argv = self.argv() result = subprocess.run([*command, '--only', 'hermes'], cwd=self.root, capture_output=True, text=True, timeout=30, env=dict(os.environ))