StructOp Handbook
Contents Examples Commands
Handbook / What is StructOp?

Human and AI collaboration

StructOp provides a common representation of software that developers, automated tools and AI development systems can all read. The objective is not merely to generate software faster. It is to improve the ability of humans and AI to understand, review, verify and maintain software together.

On this page

Who does what#

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.

What StructOp provides#

CapabilityFor a personFor a tool or agent
Human-readable declarations.st files in a small, regular syntaxThe same files; structop fmt keeps their layout standard
Named application componentsAddresses such as ability.print.GreetThe same addresses in every JSON document
Explicit dependenciesdepends_on, data blocks and module outputsEdges in graph -json
Execution relationshipsstructop graph, drawn in the terminalgraph -json, -format=mermaid and -format=archify
Provider schemasstructop schemaschema -json
Structured diagnosticsFile, line, column and a suggestionvalidate -json with a range and a hint
Machine-readable outputText by default-json on init, validate, plan, show, state, graph, test, schema and version
Application change plansstructop planplan -json; plan -out=FILE and apply FILE
Graph generationgraph -changed and -impactThe same views as JSON
Validation before compilationstructop validateIts exit code and JSON document
Build state trackingstructop state list, state showstate -json, show -json

The JSON formats are described in Machine-readable output.

One diagnostic, two readers#

The same mistake, a misspelt reference, as a person and as a tool see it:

structop validate
$ structop validate
Error: unknown ability "ability.call.Greeet"
  on main.st line 11, column 19
  Did you mean "ability.call.Greet"?
structop validate -json
$ structop validate -json
{"format_version":"1.0","command":"validate","valid":false,"diagnostics":[{"severity":"error","message":"unknown ability \"ability.call.Greeet\"","hint":"ability.call.Greet","range":{"file":"main.st","line":11,"column":19}}]}

A collaboration workflow#

The steps below show one way a team can work with an AI development agent. StructOp performs the steps marked StructOp; people and the agent perform the others.

StepWho actsHow
1. Define a requirementDeveloperIn the team’s usual way
2. Inspect the existing application definitionsAI agentReads the .st files, graph -json and schema -json
3. Modify the relevant declarationsAI agentEdits .st files
4. Validate the modificationsStructOpstructop validate
5. Generate a change planStructOpstructop plan -out=FILE
6. Review the proposed changesDeveloperReads the plan and the edited declarations
7. Inspect execution relationships where relevantDeveloper, with StructOpstructop graph -changed or -impact
8. Apply the approved changesStructOp, started by the developerstructop apply FILE, which refuses a plan that no longer matches
9. Test application behaviourStructOp, with tests the team wrotestructop test

What StructOp does not guarantee#

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.