ReferenceOperatorscontent.generate

content.generate

Generated by docs/scripts/generate-docs.mjs from operators/content-generate/operator.md and operators/content-generate/operator.json. Edit the source, not this page.

Binding

FieldValue
idcontent.generate
domaincontent
resources.profileluna
resources.requires
policy.webSearch
policy.grammarBound
policy.imageGeneration

Job

Generate or refactor one educational content unit in one linear pass: a teacher brief that constrains everything after it, one written edition per declared language, images made to a stated claim, code and executable checks that actually run, and an independent review that receives the artifacts without the producer’s rationale.

The brief comes first and constrains what follows

The teacher brief is written before anything else, from curriculum and source evidence, in one fresh execution that inherits no turns. It publishes the learner inputs, the observable outcomes, the claims a visual may encode, the examples, and the explicit add, change, and remove dispositions, and it is then fingerprinted so nothing downstream may extend it. Everything after it is measured against it: an edition may only claim coverage of an outcome the brief published, an image may only encode a claim the brief published, and every declared edition must cover the whole published outcome set before the unit can ship. An edition that covers part of the brief is a partial lesson in one language and a complete one in another, which is exactly the silent defect this check exists to catch. A change or remove disposition names what it acts on, because a disposition with no target is a wish.

Generated code must actually run

Every implementation track is built with the exact command commands names for it, and the exit code is read and recorded in response/data/e2e.json. A non-zero exit code cannot ship, because the lesson would tell a learner that code works on nobody’s evidence. Step 7 runs the declared command per track inside a bounded run, read and repair loop whose ceiling is maxE2eIterations; the loop lives inside the step, so E2E_FAILED is raised once, when the iterations are spent, rather than on the first red run. The loop may repair the implementation or the harness. It may never move the contract it is measured by, so the contract fingerprint is taken before the first run and compared after the last one: a test deleted, skipped, loosened, or special cased to make the run green is the failure that comparison exists to catch, and it is CONTRACT_WEAKENED. A track carries its build command and its exit code, a run carries its command, its exit code, and its named assertions, and neither carries a sentence claiming success.

The image is made to a stated intent

The visual is derived from the brief’s claims, the prompt that states that intent is persisted beside the result, and the result is inspected for legibility, hierarchy, and claim fidelity. Step 5 runs only when stageModes turns the image on; with the image off the step produces nothing at all, no image and no prompt, and the receipt records STAGE_DISABLED, because a decision that leaves no record reads later as an omission. A claim the brief never published cannot appear, and a visual that fails its own claim-fidelity inspection cannot ship. An image is not decoration added at the end; it is one of the claims, drawn.

The review is a nested exchange, and revision is a fallback with a ceiling

After the executable check, the branch pauses: it emits response/response.json with status waiting and awaiting { exchange: review, kind: content-review }. The orchestrator writes review/request/request.json with the produced artifacts and the claims they make as inputs, never the producer’s rationale, and runs a fresh agent on this operator’s own profile with no inherited turns; that agent is never the execution that wrote the brief or an edition, and it writes only review/response/. It scores correctness, pedagogy, interview value and language, and, where those stages ran, visual fidelity, code quality and executable proof. Approval requires every applicable score at or above 85 and no open error finding. A returned revision is not a stop: it is the fallback REVIEW_REVISION_REQUIRED, and the branch repairs exactly the artifacts the review’s findings name, by owning stage, then reopens the exchange for the next round. The ceiling is maxReviewRounds; when those rounds are spent and the review still returns a revision, REVIEW_ROUNDS_EXHAUSTED terminates, because a unit that has been rewritten to a reviewer’s satisfaction after unbounded rounds was rewritten by the reviewer. A unit that passes its own author’s review has not been reviewed, which is why shared executions, inherited turns, and producer rationale are three separate refusals.

Boundary

Context is read-only. The operator writes only response/ of its own branch: the brief, the receipt, the machine record of the build and the executable check, and the editions, image, prompt and tracks under response/artifacts/; the review agent writes only review/response/. It runs only the declared build and executable-check commands. It never writes an article before the brief is frozen or beyond what the brief published, claims a learning outcome, example, or visual claim the brief does not publish, reports a build or executable check that was not run or whose exit code was not read, changes the executable contract during a repair loop, lets the producer of an artifact perform, steer, or brief its own review, or approves a unit while any applicable score sits below the published minimum. It does not edit the curriculum, publish the unit to the served object, or claim any readiness beyond the checks it actually ran.

Context

AliasBindRequired
@remote/minio/<contentId>/<locale>the lesson as served, by the fingerprint of the fetched object; the unit being authored or revisedyes
@worktrees/sessions/central-runtimethe AI runtime that runs, reads, and repairs generated code, by generationyes

Inputs

KindFromRequired
content-generation-receipta prior run of content.generate on the same unit; regression history, absent on the first passno

Requirements

FieldTypeDefaultAsk
unitidThe content unit being authored or revised
naturalLanguageslistviThe languages the unit is written in; every one of them covers the whole outcome set
implementationLanguageslistemptyThe languages the implementation tracks are written in; empty means no code and no executable check
stageModeslist of {image}image offWhich optional stages run; image on turns step 5 on
commandslist of {language, buildCommand, checkCommand}the commands the unit declaresThe exact command each track is built and checked with
maxE2eIterationsnumber 1–202How many run, read and repair iterations step 7 may spend before E2E_FAILED
maxReviewRoundsnumber 1–202How many review rounds the revision fallback may spend before REVIEW_ROUNDS_EXHAUSTED
resumetokennullThe blocked branch’s token when re-entering after a stop

Steps

#StepParamsReadsWritesStops with
1Validate the gate and resumeresumerequest/request.json, input content-generation-receipt when present, @remote/minio/<contentId>/<locale> at the frozen unit bindingINVALID_INPUT, SOURCE_DRIFT, NO_PROGRESS
2Bind the served unit and the runtimeunit@remote/minio/<contentId>/<locale> for curriculum and style as served, @worktrees/sessions/central-runtime for the runtime configuration, @tools/objectstorage
3Write and freeze the briefnaturalLanguages, implementationLanguages@remote/minio/<contentId>/<locale> for curriculum and source evidence, @tools/websearchresponse/brief.md<br />IEF_UNBOUND
4Write every declared editionnaturalLanguagesresponse/brief.md as the frozen briefresponse/artifacts/article.<language>.mdOUTCOME_UNCOVERED
5Generate the image to its claims, only when stageModes turns it onstageModesresponse/brief.md for the claims and the stated image intentresponse/artifacts/image.<name>, response/artifacts/prompt.<name>.txt, @tools/imagegenIMAGE_UNAVAILABLE
6Implement every declared trackimplementationLanguages, commandsresponse/brief.md, @worktrees/sessions/central-runtime where each build command runsresponse/artifacts/track.<language>.<extension>, @tools/shellCODE_BUILD_FAILED
7Run the executable check, at most maxE2eIterations iterationsmaxE2eIterations@worktrees/sessions/central-runtime where each declared command runsresponse/data/e2e.json, @tools/shellE2E_FAILED, CONTRACT_WEAKENED
8Await the review: pause, a fresh agent reads the artifacts without the producer’s rationale, revise and reopen while rounds remainmaxReviewRoundsreview/response/review.md once the exchange is doneresponse/response.json (waiting, awaiting review)REVIEW_REVISION_REQUIRED, REVIEW_ROUNDS_EXHAUSTED
9Write the receipt and emiteverything aboveresponse/response.md, response/response.json

Under the defaults the unit is one Vietnamese edition with no image, no track and no executable check, and its quality rests entirely on step 8. A resume begins again at step 1, reuses only unchanged fingerprinted observations, and consumes the exact delta; a revised brief arrives as a new fingerprint, because the same fingerprint cannot yield a different answer. The receipt claims no publication, no learner outcome in production, and no acceptance beyond the checks actually run.

Outputs

KindFileTypeRequired
content-generation-receiptresponse/response.mdmdyes
content-briefresponse/brief.mdmdyes
e2eresponse/data/e2e.jsondatano
content-reviewreview/response/review.mdmdyes
articleresponse/artifacts/article.<language>.mdartifactyes
imageresponse/artifacts/image.<name>artifactno
image-promptresponse/artifacts/prompt.<name>.txtartifactno
trackresponse/artifacts/track.<language>.<extension>artifactno

Stops

CodeDisposition
INVALID_INPUTterminate
SOURCE_DRIFTterminate
NO_PROGRESSterminate
<br />IEF_UNBOUNDterminate
OUTCOME_UNCOVEREDterminate
IMAGE_UNAVAILABLEterminate
CODE_BUILD_FAILEDterminate
E2E_FAILEDterminate
CONTRACT_WEAKENEDterminate
REVIEW_REVISION_REQUIREDfallback
REVIEW_ROUNDS_EXHAUSTEDterminate

Next

WhenOperator
the routed content object or the shared runtime does not answer at the frozen bindingworkspace.bind

Source: operators/content-generate/operator.md.