Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLIPublic
Assigneesskunk-ape

Relationships

#2884 gatorwalk-factory: the factory definition lives in the factory model, with its schema, not in a separate file

Opened by skunk-ape · 10/1/2026· Shipped 10/1/2026

Move the factory definition back into the factory model's own definition, and give the factory type its definition schema, so swamp validates it as it does any model. This replaces #2803's separate file.

Why

Adam's review feedback (2026-10-01): "I don't understand why the definition is not itself a model. It will have to grow to have basically every feature models have (schema, inputs, CEL expressions)." He feels strongly about not introducing a separate file for the factory definition.

#2803 moved the definition out of the factory's globalArguments into factories/<factory>.yaml. The factory model now holds only { definition: <path>, tracker: <name> }; for example, models/@swamp/gatorwalk-factory/factory/swamp-extensions.yaml points at factories/swamp-extensions.yaml. Its reason (DESIGN.md, "Where a factory definition lives") was that people pasted definitions into globalArguments by hand while also keeping a file copy, and the two drifted. That reason has largely gone. Seth has since decided that factories are authored and edited only by the agent, and a swamp model definition is already a YAML file in the repo that an agent edits directly. One copy is kept, in the place swamp already looks.

What this gains:

  • swamp's own checks see the definition. The factory type's schema is only two strings today, so swamp model validate cannot see definition errors. That is the old software-factory defect #1236, where the platform-facing schema was stages: unknown[].
  • Remote factories work again. A remote worker receives the model definition but not the repo file, so start fails there today (DESIGN.md, "Remote factories are later").
  • One copy, nothing to sync.

Scope

  • The factory's globalArguments carry the definition inline, along with tracker (#2795). Remove the definition: <path> form; there are no users before go-live, so there's nothing to keep compatible.
  • The factory model type's globalArguments schema is the definition schema (_lib/engine/definition_schema.ts), so swamp validates it.
    • Decision for the implementer: swamp validates globalArguments with schema.partial() on every run (DESIGN.md). Check what the full schema means under partial(), both at save time and at run time. Check that error messages stay as good as gatorwalk's own validate, which still runs the graph analysis and saved scenarios. Say what swamp model validate reports versus gatorwalk's validate.
  • CEL: swamp evaluates ${{ }} in globalArguments. gatorwalk's definition already rejects ${{ and uses {{name}} placeholders and bare CEL strings in gates, kept for exactly this case (DESIGN.md, "${{ stays rejected"). Confirm nothing in a definition is touched by swamp's evaluation, and add a test with a CEL gate and a {{name}} prompt that survive a save-and-run round trip. Say whether swamp-native ${{ }} (vault or env references) should be allowed in specific fields later. Don't enable it here.
  • init --input from=<starter> writes the starter into the factory's model definition instead of copying a file, and never overwrites an existing definition.
  • Every reader that used the file reads the factory's raw model definition through the definition repository: validate, design_page, new_key, start, reset repin=true, claim. Keep both shapes on remote workers (_globalArguments). start still pins a copy with its digest, so running work items are unaffected.
  • Studio (#2806, and #2807 in progress): it watches and reads the factory's model definition file instead of factories/<name>.yaml, and the picker lists factory models. The Design mode's "Copy reference" lines name the model definition file and document path.
  • Scenarios (#2805): decide whether they stay in scenarios/<factory>/, keyed by factory name (probably yes), and say so.
  • Remove _lib/engine/definition_file.ts and its path rules if nothing else needs them. Remove factories/ from the examples and tests. Update the skill (the authoring reference and driving), README, DESIGN.md (replace "Where a factory definition lives" and add a decision-log entry citing this feedback), the examples' instructions and the integration harness.

Done when

  • A factory's model definition holds its definition, and swamp model validate reports a schema error in it.
  • gatorwalk's validate still reports graph findings and scenario results.
  • init, start, claim, reset repin=true and the studio work from the model definition alone, with no factories/ file anywhere.
  • A start on a remote-worker-shaped definition (_globalArguments) works in tests.
  • The authoring skill's acceptance run still reaches a validating factory and a started work item.

Careful

  • The live dogfood run (#2711) is using ~/sc/swamp-extensions/.swamp and factories/swamp-extensions.yaml in the main checkout. Don't touch that checkout. Its work item has a pinned copy.
  • #2807 (studio Design mode) is in progress and reads the definition file. Coordinate so the second of the two to merge adapts.

Out of scope: work items as data inside the factory (Adam's other suggestion). That stays one instance per work item; see DESIGN.md "The runtime: one run record per work item" and #818.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 6 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

10/1/2026, 2:19:57 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
skunk-ape assigned skunk-ape10/1/2026, 12:17:03 PM

Sign in to post a ripple.