Skip to content

ci(trust): OpenSSF Scorecard workflow + README badge; initial score recorded (#980 P1b) #1025

Closed

Description

@admarble

Epic: W2 Blocked by: #980 Tier: mechanical Doc: W2 PLAN §7 D5/D8, §8 (README serialization)

Why

#980 AC-5. A recurring, third-party-computed supply-chain signal that a
reviewer can check without trusting our prose. Sequenced after node 03 so the
README edits (03 link line → 05 badge line → 07 section) do not conflict.

Scope

  • may touch: .github/workflows/scorecard.yml (new; ossf/scorecard-action
    pinned by commit SHA like the other workflows), README.md (one badge line),
    CHANGELOG.md (one bullet).
  • not in scope: remediating findings (recorded, not fixed here); any other
    workflow; SECURITY.md/threat model text.

Acceptance criteria

  • AC-1: the workflow runs on push to main and weekly schedule with permissions limited to what the action documents, action pinned by SHA — Verify: grep -c "ossf/scorecard-action@[0-9a-f]\{40\}" .github/workflows/scorecard.yml → 1; gh run list --workflow scorecard.yml --limit 1 --json conclusion --jq '.[0].conclusion' → success.
  • AC-2: README badge renders — Verify: curl -sIL "$(grep -o 'https://api.securityscorecards.dev/projects/[^)]*badge' README.md | head -1)" | grep -c "^HTTP/2 200" → 1 (runner amendment 2026-09-10, W2 D18: the badge host answers 302 first and serves the SVG on the redirected URL, so the original first-line check can never pass; -L follows the redirect).
  • AC-3: the initial score and the top-3 remediation items are posted as a comment on this issue — Verify: gh issue view <this> --json comments --jq '.comments[-1].body' | grep -c "Score:" → 1.

Done when

Scorecard runs on its own schedule, the badge is live, and the first score is
on record with its remediations named.

Activity

  1. added
    enhancement
    graph-2026-09-w2
    on Sep 9, 2026
  2. admarble commented on Sep 10, 2026

    @admarble
    ContributorAuthor

    Runner context — W2 wave 2 launch (2026-09-10). Node 05, mechanical tier. Base: main at 6783356 (v2.14.0 + wave 1: #980/#982/#990/#1032 merged). Stop-at-PR: open the PR, do not merge. Gate tests need Mutation-verified: records in the PR body with failedTest as <test file path> > <test name> (CLAUDE.md; a describe title alone is rejected). Foreground only: run every check in the foreground with a timeout (timeout 600 npm test 2>&1 | tail -80); the pre-tool hook now blocks Monitor and run_in_background under the orchestrator (#1032) — nothing will wake you, the phase ends when your turn ends. Commit a WIP within 5 minutes and every ~10 minutes; every phase has a hard 30-minute wall. CHANGELOG.md [Unreleased]: append one bullet under the matching ### heading, never a second heading of the same name.

  3. admarble commented on Sep 10, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (3 ACs, 2 directories) · SCOPE_OK

    AC checklist

    • AC-1: scorecard.yml on push(main) + weekly schedule, scoped permissions, action pinned by 40-hex SHA; run concludes success.
    • AC-2: README Scorecard badge added (existing badge block, after the CI badge); resolves HTTP 200.
    • AC-3: Initial score + top-3 remediations posted as a comment on this issue (Score: present in last comment).

    Plan

    1. Resolve real SHA pins at implementation time (gh api .../git/refs/tags/<version>) for ossf/scorecard-action and its checkout/upload-artifact/codeql-action companions — do not hardcode from memory.
    2. Add .github/workflows/scorecard.yml: the action's own starter shape (checkout → scorecard-action → upload-artifact → upload-sarif), permissions: read-all + narrowed job permissions, push(main) + weekly schedule.
    3. Add one README badge line (after the CI badge) — the single line this node owns per PLAN §8's 03→05→07 README serialization; don't touch node 03's link line or reserve node 07's section.
    4. Append one ### Security bullet to CHANGELOG.md [Unreleased] (same heading docs+ci(trust): public threat model with OWASP agentic mapping, SECURITY.md, recurring injection eval, and supply-chain trust signals #980 used).
    5. Post-merge follow-up (cannot happen inside this PR): once the workflow has run once on main and published, fetch the score and post it + top-3 remediations as a comment on this issue.

    Key decisions

    • No CI gating on score — recording only, per the issue's explicit Non-Goals.
    • testgen/security-review phases skipped — no unit-testable code, mechanical CI/docs change (PLAN D8 tiering).

    Open questions

    • Exact SHA pins resolved at exec time, not planning time (don't trust a memorized SHA).
    • AC-1's run-success check and AC-3 are structurally post-merge; per stop-at-PR, the PR will document them as a pending follow-up rather than closing them pre-merge.
    • Confirm publish_results: true only needs the push: main trigger to resolve the badge (AC-2) — a 404 immediately post-merge, pre-first-run, isn't a bug.

    Phases: exec → qa
    Quality Loop: disabled

  4. added
    planned
    on Sep 10, 2026
  5. admarble commented on Sep 10, 2026

    @admarble
    ContributorAuthor

    QA Verdict: NEEDS_VERIFICATION

    AC coverage: 0/6 met

    Gaps:

    • All three ACs are PENDING on post-merge execution because a push/schedule workflow cannot run from an open PR; the implementation itself is complete
    • AC-2's declared verify command is mis-specified and can never pass as written; the post-merge follow-up needs curl -sIL or an SVG-text assertion instead
    • The first post-merge run fails at the SARIF upload step if Code Scanning is not enabled on the repository, leaving AC-1's success conclusion unmet despite a correct workflow
    • Four unpinned action references survive in a sibling workflow and will be flagged by the Scorecard Pinned-Dependencies check this PR introduces

    Suggestions:

    • The action's README at the pinned v2.4.4 documents the badge host as api.scorecard.dev; the README uses the legacy api.securityscorecards.dev. I confirmed both 302 to the identical shields.io URL, so this is a working alias, not a defect — but it's the AC text that pinned the legacy domain, so leaving it is the right call for this PR.
  6. admarble commented on Sep 10, 2026

    @admarble
    ContributorAuthor

    Runner verification of the NEEDS_VERIFICATION verdict (2026-09-10, PR #1041 at f009f9d2). Executed in the worktree, verbatim where an AC gives a command:

    Check Command / method Result
    AC-1 pin grep -c "ossf/scorecard-action@[0-9a-f]\{40\}" .github/workflows/scorecard.yml 1 ✅
    AC-1 triggers + permissions YAML parsed: on: push(main), schedule(30 4 * * 1); top-level permissions: read-all; job security-events: write, id-token: write — the set the action documents ✅
    All four action pins resolve to their tags gh api repos/<owner>/<repo>/git/ref/tags/<tag> → sha checkout v7.0.1 ✅, upload-artifact v7.0.1 ✅, scorecard-action v2.4.4 ✅, codeql-action v4.38.0 ✅
    AC-1 first run conclusion == success gh run list --workflow scorecard.yml post-merge only — a push/schedule workflow cannot run from a PR branch
    AC-2 badge curl -sIL <badge> 302 → 200 image/svg+xml ✅ (AC-2's verify command amended, D18: it needs -L)
    AC-3 score comment — post-merge only (needs the first published run)
    Code Scanning prerequisite for the SARIF upload step gh api repos/sequant-io/sequant/code-scanning/alerts → 404 no analysis found no analysis yet; on a public repo the first upload-sarif creates it — the first post-merge run is the test

    Post-merge runner checklist (this issue stays awaiting_verification until then): watch the first scorecard.yml run on main → if the SARIF upload step fails, enable Code Scanning (Settings → Code security) and re-run; then read the score from https://scorecard.dev/viewer/?uri=github.com/sequant-io/sequant and post the AC-3 comment (Score: + top-3 remediations). QA's note about four unpinned action refs in a sibling workflow is out of this node's scope (not in scope: remediating findings) — Dependabot PRs #1037–#1039 touch those same actions.

  7. added a commit that references this issue on Sep 11, 2026
  8. admarble commented on Sep 11, 2026

    @admarble
    ContributorAuthor

    Post-merge verification — AC-1 and AC-3 (runner, 2026-09-11 01:20Z).

    • AC-1: first scorecard.yml run on main (2d8f17a, run 34549929846) → success, every step green including Upload to code-scanning — no manual Code Scanning enablement was needed on this public repo.
    • AC-2: badge live (302 → 200 image/svg+xml, amended verify D18).
    • AC-3, initial score from api.securityscorecards.dev (published for 2d8f17a at 01:15:33Z):

    Score: 5.8 / 10

    Top-3 remediations by leverage (recorded, not fixed here — node 05 scope):

    1. Branch-Protection 0 → require a PR review on main. Also lifts Code-Review (0/30 approved changesets) and, per docs/THREAT-MODEL.md, promotes the merge gate from model-dependent to deterministic in one cell. Repo setting, owner action.
    2. Token-Permissions 0 → least-privilege permissions: on every workflow (ci.yml and siblings run with the default write token; scorecard.yml already sets read-all + per-job grants). Small, mechanical; a good follow-up issue.
    3. Pinned-Dependencies 7 → pin the remaining action references by SHA (the four unpinned refs QA noted in a sibling workflow; Dependabot's chore(deps): bump actions/upload-artifact from 4.6.2 to 7.0.1 #1037–chore(deps): bump actions/checkout from 4 to 7 #1039 bump versions but do not hash-pin).

    Below the line, for the record: Packaging / Signed-Releases -1 (no release workflow signal — the release flow is the /release skill, and provenance is gate #1026's decision), CII-Best-Practices, SAST, Fuzzing, Contributors all 0 — informational for a single-maintainer CLI; Dependency-Update-Tool, Maintained, Security-Policy, Dangerous-Workflow, Binary-Artifacts, License, Vulnerabilities, CI-Tests all 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgraph-2026-09-w2planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions