@crvouga/atlas 1.10.0 → 1.12.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 (51) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/dist/reports/src/review-collection-store.d.ts +47 -0
  3. package/dist/reports/src/review-collection-store.js +214 -0
  4. package/dist/reports/src/review-collection.d.ts +88 -0
  5. package/dist/reports/src/review-collection.js +144 -0
  6. package/dist/reports/src/test-catalog.d.ts +2 -0
  7. package/dist/reports/src/test-catalog.js +1 -1
  8. package/dist/schema/src/api.d.ts +574 -0
  9. package/dist/schema/src/api.js +152 -1
  10. package/dist/server/src/app.js +4 -1
  11. package/dist/server/src/openapi.js +46 -1
  12. package/dist/server/src/review-collections.d.ts +39 -0
  13. package/dist/server/src/review-collections.js +179 -0
  14. package/docs/extending.md +8 -1
  15. package/docs/reference/http-api.md +122 -0
  16. package/docs/reference/reports.md +294 -0
  17. package/docs/reference/schema.md +131 -0
  18. package/docs/reference/server.md +44 -0
  19. package/docs/rich-evidence.md +77 -0
  20. package/docs/server.md +41 -0
  21. package/docs/ui.md +67 -0
  22. package/llms-full.txt +315 -1
  23. package/package.json +1 -1
  24. package/packages/schema/schemas/review-collection.schema.json +398 -0
  25. package/packages/schema/schemas/review-manifest.schema.json +475 -0
  26. package/packages/server/openapi.json +6729 -4084
  27. package/packages/visualizer/src/app/router.tsx +9 -1
  28. package/packages/visualizer/src/evidence/applicability-view.tsx +233 -0
  29. package/packages/visualizer/src/evidence/applicability.test.ts +131 -0
  30. package/packages/visualizer/src/evidence/applicability.ts +241 -0
  31. package/packages/visualizer/src/evidence/artifact-tags.tsx +2 -1
  32. package/packages/visualizer/src/evidence/artifacts.tsx +88 -42
  33. package/packages/visualizer/src/evidence/behavior-panel.tsx +55 -26
  34. package/packages/visualizer/src/evidence/feature-page.tsx +25 -4
  35. package/packages/visualizer/src/evidence/media-timing.test.ts +85 -0
  36. package/packages/visualizer/src/evidence/media-timing.ts +150 -0
  37. package/packages/visualizer/src/evidence/moments.tsx +457 -0
  38. package/packages/visualizer/src/evidence/outcome-summary.tsx +27 -0
  39. package/packages/visualizer/src/evidence/outcome.ts +7 -2
  40. package/packages/visualizer/src/explorer/ArtifactsView.tsx +19 -5
  41. package/packages/visualizer/src/explorer/Explorer.tsx +7 -2
  42. package/packages/visualizer/src/explorer/RecordingTextSearch.tsx +355 -0
  43. package/packages/visualizer/src/explorer/TestDetail.tsx +2 -2
  44. package/packages/visualizer/src/explorer/collection-model.test.ts +31 -0
  45. package/packages/visualizer/src/explorer/collection-model.ts +45 -0
  46. package/packages/visualizer/src/explorer/collections.tsx +513 -0
  47. package/packages/visualizer/src/explorer/playlist-entries.ts +29 -0
  48. package/packages/visualizer/src/explorer/playlist.tsx +164 -37
  49. package/packages/visualizer/src/explorer/recording-text.test.ts +149 -0
  50. package/packages/visualizer/src/explorer/recording-text.ts +490 -0
  51. package/packages/visualizer/src/explorer/search.ts +17 -3
@@ -27,6 +27,7 @@ decided exactly as before ([the report contract](report-contract.md)). Evidence
27
27
  | `attempts` | check | Every try of a retried check, with its own status, detail, steps and attachments. A check that passed after failing is flaky. |
28
28
  | `tags`, `labels` | check, layer | Filters and groups (`smoke`, `flaky`, an owner, a browser). |
29
29
  | `tags` | attachment | Marks one recording or screenshot, for example `demo`: shown as a `#demo` chip, and searchable. See [Tagging artifacts and demos](#tagging-artifacts-and-demos). |
30
+ | `extensions['atlas.media']` | attachment (video) | Where the check's steps are in the recording, so a click on a step seeks the video. See [Place steps in a recording](#place-steps-in-a-recording). |
30
31
  | `scope` | attachment, attempt, check, part, layer | What a recording does and does not show: where it ran, whether data and dependencies were real, whether audio was captured. See [Evidence scope](#evidence-scope). |
31
32
  | `annotations`, `links` | check, step, attempt, layer | Notes, warnings and issue links next to the result. |
32
33
  | `specPath` | check | The spec a check belongs to (a `.feature`, a test file), relative to the repository. Checks are grouped by it. |
@@ -109,6 +110,44 @@ Every field is optional, and every value except the booleans is an open string.
109
110
  - **It decides nothing.** A scope never changes a status, a slot or a winner. A scope an older Atlas cannot read is
110
111
  dropped, and the attachment, check and layer stay.
111
112
 
113
+ ## Place steps in a recording
114
+
115
+ A step says when it started on the check's clock (`offsetMs`, after the check started). A video has its own clock, which
116
+ began when the recorder did, and the two are not assumed to agree: a recorder usually starts before the first step, and a
117
+ paced demo may have delays put into the video that the check never waited for. To let a reviewer click a step and land on
118
+ its moment in the video, say how the clocks relate in the `atlas.media` extension of the video attachment:
119
+
120
+ ```ts
121
+ {
122
+ name: 'checkout.webm', role: 'video', durationMs: 9000,
123
+ extensions: {
124
+ 'atlas.media': {
125
+ checkStartMs: 1200, // the check started 1.2 s into the video
126
+ pauses: [{ atMs: 900, durationMs: 2000, reason: 'title card' }], // 2 s put into the video before the step at +900 ms
127
+ marks: [{ step: 'pay', mediaMs: 4100 }] // a step whose moment in the video you know exactly
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ Every field is optional and none of it decides a status, a slot or a winner. A step is placed at `checkStartMs` + its
134
+ `offsetMs` + the `durationMs` of every pause whose `atMs` is at or before the step; a mark names the moment outright and
135
+ wins. Anything else is unavailable and said so, never guessed.
136
+
137
+ - **Without timing, nothing is placed.** A video with no `atlas.media`, no `checkStartMs`, or a step with no `offsetMs` and
138
+ no mark, is never assumed to start with the check, and a step is never placed from the wording of its name. Selecting
139
+ such a step says why it cannot be shown, and moves nothing.
140
+ - **Outside the video is not clamped.** A moment before the start, or after `durationMs` (or the length the player reports),
141
+ is unavailable. A declaration with a field Atlas cannot read (a pause without a duration) is reported and places nothing.
142
+ - **Pacing is not latency.** A video with `pauses`, or with a `scope` of `pacing: 'paced'`, is labelled as paced: the time
143
+ between its steps includes deliberate pauses and is not application latency, and no measurement is changed by it.
144
+ - **Each try has its own clock.** Put the video and the `atlas.media` of a retry on its `attempts[]` entry, with that
145
+ try's `steps`. A try is aligned only by its own video, never by the check's or an earlier try's.
146
+ - **Link to a moment.** The viewer copies a link that names the run (`layer`), the exact recording (`clip`, its digest or
147
+ stored key) and the position (`clipAt`, milliseconds into the video). Opening it selects that recording of that run, even
148
+ when a newer run exists, and goes to the position; a recording the run does not hold is reported, never replaced.
149
+ - **Older layers.** A layer without `atlas.media` reads exactly as before; the video plays and its steps list as ever.
150
+
112
151
  ## Product latency
113
152
 
114
153
  A test's `durationMs` includes fixture setup, deliberate waits, demo pacing, retries and cleanup, so it says how long the
@@ -183,6 +222,44 @@ curl "$ATLAS_SERVER_URL/api/reports/artifacts?artifactTag=demo&type=video&domain
183
222
  **live query**: opening it asks again and shows what matches the newest report. It is not a snapshot; an immutable
184
223
  review collection is a separate feature. *Copy link* gives the address, which holds the whole query.
185
224
 
225
+ ## Words in recordings
226
+
227
+ A reviewer who remembers a phrase that was spoken or shown in a video can search for it on the **Artifacts** tab
228
+ (**Search inside recordings**, the `inside` address parameter). Atlas never transcribes video or reads a screen: it
229
+ searches text you attach, and nothing is read from a recording until words are typed. Attach it beside the video, at the
230
+ same level (the check, or the retry attempt that recorded the video):
231
+
232
+ ```ts
233
+ attachments: [
234
+ { id: 'video', name: 'checkout.webm', contentType: 'video/webm', data: video },
235
+ // Spoken words: WebVTT, SubRip, JSON segments or plain text.
236
+ { name: 'checkout.vtt', role: 'transcript', contentType: 'text/vtt', data: transcript,
237
+ extensions: { 'atlas.text': { recording: 'video', generated: true, generator: 'my-speech-tool' } } },
238
+ // Text shown on screen, with its own timing.
239
+ { name: 'screen.json', role: 'ocr', contentType: 'application/json', data: JSON.stringify({ segments: [{ start: 2, end: 4, text: 'Order total', confidence: 0.9 }] }) }
240
+ ]
241
+ ```
242
+
243
+ - **Which attachment is text.** One with `extensions["atlas.text"]`, a `role` of `transcript`, `ocr`, `screen-text`,
244
+ `captions` or `subtitles`, or a WebVTT or SubRip type. `extensions["atlas.text"].kind` (`speech`, `screen`, `caption`)
245
+ says what it is; otherwise the role does. It belongs to the video that lists its `id` in `captions`, or that
246
+ `extensions["atlas.text"].recording` names by `id`, else to the only video at the same level.
247
+ - **Segments.** WebVTT and SubRip cues; JSON as `{ "segments": [...] }` (or `cues`, `results`, `lines`, or a bare list) of
248
+ `{ text, start, end }` in seconds or `{ text, startMs, endMs }`, with an optional `confidence` between 0 and 1. A
249
+ segment whose time is missing or invalid is still searched and is shown with no time; the viewer offers the recording
250
+ and says seeking is unavailable, and never guesses a moment.
251
+ - **Honesty about the text.** `generated: true` (with `generator`) marks text a tool produced; results show it with its
252
+ confidence and say it may contain errors. A result always shows the indexed words, never a reworded quotation. A
253
+ match finds a moment; it is not a new assertion, and the result's own outcome and the retry attempt stay beside it.
254
+ - **States are different things.** Searched with no match; not indexed (no text was supplied); unsupported (the video is
255
+ silent by its `scope.audioCaptured: false`, or the text is in a form that is not read, or sits at a `uri`); failed
256
+ (`extensions["atlas.text"].state: "failed"` with a `reason`, a file left out with `omitted`, or text that did not
257
+ parse). The ones not searched are listed apart and never counted as "no match".
258
+ - **Access.** The text is read through the same report API, and so the same access rules, that play the recording. A file
259
+ the viewer may not read is not indexed and appears in no snippet or count. The index exists only in the open page: there
260
+ is no stored or cross-project index. Sending evidence to a transcription or OCR service is the producer's explicit
261
+ decision and happens outside Atlas.
262
+
186
263
  ## Labels describe, parameters split
187
264
 
188
265
  A result's **slot** is its producer, check id, part kind, spec, environment and **parameters**. The newest completed
package/docs/server.md CHANGED
@@ -335,6 +335,37 @@ edit, and the server's time. Nothing about the layer, its results or the report'
335
335
  See [Tagging artifacts and demos](rich-evidence.md#tagging-artifacts-and-demos) for the tag rules. Reviewer tags are
336
336
  shown in the viewer's evidence; the tests API (`artifactTag`) searches the producers' tags.
337
337
 
338
+ ## Review collections
339
+
340
+ A team can publish a named, curated review of a few behaviors: recordings from several explicit executions, notes on
341
+ what each is for, and the gaps nobody recorded yet. A **review collection** is kept beside the report under
342
+ `curation/review-collections/` (never as a layer, a check or a run), so it cannot pass or fail anything, decides no
343
+ slot or winner, and never claims its entries are one execution: every entry keeps the layer, run, commit, environment and
344
+ status it was recorded with.
345
+
346
+ - **Freeze.** `POST /api/reports/review-collections` (publish) takes a title, optional `purpose`, `audience` and `tags`
347
+ (such as `demo`), the ordered `entries` (`layer` and `check` from `GET /api/reports/artifacts`, optionally `kind`
348
+ and one `recording`, and a `caption`) and optional `gaps`. The viewer's **Freeze as review collection** button on the
349
+ Artifacts tab sends the filtered set as it is listed. The server resolves each entry to the result it holds and
350
+ records what the report says about it; an entry it cannot resolve refuses the whole request (`422`, naming the entry).
351
+ The order is the curator's: a failed, retried or incomplete result stays beside a later passing replay, each with its
352
+ own status, time and tries.
353
+ - **Immutable.** A revision is never changed or deleted by the server. Later runs and changed tags do not alter it. To
354
+ change a collection, publish a new revision with `basedOn: { id, revision }` naming the newest (`409` otherwise); older
355
+ revisions stay readable (`?revision=`).
356
+ - **Notes and marks** (`POST .../review-collections/reviews`, publish) are separate immutable records with the token's name
357
+ and the time: a `note`, a `gap` note (optionally at a `timecodeMs` of the entry's recording), `reviewed` and `unreviewed`.
358
+ They are curation: they change no outcome, layer or winner, and a reviewed mark is not an acceptance sign-off.
359
+ - **When a source goes away** (`GET .../review-collections/detail`) the entry stays where it was with its frozen snapshot
360
+ and an `availability` of `unavailable` (its layer is gone, for example collected) or `unverified` (held, but the report
361
+ no longer lists it), with the reason. Nothing is removed or replaced.
362
+ - **Sharing** adds no access. The share URL is the viewer's `?tab=collections&collection=<id>`; reading needs the same
363
+ read access as the report, and a visitor can Read, Watch and Inspect only what the attachment routes already allow them.
364
+ Nothing is public by default.
365
+ - **Export.** `GET .../review-collections/export` is a portable manifest: the exact sources, each file with its recorded
366
+ name, a safe name and path, its `sha256` when the report holds one (`null` is unknown, not verified), and every missing
367
+ source or file. It holds no bytes. `capabilities.reviewCollections` on `/api/server` says a server has all this.
368
+
338
369
  ## Streaming
339
370
 
340
371
  `GET /api/events` is a server-sent-events stream:
@@ -475,6 +506,16 @@ curl "$ATLAS_SERVER_URL/api/projects/$ATLAS_PROJECT/reports/tests?format=markdow
475
506
  | `GET /api/projects/{project}/reports/artifact-tags` | read | Reviewer tags of attachments: every recorded edit. |
476
507
  | `POST /api/reports/artifact-tags` | publish | Tag or untag one attachment after upload. |
477
508
  | `POST /api/projects/{project}/reports/artifact-tags` | publish | Tag or untag one attachment after upload. |
509
+ | `GET /api/reports/review-collections` | read | Review collections: curated sets of recordings, newest first. |
510
+ | `GET /api/projects/{project}/reports/review-collections` | read | Review collections: curated sets of recordings, newest first. |
511
+ | `POST /api/reports/review-collections` | publish | Publish an immutable review collection (or a new revision of one). |
512
+ | `POST /api/projects/{project}/reports/review-collections` | publish | Publish an immutable review collection (or a new revision of one). |
513
+ | `GET /api/reports/review-collections/detail` | read | One review collection revision with how its sources stand now. |
514
+ | `GET /api/projects/{project}/reports/review-collections/detail` | read | One review collection revision with how its sources stand now. |
515
+ | `POST /api/reports/review-collections/reviews` | publish | Add a note, a time-coded gap note or a reviewed mark to a collection entry. |
516
+ | `POST /api/projects/{project}/reports/review-collections/reviews` | publish | Add a note, a time-coded gap note or a reviewed mark to a collection entry. |
517
+ | `GET /api/reports/review-collections/export` | read | Portable index (manifest) of one review collection revision. |
518
+ | `GET /api/projects/{project}/reports/review-collections/export` | read | Portable index (manifest) of one review collection revision. |
478
519
  | `GET /api/reports/runs` | read | The runs that recorded the report. |
479
520
  | `GET /api/projects/{project}/reports/runs` | read | The runs that recorded the report. |
480
521
  | `GET /api/reports/artifacts` | read | Recorded results that carry evidence, across the whole history. |
package/docs/ui.md CHANGED
@@ -82,6 +82,15 @@ when Watch is on screen.
82
82
  - The promise's revision (the spec's fingerprint now) and the evidence's revision (the fingerprint the layer recorded)
83
83
  are shown separately. A known difference demotes a recording to "Recording is older" with an alert; a missing
84
84
  fingerprint is "not recorded", never a match.
85
+ - Whether the evidence applies is a separate reading (`evidence/applicability.ts`), shown on Watch and Inspect and as a
86
+ row badge when it is stale (or unknown against a named release): `applies`, `stale` (an earlier promise or another
87
+ build), `unknown`, or `none`. It never changes a status or a coverage state. Age is when the checks ran
88
+ (`recordedAtMs`), never when the layer was uploaded or annotated. A release is named in the address (`release` build,
89
+ `releaseSha`, `releasePlatform`); a branch name or a passing run never supplies one. Another platform, a missing
90
+ build or commit, or a checkout with local changes (`freshness`) is `unknown`, never an exact match. Producers say
91
+ what they know with labels: `build`, `platform`, and `applies-to` with `applies-to-by` (the policy that asserts the
92
+ evidence still holds for those builds; without it the assertion is refused). The "Stale or unverified" filter
93
+ (`evidence=stale`) lists every behavior whose evidence does not apply, including those with none.
85
94
  - A recording is always labelled illustrative: it shows one run and does not approve a behavior for production.
86
95
  `demo`/`representative` tags only add a "Representative demo" label.
87
96
  - The spec index searches titles, paths and declared domains, and can group by the domain from spec metadata (specs with
@@ -141,6 +150,64 @@ over the same filtered set the page lists, in the same order (`explorer/playlist
141
150
  (paced, scripted, silent, synthetic) and the sentence that the length is the recording's, not production latency. Developer
142
151
  details opens the test pinned to that run's record and closes the playlist.
143
152
 
153
+ ## Steps and moments in a recording
154
+
155
+ Wherever a result's steps sit beside its recording (a result's Timeline under Inspect, the Watch tab of a behavior, an
156
+ opened watch playlist), `evidence/moments.tsx` joins them. Placement is from the recording's own declared timing
157
+ (`evidence/media-timing.ts`, the `atlas.media` extension; see [Place steps in a recording](rich-evidence.md#place-steps-in-a-recording)),
158
+ never from an assumption that the recording starts with the check.
159
+
160
+ - A step has a "Recording m:ss.s" button that seeks the selected recording; the step's test-clock offset stays visible beside it.
161
+ A step that cannot be placed (no timing, no origin, no offset, outside the recording, unreadable declaration) is "Not aligned"
162
+ and selecting it states the reason in a status alert. Nothing is guessed and the video is not moved.
163
+ - While playing, the step under the playhead gets `aria-current="step"` and "Playing now". It never moves focus, scrolls
164
+ the page or announces itself. Seeking only scrolls the player into view.
165
+ - A paced recording (pauses declared, or a `pacing: paced` scope) says that gaps between steps include deliberate pauses and are
166
+ not application latency.
167
+ - A failed step has "Jump to the failing moment" in the bar above the timeline, and the failure summary has the same action
168
+ (`requestFailureMoment`). If the recording is not on screen, or the step cannot be placed, it says so.
169
+ - "Copy link to this moment" names the run (`layer`), the exact recording (`clip`) and the position (`clipAt`, ms), as the
170
+ explorer address `/?test=…&layer=…&clip=…&clipAt=…` (the playlist links to the result it is playing). Opening it selects that
171
+ recording of that exact run and seeks once the player knows its length; a position past the end or a recording that the run
172
+ does not hold is reported and nothing else is played in its place. If the browser refuses to copy, the link is shown to copy.
173
+ - One provider serves one holder: the check, or one try. A try's steps are placed by that try's recording and timing only.
174
+
175
+ ## Review collections
176
+
177
+ The **Collections** tab (`explorer/collections.tsx`, `?tab=collections&collection=<id>&rev=<n>`) lists and opens review
178
+ collections, and the Artifacts tab's **Freeze as review collection** button (a Mantine `Modal`) freezes the filtered set as it is
179
+ listed. A collection is curation, not a test run (`@crvouga/atlas/reports/review-collection`, `docs/server.md#review-collections`).
180
+
181
+ - The page never shows one status for the whole collection. Every entry shows the status it was **recorded** with ("Failed as
182
+ recorded"), its time, run, commit, layer and tries in order, so entries from several runs are never read as one execution; the
183
+ note at the top says how many runs they come from. The order is the curator's: a failed or incomplete take stays beside a
184
+ later passing replay and is never collapsed to the newest pass.
185
+ - A revision is frozen. Opening an older revision says a newer one exists; a change is a new revision, never an edit.
186
+ - An entry whose source is gone (`unavailable`) or cannot be checked (`unverified`) stays in its place with the reason and
187
+ what it was when frozen, and its recording says it is not available. Nothing is removed or replaced.
188
+ - Notes, time-coded gap notes (`m:ss`, or seconds; a mistake is said, not guessed) and the **Reviewed** switch are separate
189
+ records with who and when. They change no outcome and the page says a mark is not an approval. Writing needs a token that
190
+ may publish, held only in this tab; a read-only visitor is refused with the server's reason and can still Read, Watch and
191
+ Inspect. **Download manifest** is the portable index; the share link adds no access.
192
+
193
+ ## Search inside recordings
194
+
195
+ The Artifacts tab has a **Search inside recordings** section (`explorer/RecordingTextSearch.tsx`; words in `inside`). It
196
+ applies the shared matcher (`find/`) to the transcript, caption and screen-text segments producers attached
197
+ (`explorer/recording-text.ts`; format in [rich evidence](rich-evidence.md#words-in-recordings)), so phrases, close
198
+ spellings, meaning and typed filters (`status:failed`) behave as in every search box.
199
+
200
+ - Nothing is read until words are typed; then each listed result's evidence and text files are read a few at a time
201
+ through the report API (the same access rules as playing the recording). The video is never read. A file the viewer
202
+ may not read is not indexed and is reported as not searched, never counted or quoted. There is no stored index.
203
+ - A result shows the indexed words exactly as indexed, why it matched (exact, close spelling, meaning), the source (spoken,
204
+ on screen, caption), generated text with its generator, confidence and a warning, the time range, the owning result and
205
+ retry attempt, and the result's own outcome. A match is never described as the behavior passing.
206
+ - "No match" is only said about searched recordings. Recordings with no text (`Not indexed`), silent or unsupported ones
207
+ and unreadable text (`Failed`) are counted separately and listed under **Recordings that were not searched**.
208
+ - A result opens the playlist on that result, that attempt's video and, when its time is usable and reachable, that time.
209
+ With no usable time the recording opens at its start and a note says seeking is unavailable.
210
+
144
211
  ## Icons and notation marks
145
212
 
146
213
  Use named imports from `@tabler/icons-react` for all UI glyphs. The icon package supplies SVG paths;