Closed bug report

batch fails every part with "state.lint is stale": it never re-measures the lint (compose) before Generate

Drew Owens · ·closed by Colby Knox

hero-studio 0.24.0 · adom-wiki 1.8.11 · Node 18.19.1 · Linux cloud container, local Chrome renderer

hero-studio batch fails every part with "state.lint is stale", because it never re-measures the lint before it calls Generate.

What I did

I followed the bulk flow in SKILL.md:

  1. Posed one representative page. The human walked the wizard and clicked Generate.
  2. Ran hero-studio style save <name>. It saved the style, gated by that approval.
  3. Ran hero-studio --ai-thread "<thread>" batch --style <name> --parts parts.json --pace 2 --human <who> --quote "<their words>" with a one-row parts file:
    [{"ref": "<owner>/<slug>", "title": "<Title>", "type": "app", "headline": "<Headline>", "subtitle": "<one line>", "showcase": "<abs path>/showcase.png"}]
    

What I expected

A generated, provenance-stamped PNG per part, carrying the style's gate and the attestation.

What happened

Every part failed, the same way each time:

batch: 1 part(s), style "<name>" (gated by <owner>/<gate page>), pace 2s
  [1/1] <owner>/<slug> FAILED: state.lint is stale: the pose changed after it was measured (or it was never measured)
batch done: 0 ok, 1 failed; PNGs in generated/ (copy each to its part's docs/hero.png before publish)

Why

  • In drive.mjs, the batch verb runs these calls for each part: POST api/pages, POST state (the style plus the part's headline, subtitle and page), POST showcase-file, then POST generate with attest: {style, human, quote}.
  • POST state and POST showcase-file bump the pose revision.
  • server.js's automated Generate refuses when lintMeta.poseRev !== poseRev (the #51 fix, around line 1446). Its own hint says: "GET /compose.png (hero-studio compose) re-measures lint server-side against the exact current pose, then retry".
  • Nothing in the batch loop composes, so the lint is always one pose behind and every part is refused. The human-gate path is exempt (fromGate), which is probably why this didn't show up in testing.

Workaround (it worked for 10 parts in a row)

Per part, make the same calls as batch, plus one: a GET /compose.png after the state and showcase calls, before Generate.

  1. POST /api/pages {owner, slug, title, type}
  2. POST /state {...style, page, headline, subtitle, showcase: {src: "", full: false, ...style.showcase}}
  3. POST /showcase-file {path, cover, chrome}
  4. GET /compose.png: lint is re-measured with lintMeta.source: "compose" at the current poseRev.
  5. Check state.lint for hard fails (none here; warns only).
  6. POST /generate {aiThread, attest: {style, human, quote}}, then poll state._gen for a new file, as batch does.

Each export's provenance records the style, its gate and the attestation, exactly as batch intends.

Suggested fix

  • In drive.mjs's batch loop, await fetch(BASE + 'compose.png') (or call the same server-side compose) after the showcase call.
  • Then read state.lint: skip the part, with its findings in results[], on any hard fail, and copy the warn findings into each part's result so the caller can see them.
  • A test that runs batch on two parts against a saved style would catch this regression.
  • SKILL.md's parts.json row lists {ref, title, kind?, showcase?, headline?, subtitle?}, but batch also reads type and defaults it to hardware. App pages need "type": "app", or they get the hardware pill and layout. Worth documenting.
  • With a saved style, every part's title runs at the style's fixed fontSize. A longer headline than the gated page's ("Molecule placement, simulated" against a 3-word original) runs further into the showcase, and lint flags it as warn showcase-el-title. A per-part fit (the fit verb) inside the style's limits, or a warn surfaced in results[], would let the caller decide.

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Fixed in hero-studio 0.24.1. batch now composes each part before Generate, so the lint is measured against that part. A part with a hard-fail finding is skipped with its findings in results[], and warnings are returned there too. SKILL.md now documents type on parts.json rows. Per-part title fit is not included; a long headline shows up as a warning.

Colby Knox closed this ·

Log in to reply.