@crvouga/atlas 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/reports/src/evidence-detail.js +6 -1
  3. package/dist/reports/src/evidence-types.d.ts +2 -0
  4. package/dist/reports/src/explorer-types.d.ts +19 -0
  5. package/dist/reports/src/latency.d.ts +204 -0
  6. package/dist/reports/src/latency.js +219 -0
  7. package/dist/reports/src/reliability.d.ts +181 -0
  8. package/dist/reports/src/reliability.js +294 -0
  9. package/dist/reports/src/report-index.js +1 -1
  10. package/dist/reports/src/reports-explorer-route.d.ts +19 -6
  11. package/dist/reports/src/reports-route.d.ts +19 -6
  12. package/dist/reports/src/test-catalog.d.ts +11 -3
  13. package/dist/reports/src/test-catalog.js +12 -5
  14. package/dist/schema/src/api.d.ts +377 -0
  15. package/dist/schema/src/api.js +55 -3
  16. package/dist/schema/src/layer.d.ts +90 -0
  17. package/dist/schema/src/layer.js +20 -1
  18. package/dist/server/src/app.js +15 -0
  19. package/dist/server/src/llms.js +1 -0
  20. package/dist/server/src/openapi.js +25 -2
  21. package/docs/extending.md +1 -1
  22. package/docs/reference/http-api.md +48 -0
  23. package/docs/reference/reports.md +619 -1
  24. package/docs/reference/schema.md +39 -0
  25. package/docs/rich-evidence.md +43 -0
  26. package/docs/server.md +18 -0
  27. package/docs/ui.md +20 -1
  28. package/llms-full.txt +130 -2
  29. package/package.json +1 -1
  30. package/packages/schema/schemas/check-detail.schema.json +56 -1
  31. package/packages/schema/schemas/effective-delta.schema.json +86 -2
  32. package/packages/schema/schemas/effective-evidence.schema.json +86 -2
  33. package/packages/schema/schemas/evidence-page.schema.json +13 -0
  34. package/packages/schema/schemas/layer-rows.schema.json +73 -2
  35. package/packages/schema/schemas/layer.schema.json +112 -2
  36. package/packages/schema/schemas/publish-checks.schema.json +56 -1
  37. package/packages/schema/schemas/test-catalog.schema.json +102 -0
  38. package/packages/schema/schemas/test-history.schema.json +204 -0
  39. package/packages/schema/schemas/test-reliability.schema.json +629 -0
  40. package/packages/server/openapi.json +2354 -661
  41. package/packages/visualizer/src/evidence/check-detail.tsx +9 -0
  42. package/packages/visualizer/src/explorer/ProductLatency.tsx +214 -0
  43. package/packages/visualizer/src/explorer/Reliability.tsx +337 -0
  44. package/packages/visualizer/src/explorer/TestDetail.tsx +12 -2
  45. package/packages/visualizer/src/explorer/catalog.tsx +1 -1
  46. package/packages/visualizer/src/explorer/search.ts +36 -0
@@ -10,6 +10,7 @@
10
10
  * `type`, `label`, `branch`, `outcome`, `since` and `until`, so a link to one tab's filters opens the same query on another.
11
11
  */
12
12
  import { joinList, splitList, type ArtifactFilter } from '@crvouga/atlas/reports/artifact-query';
13
+ import type { ReliabilityScope } from '@crvouga/atlas/reports/reliability';
13
14
  import { TEST_SORTS, type TestQuery } from '@crvouga/atlas/reports/test-catalog';
14
15
  import { z } from 'zod/v4';
15
16
 
@@ -71,6 +72,18 @@ export const ExplorerSearchFields = {
71
72
  source: text,
72
73
  /** With `openRun` and `layer`: the one file of that layer (an `artifactRef`: `id:…`, `key:…` or `name:…`) the run's Artifacts select. */
73
74
  artifact: text,
75
+ /** The scope of the open test's reliability figure: environments, producers, branches, `key=value` parameters. */
76
+ relEnv: text,
77
+ relProducer: text,
78
+ relBranch: text,
79
+ relParam: text,
80
+ /** The reliability window, as `since` and `until` (`YYYY-MM-DD`, local time). */
81
+ relSince: text,
82
+ relUntil: text,
83
+ /** `any`: count every spec revision. Otherwise only the current one is counted. */
84
+ relRevision: z.enum(['any']).optional().catch(undefined),
85
+ /** The reliability's independent executions (its denominator) are open. */
86
+ relOpen: z.preprocess((value) => (value === 'true' ? true : value), z.literal(true)).optional().catch(undefined),
74
87
  /** Only the runs, and the results of an opened run, that have a playable video recording. */
75
88
  video: z.preprocess((value) => (value === 'true' ? true : value), z.literal(true)).optional().catch(undefined)
76
89
  };
@@ -102,6 +115,14 @@ export type ExplorerSearch = {
102
115
  readonly layer?: string;
103
116
  readonly source?: string;
104
117
  readonly artifact?: string;
118
+ readonly relEnv?: string;
119
+ readonly relProducer?: string;
120
+ readonly relBranch?: string;
121
+ readonly relParam?: string;
122
+ readonly relSince?: string;
123
+ readonly relUntil?: string;
124
+ readonly relRevision?: 'any';
125
+ readonly relOpen?: true;
105
126
  readonly video?: true;
106
127
  };
107
128
 
@@ -153,6 +174,21 @@ export function narrowed(search: ExplorerSearch): boolean {
153
174
  return !!(search.q || search.status || search.env || search.producer || search.domain || search.spec || search.tag || search.scope || search.artifactTag || search.inRun || search.video);
154
175
  }
155
176
 
177
+ /** The reliability scope an address asks for, in the shape `reliability` reads: days are the viewer's local days. */
178
+ export function reliabilityScopeOf(search: ExplorerSearch): ReliabilityScope {
179
+ const list = (value: string | undefined) => (values(value).length ? values(value) : undefined);
180
+ const parts = {
181
+ environment: list(search.relEnv),
182
+ producer: list(search.relProducer),
183
+ branch: list(search.relBranch),
184
+ parameter: list(search.relParam),
185
+ ...(search.relRevision ? { revision: search.relRevision } : {}),
186
+ since: dayMs(search.relSince, false),
187
+ until: dayMs(search.relUntil, true)
188
+ };
189
+ return Object.fromEntries(Object.entries(parts).filter(([, value]) => value !== undefined)) as ReliabilityScope;
190
+ }
191
+
156
192
  /** The filters of the Runs and Artifacts tabs, in the address. */
157
193
  export const FILTER_FIELDS = ['q', 'artifactTag', 'inherited', 'type', 'label', 'env', 'producer', 'branch', 'outcome', 'domain', 'spec', 'since', 'until', 'video'] as const;
158
194