You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This advances Phase 2 from a qualified native launcher/binder to a real worker-side authenticated broker runtime while keeping provider lifecycle enablement fail-closed.
What changed
Added RecipeWorkerBrokerRuntime, a broker-only worker loop that:
binds every message to the expected installation principal and exact job ID;
consumes only typed prepare, input_chunk, input_complete, cancel, and collect operations;
runs broker reads concurrently with provider transforms so cancellation reaches an in-flight transform;
enforces a bounded message budget and wall-clock watchdog;
closes the broker connection and provider on every terminal/failure path.
Made RecipeWorkerSession thread-safe for concurrent cancellation and provider completion.
Added explicit broker streaming operations while retaining legacy start only as a transport compatibility value; the fixed worker rejects it rather than guessing semantics.
Replaced the package's unconditional refusal entrypoint with the fixed native launch contract: protected pipe, broker PID, installation principal, and job ID. Direct/malformed/failed launches still return exit 78 and never fall back to stdio, shell, paths, or host-process execution.
Extended the launcher command line and PyInstaller hidden imports for the worker runtime.
Updated the broker, worker, launcher, sandbox, parent ADRs, evidence log, packaging notes, and qualification probes so the documented gates match the implementation.
Safety and release boundary
This PR does not enable the production execution lifecycle or UI route. The generated Windows package is intentionally unsigned and is not launch-authorized by source control. The remaining release gate is an externally signed and pinned worker generation installed through SignedBundleInstaller, followed by a real suspended AppContainer/Job Object launch, authenticated broker handshake against the actual PID/AppContainer token, hostile decoder corpus, watchdog/accounting evidence, artifact-boundary publication evidence, and external security review.
Validation
Python: 251 passed, 1 skipped with one pre-existing pytest-asyncio deprecation warning.
Worker runtime: 9 dedicated tests, including cancellation during an active transform and watchdog expiry.
Frontend lint, typecheck, production build, and all 39 frontend tests: passed.
Windows PyInstaller package build: passed; dist/recipe-runtime/recipe_worker.exe direct launch returned exit 78.
Native qualification: Job Object/AppContainer controls passed; the overall qualification remains intentionally blocked at the signed-worker/PID-token gate (recipe_sandbox_qualification.py --strict exit 2).
Review focus
Please review the worker concurrency/cancellation state transitions, watchdog close behavior, broker envelope identity binding, package argument parsing, and the explicit distinction between qualification evidence and production authorization.
Quality passed on this branch (run 30036865775 / job 89306894273, 3m07s): headless tests, compile, generated-contract verification, frontend typecheck/lint/unit tests/build, one-folder Windows package build, and launcher-managed bundle verification.
Local evidence also passed: 251 Python tests with one platform skip, targeted Ruff, compileall, contract generation, diff check, package direct-launch refusal (exit 78), and native qualification controls. The qualification remains intentionally blocked only because this PR does not ship or install an externally signed worker generation; that gate still requires the signed manifest/trust root, real suspended worker PID/AppContainer broker handshake, hostile in-sandbox corpus, watchdog/accounting evidence, artifact publication evidence, and external review. Provider lifecycle/UI remain disabled.
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
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
This advances Phase 2 from a qualified native launcher/binder to a real worker-side authenticated broker runtime while keeping provider lifecycle enablement fail-closed.
What changed
RecipeWorkerBrokerRuntime, a broker-only worker loop that:prepare,input_chunk,input_complete,cancel, andcollectoperations;RecipeWorkerSessionthread-safe for concurrent cancellation and provider completion.startonly as a transport compatibility value; the fixed worker rejects it rather than guessing semantics.78and never fall back to stdio, shell, paths, or host-process execution.Safety and release boundary
This PR does not enable the production execution lifecycle or UI route. The generated Windows package is intentionally unsigned and is not launch-authorized by source control. The remaining release gate is an externally signed and pinned worker generation installed through
SignedBundleInstaller, followed by a real suspended AppContainer/Job Object launch, authenticated broker handshake against the actual PID/AppContainer token, hostile decoder corpus, watchdog/accounting evidence, artifact-boundary publication evidence, and external security review.Validation
251 passed, 1 skippedwith one pre-existingpytest-asynciodeprecation warning.python -m compileall -q backend\\cortex_backend\\execution tests: passed.python tools/generate_contracts.py: passed.git diff --check: passed.dist/recipe-runtime/recipe_worker.exedirect launch returned exit78.blockedat the signed-worker/PID-token gate (recipe_sandbox_qualification.py --strictexit2).Review focus
Please review the worker concurrency/cancellation state transitions, watchdog close behavior, broker envelope identity binding, package argument parsing, and the explicit distinction between qualification evidence and production authorization.