Agent runtime · propose–verify
Harness
Most of Beforewear is not a happy-path blank. It is a harness: agents propose a cut and sewing, the factory verifies, and refusal is structured so the agent can revise.
Workflows are example walks on this loop. The contract is the loop itself — SDK, MCP, and the workflow runner are three surfaces over the same engine.
Evidence, assumptions, and approval
A sketch or photograph can guide a proposal; it does not establish hidden seams, tolerances, grading rules, or measured cloth behavior. Keep those unknowns explicit in the brief.
| Input | Review requirement |
|---|---|
| Reference image or swatch | Separate visible details from inferred construction and material assumptions. |
| Patterns, size chart, material profile | Confirm units, source, body measurements, grading intent, and measured properties with the technical owner. |
| Proposed garment or tech pack | Review construction, dimensions, artwork, and manufacturing requirements before handoff. |
For example, when a reference does not specify a seam allowance, record it as unresolved and obtain the technical designer’s specification. A successful geometry check does not approve that manufacturing decision. The public preview does not expose a complete approval-management interface; agree these review points in the engagement.
Propose–verify
An agent proposes a Pattern or Construction, then checks it through preflight and arrangement. A refusal returns evidence the agent can use to revise the source. Acceptance comes from those checks; the agent cannot relax clearance bounds to make a failed proposal pass.
What agents send
Resources and evidence. Not solver knobs.
| Job | Send | Do not send |
|---|---|---|
| Cut | Pieces, a size chart, a sentence, a sketch, product photos | Stretch, scale, grade rules |
| Sewing | Family, recipes, evidence photos | Clearance bounds |
| Avatar | sex, size, a library pose or a custom pose | A mesh, custom measurements, joint angles, a raw SMPL-X file as if it were the factory body |
| Cloth | A library id, or a swatch | Stretch knobs |
| Drape | device: cpu or gpu | Artwork |
{placement: uri} after a blank exists | Panel names as if they were placements | |
| Mockup | kind, optional photo_uri | Prompts, seeds, inpaint — nothing that owns the print |
| Tech pack | Sealed Pattern + Construction, optional run_id | Page layout, stitch codes, nest gap |
| Cloth in space | kind: flatlay, hanger, or fold | Substeps, gravity, in-between frames |
Gates
2D first: pattern.preflight, construction.preflight. Physics next: garment.arrange, implied by garment.drape. A refusal is GateError JSON — gate, phase, counts, witnesses, hint. On MCP it is still a JSON-RPC result with isError: true, not a protocol crash.
Then pattern.revise or construction.revise. New ids. The parent resources stay. Walked example: revise_after_gate — one Client, the stub refuses arrange once.
Immutable Runs
Drape produces a blank: UVs, no artwork. Finish, colorway, and graphic return children with parent_id. Size, pose, body, construction, or cloth require a new drape. Navy and black are stamps, not a second physics job. Cloth in space continues a draped or presented Run off the avatar; it is not a second on-body drape.
Provenance on every resource: observed, derived, human_declared, agent_declared.
Surfaces
| Surface | Role |
|---|---|
Python Client | Namespaces over the engine. Same names as the tools. |
| MCP | Dotted tools on stdio. The catalog is the contract. Hosted auth later. |
| Workflow runner | Executable walks. expect_gate, stable sample paths, stub or a plugged-in engine. |
| Engine | v1 is in-memory. Swap later without changing call sites. |
python examples/run_workflow.py --list is how an agent sees the walks. The harness underneath them is this page.
Checks, not jobs
garment.measure is points of measure versus the size chart. uv.audit asks whether printable placements still have honest UVs after drape. They inspect a Run. They do not author one.