@metasession.co/devaudit-cli 0.1.55 → 0.1.57

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.55",
3
+ "version": "0.1.57",
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,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@clack/prompts": "^0.8.2",
36
- "@metasession.co/devaudit-plugin-sdk": "^0.1.55",
36
+ "@metasession.co/devaudit-plugin-sdk": "^0.1.57",
37
+ "ajv": "^8.20.0",
37
38
  "commander": "^12.1.0",
38
39
  "consola": "^3.2.3",
39
40
  "env-paths": "^3.0.0",
@@ -332,7 +332,7 @@ upload-evidence:
332
332
  needs: [e2e-tests]
333
333
  if: github.event_name == 'pull_request'
334
334
  steps:
335
- - uses: actions/checkout@v4
335
+ - uses: actions/checkout@v6
336
336
 
337
337
  # Upload test artifacts
338
338
  - name: Upload E2E evidence
@@ -367,7 +367,7 @@ sync-compliance-docs:
367
367
  runs-on: ubuntu-latest
368
368
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
369
369
  steps:
370
- - uses: actions/checkout@v4
370
+ - uses: actions/checkout@v6
371
371
  - name: Upload compliance documents
372
372
  run: |
373
373
  for doc in compliance/RTM.md compliance/test-plan.md compliance/test-cases.md compliance/test-summary-report.md; do
@@ -209,13 +209,13 @@ jobs:
209
209
  e2e:
210
210
  runs-on: ubuntu-latest
211
211
  steps:
212
- - uses: actions/checkout@v4
213
- - uses: actions/setup-node@v4
212
+ - uses: actions/checkout@v6
213
+ - uses: actions/setup-node@v6
214
214
  with: { node-version: 'lts/*' }
215
215
  - run: npm ci
216
216
  - run: npx playwright install --with-deps
217
217
  - run: npm run test:e2e
218
- - uses: actions/upload-artifact@v4
218
+ - uses: actions/upload-artifact@v7
219
219
  if: always()
220
220
  with:
221
221
  name: playwright-report
@@ -46,11 +46,11 @@ jobs:
46
46
  name: E2E Regression Tests
47
47
  runs-on: ubuntu-latest # adapt to your runner; e.g. self-hosted, ubuntu-24.04
48
48
  steps:
49
- - uses: actions/checkout@v4
49
+ - uses: actions/checkout@v6
50
50
  with:
51
51
  fetch-depth: 0 # for E2E_NEW_SPECS computation
52
52
 
53
- - uses: actions/setup-node@v4
53
+ - uses: actions/setup-node@v6
54
54
  with:
55
55
  node-version: '22' # match your project
56
56
  cache: 'npm'
@@ -111,7 +111,7 @@ jobs:
111
111
  npx playwright test --project="$PROJECT" --reporter=json,html
112
112
  fi
113
113
 
114
- - uses: actions/upload-artifact@v4
114
+ - uses: actions/upload-artifact@v7
115
115
  if: always()
116
116
  with:
117
117
  name: e2e-regression-report
@@ -33,7 +33,7 @@ jobs:
33
33
  PROJECT_SLUG: {{PROJECT_SLUG}}
34
34
 
35
35
  steps:
36
- - uses: actions/checkout@v4
36
+ - uses: actions/checkout@v6
37
37
  with:
38
38
  # The default `pull_request` checkout is a synthetic merge commit
39
39
  # with an empty body, so `derive-release-version.sh` can't see the
@@ -41,7 +41,7 @@ jobs:
41
41
  {{APP_ENV}}
42
42
 
43
43
  steps:
44
- - uses: actions/checkout@v4
44
+ - uses: actions/checkout@v6
45
45
  with:
46
46
  # Full history so the "new specs on this branch" calculation
47
47
  # (E2E_NEW_SPECS, below) can do a real diff against the merge
@@ -51,7 +51,7 @@ jobs:
51
51
 
52
52
  # ── Cached installs (skip if already present on self-hosted runner) ──
53
53
 
54
- - uses: actions/setup-node@v4
54
+ - uses: actions/setup-node@v6
55
55
  with:
56
56
  node-version: {{NODE_VERSION}}
57
57
 
@@ -209,7 +209,7 @@ jobs:
209
209
 
210
210
  # ── Upload artifacts ──
211
211
 
212
- - uses: actions/upload-artifact@v4
212
+ - uses: actions/upload-artifact@v7
213
213
  if: always()
214
214
  continue-on-error: true
215
215
  with:
@@ -232,22 +232,41 @@ jobs:
232
232
  register-release:
233
233
  name: Register Release
234
234
  runs-on: {{RUNNER}}
235
- if: ${{ vars.DEVAUDIT_BASE_URL != '' }}
236
235
  outputs:
237
236
  version: ${{ steps.version.outputs.version }}
238
237
  env:
239
- DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
238
+ DEVAUDIT_BASE_URL_VAR: ${{ vars.DEVAUDIT_BASE_URL }}
240
239
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
241
240
  steps:
242
- - uses: actions/checkout@v4
241
+ - uses: actions/checkout@v6
243
242
 
244
- - name: Validate DevAudit env
243
+ - name: Resolve DevAudit base URL
245
244
  run: |
246
- if [ -z "${DEVAUDIT_BASE_URL}" ] || [ -z "${DEVAUDIT_API_KEY}" ]; then
247
- echo "::error::DEVAUDIT_BASE_URL (variable) and DEVAUDIT_API_KEY (secret) must both be set."
245
+ # Prefer sdlc-config.json devaudit.base_url (PR-visible) over the
246
+ # deprecated repo Variable matching compliance-evidence.yml and
247
+ # check-release-approval.yml. DevAudit-Installer#156: gating this job
248
+ # on `vars.DEVAUDIT_BASE_URL` silently skipped release registration +
249
+ # evidence upload for consumers that moved base_url into
250
+ # sdlc-config.json (the v1.23.0 direction).
251
+ BASE=""
252
+ if [ -f sdlc-config.json ]; then
253
+ CONFIG_URL=$(jq -r '.devaudit.base_url // empty' sdlc-config.json 2>/dev/null || true)
254
+ [ -n "$CONFIG_URL" ] && BASE="$CONFIG_URL"
255
+ fi
256
+ if [ -n "$BASE" ]; then
257
+ echo "Using devaudit.base_url from sdlc-config.json: $BASE"
258
+ elif [ -n "$DEVAUDIT_BASE_URL_VAR" ]; then
259
+ BASE="$DEVAUDIT_BASE_URL_VAR"
260
+ echo "::warning::Using repo Variable DEVAUDIT_BASE_URL (deprecated in v1.23.0). Move base_url to sdlc-config.json devaudit.base_url for PR-visible config."
261
+ else
262
+ echo "::warning::No DevAudit base URL configured — skipping release registration. Set devaudit.base_url in sdlc-config.json."
263
+ fi
264
+ if [ -n "$BASE" ] && [ -z "${DEVAUDIT_API_KEY}" ]; then
265
+ echo "::error::DEVAUDIT_API_KEY (secret) must be set when a DevAudit base URL is configured."
248
266
  exit 1
249
267
  fi
250
- echo "BASE=${DEVAUDIT_BASE_URL%/}" >> "$GITHUB_ENV"
268
+ echo "BASE=${BASE%/}" >> "$GITHUB_ENV"
269
+ echo "DEVAUDIT_BASE_URL=${BASE%/}" >> "$GITHUB_ENV"
251
270
 
252
271
  - name: Determine release version
253
272
  id: version
@@ -263,6 +282,7 @@ jobs:
263
282
  echo "Release version: ${VERSION}"
264
283
 
265
284
  - name: Ensure release exists
285
+ if: env.DEVAUDIT_BASE_URL != ''
266
286
  run: |
267
287
  chmod +x scripts/upload-evidence.sh 2>/dev/null || true
268
288
  # Create the release in DevAudit (no evidence yet — just registration)
@@ -273,6 +293,7 @@ jobs:
273
293
  --git-sha ${{ github.sha }} --branch ${{ github.ref_name }} || true
274
294
 
275
295
  - name: Sync known requirements from RTM
296
+ if: env.DEVAUDIT_BASE_URL != ''
276
297
  env:
277
298
  GH_TOKEN: ${{ github.token }}
278
299
  run: |
@@ -343,15 +364,35 @@ jobs:
343
364
  # evidence — `status=failed` is itself the audit trail. `!cancelled()`
344
365
  # still guards against partial state on operator-cancel.
345
366
  # DevAudit-Installer#96.
346
- if: ${{ always() && !cancelled() && vars.DEVAUDIT_BASE_URL != '' && needs.register-release.result == 'success' }}
367
+ if: ${{ always() && !cancelled() && needs.register-release.result == 'success' }}
347
368
  env:
348
- DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
369
+ DEVAUDIT_BASE_URL_VAR: ${{ vars.DEVAUDIT_BASE_URL }}
349
370
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
350
371
  steps:
351
- - uses: actions/checkout@v4
372
+ - uses: actions/checkout@v6
373
+
374
+ - name: Resolve DevAudit base URL
375
+ run: |
376
+ # Prefer sdlc-config.json devaudit.base_url over the deprecated repo
377
+ # Variable (DevAudit-Installer#156). When neither is set the upload
378
+ # step below no-ops via `if: env.DEVAUDIT_BASE_URL != ''`.
379
+ BASE=""
380
+ if [ -f sdlc-config.json ]; then
381
+ CONFIG_URL=$(jq -r '.devaudit.base_url // empty' sdlc-config.json 2>/dev/null || true)
382
+ [ -n "$CONFIG_URL" ] && BASE="$CONFIG_URL"
383
+ fi
384
+ if [ -n "$BASE" ]; then
385
+ echo "Using devaudit.base_url from sdlc-config.json: $BASE"
386
+ elif [ -n "$DEVAUDIT_BASE_URL_VAR" ]; then
387
+ BASE="$DEVAUDIT_BASE_URL_VAR"
388
+ echo "::warning::Using repo Variable DEVAUDIT_BASE_URL (deprecated in v1.23.0). Move base_url to sdlc-config.json devaudit.base_url for PR-visible config."
389
+ else
390
+ echo "::warning::No DevAudit base URL configured — skipping evidence upload. Set devaudit.base_url in sdlc-config.json."
391
+ fi
392
+ echo "DEVAUDIT_BASE_URL=${BASE%/}" >> "$GITHUB_ENV"
352
393
 
353
394
  - name: Download CI gate artifacts
354
- uses: actions/download-artifact@v4
395
+ uses: actions/download-artifact@v8
355
396
  continue-on-error: true
356
397
  with:
357
398
  name: ci-results
@@ -40,7 +40,7 @@ jobs:
40
40
  GH_TOKEN: ${{ github.token }}
41
41
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
42
42
  steps:
43
- - uses: actions/checkout@v4
43
+ - uses: actions/checkout@v6
44
44
  with:
45
45
  ref: develop
46
46
  fetch-depth: 0
@@ -69,7 +69,7 @@ jobs:
69
69
  DEVAUDIT_BASE_URL_VAR: ${{ vars.DEVAUDIT_BASE_URL }}
70
70
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
71
71
  steps:
72
- - uses: actions/checkout@v4
72
+ - uses: actions/checkout@v6
73
73
  with:
74
74
  # Full history so `req_meta_args` can `git log --grep "[REQ-XXX]|Ref: REQ-XXX"`
75
75
  # against the implementation commits (the merge commit alone never
@@ -512,7 +512,7 @@ jobs:
512
512
  name: Upload E2E Regression Evidence
513
513
  if: github.event_name == 'workflow_run'
514
514
  runs-on: {{RUNNER}}
515
- # actions: read is required so `actions/download-artifact@v4` with
515
+ # actions: read is required so `actions/download-artifact@v8` with
516
516
  # `run-id` can read another workflow's artifacts. Without it the
517
517
  # download step fails with a 404 even when the artifact exists.
518
518
  permissions:
@@ -522,7 +522,7 @@ jobs:
522
522
  DEVAUDIT_BASE_URL_VAR: ${{ vars.DEVAUDIT_BASE_URL }}
523
523
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
524
524
  steps:
525
- - uses: actions/checkout@v4
525
+ - uses: actions/checkout@v6
526
526
  with:
527
527
  # Check out the SHA the E2E Regression ran against — that
528
528
  # determines the release version + the in-scope REQs via the
@@ -557,7 +557,7 @@ jobs:
557
557
 
558
558
  - name: Download E2E Regression artifact
559
559
  if: steps.resolve.outputs.skip != 'true'
560
- uses: actions/download-artifact@v4
560
+ uses: actions/download-artifact@v8
561
561
  with:
562
562
  name: e2e-regression-report
563
563
  path: e2e-artifacts/
@@ -23,7 +23,7 @@ jobs:
23
23
  name: Compliance Validation
24
24
  runs-on: {{RUNNER}}
25
25
  steps:
26
- - uses: actions/checkout@v4
26
+ - uses: actions/checkout@v6
27
27
  with:
28
28
  fetch-depth: 0
29
29
 
@@ -38,7 +38,7 @@ jobs:
38
38
  # skips this job entirely on unlabelled issue closes.
39
39
  if: contains(github.event.issue.labels.*.name, 'incident')
40
40
  steps:
41
- - uses: actions/checkout@v4
41
+ - uses: actions/checkout@v6
42
42
  with:
43
43
  fetch-depth: 0
44
44
  token: ${{ secrets.DEVAUDIT_USER_TOKEN || github.token }}
@@ -34,7 +34,7 @@ jobs:
34
34
  name: Generate quarterly periodic-review.md
35
35
  runs-on: ubuntu-latest
36
36
  steps:
37
- - uses: actions/checkout@v4
37
+ - uses: actions/checkout@v6
38
38
  with:
39
39
  fetch-depth: 0
40
40
  # Need write access for the chore branch.
@@ -44,7 +44,7 @@ jobs:
44
44
  RELEASE_INPUT: ${{ github.event.inputs.release }}
45
45
 
46
46
  steps:
47
- - uses: actions/checkout@v4
47
+ - uses: actions/checkout@v6
48
48
  with:
49
49
  fetch-depth: 0 # full history so merged commits' REQ tags are readable
50
50
 
@@ -45,9 +45,9 @@ jobs:
45
45
  {{APP_ENV}}
46
46
 
47
47
  steps:
48
- - uses: actions/checkout@v4
48
+ - uses: actions/checkout@v6
49
49
 
50
- - uses: actions/setup-python@v5
50
+ - uses: actions/setup-python@v6
51
51
  with:
52
52
  python-version: '{{PYTHON_VERSION}}'
53
53
  cache: pip
@@ -164,11 +164,11 @@ jobs:
164
164
 
165
165
  # ── Upload artifacts ──
166
166
 
167
- # actions/upload-artifact@v4 doesn't honour the job's `working-directory`;
167
+ # actions/upload-artifact@v7 doesn't honour the job's `working-directory`;
168
168
  # paths are workspace-relative. Prefix with WORKING_DIR_PREFIX so artifacts
169
169
  # uploaded from a subdir project (e.g. mission-control-api/) include the
170
170
  # subdir in their stored path, matching where the gate steps wrote them.
171
- - uses: actions/upload-artifact@v4
171
+ - uses: actions/upload-artifact@v7
172
172
  if: always()
173
173
  continue-on-error: true
174
174
  with:
@@ -191,7 +191,7 @@ jobs:
191
191
  DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
192
192
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
193
193
  steps:
194
- - uses: actions/checkout@v4
194
+ - uses: actions/checkout@v6
195
195
 
196
196
  - name: Validate DevAudit env
197
197
  run: |
@@ -293,7 +293,7 @@ jobs:
293
293
  DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
294
294
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
295
295
  steps:
296
- - uses: actions/checkout@v4
296
+ - uses: actions/checkout@v6
297
297
 
298
298
  # Download to workspace root: upload-artifact@v4 preserves the file's
299
299
  # workspace-relative path (e.g. mission-control-api/ci-evidence/sast.json
@@ -301,7 +301,7 @@ jobs:
301
301
  # those exact paths so the upload-evidence.sh references below resolve
302
302
  # without nesting.
303
303
  - name: Download CI gate artifacts
304
- uses: actions/download-artifact@v4
304
+ uses: actions/download-artifact@v8
305
305
  continue-on-error: true
306
306
  with:
307
307
  name: ci-results
@@ -352,15 +352,19 @@ jobs:
352
352
 
353
353
  mkdir -p {{WORKING_DIR_PREFIX}}ci-evidence
354
354
 
355
+ # Precise evidence_type=sast_report (matches the node template; the
356
+ # imprecise audit_log used pre-devaudit#370 made the portal's SAST and
357
+ # dependency panels show identical content — DevAudit-Installer#157).
355
358
  if [ -f {{WORKING_DIR_PREFIX}}ci-evidence/sast-results.json ]; then
356
359
  upload sast-results.json \
357
- {{PROJECT_SLUG}} _compliance-docs audit_log {{WORKING_DIR_PREFIX}}ci-evidence/sast-results.json \
360
+ {{PROJECT_SLUG}} _compliance-docs sast_report {{WORKING_DIR_PREFIX}}ci-evidence/sast-results.json \
358
361
  --category security_scan --gate-status "$STATUS_SAST" ${FLAGS}
359
362
  fi
360
363
 
364
+ # Precise evidence_type=dependency_audit (matches the node template).
361
365
  if [ -f {{WORKING_DIR_PREFIX}}ci-evidence/dependency-audit.json ]; then
362
366
  upload dependency-audit.json \
363
- {{PROJECT_SLUG}} _compliance-docs audit_log {{WORKING_DIR_PREFIX}}ci-evidence/dependency-audit.json \
367
+ {{PROJECT_SLUG}} _compliance-docs dependency_audit {{WORKING_DIR_PREFIX}}ci-evidence/dependency-audit.json \
364
368
  --category security_scan --gate-status "$STATUS_DEPAUDIT" ${FLAGS}
365
369
  fi
366
370
 
@@ -123,7 +123,7 @@
123
123
  "action": {
124
124
  "type": "string",
125
125
  "pattern": "^[^@]+@v[0-9]+$",
126
- "description": "GitHub Actions reference — e.g. actions/setup-node@v4, actions/setup-python@v5."
126
+ "description": "GitHub Actions reference — e.g. actions/setup-node@v6, actions/setup-python@v6."
127
127
  },
128
128
  "with": {
129
129
  "type": "object",
@@ -30,7 +30,7 @@
30
30
  "test": "ci-evidence/e2e-results.json"
31
31
  },
32
32
  "runtime_setup": {
33
- "action": "actions/setup-node@v4",
33
+ "action": "actions/setup-node@v6",
34
34
  "with": { "node-version": "{{NODE_VERSION}}", "cache": "npm" }
35
35
  },
36
36
  "config_keys": {
@@ -21,7 +21,7 @@
21
21
  "test": "ci-evidence/junit.xml"
22
22
  },
23
23
  "runtime_setup": {
24
- "action": "actions/setup-python@v5",
24
+ "action": "actions/setup-python@v6",
25
25
  "with": { "python-version": "{{PYTHON_VERSION}}", "cache": "pip" }
26
26
  },
27
27
  "config_keys": {