Spaces:
Running
Running
Repair terminal history pruning after boundary cleanup
Browse filesFiles changed (13)
- CHANGELOG.md+8
- QUALIFICATION.md+1-1
- README.md+3-3
- RELEASE_NOTES.md+9-3
- scripts/first_kill.py+2-2
- scripts/install.py+1-1
- scripts/upgrade.py+1
- src/lumi_eggcracker/__init__.py+1-1
- src/lumi_eggcracker/supervisor.py+20-4
- tests/test_cli.py+1-1
- tests/test_first_kill.py+1-1
- tests/test_supervisor.py+70
- tests/test_upgrade_identity.py+1
12345# Changelog## 1.0.4 (release candidate)- Serialize deterministic owned-cgroup containment against autonomous12345678910111213# Changelog## 1.0.5 (release candidate)- Retry bounded terminal-history pruning after exact offline-boundary teardownsucceeds, preventing namespace identity reuse from leaving the store aboveits 128-record limit on a busy or rebooted host.- Protect the just-completed run during the post-cleanup pass and continue toretain any terminal record whose namespace cleanup remains uncertain.## 1.0.4 (release candidate)- Serialize deterministic owned-cgroup containment against autonomous
123456# QualificationThis file defines the native qualification contract for one exact 1.0.4candidate and host. The release manifest, source archive, embedded zipappidentity, installed policy, all receipts and the evidence seal must name thesame source commit. Re-run every gate after any commit change; evidence from123456# QualificationThis file defines the native qualification contract for one exact 1.0.5candidate and host. The release manifest, source archive, embedded zipappidentity, installed policy, all receipts and the evidence seal must name thesame source commit. Re-run every gate after any commit change; evidence from
1 unmodified line234567814 unmodified lines2324252627282933 unmodified lines636465666768691 unmodified line[](https://github.com/noqt/Lumi-Eggcracker/actions/workflows/ci.yml)1.0.4 release candidate (local qualification)· [Try it without installing](TRY_IT.md)· [Check host compatibility](#check-host-compatibility)· [Run the first kill](#run-the-first-kill)14 unmodified linesEggcracker works on native Linux today and supports four qualified AI workloadprofiles plus an offline boundary for every explicitly selected workload. It'san internal 1.0.4 release candidate, intentionally limited; the exact boundary is in[Current boundary](#current-boundary).**Want to see the core idea work?** [Try the hosted proof](TRY_IT.md). You don't33 unmodified linesqualification:```text[eggcracker] candidate artifact and release identity verified: 1.0.4 -> <qualified-commit>{"primitive": "pidfd-stop+cgroup.kill","profile": "content.gguf-llama",1 unmodified line234567814 unmodified lines2324252627282933 unmodified lines636465666768691 unmodified line[](https://github.com/noqt/Lumi-Eggcracker/actions/workflows/ci.yml)1.0.5 release candidate (local qualification)· [Try it without installing](TRY_IT.md)· [Check host compatibility](#check-host-compatibility)· [Run the first kill](#run-the-first-kill)14 unmodified linesEggcracker works on native Linux today and supports four qualified AI workloadprofiles plus an offline boundary for every explicitly selected workload. It'san internal 1.0.5 release candidate, intentionally limited; the exact boundary is in[Current boundary](#current-boundary).**Want to see the core idea work?** [Try the hosted proof](TRY_IT.md). You don't33 unmodified linesqualification:```text[eggcracker] candidate artifact and release identity verified: 1.0.5 -> <qualified-commit>{"primitive": "pidfd-stop+cgroup.kill","profile": "content.gguf-llama",
12345624 unmodified lines31323334353637# Lumi Eggcracker 1.0.4 — release candidate repairThis local 1.0.4 candidate repairs the qualified root-supervisor product afterthe 0.7 runtime-topology, 0.8 execution-boundary, 0.8.1 deployment-hardeningand 0.9 bounded-local-lockdown milestones. It carries four exact native CPUAI profiles, direct cgroup-v2 containment, offline selected-workload and24 unmodified linesdefers that same cgroup, preventing a redundant detector kill and false locallockdown when an approved process disappears during deterministic containment.The public first-kill helper defaults to `v1.0.4`. The packaged support helperdelegates to the installed root-owned zipapp, so the documented command worksfrom the verified Linux release bundle without importing a mutable checkout.The bootstrap now also requires a detached `SHA256SUMS.asc` signature from the12345624 unmodified lines31323334353637383940414243# Lumi Eggcracker 1.0.5 — release candidate repairThis local 1.0.5 candidate repairs the qualified root-supervisor product afterthe 0.7 runtime-topology, 0.8 execution-boundary, 0.8.1 deployment-hardeningand 0.9 bounded-local-lockdown milestones. It carries four exact native CPUAI profiles, direct cgroup-v2 containment, offline selected-workload and24 unmodified linesdefers that same cgroup, preventing a redundant detector kill and false locallockdown when an approved process disappears during deterministic containment.After exact offline-boundary teardown succeeds, terminal-history pruning nowruns again with the just-completed run protected. This keeps the bounded storeat 128 records even when namespace identity reuse made older recordstemporarily non-removable during the pre-cleanup persistence pass. An uncertainboundary remains retained and still fails health closed.The public first-kill helper defaults to `v1.0.5`. The packaged support helperdelegates to the installed root-owned zipapp, so the documented command worksfrom the verified Linux release bundle without importing a mutable checkout.The bootstrap now also requires a detached `SHA256SUMS.asc` signature from the
33 unmodified lines34353637383940425 unmodified lines46646746846947047147233 unmodified linesREPOSITORY = "noqt/Lumi-Eggcracker"DEFAULT_TAG = "v1.0.4"RELEASE_KEY_FINGERPRINT = "53786DEB001459956A2E1B86A3F29F7A27636DC7"WORKLOAD_USER = "lumi-eggcracker-workload"INSTALL_TARGETS = (425 unmodified linesdef release_files(tag: str, workspace: Path) -> tuple[Path, Path, Path, Path]:version = tag.removeprefix("v")if not version.replace(".", "").isdigit() or version.count(".") != 2:raise FirstKillError("tag must look like v1.0.4")base = f"https://github.com/{REPOSITORY}/releases/download/{tag}"sums = workspace / "SHA256SUMS"signature = workspace / "SHA256SUMS.asc"33 unmodified lines34353637383940425 unmodified lines46646746846947047147233 unmodified linesREPOSITORY = "noqt/Lumi-Eggcracker"DEFAULT_TAG = "v1.0.5"RELEASE_KEY_FINGERPRINT = "53786DEB001459956A2E1B86A3F29F7A27636DC7"WORKLOAD_USER = "lumi-eggcracker-workload"INSTALL_TARGETS = (425 unmodified linesdef release_files(tag: str, workspace: Path) -> tuple[Path, Path, Path, Path]:version = tag.removeprefix("v")if not version.replace(".", "").isdigit() or version.count(".") != 2:raise FirstKillError("tag must look like v1.0.5")base = f"https://github.com/{REPOSITORY}/releases/download/{tag}"sums = workspace / "SHA256SUMS"signature = workspace / "SHA256SUMS.asc"
62 unmodified lines6364656667686962 unmodified linesRUNTIME,WATCHDOG_RUNTIME,)INSTALLER_VERSION = "1.0.4"MAX_RELEASE_MANIFEST_BYTES = 32 * 1024INSTALL_JOURNAL = Path("/var/lib/lumi-eggcracker-install-journal.json")LIFECYCLE_LOCK = Path("/run/lock/lumi-eggcracker-lifecycle.lock")62 unmodified lines6364656667686962 unmodified linesRUNTIME,WATCHDOG_RUNTIME,)INSTALLER_VERSION = "1.0.5"MAX_RELEASE_MANIFEST_BYTES = 32 * 1024INSTALL_JOURNAL = Path("/var/lib/lumi-eggcracker-install-journal.json")LIFECYCLE_LOCK = Path("/run/lock/lumi-eggcracker-lifecycle.lock")
43 unmodified lines44454647484943 unmodified lines"1.0.1","1.0.2","1.0.3",installer.INSTALLER_VERSION,}43 unmodified lines4445464748495043 unmodified lines"1.0.1","1.0.2","1.0.3","1.0.4",installer.INSTALLER_VERSION,}
123"""Lumi Eggcracker: autonomous Linux AI-runtime containment."""__version__ = "1.0.4"123"""Lumi Eggcracker: autonomous Linux AI-runtime containment."""__version__ = "1.0.5"
458 unmodified lines459460461462463464666 unmodified lines11311132113311341135113611371083 unmodified lines222122222223222422252226222738 unmodified lines2266226722682269227022712272744 unmodified lines3017301830193020302130223023458 unmodified linesfor _, path in removable[:remove_count]:path.unlink(missing_ok=True)def _stored_boundary_cleanup_healthy(self) -> bool:"""Reject clean health while a terminal run still owns namespace mounts."""try:666 unmodified linesif record.get("boundary") is None:continuetry:self._teardown_boundary(record)except (JsonInputError, OSError):# Containment and its receipt remain authoritative. Keep the# retained run identity for restart recovery and fail health1083 unmodified linescleanup = self._cleanup(record["unit"])if boundary is not None:try:cleanup["offline_boundary"] = self._teardown_boundary(record)except (JsonInputError, OSError) as error:self.boundary_cleanup_healthy = Falsecleanup["offline_boundary"] = {"error": str(error)[:160]}38 unmodified linesrecord.update(current)self._store(current)try:self._teardown_boundary(current)except (JsonInputError, OSError):# The workload is already empty and the terminal state is# durable. Keep the boundary failure visible to doctor and744 unmodified linesand record.get("boundary") is not None):try:self._teardown_boundary(record)except (JsonInputError, OSError):# A completed workload cannot retain a useful boundary.# Refuse a clean-health claim if exact identity-checked458 unmodified lines459460461462463464465466467468469470471472473474475476477478666 unmodified lines11451146114711481149115011511083 unmodified lines22352236223722382239224022412242224338 unmodified lines2282228322842285228622872288744 unmodified lines3033303430353036303730383039458 unmodified linesfor _, path in removable[:remove_count]:path.unlink(missing_ok=True)def _teardown_terminal_boundary(self, record: dict[str, Any]) -> dict[str, Any] | None:"""Release exact boundary authority, then retry bounded history pruning.Namespace identifiers can be reused while the next workload boundary islive. The pre-cleanup persistence pass must therefore retain recordswhose recorded identity still appears mounted. Once exact teardown hassucceeded, retry pruning while protecting the record just completed."""result = self._teardown_boundary(record)self._prune_terminal_records(protected_run_id=record["run_id"])return resultdef _stored_boundary_cleanup_healthy(self) -> bool:"""Reject clean health while a terminal run still owns namespace mounts."""try:666 unmodified linesif record.get("boundary") is None:continuetry:self._teardown_terminal_boundary(record)except (JsonInputError, OSError):# Containment and its receipt remain authoritative. Keep the# retained run identity for restart recovery and fail health1083 unmodified linescleanup = self._cleanup(record["unit"])if boundary is not None:try:cleanup["offline_boundary"] = self._teardown_terminal_boundary(record)except (JsonInputError, OSError) as error:self.boundary_cleanup_healthy = Falsecleanup["offline_boundary"] = {"error": str(error)[:160]}38 unmodified linesrecord.update(current)self._store(current)try:self._teardown_terminal_boundary(current)except (JsonInputError, OSError):# The workload is already empty and the terminal state is# durable. Keep the boundary failure visible to doctor and744 unmodified linesand record.get("boundary") is not None):try:self._teardown_terminal_boundary(record)except (JsonInputError, OSError):# A completed workload cannot retain a useful boundary.# Refuse a clean-health claim if exact identity-checked
12 unmodified lines1314151617181912 unmodified linesoutput = io.StringIO()with redirect_stdout(output):self.assertEqual(0, main(["version"]))self.assertEqual("1.0.4", output.getvalue().strip())def test_public_help_has_only_supported_commands(self) -> None:from lumi_eggcracker.cli import _parser12 unmodified lines1314151617181912 unmodified linesoutput = io.StringIO()with redirect_stdout(output):self.assertEqual(0, main(["version"]))self.assertEqual("1.0.5", output.getvalue().strip())def test_public_help_has_only_supported_commands(self) -> None:from lumi_eggcracker.cli import _parser
23 unmodified lines2425262728293023 unmodified linesclass FirstKillTests(unittest.TestCase):def test_default_release_identity_is_the_1_0_candidate(self) -> None:self.assertEqual("v1.0.4", first_kill.DEFAULT_TAG)def test_preflight_exits_before_every_mutating_or_network_step(self) -> None:output = io.StringIO()23 unmodified lines2425262728293023 unmodified linesclass FirstKillTests(unittest.TestCase):def test_default_release_identity_is_the_1_0_candidate(self) -> None:self.assertEqual("v1.0.5", first_kill.DEFAULT_TAG)def test_preflight_exits_before_every_mutating_or_network_step(self) -> None:output = io.StringIO()
1072 unmodified lines1073107410751076107710781072 unmodified linesself.assertTrue(pending_path.is_file())self.assertFalse(clean_path.exists())def test_autonomous_kill_terminal_state_wins_completion_race(self) -> None:supervisor = self._instance()with tempfile.TemporaryDirectory() as raw:1072 unmodified lines10731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481072 unmodified linesself.assertTrue(pending_path.is_file())self.assertFalse(clean_path.exists())def test_terminal_boundary_teardown_retries_pruning_after_identity_release(self,) -> None:supervisor = self._instance()with tempfile.TemporaryDirectory() as raw:supervisor.runs = Path(raw)current_path = supervisor.runs / ("a" * 24 + ".json")historical_path = supervisor.runs / ("b" * 24 + ".json")current_path.write_text("{}", encoding="utf-8")historical_path.write_text("{}", encoding="utf-8")current = {**record(),"boundary": {"recorded": True},"created_monotonic_ns": 1,"state": "TERMINATED",}historical = {**record(),"boundary": {"recorded": True},"created_monotonic_ns": 10_000,"name": "historical","run_id": "b" * 24,"state": "TERMINATED","unit": "lumi-eggcracker-workload-" + "b" * 24 + ".service",}boundary = MagicMock()boundary.namespace_mounts_present.return_value = Falsewith (patch("lumi_eggcracker.supervisor.MAX_TERMINAL_RECORDS", 1),patch.object(supervisor,"_teardown_boundary",return_value={"removed": True},) as teardown,patch("lumi_eggcracker.supervisor.load_run",side_effect=lambda _root, run_id: (current if run_id == "a" * 24 else historical),),patch("lumi_eggcracker.supervisor.OfflineBoundary.from_record",return_value=boundary,),):result = supervisor._teardown_terminal_boundary(current)self.assertEqual({"removed": True}, result)teardown.assert_called_once_with(current)self.assertTrue(current_path.is_file())self.assertFalse(historical_path.exists())def test_terminal_boundary_teardown_does_not_prune_after_cleanup_failure(self,) -> None:supervisor = self._instance()item = {**record(), "boundary": {"recorded": True}, "state": "TERMINATED"}with (patch.object(supervisor,"_teardown_boundary",side_effect=JsonInputError("boundary identity drifted"),),patch.object(supervisor, "_prune_terminal_records") as prune,self.assertRaisesRegex(JsonInputError, "identity drifted"),):supervisor._teardown_terminal_boundary(item)prune.assert_not_called()def test_autonomous_kill_terminal_state_wins_completion_race(self) -> None:supervisor = self._instance()with tempfile.TemporaryDirectory() as raw:
66 unmodified lines67686970717266 unmodified linesself.assertIn("1.0.1", upgrader.SUPPORTED_SOURCES)self.assertIn("1.0.2", upgrader.SUPPORTED_SOURCES)self.assertIn("1.0.3", upgrader.SUPPORTED_SOURCES)def test_legacy_manifest_resolves_live_gid_instead_of_using_uid(self) -> None:upgrader = self.load_upgrader()66 unmodified lines6768697071727366 unmodified linesself.assertIn("1.0.1", upgrader.SUPPORTED_SOURCES)self.assertIn("1.0.2", upgrader.SUPPORTED_SOURCES)self.assertIn("1.0.3", upgrader.SUPPORTED_SOURCES)self.assertIn("1.0.4", upgrader.SUPPORTED_SOURCES)def test_legacy_manifest_resolves_live_gid_instead_of_using_uid(self) -> None:upgrader = self.load_upgrader()
CHANGELOG.md+8
QUALIFICATION.md+1-1
README.md+3-3
RELEASE_NOTES.md+9-3
scripts/first_kill.py+2-2
scripts/install.py+1-1
scripts/upgrade.py+1
src/lumi_eggcracker/__init__.py+1-1
src/lumi_eggcracker/supervisor.py+20-4
tests/test_cli.py+1-1
tests/test_first_kill.py+1-1
tests/test_supervisor.py+70
tests/test_upgrade_identity.py+1