Skip to content

feat: add Prompt Studio v9 Generation Console and Evaluation Loop - #48

Draft
IMONsergey wants to merge 70 commits into
mainfrom
feat/prompt-studio-v9-generation-console
Draft

feat: add Prompt Studio v9 Generation Console and Evaluation Loop#48
IMONsergey wants to merge 70 commits into
mainfrom
feat/prompt-studio-v9-generation-console

Conversation

@IMONsergey

@IMONsergey IMONsergey commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Prompt Studio v9 turns returned single/batch Seedance generations into an evidence-based human production review and controlled iteration system.

Production loop

V7/V8 generation history → Generation Console → structured Evaluation → saved Comparison → explicit human Winner → explicit continuation or one-lever Retake Draft

No provider submission or credential moves into the browser.

Generation Console

New browser runtime:

  • prompt-studio-generation-evaluation.js
  • prompt-studio-v9-workflow-guard.js
  • prompt-studio-v9-console-ui.js
  • prompt-studio-v9-bootstrap.js
  • prompt-studio-v9.css

Console reads canonical V7/V8 generation history and surfaces:

  • task/status/export lineage;
  • V8 batch/variant label when present;
  • current evaluation score;
  • safe external output links;
  • comparison selection.

Generated video/images are not auto-embedded or automatically downloaded.

Structured production Evaluation

13 explicit dimensions:

  1. task adherence
  2. identity consistency
  3. composition/framing
  4. camera
  5. motion/action
  6. timing/shot readability
  7. continuity
  8. material/physics
  9. lighting/color
  10. graphics/text/logo
  11. audio fit
  12. artifact control
  13. production readiness

Each dimension supports score 1–5 or unrated, reviewer note, and evidence/observation.

overallScore is the transparent arithmetic average of rated dimensions only. It is not AI confidence.

Extension state:

  • generationEvaluations — max 200
  • one canonical upserted evaluation per task/export lineage

Score ≠ Winner

Winner state is deliberately separate from numeric evaluation.

Saved comparison:

  • 2–8 task IDs
  • label + timestamps
  • derived runtime view follows V8 batch lineage back to V4 Variant identity/delta

Winner:

  • must belong to saved comparison
  • explicit human action only
  • task ID + export hash + human rationale + timestamp
  • changing a score never silently changes the winner

Architecture decision: docs/ADR-017-V9-HUMAN-WINNER.md.

Explicit winner continuation

After winner selection, V9 reuses the existing guarded V7 continuation path:

  • winner video → new stable @refNN, mediaType:video, role:motion
  • winner last frame → new stable @refNN, mediaType:image, role:first-frame, locked

No output attaches automatically simply because it won.

One-lever Retake Draft

Retake stores:

  • source task/export lineage
  • exactly one named production lever
  • change instruction
  • expected improvement
  • retained locks
  • status:draft

Saving a Retake Draft does not:

  • rewrite Prompt Studio sections
  • mutate references
  • create a Variant automatically
  • call AI automatically
  • submit a generation

Architecture decision: docs/ADR-018-V9-ONE-LEVER-RETAKE.md.

Extension-safe V9 state

  • generationEvaluations — max 200
  • generationComparisons — max 100
  • generationWinners — comparison-keyed map
  • generationRetakes — max 100

New closed schema:

  • schemas/prompt-studio-generation-evaluation.schema.json

Core Prompt Studio schema remains unchanged.

Cross-layer staged-work safety

V9 mutating decisions are blocked while any overlapping production draft is staged:

  • V4 dirty Storyboard
  • V5 staged Repair
  • V7 staged Generation Result
  • V8 staged Batch Result

V9 also exposes its own dirty Evaluation/Retake draft state.

While V9 is dirty, capture-phase guard blocks project-changing actions such as project switch/new/import/delete, source Fork, revision Restore and mutations in V4/V5/V7/V8 until Save/Discard.

If an external/public project mutation still occurs, the unsaved V9 draft invalidates visibly rather than applying to a newer project version.

Public mutation boundary

All saved V9 decisions use:
window.porterPromptStudio.replaceProject(..., { snapshot:true, preserveIdentity:true })

No private Prompt Studio project state access.

Browser security boundary

V9 browser runtime contains no:

  • provider fetch path
  • XHR/beacon submission
  • ARK_API_KEY
  • Authorization headers
  • automatic remote output-media embedding

V9 is a review/decision layer over result manifests already returned through V7/V8.

Tests / CI

New behavioral contracts:

  • validate-prompt-studio-v9-evaluation.mjs
  • validate-prompt-studio-v9-console-ui.mjs (canonical UI contract)
  • validate-prompt-studio-v9-production.mjs

Dedicated Node 20/22/24 CI runs:

  • TypeScript + Vitest
  • V4 Variant/Handoff baseline
  • V7 Generation Results baseline
  • V8 batch/return baseline
  • V9 engine
  • V9 Console/guards
  • V9 production/project-memory contract
  • generalized Pages module graph
  • protected exact-100 render
  • schema parse + syntax checks

GitHub-native project memory

Durable V9 context is stored in:

  • docs/PROJECT-MEMORY.md
  • docs/PROJECT-MEMORY.json
  • docs/PROMPT-STUDIO-V9-GENERATION-CONSOLE.md
  • docs/PROMPT-STUDIO-V9-STATE.json
  • ADR-017 / ADR-018

The V9 state file records branch/PR/exit criteria. Project planning must not depend on chat history.

Protected invariants

Unchanged:

  • exactly 100 unique curated runtime cases
  • exactly 192 Porter Originals
  • no automatic curated mutation
  • no browser provider submission
  • no client-side provider credential
  • no automatic generated-output attachment
  • extension-safe project persistence

Next

After V9:

  1. V10 Production Memory + Learning
  2. V11 Multi-provider execution abstraction
  3. Research Corpus 500–1000 continues in parallel

This PR remains draft until final source/contract audit verifies mount order, browser zero-network boundary, cross-layer guards and current GitHub project memory.

@IMONsergey IMONsergey changed the title [PROJECT MEMORY] V9 Generation Console + Evaluation Loop feat: add Prompt Studio v9 Generation Console and Evaluation Loop Aug 8, 2026

Copy link
Copy Markdown
Owner Author

V9 release audit — current state

Implementation is intentionally still draft. Do not treat queued GitHub Actions as passing execution.

Completed in branch:

  • 13-dimension extension-safe Evaluation engine + closed schema;
  • Generation Console over V7/V8 history;
  • V8 batch → V4 Variant comparison lineage;
  • explicit human Winner + rationale (ADR-017);
  • explicit winner video/last-frame continuation via V7 path;
  • one-lever Retake Draft with no automatic prompt rewrite (ADR-018);
  • V4/V5/V7/V8 staged-work guard + dirty V9 guard;
  • Node 20/22/24 CI definition;
  • V9 Pages preflight definition;
  • V9 feature doc/state + canonical GitHub project memory.

Known release blockers before Ready/Merge:

  1. Two superseded early JSDOM tests remain in the branch (validate-prompt-studio-v9-ui.mjs, validate-prompt-studio-v9-console-ui.mjs). Final canonical test is validate-prompt-studio-v9-console.mjs.
  2. Existing V9 CI / V9 Pages preflight definitions must point only to the final validate-prompt-studio-v9-console.mjs test.
  3. Verify the actual PR diff contains production shell mount order v7 → v8 → v9 → Cmd-K.
  4. Optional final hardening before release: direct public openSource() bypass protection while V9 draft is dirty; remove winner from Evaluation verdict enum entirely; leaf-level variant delta paths.

These blockers are also recorded in docs/V9-IMPLEMENTATION-NOTES.md so they are not chat-only context.

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.

1 participant