Skip to content

Update comic rendering pipeline#24

Open
elasticdotventures wants to merge 5 commits into
mainfrom
feature/comic-rendering-pipeline-updates
Open

Update comic rendering pipeline#24
elasticdotventures wants to merge 5 commits into
mainfrom
feature/comic-rendering-pipeline-updates

Conversation

@elasticdotventures
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 24, 2026 01:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the scripted SVG comic pipeline to support richer per-panel metadata (scene/beat/visual focus/expression/cameos), improves prompt planning via scenario + improv menus, and surfaces more provenance (model selection) through the voting UX/API.

Changes:

  • Add structured script metadata (scene/beat/visualFocus/expression/cameo) and use it in both prompting and SVG rendering (new backdrops, faces/expressions, and new characters).
  • Update workflow planning to generate scenario setups + shared improv menus, and to select script models from an env-configurable lineup.
  • Improve the web terminal integration and voting UX (model reveal after voting) with corresponding API contract updates.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
wrangler.toml Replaces A/B script model vars with a configurable SCRIPT_MODEL_LINEUP list.
src/types/vue-web-terminal.d.ts Adds proper Vue Plugin default export typing for vue-web-terminal.
src/main.ts Switches to Terminal plugin default export and makes the terminal websocket URL configurable via env.
src/components/TheXTerm.vue Adds focus-on-pointerdown, normalizes comic enable commands, and refactors activity listeners/connection bootstrapping.
src/components/ComicViewer.vue Stores and displays the selected model after a vote.
scripts/test-api-contracts.mjs Extends contract assertions for vote responses and workflow plan shape.
functions/lib/svg-renderer.ts Major renderer upgrade: scene backdrops, expression-aware faces, cameos, and new characters (tux/python/kube_captain).
functions/lib/svg-prompt-generator.ts Updates prompt phrasing/style guide toward xkcd-like B/W line art + props.
functions/lib/local-bootstrap-comic.ts Updates bootstrap scripts to use new per-panel metadata and new characters.
functions/lib/ledgrrr-wasm/ledger_workflow_wasm_bg.wasm.types.txt Adds wasm type dump artifact file.
functions/lib/ledgrrr-wasm/index.ts Fixes import to reference the generated .js module.
functions/lib/comic-generator.ts Adds new panel fields/types, improv menu support, sanitizers, and richer prompt rules.
functions/lib/cast.ts Extends CastCharacter with optional behavior/idea/drawable metadata.
functions/lib/agentic-comic-workflow.ts Adds scenario/improv planning, broader topic generation, and script-model lineup selection.
functions/api/vote.ts Returns {selected: {variant, model}} in vote response by reading model_a/model_b from DB.
cast/characters.ts Enriches existing cast metadata and adds new characters (tux/python/kube_captain).
Comments suppressed due to low confidence (3)

functions/lib/comic-generator.ts:409

  • These heuristic scene regexes are missing grouping around the alternation, so the \b boundary only applies to the first alternative (e.g., \bwhiteboard OR diagram OR ...). This can misclassify scenes based on partial/accidental matches. Wrap alternatives in a non-capturing group and add a trailing boundary where appropriate (e.g., \b(?:whiteboard|diagram|arrow|...)\b).
  const hint = `${action || ''} ${dialogue || ''} ${robotThought || ''}`.toLowerCase();
  if (/\bwhiteboard|diagram|arrow|architecture|box|flow|schema|chart\b/.test(hint)) return 'whiteboard';
  if (/\bincident|outage|pager|status|sev|war room|rollback|postmortem\b/.test(hint)) return 'incident_room';
  if (/\bmeeting|standup|roadmap|kpi|slide|stakeholder|executive\b/.test(hint)) return 'meeting';
  if (/\bdns|tcp|packet|cache|cdn|api|queue|service|network\b/.test(hint)) return 'network';

src/components/TheXTerm.vue:202

  • Event bus handlers are registered on mount (emitter.on(...)) but never unregistered on unmount. If this component is remounted (navigation/HMR), it will accumulate duplicate listeners and push duplicate terminal messages. Add emitter.off('webSocket.open', handleMessage) / emitter.off('webSocket.onMessage', handleMessage) in onUnmounted().
onMounted(() => {
  // Don't start idle timer here - wait for terminal initialization

  emitter.on("webSocket.open", handleMessage);
  emitter.on("webSocket.onMessage", handleMessage);

functions/lib/svg-renderer.ts:1343

  • roughPolyline() is introduced here but never used in this module, which increases maintenance surface area and makes it harder to tell which helpers are part of the renderer pipeline. If it's not needed, remove it; if it is, wire it into the relevant drawing paths and add a brief usage comment.
function roughPolyline(points: Point[], rng: () => number, controls: SketchControls): Point[] {
  const roughPoints: Point[] = [];
  for (let index = 0; index < points.length - 1; index += 1) {
    const segment = roughLinePoints(points[index], points[index + 1], rng, controls, 4, 0.06);
    if (index > 0) segment.shift();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread functions/lib/svg-renderer.ts Outdated
Comment thread functions/lib/comic-generator.ts Outdated
Comment thread functions/lib/comic-generator.ts Outdated
Comment on lines 303 to 307
assert.equal(response.status, 200);
let payload = await readJson(response);
assert.deepEqual(payload.votes, { a: 1, b: 0 });
assert.deepEqual(payload.selected, { variant: 'a', model: '@cf/model-a' });

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying promptexecutionwebsite with  Cloudflare Pages  Cloudflare Pages

Latest commit: c121a93
Status: ✅  Deploy successful!
Preview URL: https://161c96ee.promptexecutionwebsite.pages.dev
Branch Preview URL: https://feature-comic-rendering-pipe.promptexecutionwebsite.pages.dev

View logs

elasticdotventures and others added 2 commits May 24, 2026 12:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brian Horakh <35611074+elasticdotventures@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants