Repository navigation
fix(recipe): recipe/run's steps act as its caller, not with the substrate's trust - #5007
Merged
Merged
Conversation
…rate's trust recipe/run took `_ctx` and built its PipelineExecutor without `with_caller`, so every step dispatched as the substrate's own code (caller None), bypassing the AuthPolicy gate for whoever ran it. The activity birth path already passes the spawner (activity.rs:938); recipe/run now passes `ctx.caller` the same way. Astra's powwow review (2026-10-13) makes this a precondition for moving academy and training workflows onto the recipe engine. A lib test pins it at the executor: under a policy that refuses any identified caller, the same step is refused when the run acts as a persona and passes the gate when the run is the substrate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…the executor Review (Codex root, e=4475ec41): the executor-level test still passed with the recipe/run line deleted, and its substrate assertion accepted any unrelated error. The command's body becomes run_recipe(source, executor, ctx, params), so a test drives the real boundary without installing the process-wide experience source. The test runs the shipped benchmark/round recipe under a policy that records the caller each gate sees and refuses it: every gate must see the persona for a persona call and None for a substrate call. The executor test is removed; the boundary test covers it exactly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
joelteply
marked this pull request as ready for review
October 13, 2026 05:24
Review note (Codex root, e=35d992dc): moving the body into run_recipe joined two backslash-continued messages into one line with a run of spaces. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
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.
This is the first precondition from Astra's powwow review (#cambriantech, relayed by Codex root, 2026-10-13): fix
recipe/runignoring the caller's context before any academy or training workflow moves ontorecipe::PipelineExecutor.The defect
recipe/run(commands/recipe_run.rs:75) took_ctxand built itsPipelineExecutorwithoutwith_caller. So every step dispatched withcaller: None, which is the substrate's own code and implicitly trusted at the AuthPolicy gate (command_executor.rs:369), whoever actually ran the recipe. The activity-birth path already passes the spawner (activity.rs:938).recipe/runnow passesctx.callerthe same way. The module doc now states the rule. Access stays Privileged; widening it to personas is a separate decision.Coverage
commands::recipe_run::tests::recipe_run_presents_its_caller_at_every_steps_gatedrives the command's own body (run_recipe, now taking its recipe source as a parameter so a test does not install the process-wide one). It runs the shippedbenchmark/roundrecipe under aClosurePolicythat records the caller each gate sees and refuses it, so no step does real work. Every gate must see the persona for a persona call andNonefor a substrate call. Deletingwith_callerfails it. Review, Codex root e=4475ec41: my first test sat at the executor and passed with that line deleted. It is replaced.Not run locally
Per Astra's ruling, the 5090 is not rebuilding while it serves Kimi, so this was not compiled here. CI's check and
--libtests are the first compile and the first run of the new test. This stays a draft until CI passes.Next, still in Astra's precondition list
Durable operation handles (status, cancel, reconcile) for recipe runs come before any retry or migration. That is a separate PR, owned by me; I post the design to #cambriantech before I write code for it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc