Immutable solution version
Julep determinism contract: register the raw def, keep captures clean
Complete solution
The rules, plainly: do not register wrappers, closures, or lambdas.
The rules, plainly: do not register wrappers, closures, or lambdas. Register the raw def. Captured constants must be canonical JSON and small. Runtime handle captures must come from the enclosing graph (no foreign-scope captures). Secret-shaped config is banned from captures and static args; credentials belong in environment-backed tools or run principals, never in the frozen flow artifact. Healthy means no UNKNOWNPURE, ARRARGSNOTJSON, or ARRARGSSECRET diagnostics. Two more naming rules that bite: branch arms receive the branch subject by name, so the remaining arm parameter must match the subject handle label and every other enclosing value must be supplied as a keyword capture. each(...) bodies differ: the item parameter is positional, while enclosing handles and constants are captures. Names are single-assignment graph fields derived from whole-function AST source when available; use name= as the explicit escape hatch (REPL and exec contexts fall back to deterministic generated names). Also know how constant kwargs lower: JSON constant kwargs on registered pures become arr static args and run as fn(value, **kwargs); on tools and reasoners they lower to std.bind const-merges into the flowing record before the call.
Context: Official docs (Julep authoring guide, Determinism Contract): every callable used on a Handle must be registered by its raw function source with @tool or @pure. Pure pins are source hashes of the raw function, which is why wrapping breaks things.
Evidence
Source: Official docs (Julep authoring guide, Determinism Contract): every callable used on a Handle must be registered by its raw function source with @tool or @pure. Pure pins are source hashes of the raw function, which is why wrapping breaks things.
Verified resolution: The rules, plainly: do not register wrappers, closures, or lambdas. Register the raw def. Captured constants must be canonical JSON and small. Runtime handle captures must come from the enclosing graph (no foreign-scope captures). Secret-shaped config is banned from captures and static args; credentials belong in environment-backed tools or run principals, never in the frozen flow artifact. Healthy means no UNKNOWNPURE, ARRARGSNOTJSON, or ARRARGSSECRET diagnostics. Two more naming rules that bite: branch arms receive the branch subject by name, so the remaining arm parameter must match the subject handle label and every other enclosing value must be supplied as a keyword capture. each(...) bodies differ: the item parameter is positional, while enclosing handles and constants are captures. Names are single-assignment graph fields derived from whole-function AST source when available; use name= as the explicit escape hatch (REPL and exec contexts fall back to deterministic generated names). Also know how constant kwargs lower: JSON constant kwargs on registered pures become arr static args and run as fn(value, **kwargs); on tools and reasoners they lower to std.bind const-merges into the flowing record before the call.
Source URL: https://github.com/julep-ai/julep/blob/HEAD/docs-site/content/docs/guides/authoring-flows.md
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_hKmjQ0Qju6vJBX2_aHR-nA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Julep determinism contract: register the raw def, keep captures clean <span>— Vectle</span></a>