A StructOp project has more than one reader. A person reads it. A tool reads it. And more and more often, an AI development agent reads it too.
This post accompanies the season finale of our series on Declarative Application Engineering (DAE) with StructOp. Everything below follows the published StructOp handbook, and every terminal block is a real StructOp 0.1.0 session.
Who does what
The handbook's Human and AI collaboration page is precise about the boundary:
StructOp contains no AI model and does not write declarations. An AI development agent is a separate program, chosen and supervised by the people who use it. StructOp gives both the agent and the people the same declarations to read, the same checks and the same plan to review.
Two forms of every view
Every view comes in two forms: text for a person, and JSON for a tool. Add -json to init, validate, plan, show, state, graph, test, schema or version, and the command prints exactly one JSON document on standard output, in a versioned format ("format_version": "1.0"). apply prints your own program's output, so it has no JSON form: save the plan with plan -out=FILE and apply that file. The contract is in Machine-readable output.
structop schema says what the project's providers accept, so an editor or an assistant can offer only what is valid:
$ structop schema print every ability also accepts: depends_on AddressList enabled Bool provider StructOp/c 2.3.0 (C) ability print message String required One change, followed end to end
We start from the greeting app built in episode 1 (episode 1) and add one requirement: say goodbye after the greeting. Say an agent adds this block to main.st, and misspells Greet:
ability "print" "Bye" { message = "Goodbye, ${data.value.name.current}." depends_on = [ability.print.Greeet] } One diagnostic, two readers
validate catches it before anything is built. A person gets the file, line, column and a suggestion:
$ structop validate; echo "exit $?" Error: unknown ability "ability.print.Greeet" on main.st line 11, column 19 Did you mean "ability.print.Greet"? exit 1 A tool gets the same diagnostic as JSON, with the same exit code:
$ structop validate -json | jq .diagnostics [ { "severity": "error", "message": "unknown ability \"ability.print.Greeet\"", "hint": "ability.print.Greet", "range": { "file": "main.st", "line": 11, "column": 19 } } ] Plan, and save the plan
With the typo fixed, validate succeeds, and the plan is saved to a file:
$ structop plan -out=bye.plan # program.app will be replaced ~ program.app (.structop/build/app) + ability.print.Bye ~ ability.value.name (run order): 3 -> 4 Plan: 0 to add, 1 to change, 0 to destroy. Saved the plan to: bye.plan To perform exactly these actions, run: structop apply "bye.plan" One ability is added, and the value moves one place in the run order. plan -json gives a tool the same plan: each change lists the abilities that cause it, with the file and line of each (excerpt of the real document):
$ structop plan -json | jq . ... "summary": { "add": 0, "change": 1, "destroy": 0 }, ... { "address": "ability.print.Bye", "action": "create", "range": { "file": "main.st", "line": 9, "column": 1 }, "attributes": [] }, ... What the change touches
structop graph -changed draws the application and marks the new ability + and the moved one >. As JSON, the same graph is nodes and edges:
$ structop graph -changed -json | jq -c '.nodes[] | {address, change}' {"address":"ability.prompt.Ask","change":null} {"address":"ability.print.Greet","change":null} {"address":"ability.print.Bye","change":"create"} {"address":"ability.value.name","change":"moved"} {"address":"data.value.name","change":null} Read the plan before apply
The reviewer, a person or an agent, reads the saved plan (structop show bye.plan checks the file and prints it), reads the edited declarations, and then applies exactly that file:
$ echo Ada | structop apply bye.plan ... Apply complete! Resources: 0 added, 1 changed, 0 destroyed. What is your name: Hello, Ada! Goodbye, Ada. If the declarations change after the review, the saved plan no longer matches, and apply refuses it:
$ structop apply review.plan; echo "exit $?" Error: saved plan is stale: the configuration changed; run structop plan again exit 1 Then test the behaviour. structop test passes, and test -json reports each case and the totals:
$ structop test -json | jq '{cases: [.cases[] | {name, result, exit_code}], summary}' { "cases": [ { "name": "greets_and_says_goodbye", "result": "pass", "exit_code": 0 } ], "summary": { "passed": 1, "failed": 0 } } One way to work together
The handbook describes one collaboration workflow: a developer defines the requirement; the agent reads the .st files, graph -json and schema -json, and edits the declarations; StructOp validates and generates a change plan with plan -out=FILE; the developer reviews the plan and the edits, looks at graph -changed or -impact where relevant, and starts structop apply FILE; the team's own tests run with structop test.
What it does not guarantee
Be clear about the limits. Validation finds errors in declarations: unknown names, wrong types, missing attributes, dependency cycles. It does not detect security vulnerabilities. A plan shows what will change, not that the change is what the requirement meant. Tests check what they are written to check. In the handbook's words: StructOp does not make AI-generated software secure, correct or of high quality. It gives the people responsible for it more to inspect before they accept a change.
The season, in ten episodes
- episode 1 — an application as declarations
- episode 2 — types, a list, a loop, a function, a switch
- episode 3 — see a change before it is built
- episode 4 — settings, arguments, values and reuse
- episode 5 — run blocks that check behaviour
- episode 6 — the same declarations, two toolchains
- episode 7 — where ability kinds come from
- episode 8 — everything together, in one program
- episode 9 — components, systems and objects
- Humans and AI on one representation (this post)
The previous post was episode 9.
What DAE means now
An application described as declarations, that people and tools can check, plan, draw and test, before any of it runs. Everything from this season is in the handbook; the scope and roadmap page says what version 0.1.0 covers. More is coming.






