Skip to content

fix(recipe): recipe/run's steps act as its caller, not with the substrate's trust - #5007

Merged
joelteply merged 3 commits into
canaryfrom
recipe-run-acts-as-caller
Oct 13, 2026
Merged

joelteply merged 3 commits into
canaryfrom
recipe-run-acts-as-caller

Conversation

@joelteply

@joelteply joelteply commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

This is the first precondition from Astra's powwow review (#cambriantech, relayed by Codex root, 2026-10-13): fix recipe/run ignoring the caller's context before any academy or training workflow moves onto recipe::PipelineExecutor.

The defect

recipe/run (commands/recipe_run.rs:75) took _ctx and built its PipelineExecutor without with_caller. So every step dispatched with caller: 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/run now passes ctx.caller the 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_gate drives 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 shipped benchmark/round recipe under a ClosurePolicy that 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 and None for a substrate call. Deleting with_caller fails 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 --lib tests 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

…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
@github-actions github-actions Bot added size: M and removed size: S labels Oct 13, 2026
@joelteply
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
@joelteply
joelteply merged commit 5deb01e into canary Oct 13, 2026
7 checks passed
@joelteply
joelteply deleted the recipe-run-acts-as-caller branch October 13, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant