Portable authenticated worker identity: semantic identity plus audit-only aliases for the primary-QRF worker binding (fixes #863) - #871
Merged
Conversation
…he builder fake binds its manifest payload, re-pin the resource-semantics and full-checkpoint identities, regenerate coverage evidence
…v 0.12's major.minor pyvenv version CI failed on the rebased head in two ways the local macOS run could not show: - uv 0.12 writes `version_info = 3.13` (major.minor) to pyvenv.cfg for uv-managed interpreters; the parser demanded a triplet. It now accepts major.minor or major.minor.micro, requires the declared prefix to match the running interpreter, and canonicalizes to sys.version_info[:3], so the semantic identity does not depend on which uv wrote the venv. - The wheels job reported `Duplicate source modules for worker identity: 'microcosm.build'`. The namespace index now walks the search locations in import order and lets a later root shadow an earlier one only with byte-identical source (an installed wheel next to its checkout, lib64 beside lib); differing shadowed source still refuses, naming both paths. Tests cover both accept paths and every refusal.
MaxGhenis
force-pushed
the
f1-portable-worker-identity
branch
from
September 4, 2026 03:25
97b44d3 to
5e6c895
Compare
Both this branch and #847 moved the US spec digest, the late resource semantics and full-checkpoint identities, and the coverage evidence; the rebase kept main's values, which this tree no longer produces. Regenerated from the rebased tree: spec_sha256 9db29b4d…, late_resource_semantics c7d26e86…, full_checkpoint 5deaf532…, us-f0-coverage.json (42154/42154 fields, 41/41 inventory checks). Restores this branch's materializer 13 and pool manifest schema 10 assertions that the conflict resolution had dropped.
…; bind the preflight fake's manifest payload CI on the rebased head found two omissions the lane's local run did not cover: the new us_runtime/worker_identity.py module was unclassified in the spine-blindness registry (and pushed the pool-build tool's pinned runtime import graph from 69 to 70 modules), and the release-gate preflight test's fake AuthenticatedPoolH5 did not carry manifest_payload_sha256, which the release receipt now re-derives from the manifest it is handed.
…gests CI on Linux computed different late-resource-semantics and full-checkpoint digests from the macOS pins. The branch had narrowed the pre-digest stripping from the whole `worker_execution` subtree to its audit aliases, on the premise that the new semantic identity is spec evidence; it is not: it hashes the interpreter binary, ABI, pyvenv.cfg, the installed distributions' RECORD files and the resolved CPU count, all of which legitimately differ between platforms and authenticate an environment for replay rather than describe the spec. Restore main's rule (strip the whole subtree, plus audit aliases and receipt self-hashes), re-pin the two digests from the stripped receipts, regenerate the coverage evidence, and pin the invariant with a test that a macOS binding, a Linux binding and no binding digest identically.
MaxGhenis
marked this pull request as ready for review
September 4, 2026 09:38
…t resume On a relocated-checkpoint resume the primary receipt reported the fresh run's normalized input-binding digest instead of the digest of the sidecar the run actually retained, so the receipt could not be reconciled against the retained binding. Report the observed (retained) sidecar digest on resume and the normalized digest on initialize. Regression: test_relocated_checkpoint_resume_reports_the_retained_sidecar_digest in test_us_stacked_spine.py (relocates the audit aliases via _late_primary_qrf_worker_execution_binding, resumes, and asserts the receipt digest equals the sidecar digest; red on the unfixed code).
juaristi22
added a commit
that referenced
this pull request
Sep 5, 2026
…dentity (#834) Main's #871 attests the workspace lock; this branch's policyengine-uk floor bump (>=2.93, lock 2.94.0) changed uv.lock, so the merged tree's digest is approved. No derived identity moved: the spec-engine identity, legacy adapter, re-emission, field-usage and inventory-coverage suites pass on the approved digest without a re-pin. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #863. The authenticated US multispine pool loader bound the late primary-QRF worker to the build worktree's absolute interpreter path (
argv_template[0]andinterpreter.executable), so a byte-identical interpreter reached through another virtualenv path was refused and no sealed pool could be scored out of tree (the c-27 root-cause lane'sSTOP.md).This PR versions the worker binding into a semantic identity and audit-only aliases:
pyvenv.cfgfields, worker-module source and transitive-import digests, the exactuv.lockdigest, the installed-distribution RECORD digest, arguments afterargv[0](withargv[0]canonicalized to an interpreter placeholder), and the semantic fit controls (fit jobs, predict workers). Authentication compares this identity.sys.executable,sys.prefix, rawargv_template[0]) are recorded and never compared.Verification
Implemented by a sol build lane from the c-27 lane's
FIX-PLAN.md§F1 with fail-before evidence recorded indocs/f1-portable-worker-identity/; the lane's Codex lane ran out before its final verification, which was completed by hand: the resolver-binding case in the spec-bundle identity allowlist, the builder fake's manifest-payload binding, and the resource-semantics and full-checkpoint identity pins were fixed and the coverage evidence regenerated (42154/42154 configuration fields, 41/41 inventory checks). CI on this branch is the verification of record.Not in this PR
The immigration composition gate's anchor (#864) and the c-27 replay itself, which this PR unblocks.
Rebase onto post-#847 main and CI fixes (9/4)
Rebased onto main at 5e9ef2e (graph amendments 11–18). Pins that both sides moved were regenerated from the rebased tree: US
spec_sha2569db29b4d…,late_resource_semanticsc7d26e86…,full_checkpoint5deaf532…, anddocs/evidence/spec-engine/us-f0-coverage.json(42154/42154 fields, 41/41 inventory checks). The materializer version 13 and pool manifest schema 10 bumps from this branch are unchanged.Two defects CI found on the rebased head that the macOS lane run could not:
version_info = 3.13(major.minor) topyvenv.cfgfor uv-managed interpreters; the parser demanded a triplet, so everyuv syncjob failed at_canonical_pyvenv_config. It now accepts major.minor or major.minor.micro, requires the declared prefix to match the running interpreter, and canonicalizes tosys.version_info[:3], so the semantic identity does not depend on which uv wrote the venv. Verified locally:uvx uv@0.12.9 venvwrites3.13, uv 0.11.7 writes3.13.9.Duplicate source modules for worker identity: 'microcosm.build'._module_source_indexnow walks the namespace search locations in import order and lets a later root shadow an earlier one only with byte-identical source (an installed wheel next to its checkout,lib64besidelib); differing shadowed source still refuses, naming both paths.Tests cover both accept paths and every refusal (
test_worker_source_index_accepts_a_byte_identical_shadow_root,..._rejects_a_shadow_root_with_different_source,test_canonical_pyvenv_config_accepts_uv_major_minor_and_triplet_versions,..._rejects_versions_that_are_not_the_interpreter).Two further omissions CI surfaced on the rebased head, both fixed:
us_runtime/worker_identity.pyis now classified as a reviewed non-registry module in the spine-blindness registry (the pool-build tool's pinned runtime import graph is 70 modules), and the release-gate preflight test's fakeAuthenticatedPoolH5bindsmanifest_payload_sha256, which the release receipt re-derives from the manifest it is handed.Digest portability. Linux CI computed different
late_resource_semanticsandfull_checkpointinventory digests from the macOS pins. This branch had narrowedinventory_coverage._without_operational_bindingsfrom stripping the wholeworker_executionsubtree (main's rule) to stripping only its audit aliases, on the premise that the new semantic identity is spec evidence. It is not: it hashes the interpreter binary, ABI,pyvenv.cfg, the installed distributions' RECORD files and the resolved CPU count, all of which legitimately differ between platforms and authenticate an environment for replay. Main's rule is restored, the two digests re-pinned from the stripped receipts, andtest_operational_free_digest_ignores_the_worker_execution_bindingpins the invariant (a macOS binding, a Linux binding and no binding digest identically).Design note for review: the semantic identity is portable across interpreter paths (the #863 ask) but remains bound to one machine's interpreter bytes and installed distributions. A c-27 replay on a different box therefore authenticates through the legacy attestation path or needs a looser projection; this PR does not decide that.
Sol gate round (9/4): four identity findings closed
pipelineand malformed envelopes are refused with the live path's errors.TORCH_DEVICE_BACKEND_AUTOLOAD=0in the semantic environment and the worker bootstrap),torch.backendsentry-point providers are enumerated and refused outside the installed-code closure, duplicate distribution identities are refused.Spec-engine inventory digests still strip
worker_execution;tools/spec_engine_coverage.py --checkpasses, so no spec pin moved.Verification on 32ce6f5 (dispatching session, after recovering the lane's clone from a snapshot):
tools/spec_engine_coverage.py --check42154/42154 fields, 41/41 inventory checks; the worker-identity, h5_io, preflight, fiscal-builder, inventory-coverage, coverage-tool, imputation-semantics and spine-blindness suites all pass (exit 0);ruff checkclean.Astra gate round (9/4): two identity findings closed
TORCH_DEVICE_BACKEND_AUTOLOAD=0is set in the worker subprocess environment before interpreter startup (the stacked-spine launch environment, bound into the execution binding), with the bootstrap guard kept as defense in depth; a fresh-process regression inherits=1from the parent and asserts the worker's first Torch import sees0.__pycache__contents (caches disabled and redirected away from the source tree), so the executed code is the authenticated source; a valid-header stale-cache regression proves a timestamp-matched cache with different code is never executed under the identity.No spec-engine pin moved (
tools/spec_engine_coverage.py --checkgreen); required suites 964 passed on the lane, re-verified by the dispatching session.Astra gate 3b95309f round 2 (50c9232)
sha256(normalized digest on initialize). Regressiontest_relocated_checkpoint_resume_reports_the_retained_sidecar_digest(red on the unfixed code). A pool-tool-level duplicate that could not locate the sidecar was removed; the test file's import block was re-sorted.test_late_executor_authority_binds_every_transfer_bank_identityfailed twice locally after the worker-identity tests, both times while a second pytest process ran in the same clone. The same 14-test selection passed three times when run alone (once under a diagnostic plugin that would have logged the differing identity paths; it logged nothing). No mechanism is claimed; the engine-us CI lane (single process) is the authoritative check.ruff check packages toolsclean;ruff format --checkclean on the touched files;tools/spec_engine_coverage.py --check42154/42154 configuration fields, 41/41 inventory checks (no pin moved); the identity/autoload/late-executor selection 14 passed (×3 solo runs); CI on this head linked below.CI crawl fix (d653c07)
PYTHONPYCACHEPREFIX+PYTHONDONTWRITEBYTECODE=1):_clean_worker_import_trace()28–31 s,primary_qrf_worker_semantic_identity()43 s,primary_qrf_worker_execution_binding()39 s locally; most stacked-spine pipeline and receipt tests reach the live binding (first 200 tests: 2,033 s), so theengine-us (us-am, us-qs)CI lanes never finished.uv_lock_sha256argument and both bound fit-control environment values) with a publicclear_primary_qrf_worker_identity_cache(); execution bindings copy the graph. Tests prime one real identity per session and opt out vialive_worker_identitywhere they mutate identity inputs. The probe, validators, authenticator, launch controls, and bytecode isolation are unchanged (identical ASTs apart from the renamed factory). Fourteen regressions (memo reuse/reset, both environment keys, invalid inputs, lock separation, artifact-copy isolation, session consistency, opted-out namespace-byte changes, spec-generator ordering).test_us_stacked_spine.py335 passed in 348 s;us-qs+us-amCI file groups 4,352 passed, 11 skipped;ruff check packages toolsclean;tools/spec_engine_coverage.py --check42,154/42,154 fields, 41/41 inventory checks (no pin moved).