Repository navigation
Commit 51205e9
authored
improvement(workflow-code): agent efficiency — typed child results, commands use the source directory's workspace, primer and cookbook fixes (#10388)
* improvement(workflow-code): type a child call's result.data fields by the child's Response body
A parent reading <call.result.data.<field>> of a child workflow that responds on
every run had no declared type, so a JSON field stored it bare with
W_JSON_REF_UNTYPED and every such edit paid an extra check cycle.
compileWorkflow and printWorkflow now take childResults (child workflow key ->
typed top-level fields of its Response data, from childResultFields), so compile
and print type the reference the same way: a text field is stored quoted and
prints bare, a typed one is stored and printed bare.
- CLI: a check in a workspace directory reads the fields from the workflows it
already compiles. Block digests for .sim/stored-edges.json stay untyped, so a
printed block a child types does not count as edited.
- Server: every source apply, dry run and get reads the fields of the children
the workflow calls. A workspace apply reads a child it submits from its
folder, and any other child from its stored draft in the workspace
(loadChildResults, once per request). A single-workflow apply or get reads
the stored children, so a workspace folder applied on its own stores what a
workspace apply stores.
* improvement(cli): commands use the source directory's workspace; primer rename and rejoin wording
- A command run inside a source directory (nearest .sim/base.json at or above the cwd) acts on
that directory's workspace when neither --workspace nor SIM_WORKSPACE names one. Precedence:
flag > env > directory > profile, documented in sim --help. sim login opts out so a directory
never becomes the profile's stored workspace. Source commands now refuse a SIM_WORKSPACE naming
another workspace (SOURCE_OTHER_WORKSPACE), as they refuse the flag.
- Primers: a display-name rename also rewrites $ref.<key> in function files; any number of
display-name or const renames per apply, both of one block only one per apply.
- Cookbook: one Response after condition branches rejoin, a function picking the value with ??.
* chore(workflow-code): print the source primers for the mothership skill; promote-record and lock-layout docs match the code
* chore(workflow-code): simplify round 12 — one lock parse per apply, batched child reads, childSources on the per-apply loads
* chore(cli): simplify round 12 — workspace from the directory at the request layer, stored-edges under the printed typing
- resolveProfile is back to flag, env and config. The terminal reads the workspace the
working directory names once before each action (enclosingWorkspace, the same rule
recordedWorkspace uses: base, workspace folder, starter), and actingProfileFrom/clientFrom
apply it below --workspace and SIM_WORKSPACE. 'directory' leaves SettingSource; whoami and
the 404 wording read workspaceDirectory. sim login needs no opt-out. A starter directory
now chooses the workspace for every command, as it does for source create.
- explicitWorkspaceSetting lives in config and is the one "flag then env" check.
- .sim/stored-edges.json digests blocks under the child results the get printed with: a
workspace get/apply types each folder by the folders it answered with, a workflow get,
create or apply into a workspace folder by that workspace directory's folders. The check
compares its typed compile directly, so the untyped recompile is gone.
- A workspace check compiles each workflow once, with its env names, and reuses that compile
for a workflow whose calls no child result types.
* test(cli): the typed child-result check fixture keeps only the response it asserts on
* fix(cli): name the compile input type so the CLI's declaration build emits
* fix(workflow-code): type child results through chains and stored() children, the same on CLI and server
- An offline compile (storedUnread) leaves stored() on a block the lock binds unread instead of
refusing it, so a child holding a secret still compiles and types its callers; the server
compiles a submitted child folder with its lock through the same folderCompileInput.
- resolveChildResults types each workflow's Response fields by its callees' fields, callees
first (strongly connected components; a call within a cycle stays untyped), shared by the
workspace check, the stored-edges records, the apply and the read paths.
- The stored read lifts a child's own calls to keys, so a forwarded field is typed as the
compile types it.
- The primers say source commands refuse a -w naming another workspace.
* fix(workflow-code): a submitted child types with its stored block catalog; child results never fail a written apply
* fix(cli): the workflow primer says where a starter's workspace comes from until create
* chore(cli): import ChildResults from workflow-code, not through stored-edges
* fix(cli): the workflow primer gives a starter its create step instead of apply
* fix(cli): the primers keep the one-workflow-variable-per-apply rename rule1 parent 25952cf commit 51205e9
64 files changed
Lines changed: 2182 additions & 208 deletions
File tree
- apps
- docs/content/docs
- cli
- workflows/code
- sim/lib
- workflows
- application
- source-pipeline
- evaluate
- code
- workspace-source/application
- kinds/workflow
- packages
- sim-cli
- scripts
- src
- commands
- protocol
- source-dir
- config
- runtime
- test
- workflow-code/src
- compile
- print
- workflow-sdk
- cookbook/examples
- src/codegen
- workspace-code/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8698 | 8698 | | |
8699 | 8699 | | |
8700 | 8700 | | |
8701 | | - | |
| 8701 | + | |
8702 | 8702 | | |
8703 | 8703 | | |
8704 | 8704 | | |
| |||
10053 | 10053 | | |
10054 | 10054 | | |
10055 | 10055 | | |
10056 | | - | |
| 10056 | + | |
10057 | 10057 | | |
10058 | 10058 | | |
10059 | 10059 | | |
| |||
10083 | 10083 | | |
10084 | 10084 | | |
10085 | 10085 | | |
10086 | | - | |
| 10086 | + | |
10087 | 10087 | | |
10088 | 10088 | | |
10089 | 10089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
1443 | | - | |
| 1443 | + | |
1444 | 1444 | | |
1445 | 1445 | | |
1446 | 1446 | | |
| |||
0 commit comments