feat(678): typed Scenario object on /api/v2/plays + Session Viewer parity#688
Merged
Conversation
…rity
Promote the run-identity ("Scenario") assembly off the dashboard into the
API contract, so the Sessions list, Session Viewer header, and chat tools
share one shape instead of each re-deriving it client-side (#673 did it
inline in Sessions.vue).
Backend (forwarder):
- internal/plays/scenario.go — enrichScenario() attaches a nested `scenario`
object to each play row at the single FindPlays chokepoint (covers list +
GetPlaySummary detail). Hybrid-sourced: device/player/app/os/content from
the typed summary columns; test/platform/run_id parsed from the testing=
label tier. Omitted entirely when a play has no identity fields.
- scenario_test.go — hybrid sources, omit-when-empty, os-major-only,
device-class-only.
API:
- forwarder.yaml — new Scenario schema + optional `scenario` on PlaySummary.
- Regenerated tools/harness-cli forwarder client (Scenario type + field).
Frontend:
- v2-repo.ts — typed `Scenario` interface + `scenario?` on PlaySummary.
- Sessions.vue — scenario() now prefers the server object via scenarioView();
scenarioFromRow() is the rollout fallback (frontend may ship ahead of the
forwarder). Platform/Test facets read scenario-first via rowPlatform/rowTest.
- SessionDetails.vue — add the Platform tile alongside Test/Run ID so the
viewer surfaces the same identity set as the Sessions Scenario cell.
go build/vet/test (forwarder + harness-cli) and vue-tsc all clean.
Part 3 (stamp server/go-live build + manifest variant) tracked in #679.
Closes #678
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Parts 1+2 of #677 (split out as #678). Promotes the run-identity Scenario assembly off the dashboard into the API contract, so the Sessions list, Session Viewer header, and chat tools share one typed shape instead of each re-deriving it client-side (#673 did it inline in
Sessions.vue).Backend (forwarder)
internal/plays/scenario.go—enrichScenario()attaches a nestedscenarioobject to each play row at the singleFindPlayschokepoint (covers both the list andGetPlaySummarydetail paths). Hybrid-sourced:device/player/app/os/contentfrom the authoritative typed summary columns;test/platform/run_idparsed from thetesting=label tier. Omitted entirely (not{}) when a play has no identity fields.scenario_test.go— hybrid sources, omit-when-empty, os-major-only, device-class-only.API
forwarder.yaml— newScenarioschema + optionalscenarioonPlaySummary.tools/harness-cliforwarder client (Scenariotype + field).Frontend
v2-repo.ts— typedScenariointerface +scenario?onPlaySummary.Sessions.vue—scenario()now prefers the server object viascenarioView();scenarioFromRow()is the rollout fallback (frontend may ship ahead of the forwarder — separate deploys). Platform/Test facets read scenario-first viarowPlatform/rowTest.SessionDetails.vue— adds the Platform tile alongside the existing Test/Run ID + device/app/OS tiles, so the viewer surfaces the same identity set as the Sessions Scenario cell.Test
go build/go vet/go testclean (forwarder + harness-cli); new scenario tests pass.vue-tsc --noEmitclean; productionvite buildclean.Rollout note
The
scenarioobject requires a forwarder redeploy (make analytics-rebuild-forwarder) to populate. Until then the frontend falls back to client-side assembly, so nothing regresses if the dashboard deploys first.Follow-up
Part 3 — stamp server/
go-livebuild + manifest variant — tracked in #679 (design-gated).Closes #678
🤖 Generated with Claude Code