Skip to content

fix(security): verify the design-system publish tarball and pin the publish job's setup-node at v7.1.0 - #2447

Merged
buggtb merged 2 commits into
developmentfrom
fix/2421-design-system-publish-hardening
Nov 19, 2026
Merged

buggtb merged 2 commits into
developmentfrom
fix/2421-design-system-publish-hardening

Conversation

@spicule-hive-bot

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #2369 (the design-system build/publish split), finishing #2421. Two of the issue's three points were already fixed by that merged PR; this PR closes the remaining two.

What was already done (by #2369, merged)

  • mkdir -p "$RUNNER_TEMP/pack" before npm pack — the ENOENT fix (issue item 1).
  • The version from the unprivileged build job reaches the privileged publish scripts only through env:; no run: script in the id-token: write job contains ${{ (issue item 2).

What this PR adds

  • Tarball gate before the token step. Publish previously took whatever pkg/*.tgz held, and NPM_TOKEN covers the whole @concepttocloud scope. A new credential-free step, "Verify the tarball is the design-system package", now refuses to proceed unless there is exactly one *.tgz, whose own package/package.json names @concepttocloud/saiku-design-system at a strict-semver version equal to the version the build job reported. Publish then publishes exactly that verified tarball (npm publish "$TARBALL") instead of the raw glob. A failure here never touches the registry token.
  • setup-node pin. The publish job was still pinned at the v7.0.0 SHA (82076278…): the build(deps): bump actions/setup-node from 7.0.0 to 7.1.0 #2399 dependabot bump to v7.1.0 predates the split, and the split's rewrite reintroduced the old pin in the new job. Now pinned at 949feb2413d6458794dcd2491c4babbbce0c15c1 (v7.1.0), same as the build job.
  • acceptance/2421 — a command spec (red on base, green here) asserting: no ${{ in any run: of the id-token: write job (C1); the exactly-one/strict-name/strict-version gate and that Publish consumes the verified tarball rather than the glob (C2); the v7.1.0 pin (C3); and mkdir -p "$RUNNER_TEMP/pack" before npm pack (C4, regression guard for fix(security): split design-system build and publish jobs (#2335) #2369's ENOENT fix).

Maintainer action still required (repository settings — not code, and outside a contributor's write scope)

  • Create the npm-publish environment with required reviewers (and branch protection as desired) and move NPM_TOKEN into it as an environment secret. The workflow already declares environment: npm-publish; until the environment exists GitHub auto-creates it unprotected on first use. Also rotate NPM_TOKEN (it was exposed to a scripted publish before fix(security): split design-system build and publish jobs (#2335) #2369) — prefer a granular token limited to the @concepttocloud/saiku-design-system package, or enable npm Trusted Publishing and delete the token.

Closes #2421

Test plan

  • acceptance/2421: red on upstream/development (C2 tarball gate, C3 pin), green on this branch (node .github/scripts/acceptance-runner.mjs run --dir acceptance/2421 → pass)
  • node --test .github/scripts/*.test.mjs — 407 pass, 0 fail
  • python3 -m unittest discover -s .github/scripts -p 'test_workflow_pins.py' — 8 pass
  • shellcheck over every run: block in design-system.yml — no new findings beyond the pre-existing SC2148 shebang tip (all blocks) and an SC2153 info on the step-supplied VERSION env, the same pattern the existing registry step uses

— hive: backend=pi model=openrouter/z-ai/glm-5.3-flash


🐝 Hive Agent: contributor | SHA: 6704ec094

…ublish job's setup-node at v7.1.0

Follow-up to #2369 (design-system build/publish split), finishing #2421:

- The Publish step took whatever pkg/*.tgz held and NPM_TOKEN covers the whole
  @concepttocloud scope. A credential-free gate now runs before the token step:
  exactly one tarball, its own package/package.json naming
  @concepttocloud/saiku-design-system at a strict-semver version equal to the
  version the build job reported; Publish then publishes exactly that verified
  tarball instead of the raw glob.
- The publish job's setup-node was still pinned at the v7.0.0 SHA (the #2399
  dependabot bump predates the split, and the split's rewrite reintroduced the
  old pin there); now pinned at the v7.1.0 SHA like the build job.
- The version from the unprivileged build job still reaches the privileged
  scripts only through env — no run: script in the id-token: write job
  contains ${{ (now asserted by acceptance/2421).

Maintainer action still required (repository settings, not code): create the
npm-publish environment with required reviewers and move NPM_TOKEN into it.

Hive-Run: #2421
Hive-Plan: issue-2421 design-system publish hardening
Hive-Spec: acceptance/2421#C1-C4
Signed-off-by: spicule-hive-bot <spicule-hive-bot@users.noreply.github.com>
@github-actions github-actions Bot added the ci Created by Hive for agent-filed issue provenance label Nov 19, 2026
@github-actions github-actions Bot added the risk/high Change risk tier: high (see docs/risk-tiers.md) label Nov 19, 2026
@github-actions

Copy link
Copy Markdown

Semantic model diff

No semantic model changed in this pull request, so there was nothing to diff.
saiku#1434 · reproduce locally with saiku model diff

@spicule-hive

spicule-hive Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor
6704ec0

⚠️ Sentinel alert — maintainer review required

Hive flagged this PR (author @spicule-hive-bot, head 6704ec0940d6) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • sensitive_path — changes 1 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • .github/workflows/design-system.yml

Hive added the sentinel-alert label. While it is present, Hive will not approve this PR, apply LGTM/approval labels, or merge it through any auto-merge lane. Remove the label once reviewed; Hive will not re-apply it unless new commits are pushed. Tune paths and behaviors under sentinel in hive.yaml or the dashboard Security tab.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

CI feedback

passing · 87286a4
Generated 2026-11-19T22:43:19.146Z. Machine-readable copy: ci-feedback.json (schema v1, see docs/ci-feedback.md) - artifact on this run.

Nothing to fix: every check in this commit concluded successfully.

@buggtb buggtb added needs-rework Ask the hive's quality agent to rework this PR (reads comments, fixes CI/conflicts, pushes) rework-queued The quality agent has picked this PR up (set automatically when needs-rework is consumed) and removed needs-rework Ask the hive's quality agent to rework this PR (reads comments, fixes CI/conflicts, pushes) labels Nov 19, 2026
Signed-off-by: quality <334701613+spicule-hive[bot]@users.noreply.github.com>
@spicule-hive

spicule-hive Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Rework for the needs-rework label and CI feedback on 6704ec0 (commit 87286a40e):

  • acceptance/2335 C2 failure: The older check required literal .tgz text on the npm publish line. The new publish step uses quoted $TARBALL. I updated the check to accept that form only when the variable is wired to the tarball gate's exported pkg/*.tgz path; it still accepts a literal .tgz path and still requires --ignore-scripts and --provenance. The other two red checks (acceptance / specs and ci) were downstream of this assertion. There were no written collaborator review or inline comments beyond the rework label.
  • Outstanding maintainer action from design-system.yml: create the pack directory and stop interpolating build output into the publish script #2421: The repository settings item remains: create and protect the npm-publish environment with required reviewers, move and rotate NPM_TOKEN as an environment secret, or configure Trusted Publishing and remove the token. The workflow change in this PR also needs maintainer review. I did not edit .github/workflows or change repository settings in this rework.

Local verification: acceptance/2335 and acceptance/2421 both pass via the acceptance runner; node --test .github/scripts/*.test.mjs passes 407/407; the design-system workspace builds and svelte-check reports 0 errors and 0 warnings; git diff --check passes. The branch is mergeable with current development, so no base merge was needed. New CI checks started after the push but were pending at the last permitted check; automatic approval review blocked further CI polling (ci_watch_blocked), so I cannot report a post-push CI verdict.


🐝 Hive Agent: quality | Instance: hive-safe-wren | SHA: 87286a40e

— hive: agent=quality backend=codex model=gpt-6-sol codex=0.167.0

@buggtb
buggtb added this pull request to the merge queue Nov 19, 2026
Merged via the queue into development with commit 230bfb2 Nov 19, 2026
25 checks passed
@github-actions

Copy link
Copy Markdown

PR acceptance metric

Acceptance rate: 85.9% — 428 merged / 498 decided PRs (2 still open, excluded from the denominator).

Metric Value
Acceptance rate 85.9%
Accepted / rejected / open 428 / 70 / 2
Median time to first review (merged) 125.1 h
Median time to merge (merged) 14.1 h
Median time open (decided) 18.7 h
Mean review rounds on merged PRs 1.3
Authors with at least one merged PR 8
Author Merged Rejected Acceptance
buggtb 215 19 91.9%
app/dependabot 97 41 70.3%
juanresendiz813 95 1 99.0%
spicule-hive-bot 9 1 90.0%
app/spicule-hive 8 1 88.9%
oiacub1 2 0 100.0%
k-jm 1 3 25.0%
Prithvi1994 1 0 100.0%
laborima 0 3 0.0%
rezamuliawijaya 0 1 0.0%

Generated by scripts/pr-metrics.mjs — see docs/metrics.md.

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

Labels

agent-config ci Created by Hive for agent-filed issue provenance docs rework-queued The quality agent has picked this PR up (set automatically when needs-rework is consumed) risk/high Change risk tier: high (see docs/risk-tiers.md) sentinel-alert

Projects

None yet

Development

Successfully merging this pull request may close these issues.

design-system.yml: create the pack directory and stop interpolating build output into the publish script

2 participants