Skip to content

fix(deploy-preview): scorecard gate misjudges not_applicable, no_raw_secrets, and npm_signatures_verified#60

Merged
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
fix/issue-59-scorecard-not-applicable
Jul 10, 2026
Merged

fix(deploy-preview): scorecard gate misjudges not_applicable, no_raw_secrets, and npm_signatures_verified#60
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
fix/issue-59-scorecard-not-applicable

Conversation

@jorisjonkers-dev-agents

@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #59

Problem

The deploy-validate scorecard gate produced a red scorecard on every fresh service adoption (observed identically on the auth-api, agents-api, and agent-runtime onboardings). Recorded run logs show all five fragment renders failing, after which the gate exited 1 with no_raw_secrets=fail and npm_signatures_verified=fail — neither of which reflected a genuine finding.

Root causes

  1. no_raw_secrets overridden to fail on any render failure. A block in main() forced no_raw_secrets=fail whenever any fragment render failed. An empty out/manifests/ cannot contain secrets; the underlying grep check already passes correctly in that case. The override is removed — render failures still emit per-fragment ::warning diagnostics.
  2. npm_signatures_verified structurally impossible to pass in preview. The action always invokes artifact emit-contract with --provenance-verified false (no published artifact exists at PR time), so the contract check failed on every run. The check is now not_applicable in preview mode; provenance verification belongs to the deploy-artifact gate.
  3. Failure message named no concrete item. no_raw_secrets now reports fail:raw-secret-in:<path> naming the first offending manifest file. The overall gate filter switched from exact == "fail" matching to startswith("fail") so detail-suffixed failures still fail the gate, and the preview-summary icon logic matches the fail* prefix.

not_applicable was already excluded from the overall fail computation; the three SC-11 checks that define it (route_owner_authmode_declared, stateful_policy_declared, raw_manifests_guarded) now have explicit test coverage proving not_applicable cannot fail the gate.

Tests

New tests/test_scorecard.py (18 tests) sources run.sh and exercises compute_scorecard directly:

  • not_applicable values never count as failures; a minimal fresh-adoption fixture yields a green scorecard end to end
  • npm_signatures_verified is not_applicable regardless of contract content
  • no_raw_secrets passes when out/manifests/ is absent, empty, or secret-free — including when render failures are simulated
  • no_raw_secrets failure names the offending file path
  • detail-suffixed fail: values fail the overall gate; the jq gate filter asserted in tests must appear verbatim in run.sh so the two cannot drift

…ets (#59)

- no_raw_secrets now reports the offending file path on failure (fail:raw-secret-in:<path>)
  and correctly passes when out/manifests/ is empty or missing (all-renders-fail case)
- npm_signatures_verified is not_applicable in preview mode; --provenance-verified false
  is always passed so the check can never pass and should not gate on it
- Remove the render-failure block that incorrectly overrode no_raw_secrets to fail
- Fix render_preview_summary icon to match fail* prefix (not exact "fail" string)
- Add tests/test_scorecard.py covering all four bug fixes
The overall gate used jq select(. == "fail") (exact match). With
no_raw_secrets now returning "fail:raw-secret-in:<path>", a real raw
secret would not count as a failure and the gate would wrongly pass.
Switch to startswith("fail") and mirror the filter in the tests via a
shared constant asserted to appear verbatim in run.sh.
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot added the type: bug Something is broken or behaving incorrectly. label Jul 10, 2026
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot changed the title fix: scorecard not_applicable handling and detail-suffixed fail counting fix(deploy-preview): scorecard gate misjudges not_applicable, no_raw_secrets, and npm_signatures_verified Jul 10, 2026
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot merged commit 77c8d5c into main Jul 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something is broken or behaving incorrectly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy-validate: not_applicable SC-11 checks fail the scorecard gate

1 participant