Repository navigation
DXBRB-569: Add snapshot score CLI commands - #150
Conversation
Add dx snapshots allocationPercentages, csatScores, driverScores, dxiScores, and impactScores list commands. All six score commands, including workflowScores, now share one command factory and renderer with the same filter options and response envelope. Web links default to branch=ALL. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Follow-up API contract audit against get-dx/app master at b40c232d. Found additional fixture/type assumptions beyond the CSAT field; details inline. Please align the score fixtures with the serializers and SQL, then give the fixtures explicit response types (for example, CSAT has no separate not-applicable countPlease remove Impact metadata and scale do not match the appPlease use the actual Speed/Quality metadata and scales here. The built-in definitions use Allocation bucket should be innovation
Driver score and role values are inconsistentPlease align the driver fixture values with the app as well: these three-point counts produce DXI score and visibility are inconsistentThis DXI fixture cannot come from the app: a single contributing driver scored 65 gives a DXI of 65, not 72, because DxiTrends averages the contributing scores. Also, DxiScores computes Benchmark percentiles are numbersThe comment about decimal strings is not supported by the current app contract. BenchmarkFactor stores p50/p75/p90 as integers; driver, impact, and DXI serializers return those integers, and the workflow serializer explicitly calls Workflow fixtures do not match the serializerThis nullable distribution type is correct, but the workflow fixture reused by this refactor still models an impossible response: hidden distribution is |
| satisfied_count: 1, | ||
| very_satisfied_count: 1, | ||
| idk_na_count: 2, | ||
| not_applicable_count: 3, |
There was a problem hiding this comment.
Removed in 5aa3a17. The CSAT distribution is now a concrete type with the five satisfaction counts plus idk_na_count, so an extra key fails typecheck.
| }, | ||
| score: 65, | ||
| distribution: { | ||
| bad_count: 4, |
There was a problem hiding this comment.
may be worth having one of the responses with the 5 pt scale distribution (never-> always) since that will be most common
There was a problem hiding this comment.
Added in 5aa3a17. Deep work is now a 5-point driver (never through always, score 53 from the counts), Code review stays 3-point (score 59), and Documentation is the hidden one. The test asserts both scales render.
| blocks.push(...config.heading(result)); | ||
|
|
||
| if (result.hidden) { | ||
| blocks.push(ui.p(ui.dim("(Hidden)"))); |
There was a problem hiding this comment.
[P3] Explain hidden and unavailable results in human output
The built CLI prints only (Hidden) for a suppressed result and Score: (None) for an all-N/A CSAT result. For a non-technical user those do not explain whether access failed, the command failed, or there were insufficient responses. Please say that hidden results are below the minimum reporting threshold; distinguish an unavailable score due to no scored answers from an empty result set, and suggest checking/broadening filters where appropriate. Keep --json unchanged.
There was a problem hiding this comment.
Done in 5aa3a17. Hidden results now print "Hidden: too few responses to meet the account's minimum reporting threshold." An empty result set prints "No were returned for this snapshot." A visible result with a null score prints "Unavailable (no scored answers)" instead of "(None)". When the user passed any filter flag, both the hidden and empty messages append "Check the filter IDs or broaden the filters." The hint keys on the CLI flags rather than the API echo, so an unrecognized ID still gets it. --json is unchanged.
| label: "Filter workflow scores by team IDs", | ||
| command: | ||
| "dx snapshots workflowScores list --id MjUyNbaY --team-ids MTExNDg5,MTExNDg4", | ||
| label: `Filter ${config.noun} by team IDs`, |
There was a problem hiding this comment.
[P3] Show users how to obtain the IDs required by these commands
The generated --help examples contain sample IDs, but do not tell a first-time user where to get their own snapshot/team/attribute IDs. Please add a short read-only path such as dx snapshots list → dx snapshots snapshotTeams list --id <snapshot_id> → the score command, plus ID discovery guidance for supported filters. The DXI help should also mention its main-branch restriction. This would let someone use these commands without consulting the agent skill or knowing the API already.
There was a problem hiding this comment.
Done in 5aa3a17. Every score command's --help now has a Notes section: snapshot IDs from dx snapshots list, snapshot team IDs from dx snapshots snapshotTeams list --id <snapshot_id>, team IDs from dx teams list, attribute IDs from dx attributeGroups list, branch IDs from dx snapshots settings branches list (snapshots:admin), and group IDs from the web app since there is no CLI or API for them. The notes also explain hidden results. The DXI help adds the main-branch restriction. The skill docs point at the same commands.
|
I recommend removing web links from the score output for this release, including the shared workflow renderer, because the query parameters and ID can be base64 in our CLI but numeric IDs in the UI params. And param names may not match exactly |
Drop web links from all six score commands, including workflowScores, because the web app's filter params and ID encoding differ from the API's. Explain hidden results, empty result sets, and visible results with no scored answers in human output, and hint at the filters when the user passed any. Add help notes on where to find snapshot, team, attribute, and branch IDs, plus the DXI main-branch rule. Align types with the app: numeric benchmark percentiles, concrete CSAT and driver distribution keys, and innovation/ktlo allocation buckets. Rewrite the test fixtures to match the serializers and SQL, with scores that agree with their counts, real target roles and impact scales, and separate visible and hidden responses for workflows and DXI. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Addressed the API contract audit and the web link recommendation in 5aa3a17. Web links are removed from all six score commands, including the shared renderer that Fixtures and types now follow the serializers and SQL, and each fixture uses
|
Summary
Adds five
dx snapshotsscore commands and puts all six, including the existingworkflowScores, on one shared factory and renderer.Every score command takes
--idplus--team-ids,--snapshot-team-ids,--group-ids,--branch-ids, and--attribute-ids, and returns the same{ filters, results }envelope.Each command is a config constant (
DRIVER_SCORES_COMMAND, etc.) with its endpoint, web link section and query, and three small callbacks. Snapshot web links now default tobranch=ALL, matching the app URLs.Also updates the CHANGELOG and the
dx-cliskill docs. The docs site article is intentionally left for a follow-up.Evidence
src/commands/snapshots.test.ts40/40 pass, covering human output with visible and hidden results,--jsonpassthrough, filter forwarding, missing--id, and the DXI empty state.tsc,eslint, andprettier --checkare clean.Merge Danger
Door: two-way
Pure additions plus an internal refactor of
workflowScores. Reverting the commit restores the previous behavior.Blast Radius: small
The only user-visible change to an existing command is the
workflowScoresweb link gainingbranch=ALL. Driver and CSAT distribution labels are mapped from API keys; unknown keys fall back to a humanized label rather than being dropped.🤖 Generated with Claude Code