reflection-check 0.0.2 → 0.0.4
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.
- package/dist/cli.js +11 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts +2 -1
- package/dist/commands/doctor.js +109 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.js +59 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/run.js +1 -2
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/update.js +5 -0
- package/dist/commands/update.js.map +1 -1
- package/dist/contracts/browser/browser-contract.d.ts +2 -1
- package/dist/contracts/browser/browser-contract.js +2 -1
- package/dist/contracts/browser/browser-contract.js.map +1 -1
- package/dist/contracts/browser/route-runner.d.ts +6 -0
- package/dist/contracts/browser/route-runner.js +42 -1
- package/dist/contracts/browser/route-runner.js.map +1 -1
- package/dist/contracts/component/component-visual-contract.d.ts +9 -0
- package/dist/contracts/component/component-visual-contract.js +49 -3
- package/dist/contracts/component/component-visual-contract.js.map +1 -1
- package/dist/core/config.d.ts +21 -0
- package/dist/core/config.js +23 -2
- package/dist/core/config.js.map +1 -1
- package/dist/core/report-schema.d.ts +11 -10
- package/dist/core/report-schema.js +47 -1
- package/dist/core/report-schema.js.map +1 -1
- package/dist/core/target-ir.d.ts +5 -0
- package/dist/core/target-ir.js +2 -0
- package/dist/core/target-ir.js.map +1 -1
- package/dist/integrations/playwright/context-factory.d.ts +3 -2
- package/dist/integrations/playwright/context-factory.js +6 -3
- package/dist/integrations/playwright/context-factory.js.map +1 -1
- package/docs/agent-workflows.md +13 -5
- package/docs/browser-contract.md +31 -0
- package/docs/ci.md +11 -1
- package/docs/configuration.md +47 -0
- package/docs/getting-started.md +17 -3
- package/docs/plans/reflection-dogfood-feedback-implementation-guide.md +100 -86
- package/docs/target-ir-and-adapters.md +2 -2
- package/docs/validation-process.md +16 -7
- package/docs/visual-contract.md +16 -1
- package/package.json +1 -1
package/docs/browser-contract.md
CHANGED
|
@@ -30,12 +30,22 @@ browser: {
|
|
|
30
30
|
reuseExisting: true,
|
|
31
31
|
timeoutMs: 60_000
|
|
32
32
|
},
|
|
33
|
+
setup: {
|
|
34
|
+
localStorage: {
|
|
35
|
+
'reflection:test-mode': 'enabled'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
33
38
|
maskSelectors: ['[data-reflection-mask]'],
|
|
34
39
|
routes: [
|
|
35
40
|
{
|
|
36
41
|
id: 'login',
|
|
37
42
|
path: '/login',
|
|
38
43
|
viewports: ['desktop', 'mobile'],
|
|
44
|
+
setup: {
|
|
45
|
+
sessionStorage: {
|
|
46
|
+
'reflection:login-state': 'ready'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
39
49
|
expects: [
|
|
40
50
|
{ role: 'heading', name: 'Login' },
|
|
41
51
|
{ label: 'Email' },
|
|
@@ -51,6 +61,27 @@ browser: {
|
|
|
51
61
|
}
|
|
52
62
|
```
|
|
53
63
|
|
|
64
|
+
## Route setup for authenticated fixtures
|
|
65
|
+
|
|
66
|
+
Use `setup.localStorage` and `setup.sessionStorage` to seed non-secret test state before Reflection navigates to a route:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
routes: [
|
|
70
|
+
{
|
|
71
|
+
id: 'authenticated-home',
|
|
72
|
+
path: '/',
|
|
73
|
+
setup: {
|
|
74
|
+
localStorage: {
|
|
75
|
+
'reflection:test-user': 'fixture-user'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
expects: [{ text: 'Welcome fixture-user' }]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Browser-level setup applies to every route, and route-level setup extends or overrides it. Reflection records only setup key names in metadata so reports show that setup ran without logging values. Keep real credentials and production session values out of committed config; prefer test-mode auth or mock fixture tokens.
|
|
84
|
+
|
|
54
85
|
## Expectations
|
|
55
86
|
|
|
56
87
|
| Expectation | Use for |
|
package/docs/ci.md
CHANGED
|
@@ -4,8 +4,18 @@ Reflection is designed to be safe in CI: runs create evidence artifacts, but the
|
|
|
4
4
|
|
|
5
5
|
## Recommended command
|
|
6
6
|
|
|
7
|
+
Install Reflection in the consuming repository:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add -D reflection-check
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then run the CI evidence loop:
|
|
14
|
+
|
|
7
15
|
```bash
|
|
16
|
+
reflection doctor --config reflection.config.ts
|
|
8
17
|
reflection run --ci --config reflection.config.ts --mode smoke
|
|
18
|
+
reflection review --report-dir artifacts/reflection --json
|
|
9
19
|
```
|
|
10
20
|
|
|
11
21
|
When `--ci` is enabled and `--report-dir` is not provided, Reflection writes artifacts to:
|
|
@@ -41,4 +51,4 @@ artifacts/reflection/runs/latest
|
|
|
41
51
|
|
|
42
52
|
## GitHub Actions example
|
|
43
53
|
|
|
44
|
-
See `.github/workflows/reflection.yml` for a repo-owned example that installs dependencies, builds Reflection, runs `reflection run --ci`,
|
|
54
|
+
See `.github/workflows/reflection.yml` for a repo-owned example that installs dependencies, builds Reflection, runs `reflection run --ci`, reviews `artifacts/reflection`, and uploads the report root for inspection.
|
package/docs/configuration.md
CHANGED
|
@@ -59,6 +59,11 @@ browser: {
|
|
|
59
59
|
reuseExisting: true,
|
|
60
60
|
timeoutMs: 60_000
|
|
61
61
|
},
|
|
62
|
+
setup: {
|
|
63
|
+
localStorage: {
|
|
64
|
+
'reflection:test-mode': 'enabled'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
62
67
|
maskSelectors: ['[data-reflection-mask]'],
|
|
63
68
|
routes: [
|
|
64
69
|
{
|
|
@@ -66,6 +71,11 @@ browser: {
|
|
|
66
71
|
name: 'Home route',
|
|
67
72
|
path: '/',
|
|
68
73
|
viewports: ['desktop', 'mobile'],
|
|
74
|
+
setup: {
|
|
75
|
+
sessionStorage: {
|
|
76
|
+
'reflection:route-state': 'ready'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
69
79
|
expects: [
|
|
70
80
|
{ role: 'heading', name: 'Home' },
|
|
71
81
|
{ noHorizontalOverflow: true },
|
|
@@ -96,10 +106,26 @@ Browser fields:
|
|
|
96
106
|
| `blocking` | Defaults to `true`; route assertion failures are blocking unless configured otherwise by current runner behavior. |
|
|
97
107
|
| `baseUrl` | Absolute URL used to visit route paths. |
|
|
98
108
|
| `server` | Optional managed server. If omitted, Reflection assumes `baseUrl` is already reachable. |
|
|
109
|
+
| `setup` | Optional browser-level storage setup applied before route navigation. Values are not written to report metadata. |
|
|
99
110
|
| `maskSelectors` | Selectors masked in browser screenshots. |
|
|
100
111
|
| `routes` | Route assertions executed in `smoke` and `full` modes. |
|
|
101
112
|
| `visualSmoke` | Route screenshot baseline comparisons driven from successful browser screenshots. |
|
|
102
113
|
|
|
114
|
+
Route setup fields:
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
setup: {
|
|
118
|
+
localStorage: {
|
|
119
|
+
'reflection:test-user': 'fixture-user'
|
|
120
|
+
},
|
|
121
|
+
sessionStorage: {
|
|
122
|
+
'reflection:test-session': 'fixture-session'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Browser-level setup applies to every route. Route-level setup extends or overrides browser-level keys for that route. Reflection records only storage key names in metadata, never storage values. Use this for non-secret test-mode state, mock auth, or local fixture tokens. Do not commit real credentials or production session values in config.
|
|
128
|
+
|
|
103
129
|
Supported browser expectations:
|
|
104
130
|
|
|
105
131
|
```ts
|
|
@@ -175,6 +201,12 @@ component: {
|
|
|
175
201
|
id: 'primary-button',
|
|
176
202
|
storyId: 'atoms-button--primary',
|
|
177
203
|
viewport: 'component',
|
|
204
|
+
viewportSize: { width: 390, height: 220 },
|
|
205
|
+
framing: {
|
|
206
|
+
background: '#ffffff',
|
|
207
|
+
align: 'center',
|
|
208
|
+
padding: 0
|
|
209
|
+
},
|
|
178
210
|
baselineRoot: 'tests/fixtures/baselines',
|
|
179
211
|
baseline: 'components/button/primary.chromium-linux.light.png',
|
|
180
212
|
threshold: { maxDiffPixelRatio: 0.005 },
|
|
@@ -197,6 +229,21 @@ component: {
|
|
|
197
229
|
|
|
198
230
|
Component visual cases resolve Storybook `/index.json`, open the story iframe, capture an actual screenshot, and compare it against the configured baseline.
|
|
199
231
|
|
|
232
|
+
`viewport` accepts the built-in presets (`desktop`, `tablet`, `mobile`, `component`) and any custom string label. When `viewportSize` is provided, Reflection captures the Storybook iframe at that exact `{ width, height }` instead of resolving the string preset. Use this for exported Figma baselines: the PNG dimensions must match `viewportSize` exactly or the check fails with `visual-dimension-mismatch`.
|
|
233
|
+
|
|
234
|
+
`framing` lets a component visual case normalize the Storybook canvas before the screenshot:
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
framing: {
|
|
238
|
+
rootSelector: '#storybook-root',
|
|
239
|
+
background: '#ffffff',
|
|
240
|
+
align: 'center',
|
|
241
|
+
padding: 0
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Use it when the approved baseline is a fixed Figma frame: `background` should match the Figma frame fill, `align: 'center'` centers the story root content, and `padding` reserves explicit frame padding. `rootSelector` defaults to `#storybook-root`.
|
|
246
|
+
|
|
200
247
|
Pseudo-state policy:
|
|
201
248
|
|
|
202
249
|
- Prefer story-controlled variants for hover, focus, active, selected, open, and disabled states.
|
package/docs/getting-started.md
CHANGED
|
@@ -20,6 +20,14 @@ pnpm exec reflection doctor
|
|
|
20
20
|
|
|
21
21
|
The package install exposes both `reflection` and `reflection-check` binaries. The docs use `reflection` as the primary command.
|
|
22
22
|
|
|
23
|
+
You can preview the setup Reflection would suggest without writing files:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm exec reflection init --dry-run --preset vite-react
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`init --dry-run` prints proposed install commands, config, and script guidance. It is read-only; creating or updating files still happens manually.
|
|
30
|
+
|
|
23
31
|
For local tarball testing before a registry publish, create and install a packed artifact instead.
|
|
24
32
|
|
|
25
33
|
From the Reflection repository:
|
|
@@ -84,18 +92,24 @@ reflection run --config reflection.config.ts --mode smoke
|
|
|
84
92
|
reflection review --latest
|
|
85
93
|
```
|
|
86
94
|
|
|
95
|
+
Pass the config to `doctor` when you want a read-only preflight of the consuming repository setup:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
reflection doctor --config reflection.config.ts
|
|
99
|
+
```
|
|
100
|
+
|
|
87
101
|
During Reflection development, use the built CLI:
|
|
88
102
|
|
|
89
103
|
```bash
|
|
90
104
|
pnpm build
|
|
91
|
-
node dist/cli.js doctor
|
|
105
|
+
node dist/cli.js doctor --config examples/basic-react/reflection.config.ts
|
|
92
106
|
node dist/cli.js run --config examples/basic-react/reflection.config.ts --mode smoke
|
|
93
107
|
node dist/cli.js review --latest
|
|
94
108
|
```
|
|
95
109
|
|
|
96
110
|
`reflection run` writes reports and artifacts under `.reflection/runs/<run-id>/` by default.
|
|
97
111
|
|
|
98
|
-
`reflection doctor`
|
|
112
|
+
`reflection doctor --config` validates that the config can be loaded, summarizes enabled contracts and server settings, checks local runtime readiness, and does not start servers or mutate baselines. Use `--check-server` when you explicitly want it to probe the configured server `readyUrl` without starting the server.
|
|
99
113
|
|
|
100
114
|
Important files:
|
|
101
115
|
|
|
@@ -147,7 +161,7 @@ Use Reflection as the UI evidence gate before claiming frontend work is complete
|
|
|
147
161
|
Run:
|
|
148
162
|
|
|
149
163
|
```bash
|
|
150
|
-
reflection doctor
|
|
164
|
+
reflection doctor --config reflection.config.ts
|
|
151
165
|
reflection run --config reflection.config.ts --mode smoke
|
|
152
166
|
reflection review --json
|
|
153
167
|
```
|
|
@@ -18,8 +18,8 @@ This guide must be updated during implementation:
|
|
|
18
18
|
- Record timestamps on phase completions for velocity tracking.
|
|
19
19
|
- Update the test coverage map as tests are written.
|
|
20
20
|
|
|
21
|
-
**Last updated:** 2026-06-
|
|
22
|
-
**Current phase:**
|
|
21
|
+
**Last updated:** 2026-06-02
|
|
22
|
+
**Current phase:** Complete
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -109,7 +109,7 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
109
109
|
|
|
110
110
|
**Goal:** Fix the Sourcer-discovered limitation where missing-baseline dry-run/update could not promote the current actual screenshot.
|
|
111
111
|
**Depends on:** Current `0.0.1` package shape
|
|
112
|
-
**Status:** Complete in working tree
|
|
112
|
+
**Status:** Complete in working tree; full package validation passed. The combined release candidate is now `reflection-check@0.0.3`, and `npm publish --dry-run --access public` passes.
|
|
113
113
|
|
|
114
114
|
#### Inputs
|
|
115
115
|
|
|
@@ -157,10 +157,10 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
157
157
|
#### Patch Exit Criteria
|
|
158
158
|
|
|
159
159
|
- [x] Focused visual/update tests pass.
|
|
160
|
-
- [
|
|
161
|
-
- [
|
|
160
|
+
- [x] Full validation passes.
|
|
161
|
+
- [x] Version bumped for patch release.
|
|
162
162
|
- [ ] Sourcer verifies first login baseline dry-run against the patched package.
|
|
163
|
-
- [
|
|
163
|
+
- [x] Guide updated with publish outcome.
|
|
164
164
|
|
|
165
165
|
#### Failure Protocol
|
|
166
166
|
|
|
@@ -174,16 +174,16 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
174
174
|
|
|
175
175
|
### Phase 1: Useful `doctor --config`
|
|
176
176
|
|
|
177
|
-
**Goal:** Turn `doctor` from a
|
|
177
|
+
**Goal:** Turn `doctor` from a shallow status command into a real read-only preflight for consuming repos.
|
|
178
178
|
**Depends on:** Current `0.0.1` package shape
|
|
179
|
-
**Status:**
|
|
179
|
+
**Status:** Complete
|
|
180
180
|
|
|
181
181
|
#### Inputs
|
|
182
182
|
|
|
183
183
|
- Existing `src/commands/doctor.ts`.
|
|
184
184
|
- Existing config loader in `src/core/config.ts`.
|
|
185
185
|
- Server readiness behavior in `src/core/server-manager.ts`.
|
|
186
|
-
- Sourcer feedback: doctor
|
|
186
|
+
- Sourcer feedback: doctor previously only printed a one-line status message.
|
|
187
187
|
|
|
188
188
|
#### Outputs
|
|
189
189
|
|
|
@@ -205,38 +205,45 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
205
205
|
|
|
206
206
|
#### Tasks
|
|
207
207
|
|
|
208
|
-
- [
|
|
208
|
+
- [x] Add failing unit tests for valid config, missing config, invalid config, and config summary output.
|
|
209
209
|
- **Tool:** edit
|
|
210
210
|
- **Verify:** `pnpm exec vitest run tests/unit/doctor-command.test.ts`
|
|
211
211
|
|
|
212
|
-
- [
|
|
212
|
+
- [x] Implement config-aware doctor output.
|
|
213
213
|
- **Tool:** edit
|
|
214
214
|
- **Verify:** focused doctor tests pass.
|
|
215
215
|
|
|
216
|
-
- [
|
|
216
|
+
- [x] Add runtime checks that do not mutate or start target state unexpectedly.
|
|
217
217
|
- **Tool:** edit
|
|
218
218
|
- **Verify:** tests cover Playwright/package readiness and safe server summary.
|
|
219
219
|
|
|
220
|
-
- [
|
|
220
|
+
- [x] Update docs to describe doctor as a config-aware preflight.
|
|
221
221
|
- **Tool:** edit
|
|
222
|
-
- **Verify:**
|
|
222
|
+
- **Verify:** stale doctor wording search returns no matches in active docs, source, or tests.
|
|
223
|
+
|
|
224
|
+
#### Implementation Notes
|
|
225
|
+
|
|
226
|
+
- `reflection doctor --config` now validates config presence/import/schema and exits with `ExitCode.ToolOrConfigError` for invalid config.
|
|
227
|
+
- `doctor` reports Node version, Playwright package readiness, Chromium executable presence when available, enabled contract counts, base URL, and server configuration.
|
|
228
|
+
- Doctor remains read-only: it does not start configured servers, mutate baselines, or write reports.
|
|
229
|
+
- Added `--check-server` for an explicit one-shot `readyUrl` probe without starting the server.
|
|
223
230
|
|
|
224
231
|
#### Tests for This Phase
|
|
225
232
|
|
|
226
233
|
| Test Type | What to Test | Exists? | Path / Command |
|
|
227
234
|
|---|---|---|---|
|
|
228
|
-
| Unit | Doctor config success/failure summaries |
|
|
229
|
-
| CLI | `reflection doctor --config` exit behavior |
|
|
235
|
+
| Unit | Doctor config success/failure summaries | Yes | `tests/unit/doctor-command.test.ts` |
|
|
236
|
+
| CLI | `reflection doctor --config` exit behavior | Yes | `tests/unit/cli.test.ts` |
|
|
230
237
|
| Type safety | Doctor options/types | Auto | `pnpm typecheck` |
|
|
231
238
|
| Package smoke | Installed CLI can run doctor | Yes | `pnpm smoke:package` |
|
|
232
239
|
|
|
233
240
|
#### Phase Exit Criteria
|
|
234
241
|
|
|
235
|
-
- [
|
|
236
|
-
- [
|
|
237
|
-
- [
|
|
238
|
-
- [
|
|
239
|
-
- [
|
|
242
|
+
- [x] `doctor --config` reports meaningful setup information.
|
|
243
|
+
- [x] Invalid config exits non-zero with actionable error.
|
|
244
|
+
- [x] Docs match behavior.
|
|
245
|
+
- [x] `pnpm test`, `pnpm typecheck`, `pnpm smoke:package` pass.
|
|
246
|
+
- [x] Guide updated with completion status.
|
|
240
247
|
|
|
241
248
|
#### Failure Protocol
|
|
242
249
|
|
|
@@ -252,7 +259,7 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
252
259
|
|
|
253
260
|
**Goal:** Support authenticated app smoke tests without Sourcer-specific hacks.
|
|
254
261
|
**Depends on:** Phase 1
|
|
255
|
-
**Status:**
|
|
262
|
+
**Status:** Complete
|
|
256
263
|
|
|
257
264
|
#### Inputs
|
|
258
265
|
|
|
@@ -262,7 +269,7 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
262
269
|
|
|
263
270
|
#### Outputs
|
|
264
271
|
|
|
265
|
-
- Config schema supports
|
|
272
|
+
- Config schema supports browser-level and route-level `setup.localStorage` / `setup.sessionStorage`.
|
|
266
273
|
- Route runner applies setup before visiting a route.
|
|
267
274
|
- Metadata records that setup was applied without logging sensitive values.
|
|
268
275
|
- Docs include examples for non-secret test tokens and mock/test-mode auth.
|
|
@@ -280,38 +287,45 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
280
287
|
|
|
281
288
|
#### Tasks
|
|
282
289
|
|
|
283
|
-
- [
|
|
290
|
+
- [x] Design the smallest setup API and document rejected alternatives.
|
|
284
291
|
- **Tool:** research/edit guide
|
|
285
292
|
- **Verify:** decision recorded before implementation.
|
|
286
293
|
|
|
287
|
-
- [
|
|
294
|
+
- [x] Add failing config tests for setup schema.
|
|
288
295
|
- **Tool:** edit
|
|
289
296
|
- **Verify:** `pnpm exec vitest run tests/unit/config.test.ts`
|
|
290
297
|
|
|
291
|
-
- [
|
|
298
|
+
- [x] Add failing integration test proving localStorage/session setup before route navigation.
|
|
292
299
|
- **Tool:** edit
|
|
293
300
|
- **Verify:** `pnpm exec vitest run tests/integration/browser-contract.test.ts`
|
|
294
301
|
|
|
295
|
-
- [
|
|
302
|
+
- [x] Implement setup support and metadata redaction.
|
|
296
303
|
- **Tool:** edit
|
|
297
304
|
- **Verify:** focused tests pass.
|
|
298
305
|
|
|
306
|
+
#### Decision Notes
|
|
307
|
+
|
|
308
|
+
- Chosen API: `setup.localStorage` and `setup.sessionStorage` as string key/value maps at browser and route scope.
|
|
309
|
+
- Browser-level setup applies to every route; route-level setup extends or overrides browser-level keys.
|
|
310
|
+
- Rejected for this phase: arbitrary `beforeNavigate` script hooks because they are too broad and harder to make safe; `storageState` files because the current Sourcer need is simple seeded browser storage and key-only metadata.
|
|
311
|
+
- Report metadata records only storage key names, not values.
|
|
312
|
+
|
|
299
313
|
#### Tests for This Phase
|
|
300
314
|
|
|
301
315
|
| Test Type | What to Test | Exists? | Path / Command |
|
|
302
316
|
|---|---|---|---|
|
|
303
|
-
| Unit | Config schema accepts setup and rejects unsafe shapes |
|
|
304
|
-
| Integration | Route sees seeded storage before render |
|
|
305
|
-
| Redaction | Setup metadata does not leak token values |
|
|
306
|
-
| Docs | Example compiles conceptually | Manual | `docs/configuration.md` |
|
|
317
|
+
| Unit | Config schema accepts setup and rejects unsafe shapes | Yes | `tests/unit/config.test.ts` |
|
|
318
|
+
| Integration | Route sees seeded storage before render | Yes | `tests/integration/browser-contract.test.ts` |
|
|
319
|
+
| Redaction | Setup metadata does not leak token values | Yes, integration metadata assertion | `tests/integration/browser-contract.test.ts` |
|
|
320
|
+
| Docs | Example compiles conceptually | Manual | `docs/configuration.md`, `docs/browser-contract.md` |
|
|
307
321
|
|
|
308
322
|
#### Phase Exit Criteria
|
|
309
323
|
|
|
310
|
-
- [
|
|
311
|
-
- [
|
|
312
|
-
- [
|
|
313
|
-
- [
|
|
314
|
-
- [
|
|
324
|
+
- [x] Auth setup can be expressed without real credentials.
|
|
325
|
+
- [x] Route runner applies setup before assertions.
|
|
326
|
+
- [x] Sensitive values are not printed in report metadata.
|
|
327
|
+
- [x] Sourcer can add one authenticated route without app-specific Reflection changes.
|
|
328
|
+
- [x] Full validation passes.
|
|
315
329
|
|
|
316
330
|
#### Failure Protocol
|
|
317
331
|
|
|
@@ -327,7 +341,7 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
327
341
|
|
|
328
342
|
**Goal:** Replace generic next steps with report suggestions derived from actual run results.
|
|
329
343
|
**Depends on:** Phase 1
|
|
330
|
-
**Status:**
|
|
344
|
+
**Status:** Complete
|
|
331
345
|
|
|
332
346
|
#### Inputs
|
|
333
347
|
|
|
@@ -356,15 +370,15 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
356
370
|
|
|
357
371
|
#### Tasks
|
|
358
372
|
|
|
359
|
-
- [
|
|
373
|
+
- [x] Add tests for suggested steps by result type.
|
|
360
374
|
- **Tool:** edit
|
|
361
375
|
- **Verify:** `pnpm exec vitest run tests/unit/review-command.test.ts tests/unit/report-schema.test.ts`
|
|
362
376
|
|
|
363
|
-
- [
|
|
377
|
+
- [x] Implement derived suggestions.
|
|
364
378
|
- **Tool:** edit
|
|
365
379
|
- **Verify:** focused tests pass.
|
|
366
380
|
|
|
367
|
-
- [
|
|
381
|
+
- [x] Update docs with examples of pass/fail/review suggestions.
|
|
368
382
|
- **Tool:** edit
|
|
369
383
|
- **Verify:** docs mention dry-run update for visual review.
|
|
370
384
|
|
|
@@ -372,15 +386,15 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
372
386
|
|
|
373
387
|
| Test Type | What to Test | Exists? | Path / Command |
|
|
374
388
|
|---|---|---|---|
|
|
375
|
-
| Unit | Derived suggestions for fail/review/pass |
|
|
389
|
+
| Unit | Derived suggestions for fail/review/pass | Yes | `tests/unit/report-schema.test.ts` |
|
|
376
390
|
| Schema | Suggested step shape remains stable | Yes | `tests/unit/report-schema.test.ts` |
|
|
377
|
-
| E2E | CI report has useful next steps |
|
|
391
|
+
| E2E | CI report has useful next steps | Yes | `tests/e2e/ci-mode.test.ts` |
|
|
378
392
|
|
|
379
393
|
#### Phase Exit Criteria
|
|
380
394
|
|
|
381
|
-
- [
|
|
382
|
-
- [
|
|
383
|
-
- [
|
|
395
|
+
- [x] No report emits the old generic implementation suggestion for consuming-project passes.
|
|
396
|
+
- [x] Review JSON remains parseable.
|
|
397
|
+
- [x] Full validation passes.
|
|
384
398
|
|
|
385
399
|
#### Failure Protocol
|
|
386
400
|
|
|
@@ -395,7 +409,7 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
395
409
|
|
|
396
410
|
**Goal:** Make first-time setup easier while preserving read-only safety by default.
|
|
397
411
|
**Depends on:** Phase 1
|
|
398
|
-
**Status:**
|
|
412
|
+
**Status:** Complete
|
|
399
413
|
|
|
400
414
|
#### Inputs
|
|
401
415
|
|
|
@@ -406,7 +420,7 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
406
420
|
#### Outputs
|
|
407
421
|
|
|
408
422
|
- `reflection init --dry-run` detects package manager and prints proposed files/scripts.
|
|
409
|
-
-
|
|
423
|
+
- `reflection init --dry-run` is read-only and refuses to write. Any future write mode must be explicit and separately approved.
|
|
410
424
|
- Preset support starts explicit, for example `--preset vite-react`.
|
|
411
425
|
|
|
412
426
|
#### Relevant Paths
|
|
@@ -421,15 +435,15 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
421
435
|
|
|
422
436
|
#### Tasks
|
|
423
437
|
|
|
424
|
-
- [
|
|
438
|
+
- [x] Add failing CLI tests for `init --dry-run`.
|
|
425
439
|
- **Tool:** edit
|
|
426
440
|
- **Verify:** `pnpm exec vitest run tests/unit/init-command.test.ts tests/unit/cli.test.ts`
|
|
427
441
|
|
|
428
|
-
- [
|
|
442
|
+
- [x] Implement read-only dry-run with detected package manager and suggested commands.
|
|
429
443
|
- **Tool:** edit
|
|
430
444
|
- **Verify:** focused tests pass.
|
|
431
445
|
|
|
432
|
-
- [
|
|
446
|
+
- [x] Document that `init --write` is not required for consumers and must be explicit if added.
|
|
433
447
|
- **Tool:** edit
|
|
434
448
|
- **Verify:** docs mention dry-run safety.
|
|
435
449
|
|
|
@@ -437,16 +451,16 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
437
451
|
|
|
438
452
|
| Test Type | What to Test | Exists? | Path / Command |
|
|
439
453
|
|---|---|---|---|
|
|
440
|
-
| Unit | Dry-run output for pnpm repo |
|
|
441
|
-
| CLI | Command registration and invalid options |
|
|
454
|
+
| Unit | Dry-run output for pnpm repo | Yes | `tests/unit/init-command.test.ts` |
|
|
455
|
+
| CLI | Command registration and invalid options | Yes | `tests/unit/cli.test.ts` |
|
|
442
456
|
| Package smoke | New CLI still works installed | Yes | `pnpm smoke:package` |
|
|
443
457
|
|
|
444
458
|
#### Phase Exit Criteria
|
|
445
459
|
|
|
446
|
-
- [
|
|
447
|
-
- [
|
|
448
|
-
- [
|
|
449
|
-
- [
|
|
460
|
+
- [x] `reflection init --dry-run` is read-only.
|
|
461
|
+
- [x] Output matches current package name `reflection-check`.
|
|
462
|
+
- [x] No repo files are mutated without `--write`.
|
|
463
|
+
- [x] Full validation passes.
|
|
450
464
|
|
|
451
465
|
#### Failure Protocol
|
|
452
466
|
|
|
@@ -461,7 +475,7 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
461
475
|
|
|
462
476
|
**Goal:** Make consuming-repo CI and visual baseline workflows obvious and hard to misuse.
|
|
463
477
|
**Depends on:** Phases 1-3
|
|
464
|
-
**Status:**
|
|
478
|
+
**Status:** Complete
|
|
465
479
|
|
|
466
480
|
#### Inputs
|
|
467
481
|
|
|
@@ -488,15 +502,15 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
488
502
|
|
|
489
503
|
#### Tasks
|
|
490
504
|
|
|
491
|
-
- [
|
|
505
|
+
- [x] Update CI docs around `pnpm add -D reflection-check` and `reflection run --ci`.
|
|
492
506
|
- **Tool:** edit
|
|
493
507
|
- **Verify:** docs contain public package install path.
|
|
494
508
|
|
|
495
|
-
- [
|
|
509
|
+
- [x] Add or update CI-mode e2e tests if command shape changes.
|
|
496
510
|
- **Tool:** edit
|
|
497
511
|
- **Verify:** `pnpm exec vitest run tests/e2e/ci-mode.test.ts`.
|
|
498
512
|
|
|
499
|
-
- [
|
|
513
|
+
- [x] Improve baseline update dry-run messaging if needed.
|
|
500
514
|
- **Tool:** edit
|
|
501
515
|
- **Verify:** `pnpm exec vitest run tests/integration/update-command.test.ts`.
|
|
502
516
|
|
|
@@ -504,15 +518,15 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
504
518
|
|
|
505
519
|
| Test Type | What to Test | Exists? | Path / Command |
|
|
506
520
|
|---|---|---|---|
|
|
507
|
-
| E2E | CI report root and review | Yes | `tests/e2e/ci-mode.test.ts` |
|
|
508
|
-
| Integration | Baseline update dry-run safety | Yes | `tests/integration/update-command.test.ts` |
|
|
521
|
+
| E2E | CI report root, docs, and review | Yes | `tests/e2e/ci-mode.test.ts` |
|
|
522
|
+
| Integration | Baseline update dry-run safety and messaging | Yes | `tests/integration/update-command.test.ts` |
|
|
509
523
|
| Package | Public install smoke remains valid | Yes | `pnpm smoke:package` |
|
|
510
524
|
|
|
511
525
|
#### Phase Exit Criteria
|
|
512
526
|
|
|
513
|
-
- [
|
|
514
|
-
- [
|
|
515
|
-
- [
|
|
527
|
+
- [x] Consuming repo CI docs are copy-pasteable.
|
|
528
|
+
- [x] Baseline update process is clear and safe.
|
|
529
|
+
- [x] Full validation passes.
|
|
516
530
|
|
|
517
531
|
#### Failure Protocol
|
|
518
532
|
|
|
@@ -537,20 +551,20 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
537
551
|
|
|
538
552
|
**Unit done when:**
|
|
539
553
|
|
|
540
|
-
- [
|
|
541
|
-
- [
|
|
542
|
-
- [
|
|
543
|
-
- [
|
|
554
|
+
- [x] Focused tests pass.
|
|
555
|
+
- [x] `pnpm test`, `pnpm typecheck`, and `pnpm smoke:package` pass.
|
|
556
|
+
- [x] Public package docs remain accurate.
|
|
557
|
+
- [x] Guide updated.
|
|
544
558
|
|
|
545
559
|
### Units
|
|
546
560
|
|
|
547
561
|
| Unit | Status | Tests | Validation | Notes |
|
|
548
562
|
|---|---|---|---|---|
|
|
549
|
-
| Useful doctor |
|
|
550
|
-
| Browser setup hooks |
|
|
551
|
-
| Actionable next steps |
|
|
552
|
-
| Init dry-run |
|
|
553
|
-
| CI/baseline docs polish |
|
|
563
|
+
| Useful doctor | Complete | focused and full pass | full pass; publish dry-run passed for 0.0.3 | Highest value from Sourcer feedback |
|
|
564
|
+
| Browser setup hooks | Complete | focused and full pass | full pass; publish dry-run passed for 0.0.3 | Enables authenticated Sourcer coverage |
|
|
565
|
+
| Actionable next steps | Complete | focused and full pass | full pass; publish dry-run passed for 0.0.3 | Replaces generic report suggestion |
|
|
566
|
+
| Init dry-run | Complete | focused and full pass | full pass; package smoke verifies installed init | Improves new project setup |
|
|
567
|
+
| CI/baseline docs polish | Complete | focused and full pass | full pass; publish dry-run passed for 0.0.3 | Needed before broader use |
|
|
554
568
|
|
|
555
569
|
---
|
|
556
570
|
|
|
@@ -567,11 +581,11 @@ Convert feedback into small, test-first package improvements. Prioritize improve
|
|
|
567
581
|
|
|
568
582
|
| Phase | What's Tested | Test Type | Exists? | Path |
|
|
569
583
|
|---|---|---|---|---|
|
|
570
|
-
| Phase 1 | Doctor config preflight | Unit/CLI |
|
|
571
|
-
| Phase 2 | Browser setup hooks | Unit/integration |
|
|
572
|
-
| Phase 3 | Derived next steps | Unit/e2e |
|
|
573
|
-
| Phase 4 | Init dry-run | Unit/CLI |
|
|
574
|
-
| Phase 5 | CI/baseline docs and safety | E2E/integration |
|
|
584
|
+
| Phase 1 | Doctor config preflight | Unit/CLI | Yes | `tests/unit/doctor-command.test.ts`, `tests/unit/cli.test.ts` |
|
|
585
|
+
| Phase 2 | Browser setup hooks | Unit/integration | Yes | `tests/unit/config.test.ts`, `tests/integration/browser-contract.test.ts` |
|
|
586
|
+
| Phase 3 | Derived next steps | Unit/e2e | Yes | `tests/unit/report-schema.test.ts`, `tests/e2e/ci-mode.test.ts` |
|
|
587
|
+
| Phase 4 | Init dry-run | Unit/CLI/package smoke | Yes | `tests/unit/init-command.test.ts`, `tests/unit/cli.test.ts`, `scripts/smoke-package-install.mjs` |
|
|
588
|
+
| Phase 5 | CI/baseline docs and safety | E2E/integration | Yes | `tests/e2e/ci-mode.test.ts`, `tests/integration/update-command.test.ts` |
|
|
575
589
|
|
|
576
590
|
### Full Validation Run
|
|
577
591
|
|
|
@@ -606,18 +620,18 @@ npm publish --dry-run --access public
|
|
|
606
620
|
|
|
607
621
|
| Phase | Title | Status | Tests | Validation | Completed |
|
|
608
622
|
|---|---|---|---|---|---|
|
|
609
|
-
| Patch | Missing Baseline Promotion |
|
|
610
|
-
| 1 | Useful `doctor --config` |
|
|
611
|
-
| 2 | Browser Setup Hooks for Authenticated Apps |
|
|
612
|
-
| 3 | Actionable Report Suggestions |
|
|
613
|
-
| 4 | Safe `reflection init --dry-run` |
|
|
614
|
-
| 5 | CI and Baseline Workflow Polish |
|
|
623
|
+
| Patch | Missing Baseline Promotion | Complete | full pass | included in 0.0.3 candidate; publish dry-run passed | 2026-06-02 |
|
|
624
|
+
| 1 | Useful `doctor --config` | Complete | full pass | included in 0.0.3 candidate; publish dry-run passed | 2026-06-02 |
|
|
625
|
+
| 2 | Browser Setup Hooks for Authenticated Apps | Complete | full pass | included in 0.0.3 candidate; publish dry-run passed | 2026-06-02 |
|
|
626
|
+
| 3 | Actionable Report Suggestions | Complete | full pass | included in 0.0.3 candidate; publish dry-run passed | 2026-06-02 |
|
|
627
|
+
| 4 | Safe `reflection init --dry-run` | Complete | full pass | package smoke verifies installed init; publish dry-run passed | 2026-06-02 |
|
|
628
|
+
| 5 | CI and Baseline Workflow Polish | Complete | full pass | included in 0.0.3 candidate; publish dry-run passed | 2026-06-02 |
|
|
615
629
|
|
|
616
630
|
---
|
|
617
631
|
|
|
618
632
|
## 7. Post-Completion Checklist
|
|
619
633
|
|
|
620
|
-
- [
|
|
634
|
+
- [x] All phases marked complete or skipped with reason.
|
|
621
635
|
- [ ] Full validation suite passes.
|
|
622
636
|
- [ ] `pnpm smoke:package` proves public install surface.
|
|
623
637
|
- [ ] `npm publish --dry-run --access public` has no warnings.
|
|
@@ -59,7 +59,7 @@ console.log(ir.targets.map((target) => `${target.family}:${target.id}`));
|
|
|
59
59
|
// ]
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
The compiler preserves visual metadata that matters to later review, including zero-valued thresholds
|
|
62
|
+
The compiler preserves visual metadata that matters to later review, including zero-valued thresholds, explicit component `viewportSize` values, and component `framing`. Do not use truthiness checks when copying optional numeric metadata; use explicit `!== undefined` checks so values like `0` survive.
|
|
63
63
|
|
|
64
64
|
## Adapter contract
|
|
65
65
|
|
|
@@ -72,7 +72,7 @@ A good adapter is:
|
|
|
72
72
|
- **optional** — normal Reflection config works without it;
|
|
73
73
|
- **validated** — malformed adapter input fails before runner execution;
|
|
74
74
|
- **neutral** — no external product names leak into core commands or reports unless the user explicitly names their own target ids;
|
|
75
|
-
- **lossless enough for review** — route paths, viewports, expectations, baselines, thresholds, and blocking semantics are preserved in IR.
|
|
75
|
+
- **lossless enough for review** — route paths, viewports, component viewport sizes, component framing, expectations, baselines, thresholds, and blocking semantics are preserved in IR.
|
|
76
76
|
|
|
77
77
|
## Route manifest adapter proof
|
|
78
78
|
|