Loop-engineer comic generation - #25
Conversation
Deploying promptexecutionwebsite with
|
| Latest commit: |
4fa6090
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://22b67a44.promptexecutionwebsite.pages.dev |
| Branch Preview URL: | https://agent-loop-engineered-comics.promptexecutionwebsite.pages.dev |
Rewrite comic script generation into a scored writers-room loop: typed brief/premise generation, heuristic scoring (surprise, specificity, compression, visuality, character voice, archive novelty), and a bounded rewrite -> TRIZ-inversion -> reject state machine. Retains briefs, premise rankings, editorial decisions, and rewrite counts as reproducible R2 artifacts. Adds deterministic screenText rendering for dashboards, logs, eval files, alerts, and approval screens, integrated alongside the existing scene/pose/expression composition system. Disables production generation-on-read and refreshes the local bootstrap comics. Rebased onto main after PR #24 (scenario/improv-menu system and model lineup diversification); both feature sets are merged so comic panels carry scene, pose, beat, expression, cameo, AND screenText, and prompts combine the shared improv menu with the structured brief/premise. Co-authored-by: brianh <brianh@promptexecution.com>
06bb3c3 to
4804a60
Compare
Triage update: rebased, scope cleaned up, CI green — still needs a human validation pass before mergeI rebased this branch onto current 1. Conflicts resolved
One real bug surfaced during merge and is fixed: 2. Unrelated scope removedDropped entirely (verified via
The PR is now 17 files / +1212 −104, scoped entirely to comic generation. 3. CI status: green
4. Outstanding — needs a human, not meThis PR's own description says production Workers AI inference was never actually invoked/tested locally, and that "an authenticated AI-enabled staging generation should be reviewed before merging for model-specific output quality and latency." That's still true after this rebase — I only exercised the deterministic fallback/bootstrap path ( Leaving this as a draft per the task — not merging. |
…test:comic-loops into CI decideScriptLoopAction (comic-loop.ts) only reaches 'reject' when evaluation.passed is false after the bounded rewrite+invert attempts are exhausted, but runAgenticComicWorkflow never checked .passed before rendering/persisting - a script that failed editorial review three times still shipped as the daily comic. Now throws before any R2/D1 write if either variant's evaluation.passed is false. Every existing caller already handles this gracefully: today.ts falls back to the most recent comic, test-generate.ts returns a 500 with the rejection scores, and the cron scheduled() handler logs + re-throws (visible failure, no partial writes, fresh attempt next day since the R2 existence-check means nothing was written). Also wires test:comic-loops (9 tests covering comic-loop/comic-generator/ svg-renderer) into .github/workflows/build.yaml - it existed and passed locally but wasn't part of the actual CI gate. Verified locally before committing: bun run build, test:comic-loops (9/9 pass), test:contracts, and the full smoke:local suite (including /api/today, which exercises this exact code path) all pass with this change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kUr7Kf9wN15TPqDiKsiKw
Summary
screenTextrendering for dashboards, logs, eval files, alerts, and approval screensWhy
The previous pipeline selected a broad topic randomly, generated two scripts directly, and rendered them without a comedy-specific quality gate or feedback path. It also mandated the same robot-thought and deadpan-closer rhythm, producing structurally repetitive strips.
This change turns generation into bounded, inspectable feedback loops. Weak drafts receive targeted correction, repeated jokes are penalized against editorial memory, and the renderer can display the exact technical evidence that carries a visual payoff.
Impact
/api/today, voting, archive, and existing comic response shapes remain compatible.just dev.Validation
just test: 9 loop/generator/renderer tests and existing API contracts passedjust build: Vue type-check and Vite production build passed./scripts/smoke-local.sh: D1 initialization, Pages Worker startup,/api/today, SVG streaming, vote upsert, archive, and push-default checks passedgit diff --check: passedRemaining Validation
Production Workers AI inference was not invoked locally. An authenticated AI-enabled staging generation should be reviewed before merging for model-specific output quality and latency.