M1 PR-7 (demo side): governed Generate view#5
Merged
Conversation
demo Generate view driven by `dspack-gen serve` (localhost NDJSON): - input bar: prompt / intent / model (ollama:<tag> | anthropic:<id>) / fake-pipeline toggle (the deterministic scripted adapter the Playwright gate drives) - per-attempt panels: gate strip S1 surface-schema / S2 contract-vocabulary / S3 governance; findings with rule id, location, message, and the contract's rationale VERBATIM; on a clean attempt the S3 card lists every applicable rule as satisfied — verified by the linter, not assumed from prompt steering - the exact repair message sent (rendered from the same findings object) - emitter gate strip A1/A2/A3 per A2UI version - outcome panel: the emitted surface rendered off the generated catalog via @a2ui/react v0.9.1 (dspack tokens driving the theme), audit report v1 download; failures render honestly with no surface Verified in-browser: fake pipeline shows violation → repair → all gates green → AlertDialog renders and opens with cancel-before-confirm. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new “Generate (governed)” view to the demo app that connects to dspack-gen serve over localhost NDJSON, replays the governed pipeline steps (S1–S3 + repair + A1–A3), renders the emitted A2UI surface, and allows downloading the audit report.
Changes:
- Introduces
GenerateViewUI that streams and renders pipeline events fromdspack-gen serve. - Adds a view switcher in the demo app to toggle between existing surface previews and the governed Generate view.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| demo/src/GenerateView.tsx | New governed Generate view: NDJSON streaming client, attempt/gate/finding panels, A2UI rendering, audit report download. |
| demo/src/App.tsx | Adds navigation to the Generate view and conditionally renders it alongside the existing surfaces view. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+94
to
+104
| for (;;) { | ||
| const { done: eof, value } = await reader.read(); | ||
| if (value) buffer += decoder.decode(value, { stream: true }); | ||
| const lines = buffer.split("\n"); | ||
| buffer = lines.pop() ?? ""; | ||
| for (const line of lines) { | ||
| if (line.trim()) setEvents((prev) => [...prev, JSON.parse(line) as PipelineEvent]); | ||
| } | ||
| if (eof) break; | ||
| } | ||
| } catch (e) { |
Comment on lines
+72
to
+76
| const rendered = useMemo(() => { | ||
| if (!done?.surfaceMessages) return null; | ||
| const processor = new MessageProcessor<ReactComponentImplementation>([ingested.catalog], async () => {}); | ||
| processor.processMessages(structuredClone(done.surfaceMessages.messages) as any); | ||
| const model = Array.from(processor.model.surfacesMap.values())[0]; |
Comment on lines
+268
to
+271
| a.href = URL.createObjectURL(blob); | ||
| a.download = "audit-report.json"; | ||
| a.click(); | ||
| URL.revokeObjectURL(a.href); |
Comment on lines
+72
to
75
| const [view, setView] = useState<"surfaces" | "generate">("surfaces"); | ||
| const [surfaceKey, setSurfaceKey] = useState<string>("access"); | ||
| const [surface, setSurface] = useState<AnySurface | null>(null); | ||
| const [actions, setActions] = useState<A2uiClientAction[]>([]); |
ryandmonk
added a commit
that referenced
this pull request
Jul 2, 2026
…07ada9 Land the Generate view on main (#5 merged into its stacked base)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The demo half of PR-7 of Milestone 1 — stacked on #4 (retarget to main after #4 merges). The pipeline half (
dspack-gen serve, NDJSON events, Playwright gate) lives in the dspack-gen repo.A Generate (governed) view in the existing catalog-ingesting demo app, driven by
dspack-gen serveover localhost NDJSON:destructive-action), model reference (ollama:<tag>|anthropic:<id>; IDs are configuration, per the amended ADR-9), and a fake pipeline toggle running the server's deterministic scripted adapter (golden violating fixture → worked example) — the same backend the Playwright gate drives.@a2ui/reactv0.9.1 with dspack tokens driving the theme; audit report v1 download. Failures render honestly with no surface.Also includes the base-branch fix (pushed to #4): the emitted surface root now carries id
root— the A2UI render entry point. Found by the render step: gates A1–A3 don't check ids, so only rendering caught it.Verify
Machine gate:
npm run demo:e2ein dspack-gen (Playwright, fake adapter) — lands with the dspack-gen side of PR-7.ADRs: 2, 4, 5, 7, 8, 9.
🤖 Generated with Claude Code