A packaged workflow can name a shared output schema #6479
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.50) × (1 − Review Confidence (0.34)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 638 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 62% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.386
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #6479"
general
weight: 0.35
coderabbitai[bot]
Problem and outcome
Once a workflow is split into blocks, steps that share a schema are in different files. Archon had no way to share a schema across files: anchors work in one file only,
$refis refused, andwith:can't carry a schema. So each block kept its own copy of every schema it shared.output_format: <name>uses the pack's.shared/schemas/<name>.yaml. Archon puts the schema in place of the name when it loads the workflow, so running, type generation, validation and Codex strict mode all see an ordinary inline schema.named schemas need a packaged workflow, so it refuses to open such a workflow instead of rewriting it.Review guidance
packages/workflows/src/pack-schemas.ts, which reads a pack's schema folder and looks up names.pack-schemas.ts→loader/yaml.tsandloader.ts(where names are replaced) →workflow-discovery/load-dir.tsandscopes.ts→defaults/bundle-inventory.tsandrun-source.ts(the compiled binary and captured run sources) →output-types.ts(types for a single file)..archon/workflow-language-constitution.md.archon workflow list, the same as any other unreadable file shipped with a source install. In project and home packs, the error goes on each workflow that names the schema.Solution
Each packaged workflow loads with its pack's schemas. A string
output_formatis looked up there, and each step gets its own copy, so two steps that name one schema never share an object. A missing file, a file that isn't a mapping, a.yml-only file or a name with a path fails that workflow's load, and the error gives the schema's path. A broken file that no workflow names is a warning. The compiled binary carries.shared/schemas/, so it finds the same names.archon workflow typeson one file finds that file's pack, even through a symlinked pack folder.Behavior change
| | Before | After |
|---|---|---|
| Observable behavior |
output_formathad to be an inline mapping. | A packaged workflow can name a shared schema instead. || Failure behavior | A string
output_formatfailed schema validation. | A bad name fails that workflow's load with the schema's path. Outside a pack, the error says named schemas need a packaged workflow. |Validation
On upstream
devat fdc50f6, without the other two changes:pack-schemas.test.tscovers lookup, every load error, and keeping a pack's read errors to the workflows that name the broken schema.output-types.test.tscovers types for a single file, a symlinked pack folder and duplicate file names in one pack. Other tests cover the compiled binary and a captured run source.archon validate workflowsaccepts every workflow, and the pack's 79 workflow fixtures pass.This doesn't depend on the changes for #6475 or #6477: each of the three applies to
devon its own. Where two add tests or doc lines in the same place, whichever merges second needs a small rebase.Closes #6476
Size
Counted with
cloc --git --diff fdc50f6 7b57f59(merge base to the PR head). Blank lines left out.| Language | Files | Code added | Code modified | Code removed | Comments added | Comments removed |
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
| TypeScript | 17 | 930 | 62 | 29 | 14 | 7 |
| Markdown | 2 | 9 | 2 | 0 | 0 | 0 |
| Total | 19 | 939 | 64 | 29 | 14 | 7 |
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Named output schemas can now be stored in a workflow pack’s shared schemas directory and referenced by name. They support the same structured-output validation and type generation as inline schemas.
Workflow runs capture shared schemas with their source, preserving the original schema when a run is resumed.
Bug Fixes
Invalid or unreadable schemas now produce workflow discovery errors or warnings, while unrelated workflows and scripts can still be discovered.
Documentation
* Updated the workflow language reference with named schema setup, usage, and limitations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->