feat: write file output, config-relative paths, SGR routing support - #74
Merged
Conversation
Add a terminal `write:` step that exports a source step's rows to a deliverable file (csv / json / md / jsonl, inferred by extension or `format:`), closing the read → LLM → write office loop with no shell. - write step + fs/write.go (WriteCSV union-header, WriteJSONArray, WriteMarkdownTable); shared collectRows extracted from transform-collect - relative read/write paths now resolve to the config file's directory (absolute unchanged), so a workflow runs from any working directory - jsonschema strict-compat walker recurses anyOf/oneOf/allOf branches, so SGR discriminated-union (routing) schemas are validated for strict output - examples: csv-enrichment (minimal read→enrich→write) and inbox-triage (read emails → SGR triage → jq board → draft replies → write csv + md) - README: "Schema-Guided Reasoning (SGR)" section (Cascade / Routing / Cycle)
mirpo
force-pushed
the
feat/write-file-output
branch
from
July 22, 2026 18:06
ea9e15f to
4d75f86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a terminal
write:step and closes the read → LLM → write office loop with no shell glue. Also makes local-file paths config-relative and teaches the schema strict-checker about discriminated unions (SGR routing).What's in it
write:step — exports a source step's rows to a deliverable file:.csv(sorted union header, JSON-encoded nested cells),.json(pretty array),.md(table),.jsonl; format inferred from extension orformat:override. Terminal (can't be afrom/forEach/placeholder source).fs/write.go+step/write_step.go; sharedcollectRowsextracted from transform-collect (no JSONL-plane change).read:/write:paths now resolve to the config file's directory (absolute paths unchanged), so a workflow's data travels with it and runs from any working directory. Applies to bothread(was CWD-relative) andwrite.jsonschema) now recursesanyOf/oneOf/allOfbranches, so discriminated-union schemas are validated for OpenAI strict output. Deterministic tests:TestStrictCompatibilityIssues_UnionBranch,TestValidateJSONText_DiscriminatedUnion.csv-enrichment(minimal read→enrich→write) andinbox-triage(read emails → SGR triage → jq board → draft replies → write csv + md).anyOfunions (verified across qwen3:1.7b, llama3.2:3b, deepseek-r1:1.5b), so the local examples use Cascade.Verification
go test ./...+golangci-lintgreen.Note
Path model has a known open follow-up (intermediate JSONL/
dataset/still resolves CWD-relative whileread/writeare config-relative;--outputcontrol) — tracked separately, out of scope here.