@metasession.co/devaudit-cli 0.1.15 → 0.1.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metasession.co/devaudit-cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "DevAudit CLI — installs, syncs, and operates the Metasession SDLC across consumer projects.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@clack/prompts": "^0.8.2",
36
- "@metasession.co/devaudit-plugin-sdk": "^0.1.15",
36
+ "@metasession.co/devaudit-plugin-sdk": "^0.1.17",
37
37
  "commander": "^12.1.0",
38
38
  "consola": "^3.2.3",
39
39
  "env-paths": "^3.0.0",
@@ -85,7 +85,7 @@ The bootstrap workflow:
85
85
 
86
86
  9. **Wire up runner scripts** — at minimum `test:e2e` (headless), `test:e2e:ui` or `:headed` (interactive), `test:e2e:debug`, and `test:e2e:update-snapshots` if visual regression is in.
87
87
 
88
- 10. **Offer a CI job** — write the YAML (or equivalent) for the project's CI system, but **do not commit it without confirmation**. Show it inline first.
88
+ 10. **Offer a CI job** — write the YAML (or equivalent) for the project's CI system, but **do not commit it without confirmation**. Show it inline first. On a **DevAudit** project, `.github/workflows/ci.yml` is generated and marked do-not-edit-manually — don't hand-edit it; instead drive the E2E gate from `sdlc-config.json`. If the suite must run against a **disposable local database** (the rule on any project with no separate test instance — never test against prod), set `e2e_setup_command` (e.g. `supabase start` + load schema + seed) and `e2e_env` (e.g. `E2E_LOCAL=1`, local coords, a dummy email key) so the gate severs production. See [Local-database E2E in CI](https://github.com/metasession-dev/DevAudit-Installer/blob/main/docs/e2e-local-db-ci.md), then `devaudit update` to regenerate.
89
89
 
90
90
  11. **Write a short README** in the test directory explaining structure, how to run, how to add new tests, and how to update visual baselines. Future contributors (and the skill itself, on next invocation) will thank you.
91
91
 
@@ -130,26 +130,16 @@ jobs:
130
130
  # ── Gate 4: E2E Tests (Playwright) ──
131
131
 
132
132
  {{DATABASE_URI_STEP}}
133
-
133
+ {{E2E_SETUP_STEP}}
134
134
  - name: Kill stale dev server
135
135
  run: lsof -ti:3000 | xargs kill -9 2>/dev/null || true
136
136
 
137
- - name: Start dev server
138
- run: {{E2E_START_COMMAND}} &
137
+ {{E2E_DEV_SERVER_STEP}}
139
138
 
140
139
  - name: Wait for dev server
141
140
  run: npx wait-on http://localhost:3000 --timeout 120000
142
141
 
143
- - name: E2E Tests
144
- env:
145
- # PLAYWRIGHT_JSON_OUTPUT_NAME makes the json reporter write straight
146
- # to the file. Capturing stdout (`> e2e-results.json`) instead mixed
147
- # the html reporter's "To open report" line in after the JSON blob
148
- # and produced an unparseable file (DevAudit #48). html report still
149
- # lands in playwright-report/.
150
- PLAYWRIGHT_HTML_REPORTER_OPEN: never
151
- PLAYWRIGHT_JSON_OUTPUT_NAME: e2e-results.json
152
- run: npx playwright test --project={{E2E_PROJECT}} --reporter=json,html
142
+ {{E2E_TEST_STEP}}
153
143
  {{E2E_AUTHENTICATED_STEP}}
154
144
  # ── Gate 5: Build ──
155
145
 
@@ -172,6 +162,7 @@ jobs:
172
162
  e2e-auth-results.json
173
163
  playwright-report/
174
164
  coverage/coverage-summary.json
165
+ compliance/evidence/*/screenshots/*.png
175
166
  retention-days: 90
176
167
 
177
168
  # ──────────────────────────────────────────────
@@ -339,6 +330,44 @@ jobs:
339
330
  --category test_report ${FLAGS}
340
331
  fi
341
332
 
333
+ # Upload per-AC e2e evidence screenshots, scoped to each in-scope
334
+ # requirement so they render under "Evidence by requirement" in the
335
+ # portal. These are the per-assertion `evidenceShot(page, REQ, 'ACn-…')`
336
+ # captures (compliance/evidence/<reqId>/screenshots/*.png) — taken at the
337
+ # moment each acceptance criterion is demonstrated, NOT the Playwright
338
+ # report's trailing/failure capture. evidenceType `screenshot` →
339
+ # image/png renders inline. Only when a pending release ticket defines
340
+ # the in-scope REQ(s); skipped on ordinary dev pushes. Best-effort: a
341
+ # screenshot upload failure warns but never blocks the gate.
342
+ SHOT_REQS=()
343
+ if [ -d compliance/pending-releases ]; then
344
+ for TICKET in compliance/pending-releases/RELEASE-TICKET-REQ-*.md; do
345
+ [ -f "$TICKET" ] || continue
346
+ SHOT_REQS+=("$(basename "$TICKET" .md | sed 's/^RELEASE-TICKET-//')")
347
+ done
348
+ fi
349
+ shopt -s nullglob
350
+ SHOTS=(ci-evidence/compliance/evidence/*/screenshots/*.png compliance/evidence/*/screenshots/*.png)
351
+ if [ "${#SHOT_REQS[@]}" -gt 0 ] && [ "${#SHOTS[@]}" -gt 0 ]; then
352
+ echo "Uploading ${#SHOTS[@]} evidence screenshot(s) for: ${SHOT_REQS[*]}"
353
+ SHOT_TMP="$(mktemp -d)"
354
+ for REQ in "${SHOT_REQS[@]}"; do
355
+ for PNG in "${SHOTS[@]}"; do
356
+ # The folder is the (SRS) requirement id, the basename is the AC
357
+ # slug (ACn-…). Upload as <srs-req>-<slug>.png so the reviewer can
358
+ # see which requirement/AC each image proves and names don't collide.
359
+ SRS_REQ="$(basename "$(dirname "$(dirname "$PNG")")")"
360
+ NAMED="${SHOT_TMP}/${SRS_REQ}-$(basename "$PNG")"
361
+ cp "$PNG" "$NAMED" 2>/dev/null || continue
362
+ bash scripts/upload-evidence.sh \
363
+ {{PROJECT_SLUG}} "$REQ" screenshot "$NAMED" \
364
+ --category test_report ${FLAGS} --release "$REQ" \
365
+ || echo "::warning::evidence screenshot upload failed: ${PNG} -> ${REQ}"
366
+ done
367
+ done
368
+ fi
369
+ shopt -u nullglob
370
+
342
371
  # NOTE: committed compliance docs (planning category: RTM/test-plan/
343
372
  # test-cases, release tickets, and per-requirement
344
373
  # compliance/evidence/REQ-*/ folders) are intentionally NOT uploaded
@@ -32,9 +32,14 @@
32
32
  "e2e_project": "chromium",
33
33
  "e2e_start_command": "npm run dev",
34
34
 
35
- "_comment_e2e_authenticated": "Optional report-only authenticated e2e gate (continue-on-error, never blocks the merge). e2e_projects = Playwright project names that need a logged-in session (auth-setup runs automatically as their dependency); e2e_seed_command seeds admins/fixtures before the run; e2e_env maps repo secrets onto the seed + e2e steps. Author these specs with the e2e-test-engineer skill (evidenceShot per AC). Leave empty to run only the blocking smoke project above.",
35
+ "_comment_e2e_setup": "Optional foreground command run before the dev server starts use it to stand up a DISPOSABLE LOCAL database so the E2E gate never touches production. The consumer owns the command (the framework stays stack-agnostic). For a Supabase project: install the CLI, `supabase start`, load the local schema + seed, e.g. \"supabase start && psql \\\"$DATABASE_URL\\\" -f supabase/schema-local.sql\". Pair with e2e_env below to point the dev server + tests at the local stack. Leave empty for projects whose dev server already targets a safe test DB.",
36
+ "e2e_setup_command": "",
37
+
38
+ "_comment_e2e_authenticated": "Optional report-only authenticated e2e gate (continue-on-error, never blocks the merge). e2e_projects = Playwright project names that need a logged-in session (auth-setup runs automatically as their dependency); e2e_seed_command seeds admins/fixtures before the run. Author these specs with the e2e-test-engineer skill (evidenceShot per AC). Leave empty to run only the blocking smoke project above.",
36
39
  "e2e_seed_command": "",
37
40
  "e2e_projects": [],
41
+
42
+ "_comment_e2e_env": "Env applied to the E2E setup, (blocking) dev-server, and E2E test steps. To run E2E against a local stack, override EVERY remote/prod key here so production is fully severed — e.g. { \"E2E_LOCAL\": \"1\", \"NEXT_PUBLIC_SUPABASE_URL\": \"http://127.0.0.1:54321\", \"SUPABASE_SERVICE_ROLE_KEY\": \"<local-service-key>\", \"RESEND_API_KEY\": \"re_e2e_local_dummy_key\" }. Step-level env wins over the job-level secrets. Values may reference repo secrets, e.g. \"${{ secrets.E2E_ADMIN_USERNAME }}\".",
38
43
  "e2e_env": {},
39
44
 
40
45
  "paths_ignore": [