Skip to content

docs: document run builtin output schema (#5bj)#522

Merged
danieljohnmorris merged 3 commits into
mainfrom
fix/run-schema-doc
May 21, 2026
Merged

docs: document run builtin output schema (#5bj)#522
danieljohnmorris merged 3 commits into
mainfrom
fix/run-schema-doc

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Closes pending #5bj.

Summary

The run cmd argv builtin returns R (M t t) t on success, and the SPEC mentioned the three-key map in prose but never as a formal schema. Personas have been learning the key set (stdout / stderr / code) by trial and error. Doc-only fix: pin the schema in SPEC.md, sync it to ai.txt and the io skill, and add an example that regression-tests the shape across engines.

While verifying the keys against run_spawn in src/interpreter/mod.rs, I noticed the code value isn't just a decimal string: on unix a signal-terminated child reports signal:<n>, and an unknown status reports unknown. That nuance now appears in all three doc surfaces so agents don't have to dig into the source to learn it.

What's in the diff

  1. docs: spell out run output map schema in SPEC - SPEC.md gets an explicit key/type/meaning table immediately under the Process spawn intro paragraph.
  2. docs: sync run schema to ai.txt and io skill - ai.txt appends a one-line schema clause to the existing run description; skills/ilo/ilo-builtins-io.md previously didn't mention run at all, now has a paragraph and example in ## Environment / process.
  3. examples: add run output schema regression - new examples/run-output-schema.ilo exercises all three keys via mget and an mget-default sentinel to prove each key is present (not nil), plus the code path on a non-zero exit. tests/examples_engines.rs picks it up automatically.

Test plan

  • cargo build --release --features cranelift
  • Manual run of all four entry functions through --vm
  • cargo test --release --features cranelift --test examples_engines passes
  • cargo test --release --features cranelift --test skill_md --test skill_modular passes (skill files still under their token budget)
  • No new em dashes in any edited file
  • CI green

Follow-ups

None. If the schema ever gains a fourth key (env, duration, etc.), the SPEC table is the canonical place to add it and the other two docs cross-reference it.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris merged commit 3adb30c into main May 21, 2026
5 checks passed
@danieljohnmorris danieljohnmorris deleted the fix/run-schema-doc branch May 21, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant