Change format

A drafter returns either a change or a queue entry:

{ "change": { "summary": "Made the sign-up button bigger", "ops": [ … ] } }
{ "queue": { "kind": "feature", "reason": "It asks for new functionality, which needs the app's developers." } }

After validation the widget stores the change with format: "pmf-harness/change@1", an id, the requestId, its status (trial, accepted, rejected, rolled-out), scope (user or everyone) and which drafter made it.

Operations

{ "op": "text",  "selector": "#signup", "value": "Start tracking" }
{ "op": "attr",  "selector": "input[name=email]", "name": "placeholder", "value": "you@work.com" }
{ "op": "style", "selector": "#signup", "props": { "font-size": "17px", "padding": "9px 14px" } }
{ "op": "hide",  "selector": "#banner" }
{ "op": "move",  "selector": ".plans", "before": ".steps" }
{ "op": "class", "selector": "#signup", "add": ["btn-primary"], "remove": ["btn-quiet"] }

The rules for each are on the safety page. Style and hide operations are applied as one stylesheet, so your app re-rendering can't undo them; the others are applied to the element and re-applied if your framework replaces it.

What a request looks like

This is what a drafter receives (request):

{
  "text": "make this button bigger",
  "page": "/pricing",
  "target": {
    "selector": "#signup", "tag": "button", "text": "Sign up", "ariaRole": "button",
    "styles": { "font-size": "13px", "padding": "6px 10px", "color": "rgb(154, 52, 18)", "background-color": "rgb(254, 215, 170)" },
    "prevSelector": "p.bs-sub", "nextSelector": ""
  },
  "context": { "viewport": { "w": 1280, "h": 800 }, "outline": "heading 1: Build habbits that stick\nbutton: Sign up\n…" }
}

The structured-output schema

When the reference server asks Claude for a draft, it constrains the answer to draft.schema.json. In that schema, style properties are a list of { property, value } pairs (strict JSON schemas need fixed keys); fromDraftOutput() in src/patch.js turns the answer into the format above and validates it.