Spaces:
Running
Running
Sync GitHub source 61e6956384fc4832510e6bf506df11887c9a5184
Browse filesCanonical source: https://github.com/noqt/Lumi-Eggcracker/commit/61e6956384fc4832510e6bf506df11887c9a5184
Files changed (6)
- HUGGINGFACE_MANIFEST.json+8-8
- HUGGINGFACE_SYNC.json+3-3
- README.md+1-1
- index.html+2-2
- src/lumi_eggcracker/cli.py+60-1
- tests/test_cli.py+184-2
36 unmodified lines37383940414243145 unmodified lines189190191192193194195241 unmodified lines437438439440441442443444148 unmodified lines593594595596597598599600238 unmodified lines83984084184284384436 unmodified lines"size": 10537},"README.md": {"sha256": "9769457cb12f80f20b11f3f3d55ba43a0860c3d36d4cd721b74a2762c8be1464","size": 40484},"RELEASE_NOTES.md": {145 unmodified lines"size": 4101},"index.html": {"sha256": "bf6a2388a76492e642b8a716dc2a05da4a9ed1171bca85b7690978c34453660c","size": 22790},"integrations/prometheus/eggcracker.rules.yml": {241 unmodified lines"size": 55591},"src/lumi_eggcracker/cli.py": {"sha256": "7af201b4c5bace2471a843701ee52c9d03c2631c909d30ec27eeb360e778c65e","size": 28559},"src/lumi_eggcracker/client.py": {"sha256": "173f3e780bcbd9270651436ad0800e70e03a79844d7ec67dab9d344433c0dae9",148 unmodified lines"size": 7176},"tests/test_cli.py": {"sha256": "43f442e17937fd72c448b41f66e33bfe9ee6033ae8e67f0ed96c94c23d2eea1b","size": 34284},"tests/test_client.py": {"sha256": "d8b41628a799c13fb2f9598fe1b601544d155ef61bf081ccc561779b024218ad",238 unmodified lines},"schema": "noqt.huggingface_manifest.v1","source_repository": "https://github.com/noqt/Lumi-Eggcracker","source_revision": "a5d1879c781062f43a2a2102dd773128fc9662f2","source_url": "https://github.com/noqt/Lumi-Eggcracker/commit/a5d1879c781062f43a2a2102dd773128fc9662f2"}36 unmodified lines37383940414243145 unmodified lines189190191192193194195241 unmodified lines437438439440441442443444148 unmodified lines593594595596597598599600238 unmodified lines83984084184284384436 unmodified lines"size": 10537},"README.md": {"sha256": "5f05db1e492026c7ef8f36885bf8502f29043d9cf3bbb7370ce666be25b42434","size": 40484},"RELEASE_NOTES.md": {145 unmodified lines"size": 4101},"index.html": {"sha256": "b98dd0dd3207081bad28b3ee205603f4a2e93028966d926372f29dd3433a9f39","size": 22790},"integrations/prometheus/eggcracker.rules.yml": {241 unmodified lines"size": 55591},"src/lumi_eggcracker/cli.py": {"sha256": "561c65ca767648c1f7e2fbd841b952726b972c11f38955678a6fb07fbdc6ece6","size": 30991},"src/lumi_eggcracker/client.py": {"sha256": "173f3e780bcbd9270651436ad0800e70e03a79844d7ec67dab9d344433c0dae9",148 unmodified lines"size": 7176},"tests/test_cli.py": {"sha256": "387065282a26eaef659a5aaf393ad88eafe04481675596fa5e7f28857354e113","size": 41603},"tests/test_client.py": {"sha256": "d8b41628a799c13fb2f9598fe1b601544d155ef61bf081ccc561779b024218ad",238 unmodified lines},"schema": "noqt.huggingface_manifest.v1","source_repository": "https://github.com/noqt/Lumi-Eggcracker","source_revision": "61e6956384fc4832510e6bf506df11887c9a5184","source_url": "https://github.com/noqt/Lumi-Eggcracker/commit/61e6956384fc4832510e6bf506df11887c9a5184"}
12345658 unmodified lines65666768697071{"manifest": "HUGGINGFACE_MANIFEST.json","manifest_sha256": "9ec261a44fd95098441b39d501ad0e602fafddfde6c99eba950d1b731484824d","mirrored_files": 194,"mode": "DERIVED_READ_ONLY_MIRROR","release_reference": {58 unmodified lines},"schema": "noqt.huggingface_sync.v1","source_repository": "https://github.com/noqt/Lumi-Eggcracker","source_revision": "a5d1879c781062f43a2a2102dd773128fc9662f2","source_url": "https://github.com/noqt/Lumi-Eggcracker/commit/a5d1879c781062f43a2a2102dd773128fc9662f2","target": "https://huggingface.co/spaces/noqt/eggcracker"}12345658 unmodified lines65666768697071{"manifest": "HUGGINGFACE_MANIFEST.json","manifest_sha256": "7b21b0eb9505aaefb5f67ae06666911a8fd71c9908833f28692edaab504557a5","mirrored_files": 194,"mode": "DERIVED_READ_ONLY_MIRROR","release_reference": {58 unmodified lines},"schema": "noqt.huggingface_sync.v1","source_repository": "https://github.com/noqt/Lumi-Eggcracker","source_revision": "61e6956384fc4832510e6bf506df11887c9a5184","source_url": "https://github.com/noqt/Lumi-Eggcracker/commit/61e6956384fc4832510e6bf506df11887c9a5184","target": "https://huggingface.co/spaces/noqt/eggcracker"}
10 unmodified lines1112131415161710 unmodified lines---> Official noqt Hugging Face distribution, generated from GitHub commit> [`a5d1879c7810`](https://github.com/noqt/Lumi-Eggcracker/commit/a5d1879c781062f43a2a2102dd773128fc9662f2). This Space distributes the source for> discovery and cloning; Eggcracker itself runs on a supported native Linux> host, not on Hugging Face. A snapshot is called current only after the> release-linked sync job verifies its returned Hub commit and full manifest.10 unmodified lines1112131415161710 unmodified lines---> Official noqt Hugging Face distribution, generated from GitHub commit> [`61e6956384fc`](https://github.com/noqt/Lumi-Eggcracker/commit/61e6956384fc4832510e6bf506df11887c9a5184). This Space distributes the source for> discovery and cloning; Eggcracker itself runs on a supported native Linux> host, not on Hugging Face. A snapshot is called current only after the> release-linked sync job verifies its returned Hub commit and full manifest.
3 unmodified lines45678910638 unmodified lines6496506516526536546553 unmodified lines<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Lumi Eggcracker is noqt's native Linux kill switch for unapproved supported local-AI workloads. Clone the complete source from Hugging Face."><meta name="noqt-source-revision" content="a5d1879c781062f43a2a2102dd773128fc9662f2"><meta name="theme-color" content="#090a0c"><title>Lumi Eggcracker — Native Linux AI kill switch</title><style>638 unmodified lines<section><div class="shell source-bar"><div><div class="source-id">SOURCE COMMIT · a5d1879c7810</div><h2>Inspect every line.</h2><p>Complete source, tests, qualification documents and reproducible proof tooling are distributed in this repository.</p></div>3 unmodified lines45678910638 unmodified lines6496506516526536546553 unmodified lines<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Lumi Eggcracker is noqt's native Linux kill switch for unapproved supported local-AI workloads. Clone the complete source from Hugging Face."><meta name="noqt-source-revision" content="61e6956384fc4832510e6bf506df11887c9a5184"><meta name="theme-color" content="#090a0c"><title>Lumi Eggcracker — Native Linux AI kill switch</title><style>638 unmodified lines<section><div class="shell source-bar"><div><div class="source-id">SOURCE COMMIT · 61e6956384fc</div><h2>Inspect every line.</h2><p>Complete source, tests, qualification documents and reproducible proof tooling are distributed in this repository.</p></div>
57 unmodified lines585960616263135 unmodified lines199200201202203204299 unmodified lines504505506507508509510511512513514120 unmodified lines63563663763863964057 unmodified lines{"HEALTHY", "DRIFT", "RECOVERY_REQUIRED", "NOT_INSTALLED"})_DOCTOR_SUMMARY_NETWORK_MODES = frozenset({"offline", "unsupported"})_WAIT_PUBLIC_STATUS_KEYS = frozenset({"exec_policy_digest",135 unmodified lines}def _check_start_projection(value: object) -> dict[str, str]:"""Accept only the supervisor's fixed, nonidentifying check result."""if type(value) is not dict or set(value) != {299 unmodified linescommand = incident_commands.add_parser(action, help=help_text)command.add_argument("incident_id")doctor = commands.add_parser("doctor", help="check the installed protected supervisor")doctor.add_argument("--summary",action="store_true",help="emit a bounded readiness summary instead of the full doctor response",)support = commands.add_parser("support-bundle", help="write a local redacted health and receipt bundle")120 unmodified linesreturn 6print(json.dumps(summary, sort_keys=True))return 0 if summary["result"] == "READY" else 6value = request("doctor")print(json.dumps(value, sort_keys=True))return 0 if value.get("result") == "PASS" else 657 unmodified lines5859606162636465666768697071727374757677787980818283135 unmodified lines219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249299 unmodified lines549550551552553554555556557558559560561562563564565120 unmodified lines68668768868969069169269369469569669769869957 unmodified lines{"HEALTHY", "DRIFT", "RECOVERY_REQUIRED", "NOT_INSTALLED"})_DOCTOR_SUMMARY_NETWORK_MODES = frozenset({"offline", "unsupported"})_DOCTOR_RECOVERY_PLAN_SCHEMA = "lumi-eggcracker.doctor-recovery-plan.v1"_DOCTOR_RECOVERY_PLAN_ERROR = "eggcracker: doctor recovery plan unavailable"_DOCTOR_RECOVERY_PLAN_ACTIONS = {"cgroup_v2": "MANUAL_HOST_REVIEW","discovery": "MANUAL_SUPERVISOR_REVIEW","execution_boundary": "MANUAL_POLICY_REVIEW","incidents": "MANUAL_INCIDENT_REVIEW","network_cleanup": "MANUAL_SUPERVISOR_REVIEW","network_mode": "MANUAL_POLICY_REVIEW","network_primitives": "MANUAL_HOST_REVIEW","pidfd": "MANUAL_HOST_REVIEW","receipt_persistence": "MANUAL_SUPERVISOR_REVIEW","supervisor_readiness": "MANUAL_SUPERVISOR_REVIEW","workload_identity": "MANUAL_IDENTITY_REVIEW",}_DOCTOR_RECOVERY_PLAN_INSTALLATION_ACTIONS = {"NOT_INSTALLED": "MANUAL_INSTALLATION_REQUIRED","DRIFT": "MANUAL_INSTALLATION_REPAIR","RECOVERY_REQUIRED": "MANUAL_INSTALLATION_RECOVERY",}_WAIT_PUBLIC_STATUS_KEYS = frozenset({"exec_policy_digest",135 unmodified lines}def _doctor_recovery_plan(value: object) -> dict[str, object]:"""Reduce a doctor response to a fixed, nonidentifying recovery plan."""summary = _doctor_summary(value)installation = value["installation"]installation_state = installation["state"]failed_checks = summary["failed_checks"]actions = {_DOCTOR_RECOVERY_PLAN_ACTIONS[check]for check in failed_checksif check != "installation"}if installation_state != "HEALTHY":actions.add(_DOCTOR_RECOVERY_PLAN_INSTALLATION_ACTIONS[installation_state])return {"actions": sorted(actions),"failed_checks": failed_checks,"installation_state": installation_state,"result": summary["result"],"schema": _DOCTOR_RECOVERY_PLAN_SCHEMA,}def _check_start_projection(value: object) -> dict[str, str]:"""Accept only the supervisor's fixed, nonidentifying check result."""if type(value) is not dict or set(value) != {299 unmodified linescommand = incident_commands.add_parser(action, help=help_text)command.add_argument("incident_id")doctor = commands.add_parser("doctor", help="check the installed protected supervisor")doctor_projection = doctor.add_mutually_exclusive_group()doctor_projection.add_argument("--summary",action="store_true",help="emit a bounded readiness summary instead of the full doctor response",)doctor_projection.add_argument("--recovery-plan",action="store_true",help="emit a bounded manual recovery plan instead of the full doctor response",)support = commands.add_parser("support-bundle", help="write a local redacted health and receipt bundle")120 unmodified linesreturn 6print(json.dumps(summary, sort_keys=True))return 0 if summary["result"] == "READY" else 6if args.recovery_plan:try:recovery_plan = _doctor_recovery_plan(request("doctor"))except Exception: # noqa: BLE001 - plan failures are intentionally constantprint(_DOCTOR_RECOVERY_PLAN_ERROR, file=sys.stderr)return 6print(json.dumps(recovery_plan, sort_keys=True))return 0 if recovery_plan["result"] == "READY" else 6value = request("doctor")print(json.dumps(value, sort_keys=True))return 0 if value.get("result") == "PASS" else 6
91 unmodified lines92939495969731 unmodified lines12913013113213313413584 unmodified lines22022122222322422522620 unmodified lines24724824925025125291 unmodified lines)self.assertNotIn("recent", help_text)self.assertNotIn("chronological", help_text)def test_history_defaults_to_twenty_and_forwards_explicit_limit(self) -> None:with patch("lumi_eggcracker.cli.request", return_value={"runs": []}) as request:31 unmodified linesresponse = doctor_response()output = io.StringIO()error = io.StringIO()with patch("lumi_eggcracker.cli.request", return_value=response) as request, redirect_stdout(output), redirect_stderr(error):self.assertEqual(0, main(["doctor", "--summary"]))self.assertEqual({84 unmodified lineswith self.subTest(response=response):output = io.StringIO()error = io.StringIO()with patch("lumi_eggcracker.cli.request", return_value=response), redirect_stdout(output), redirect_stderr(error):self.assertEqual(6, main(["doctor", "--summary"]))self.assertEqual("", output.getvalue())self.assertEqual("eggcracker: doctor summary unavailable\n", error.getvalue())20 unmodified linesself.assertEqual(json.dumps(response, sort_keys=True) + "\n", output.getvalue())self.assertEqual("", error.getvalue())def test_compare_detection_receipts_help_uses_installed_command(self) -> None:output = io.StringIO()with redirect_stdout(output), self.assertRaises(SystemExit) as raised:91 unmodified lines929394959697989910010110231 unmodified lines13413513613713813914014114214314484 unmodified lines22923023123223323423523623723823920 unmodified lines26026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343491 unmodified lines)self.assertNotIn("recent", help_text)self.assertNotIn("chronological", help_text)doctor_help = io.StringIO()with redirect_stdout(doctor_help), self.assertRaises(SystemExit) as raised:main(["doctor", "--help"])self.assertEqual(0, raised.exception.code)self.assertIn("--recovery-plan", doctor_help.getvalue())def test_history_defaults_to_twenty_and_forwards_explicit_limit(self) -> None:with patch("lumi_eggcracker.cli.request", return_value={"runs": []}) as request:31 unmodified linesresponse = doctor_response()output = io.StringIO()error = io.StringIO()with (patch("lumi_eggcracker.cli.request", return_value=response) as request,redirect_stdout(output),redirect_stderr(error),):self.assertEqual(0, main(["doctor", "--summary"]))self.assertEqual({84 unmodified lineswith self.subTest(response=response):output = io.StringIO()error = io.StringIO()with (patch("lumi_eggcracker.cli.request", return_value=response),redirect_stdout(output),redirect_stderr(error),):self.assertEqual(6, main(["doctor", "--summary"]))self.assertEqual("", output.getvalue())self.assertEqual("eggcracker: doctor summary unavailable\n", error.getvalue())20 unmodified linesself.assertEqual(json.dumps(response, sort_keys=True) + "\n", output.getvalue())self.assertEqual("", error.getvalue())def test_doctor_recovery_plan_ready_is_closed_and_empty(self) -> None:response = doctor_response()output = io.StringIO()error = io.StringIO()with (patch("lumi_eggcracker.cli.request", return_value=response) as request,redirect_stdout(output),redirect_stderr(error),):self.assertEqual(0, main(["doctor", "--recovery-plan"]))self.assertEqual({"actions": [],"failed_checks": [],"installation_state": "HEALTHY","result": "READY","schema": "lumi-eggcracker.doctor-recovery-plan.v1",},json.loads(output.getvalue()),)self.assertEqual("", error.getvalue())self.assertNotIn("canary", output.getvalue())request.assert_called_once_with("doctor")def test_doctor_recovery_plan_distinguishes_installation_states(self) -> None:expected_actions = {"NOT_INSTALLED": ["MANUAL_INSTALLATION_REQUIRED"],"DRIFT": ["MANUAL_INSTALLATION_REPAIR"],"RECOVERY_REQUIRED": ["MANUAL_INSTALLATION_RECOVERY"],}for state, actions in expected_actions.items():with self.subTest(state=state):output = io.StringIO()response = doctor_response(autonomous_discovery=False,installation={"state": state, "path": "/private/install-canary"},result="UNSUPPORTED",)with (patch("lumi_eggcracker.cli.request", return_value=response),redirect_stdout(output),):self.assertEqual(6, main(["doctor", "--recovery-plan"]))plan = json.loads(output.getvalue())self.assertEqual(state, plan["installation_state"])self.assertEqual(["installation"], plan["failed_checks"])self.assertEqual(actions, plan["actions"])self.assertNotIn("canary", output.getvalue())def test_doctor_recovery_plan_hidden_readiness_is_manual_supervisor_review(self) -> None:response = doctor_response(autonomous_discovery=False, result="UNSUPPORTED")output = io.StringIO()with (patch("lumi_eggcracker.cli.request", return_value=response),redirect_stdout(output),):self.assertEqual(6, main(["doctor", "--recovery-plan"]))self.assertEqual({"actions": ["MANUAL_SUPERVISOR_REVIEW"],"failed_checks": ["supervisor_readiness"],"installation_state": "HEALTHY","result": "NOT_READY","schema": "lumi-eggcracker.doctor-recovery-plan.v1",},json.loads(output.getvalue()),)def test_doctor_recovery_plan_failures_are_sorted_and_deduplicated(self) -> None:response = doctor_response(autonomous_discovery=False,cgroup_v2=False,execution_boundary={"supported": False},discovery={"healthy": False, "receipt_persistence_healthy": False},incidents={"healthy": False, "lockdown": True},installation={"state": "DRIFT"},network={"cleanup_healthy": False,"mode": "unsupported","primitives": {"supported": False},},pidfd=False,result="UNSUPPORTED",workload_identity={"healthy": False},)output = io.StringIO()with (patch("lumi_eggcracker.cli.request", return_value=response),redirect_stdout(output),):self.assertEqual(6, main(["doctor", "--recovery-plan"]))plan = json.loads(output.getvalue())self.assertEqual(["cgroup_v2","discovery","execution_boundary","incidents","installation","network_cleanup","network_mode","network_primitives","pidfd","receipt_persistence","workload_identity",],plan["failed_checks"],)self.assertEqual(["MANUAL_HOST_REVIEW","MANUAL_IDENTITY_REVIEW","MANUAL_INCIDENT_REVIEW","MANUAL_INSTALLATION_REPAIR","MANUAL_POLICY_REVIEW","MANUAL_SUPERVISOR_REVIEW",],plan["actions"],)self.assertEqual(len(plan["failed_checks"]), len(set(plan["failed_checks"])))self.assertEqual(len(plan["actions"]), len(set(plan["actions"])))def test_doctor_recovery_plan_malformed_or_transport_response_is_constant_error(self) -> None:malformed = [{},doctor_response(result=True),doctor_response(installation={"state": "PRIVATE-CANARY"}),doctor_response(autonomous_discovery=True, result="UNSUPPORTED"),]for response in malformed:with self.subTest(response=response):output = io.StringIO()error = io.StringIO()with (patch("lumi_eggcracker.cli.request", return_value=response),redirect_stdout(output),redirect_stderr(error),):self.assertEqual(6, main(["doctor", "--recovery-plan"]))self.assertEqual("", output.getvalue())self.assertEqual("eggcracker: doctor recovery plan unavailable\n", error.getvalue())self.assertNotIn("canary", error.getvalue())output = io.StringIO()error = io.StringIO()with (patch("lumi_eggcracker.cli.request", side_effect=OSError("/private/CANARY")),redirect_stdout(output),redirect_stderr(error),):self.assertEqual(6, main(["doctor", "--recovery-plan"]))self.assertEqual("", output.getvalue())self.assertEqual("eggcracker: doctor recovery plan unavailable\n", error.getvalue())self.assertNotIn("CANARY", error.getvalue())def test_doctor_projections_cannot_be_combined_before_transport(self) -> None:with (patch("lumi_eggcracker.cli.request") as request,redirect_stderr(io.StringIO()),self.assertRaises(SystemExit) as raised,):main(["doctor", "--summary", "--recovery-plan"])self.assertEqual(2, raised.exception.code)request.assert_not_called()def test_compare_detection_receipts_help_uses_installed_command(self) -> None:output = io.StringIO()with redirect_stdout(output), self.assertRaises(SystemExit) as raised:
HUGGINGFACE_MANIFEST.json+8-8
HUGGINGFACE_SYNC.json+3-3
README.md+1-1
index.html+2-2
src/lumi_eggcracker/cli.py+60-1
tests/test_cli.py+184-2