test(cockpit-chat-debug): aimock e2e suite for the c-debug devtools dock - #1063
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
blove
enabled auto-merge (squash)
September 8, 2026 15:01
The c-debug demo had no e2e because it used to mount `<chat-debug>` alone — a devtools dock with no composer, so nothing could produce a run and the Timeline tab showed its empty state forever. The demo now mounts `<chat>` beside the dock, so the capability is drivable and gets the same aimock-replay suite every sibling chat cap has. Four specs, wired the way the siblings wire theirs (playwright.config.ts + global-setup-impl.ts + fixtures/, and an `e2e` target in project.json, which is also what puts the cap in the CI matrix — scripts/cockpit-matrix.mjs derives that from `targets.e2e`): - the Timeline tab shows its empty state before any run; - a run sent through the composer fills it with the pipeline's checkpoint rows (asserted as the exact list, newest first, since the row set is precisely what this capability exists to demonstrate); - selecting a checkpoint diffs that step of the run; - the State tab swaps in the live state inspector. No assertion reads model prose. Every checkpoint label is structural — `toDebugCheckpoint` reads `state.next[0]`, so the rows are the graph wiring read backwards. The fixture is three entries, one per LLM call the graph makes in a turn (`generate`, `summarize`, `generate_title`), discriminated by `systemMessage` because all three carry the same user message. No `hasToolResult` ordering constraint applies: the graph binds no tools. Mutation-checked by removing `<chat>` from the demo template: the three run-driven specs fail on the missing composer and only the empty-state spec passes, which is exactly the state the deleted e2e/README.md described. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two files pointed at the c-debug README as the marker for a cap that deliberately ships without an aimock suite. That is no longer true. `scripts/rerecord-all-aimock.sh` is the load-bearing one: it discovers caps by walking `*/e2e/fixtures/*.json`, so c-debug is picked up automatically now that it has a fixture, and an unlisted cap defaults to the prompt "Hello". Re-recording would have quietly replaced the fixture with one whose user message no cap spec sends. Register c-debug's actual prompt. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
blove
force-pushed
the
blove/chat-debug-e2e
branch
from
September 8, 2026 15:24
74afef1 to
1ad3e99
Compare
Contributor
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 changed
cockpit/chat/debugwas the last chat capability with no aimock-replay e2e. It had none because the demo used to mount<chat-debug>alone — a devtools dock with no composer, so nothing could produce a run and the Timeline tab sat on its empty state forever.e2e/README.mddocumented that as a permanent gap.The docs-audit work closed the gap in the demo: it now mounts
<chat>beside<chat-debug>(both carrying themainslot attribute, sinceexample-chat-layoutonly projects[main]and[sidebar]). This PR gives the capability the suite it never had, wired exactly like its siblings.The suite
cockpit/chat/debug/angular/e2e/—playwright.config.ts,global-setup-impl.ts,tsconfig.json,fixtures/c-debug.json,c-debug.spec.ts— plus ane2etarget inproject.json. That target is also what puts the cap in CI:scripts/cockpit-matrix.mjsderives thecockpit-e2ematrix fromtargets.e2e, so no workflow edit is needed (scripts/generate-aimock-scaffold.tswas not used — its ci.yml insertion predates that dispatcher).Four specs:
+ messages, read off the checkpoint the server persisted);No assertion reads model prose. The checkpoint labels are structural —
toDebugCheckpointreadsstate.next[0]— so spec 2 asserts the exact row list (Step 1,generate_title,summarize,process,generate,__start__), newest first. That row set is precisely what this capability exists to demonstrate, so a node added to or dropped from the pipeline should fail here and be re-stated rather than silently pass.The fixture
Three entries, one per LLM call the graph makes in a turn (
generate,summarize,generate_title), discriminated bysystemMessagebecause all three carry the same user message. ThehasToolResultordering rule does not apply here: the c-debug graph binds no tools.Cross-references
cockpit/render/README.mdandscripts/rerecord-all-aimock.shboth named c-debug as a documented no-e2e cap. The re-record script is the load-bearing one: it discovers caps by walking*/e2e/fixtures/*.json, so c-debug is picked up automatically now, and an unregistered cap defaults to the prompt"Hello"— a re-record would have quietly replaced the fixture with one whose user message no spec sends. Its real prompt is now registered.Verification
npx nx build cockpit-chat-debug-angular— green.npx nx e2e cockpit-chat-debug-angular— 4 passed, run three times (--skip-nx-cacheeach time): 32.3s / 13.5s / 15.2s. Deterministic.npx nx smoke cockpit-chat-debug-angular— green.<chat>from the demo template makes the three run-driven specs fail on the missing composer while the empty-state spec still passes — exactly the state the deleted README described. Restored after.npx tsc -p cockpit/chat/debug/angular/e2e/tsconfig.json --noEmit— only the pre-existingbaseUrldeprecation, identical to the tool-calls sibling.Notes
OPENAI_API_KEYis available in this environment, soAIMOCK_MODE=recordcould not run. What is real is the run: the fixture drives the actualc-debuggraph on a reallanggraph devserver through the real adapter, all three of its LLM calls match and return 200, and every assertion is on structure the server produced (checkpoint rows, persisted checkpoint values), never on the fixture's own prose. Re-recording against the live provider withbash scripts/record-aimock-cap.sh c-debug "What is a jet bridge?"would swap the three response bodies for real ones without touching a single assertion.{}on this cap, so spec 4 asserts that the inspector is mounted and bound to the agent rather than asserting content.agent.state()is the LangGraph values bag withmessagesprojected out into the transcript, andc-debugis a plainMessagesStategraph, so there is nothing else in it. The tab is not broken; the graph simply carries no state beyond its messages. Giving it one (astepslist the pipeline appends to, say) would make the State half of the dock demonstrate something and is a small change — but it rewrites what the docs page teaches, so it is left as a call for the coordinator. Spec 3 is where "reflects the run" is actually asserted, against the checkpoint diff.apps/website/content/docs/chat/components/chat-debug.mdxneeded no correction: it already describes the composer-driven flow and never claimed the demo lacked one or lacked e2e.🤖 Generated with Claude Code