Skip to content

fix: harden release and workflow inputs - #2542

Merged
tamirdresher merged 5 commits into
devfrom
squad/2538-codeql-workflows
Nov 19, 2026
Merged

tamirdresher merged 5 commits into
devfrom
squad/2538-codeql-workflows

Conversation

@tamirdresher

@tamirdresher tamirdresher commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

What

Harden release workflows, generated tables, and command authorization to address the infrastructure-side CodeQL alerts blocking Squad 2.0.0 promotion.

Why

Relates to #2538. Release jobs must use the selected trusted workflow SHA, untrusted text must not bypass Markdown or comment guards, and matrix runners must pass npm arguments without a command shell.

How

Bind manual SHA inputs to the selected workflow ref, check out that ref, escape Markdown safely, and replace ambiguous HTML-comment processing with a fail-closed parser. Invoke npm via argument arrays on Windows. Original upgrade-matrix runs remain unchanged as historical evidence. Verified Linux and Windows results from the integrated product fix are recorded in the fixture and generated documentation. The product changes merged separately in #2543.

Validation was run on the combined remediation worktree before the PRs were separated:

  • npm run gh-aw:integrity:write and npm run gh-aw:integrity:check: passed, including strict pinned workflow compilation.
  • npx --no-install vitest run test/gh-aw-command-authorization.test.ts -t 'fails closed on alternate|rejects comment-split lifecycle authority when the live contract is mutated' --maxWorkers=1 --testTimeout=30000 --hookTimeout=180000: passed, 3 tests and 62 skipped.
  • npx --no-install vitest run test/squad-20-host-feature-matrix.test.ts test/actionlint-config.test.ts test/standalone-release-workflow.test.ts test/release-script-policy.test.ts --maxWorkers=2 --testTimeout=30000 --hookTimeout=30000: passed, 105 tests and 4 skipped.
  • node scripts/render-host-feature-matrix.mjs --check, node scripts/release/check-release-scripts.mjs, and actionlint .github/workflows/squad-standalone-release.yml .github/workflows/squad-workflow-lint.yml: passed.
  • npm run lint:docs: passed.
  • Automatic upgrade matrix at f6c82545c764f1e1fbf4dd19f3ec4606b93f85f2, harness ed7a6a62ab80de5dd3ded1d25ead072f3538c38cb43bde356cc97aa80896da1b: Linux Node 22.23.4 and Windows Node 22.23.5 each passed 35 rows with 7 structural skips. Four rows per OS include the documented expected F3 failure of the historical 0.9.1 CLI; all six profile isolation checks passed per OS.
  • npx vitest run test\squad-20-upgrade-matrix.test.ts test\squad-20-preview-tarball-matrix.test.ts --testTimeout 30000: passed, 29 tests and 91 opt-in skips. Two local Windows runs at the default 5-second timeout timed out during the preview test's cold import.
  • node scripts\render-upgrade-matrix.mjs --check: passed after folding both CI artifacts.
  • Full npm test was not run locally. The full command-authorization suite had 14 pre-existing Windows virtual-path failures and two compiler timeouts locally; its Linux CI result is required.

⚠️ Quick Check

  • If SDK/CLI source files changed: completed the applicable Changeset step below (npx changeset add / .changeset/*.md, direct CHANGELOG.md entry for maintainers, or skip-changelog label for no user-facing changes)

PR Readiness Checklist

The PR readiness bot will validate these automatically after push.
Check each item before requesting review. See CONTRIBUTING.md for full details.

Branch & Commit

  • Branch created from dev (not main)
  • Branch is up to date with dev (git fetch upstream && git rebase upstream/dev)
  • Verified diff contains only intended changes (git diff --cached --stat)
  • PR is not in draft mode (mark ready when checks pass)
  • Commit history is clean (squash fixups before review)

Build & Test

  • npm run build passes
  • npm test passes (all tests green)
  • npm run lint passes (type check clean)
  • npm run lint:eslint passes
  • For migration PRs (>20 files): include test output summary in PR description

The full-suite checkbox awaits CI on the final head. The user approved the >20-file release remediation.

Changeset

  • Changeset added via npx changeset add (if packages/squad-sdk/src/ or packages/squad-cli/src/ changed)
  • Or direct CHANGELOG.md entry (maintainers only — write-protected for external contributors)
  • Or skip-changelog label applied (if no user-facing changes)

N/A: no SDK or CLI source or shipped templates changed.

Docs

  • README section updated (if new feature/module)
  • Docs feature page (if new user-facing capability)

The generated matrix pages reflect the updated renderers and preserve the original results in the fixture.

Exports

  • package.json subpath exports updated (if new module)

N/A.


Breaking Changes

Manual workflow-lint requests must select the same ref as the requested SHA.

Waivers

None requested. Required CI must pass before merge.

Relates to #2538

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 12:50
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 30f46a0

PR Scope: 🔧 Infrastructure

⚠️ 3 item(s) to address before review

Status Check Details
❌ Single commit 5 commits — consider squashing before review
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present No source files changed — changeset not required
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved 1 active Copilot thread(s) resolved (2 outdated skipped)
❌ CI passing 3 check(s) failing: test, docs-quality, gh-aw strict compile

Files Changed (21 files, +11798 −54)

File +/−
.github/workflows/squad-standalone-release.yml +6 −6
.github/workflows/squad-workflow-lint.yml +3 −1
docs/src/content/docs/scenarios/upgrading.md +7 −5
scripts/pr-readiness.mjs +1 −0
scripts/release/build-manifest.mjs +2 −1
scripts/release/check-release-scripts.mjs +1 −1
scripts/render-host-feature-matrix.mjs +62 −4
scripts/render-upgrade-matrix.mjs +5 −1
test-fixtures/spec/suite-v0.2/upgrade-matrix.json +11396 −2
test/actionlint-config.test.ts +17 −0
test/fixtures/upgrade-matrix/fs-access-log.cjs +1 −0
test/gh-aw-command-authorization.test.ts +78 −1
test/pr-readiness.test.ts +1 −0
test/release-script-policy.test.ts +6 −0
test/specification-suite.test.ts +17 −3
test/squad-20-host-feature-matrix.test.ts +41 −0
test/squad-20-preview-tarball-matrix.test.ts +10 −6
test/squad-20-upgrade-matrix.test.ts +113 −18
test/standalone-release-workflow.test.ts +5 −3
workflows/shared/squad-command-contract.mjs +25 −1
workflows/squad-workflows.manifest.json +1 −1

Total: +11798 −54


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

Authoritative evidence: scanners from the PR base commit, posted by the default-branch workflow_run reporter.
Results for head commit 30f46a096c21c6f19f79db55b3bfe092c5fffcad.

⚠️ Architectural review: 1 warning(s), 1 info.

Severity Category Finding Files
ℹ️ info template-sync Template files changed in .github/workflows/ but not in other template locations. If these templates should stay in sync, consider updating the others too. Changed: .github/workflows/, Unchanged: templates/, .squad-templates/, packages/squad-cli/templates/
🟡 warning sweeping-refactor This PR touches 21 files (21 modified/added, 0 deleted). Large PRs are harder to review — consider splitting if possible. —

Automated architectural review — informational only.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🟠 Impact Analysis — PR #2542

Risk tier: 🟠 HIGH

📊 Summary

Metric Count
Files changed 21
Files added 0
Files modified 21
Files deleted 0
Modules touched 5

🎯 Risk Factors

  • 21 files changed (21-50 → HIGH)
  • 5 modules touched (5-8 → HIGH)

📦 Modules Affected

ci-workflows (2 files)
  • .github/workflows/squad-standalone-release.yml
  • .github/workflows/squad-workflow-lint.yml
docs (1 file)
  • docs/src/content/docs/scenarios/upgrading.md
root (3 files)
  • test-fixtures/spec/suite-v0.2/upgrade-matrix.json
  • workflows/shared/squad-command-contract.mjs
  • workflows/squad-workflows.manifest.json
scripts (5 files)
  • scripts/pr-readiness.mjs
  • scripts/release/build-manifest.mjs
  • scripts/release/check-release-scripts.mjs
  • scripts/render-host-feature-matrix.mjs
  • scripts/render-upgrade-matrix.mjs
tests (10 files)
  • test/actionlint-config.test.ts
  • test/fixtures/upgrade-matrix/fs-access-log.cjs
  • test/gh-aw-command-authorization.test.ts
  • test/pr-readiness.test.ts
  • test/release-script-policy.test.ts
  • test/specification-suite.test.ts
  • test/squad-20-host-feature-matrix.test.ts
  • test/squad-20-preview-tarball-matrix.test.ts
  • test/squad-20-upgrade-matrix.test.ts
  • test/standalone-release-workflow.test.ts

This report is generated automatically for every PR. See #733 for details.

Relates to #2538

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The guard and safe-output writers disagree on comment termination, allowing protected activation markers into published text and bypassing the trusted-writer boundary.

3 open issues
What changed in this PR

Hardens the infrastructure supporting Squad 2.0.0 promotion (#2538), focusing on trusted workflow checkouts, command authorization, and generated verification output.

Changes:

  • Bind manual release and lint checkouts to the selected workflow SHA.
  • Strengthen comment parsing, Markdown table escaping, and release-script policy checks.
  • Update Windows npm helpers, preserve historical upgrade evidence separately, and expand regression coverage.
File Description
workflows/​squad-workflows.manifest.json Refreshes the command-contract integrity hash.
workflows/​shared/​squad-command-contract.mjs Adds fail-closed HTML-comment inspection.
test/​standalone-release-workflow.test.ts Checks trusted checkout and SHA-binding requirements.
test/​squad-20-upgrade-matrix.test.ts Updates Windows npm invocation and validates historical runs.
test/​squad-20-preview-tarball-matrix.test.ts Updates Windows npm invocation and tests literal arguments.
test/​specification-suite.test.ts Replaces regex-based heading-tag removal with scanning.
test/​release-script-policy.test.ts Adds long-whitespace detection coverage.
test/​pr-readiness.test.ts Covers backslashes before filename pipes.
test/​gh-aw-command-authorization.test.ts Adds comment-parsing regressions and mutation coverage.
test/​actionlint-config.test.ts Verifies manual SHA validation precedes checkout.
test-fixtures/​spec/​suite-v0.2/​upgrade-matrix.json Separates historical results from current runs.
scripts/​render-upgrade-matrix.mjs Updates escaping and discloses historical evidence.
scripts/​render-host-feature-matrix.mjs Expands table-cell backslash escaping.
scripts/​release/​check-release-scripts.mjs Simplifies whitespace matching in Node command detection.
scripts/​release/​build-manifest.mjs Updates anchor and regression-title escaping.
scripts/​pr-readiness.mjs Adds backslash escaping for filenames.
docs/​src/​content/​docs/​scenarios/​upgrading.md Regenerates tables without current-harness run claims.
docs/​src/​content/​docs/​reference/​host-feature-matrix.md Regenerates output with updated escaping.
.github/​workflows/​squad-workflow-lint.yml Validates requested SHA against the selected workflow ref.
.github/​workflows/​squad-standalone-release.yml Pins release checkouts to the dispatch SHA.

Review effort: Max (adaptive)

Comment thread scripts/render-host-feature-matrix.mjs Resolved
Comment thread test/squad-20-upgrade-matrix.test.ts Resolved
tamirdresher and others added 3 commits November 19, 2026 16:24
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bring the verified dev dependency into the upgrade-matrix branch. Closes #2538

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve the instrumented Linux and Windows results for the integrated product fixes. Closes #2538

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tamirdresher
tamirdresher merged commit 3138524 into dev Nov 19, 2026
39 of 42 checks passed
@tamirdresher
tamirdresher deleted the squad/2538-codeql-workflows branch November 19, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants