Skip to content

PRD: CI/GitHub Actions Performance Optimization — Reduce Runners Per PR Push from 19 to 8-10 #872

Closed

Description

@diberry

Problem Statement

Every PR push to bradygaster/squad triggers ~19 separate runner instances across 4 workflows (Squad CI, Repo Health, PR Readiness, Impact Analysis). With 12+ open PRs getting frequent pushes, this creates significant Actions minute consumption. Many of these runners do <10 seconds of actual work but each incurs 1-2 minutes of runner boot overhead.

This is a consolidation PRD ΓÇö the safety gates stay, they just get packaged more efficiently.

PRD v3 update: This PRD now includes a greenfield target architecture (4-5 runners per PR push) as the end state. The phased proposals below are the migration path toward that target. See Target Architecture (Greenfield) for the full design.


Current State (Per-PR Push)

Workflow File Jobs Notes
Squad CI squad-ci.yml 11 changes, docs-quality, test, changelog-gate, changelog-protection, exports-map-check, samples-build, publish-policy, workspace-integrity, prerelease-version-guard, export-smoke-test
Repo Health squad-repo-health.yml 5 bootstrap-protection, diff-guard, squad-leakage, architectural-review, security-review. Each spins up its own runner with checkout + fetch-depth:0 + setup-node + git fetch for scripts that run in <10 seconds.
PR Readiness squad-pr-readiness.yml 1 Runs TWICE per push (once on pull_request_target, once on workflow_run after CI completes)
Impact Analysis squad-impact.yml 1 Single job
Total ~19 Per PR push

Proposal

Priority 1 ΓÇö High Impact

1. Consolidate Repo Health into 1-2 jobs (currently 5)

The 5 repo-health jobs (bootstrap-protection, diff-guard, squad-leakage, architectural-review, security-review) each spin up a runner, do full checkout with fetch-depth:0, setup-node, and git fetch. The actual scripts run in seconds.

Action: Consolidate into a single job with sequential script steps. Use fetch-depth: 0 (required by all sub-checks). Three jobs post PR comments via repo-health-comment.mjs ΓÇö comment logic must handle sequential outputs with unique step IDs.

Debugging visibility: Use if: always() on every step so all checks run even if one fails. Add a final summary step that writes a per-check pass/fail table to $GITHUB_STEP_SUMMARY. Name each step clearly ΓÇö GitHub Actions UI shows step names within a job.

Savings: ~4 runner boot-ups per PR push (~8 min).

2. Consolidate Squad CI lightweight policy gates into 1 job (currently 6)

changelog-gate, changelog-protection, exports-map-check, workspace-integrity, prerelease-version-guard, and publish-policy are all lightweight checks that read files and grep ΓÇö each gets its own runner for <5 seconds of work. (samples-build and export-smoke-test are excluded ΓÇö they require full SDK builds and are not lightweight.)

Action: Merge into a single "policy-gates" job. Preserve per-step skip labels (skip-changelog, skip-exports-check, skip-workspace-check, skip-version-check, skip-export-smoke) as step-level if: conditions. Preserve per-step feature flags (vars.SQUAD_*) independently ΓÇö do NOT use a single "skip-policy-gates" label.

Note on Proposals 10 & 11: publish-policy and changelog-protection are consolidated INTO this job rather than removed. See Priority 3 rationale below.

Debugging visibility: Use if: always() on every step + write per-gate pass/fail to $GITHUB_STEP_SUMMARY. Each skip-label evaluated independently per-step:

- name: Check skip-changelog label
  id: skip-changelog
  run: |
    LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}'
    if echo "$LABELS" | grep -q "skip-changelog"; then echo "skip=true" >> "$GITHUB_OUTPUT"; fi

- name: Changelog gate
  if: always() && steps.skip-changelog.outputs.skip != 'true'
  run: node scripts/changelog-gate.mjs

Savings: ~5 runner boot-ups per PR push (~8 min).

3. Reduce PR Readiness duplicate runs (revised)

Original: Remove pull_request_target trigger entirely.

Revised (per Booster, FIDO review): Removing pull_request_target entirely loses the edited and ready_for_review event types that workflow_run doesn't provide. PR description edits and draft→ready transitions would stop updating readiness.

Action: Keep pull_request_target for edited and ready_for_review events only. Remove it for opened, synchronize, and reopened ΓÇö those are covered by the workflow_run trigger (fires after Squad CI completes).

# Before:
pull_request_target:
  types: [opened, synchronize, reopened, edited, ready_for_review]

# After:
pull_request_target:
  types: [edited, ready_for_review]

Savings: Eliminates the redundant full-push run while preserving event coverage.

4. Add path-based filtering to squad-ci.yml (revised)

Original: Add paths-ignore: at workflow level.

Revised (per FIDO, Booster review): Workflow-level paths-ignore can leave required status checks stuck in "pending" state, blocking merges for docs-only PRs. GitHub does not auto-pass skipped required checks ΓÇö they just never report.

Action: Use paths-filter action with conditional job execution instead of top-level paths-ignore. The changes job pattern already partially exists in squad-ci.yml ΓÇö extend it to gate the full pipeline. This ensures the workflow still triggers (satisfying required checks) but individual jobs exit early when irrelevant.

docs-quality orphaning: If the entire workflow gates on code paths, docs-quality gets skipped on docs-only PRs. Move docs-quality to its own lightweight workflow triggered on docs paths, or to squad-repo-health.yml.

Savings: ~15 min per docs-only push (jobs still report but exit immediately).

5. Add missing concurrency groups ΓÇö split policy (revised)

Original: Add cancel-in-progress: true to all 10 workflows.

Revised (per Booster, RETRO, FIDO — all flagged this as 🔴 CRITICAL): cancel-in-progress: true on publish/release workflows is dangerous. Cancelling an in-flight publish can leave packages partially published (e.g., SDK on npm registry but CLI not yet published).

Action: Split into two concurrency policies:

Policy Workflows Behavior
Cancel stale runs (cancel-in-progress: true) squad-scope-check, squad-preview, sync-squad-labels Safe ΓÇö read-only or idempotent checks
Queue, don't cancel (cancel-in-progress: false) squad-release, squad-promote, squad-insider-release, squad-insider-publish, squad-npm-publish Prevents partial publishes ΓÇö queued run waits for current to finish

Dropped from proposal: squad-docs-links ΓÇö workflow_dispatch only, no rapid-push risk.

# PR/validation workflows:
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

# Publish/release workflows:
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: false

Savings: Eliminates stacked redundant runs on rapid pushes without risking partial publishes.


Priority 2 ΓÇö Medium Impact

6. Consolidate issue-event workflows (3 → 1)

squad-triage, squad-issue-assign, and squad-label-enforce all fire on issues: [labeled]. That's up to 3 runners for a single label click (though if: conditions on squad-triage and squad-issue-assign already prevent boot for non-matching labels ΓÇö squad-label-enforce has no such guard).

Action: Consolidate into squad-issue-ops.yml. Add a combined filter. Note: squad-issue-assign uses secrets.COPILOT_ASSIGN_TOKEN PAT ΓÇö the combined workflow needs this secret.

Savings: 1-2 runners per label event.

7. Share build artifacts in publish pipelines

squad-insider-publish (5 jobs, ~20-30 min) and squad-npm-publish (6 jobs, ~25-35 min) both rebuild npm install + build 2-3x across jobs.

Action: Use upload-artifact/download-artifact to build once and share.

Artifact integrity requirements (per RETRO):

  • Verify artifact digests ΓÇö use actions/upload-artifact@v4 immutable artifacts
  • Pin action versions by SHA (not just @v4) to prevent supply chain attacks via tag mutation
  • Verify npm publish --provenance SLSA attestations still work when build and publish are in separate jobs (publish job must have id-token: write)
  • Only share dist/ build outputs ΓÇö never share node_modules/
  • Build job never sees NPM_TOKEN (principle of least privilege)

Savings: 15-20 min per publish.

8. Cache Playwright browsers in CI

Playwright installed every CI run (~2 min) without caching. Note: --with-deps installs system apt packages that won't be cached ΓÇö only the browser binary (~150MB) benefits.

Action: Add actions/cache for Playwright browser binaries with version key.

Savings: ~1-1.5 min per CI run.

9. Extract reusable composite action for test logic

ci-rerun.yml duplicates the entire squad-ci test job.

Action: Extract into .github/actions/test-squad-ci/ composite action.

Savings: Eliminates drift between CI and rerun workflows.


Priority 3 ΓÇö Consolidate, Not Remove

Design change from v1: Team review determined that proposals 10 and 11 should be consolidated into the policy-gates job (Proposal 2) rather than removed entirely. Both checks are lightweight (<5 seconds) and enforce policies that cannot be reliably enforced outside CI.

10. Consolidate publish-policy into policy-gates (revised)

Original: Remove and move to pre-commit hook.

Revised (per RETRO, FIDO): Pre-commit hooks are client-side and bypassable with --no-verify. A contributor or bot could add bare npm publish to a workflow file undetected. The check is a 2-second grep ΓÇö costs nothing as a step.

Action: Keep as a step in the consolidated "policy-gates" job. No separate runner needed.

11. Keep changelog-protection in policy-gates (revised)

Original: Remove as redundant with changelog-gate.

Revised (per Booster, FIDO): These enforce different policies:

  • changelog-gate: Requires a changeset file exists when SDK/CLI source changes (and allows direct CHANGELOG.md edits as an alternative)
  • changelog-protection: Restricts who can directly edit CHANGELOG.md to approved authors (bradygaster, bots)

Without changelog-protection, any contributor could bypass the changeset workflow by editing CHANGELOG.md directly. These are complementary, not redundant.

Action: Keep as a step in the consolidated "policy-gates" job. No separate runner needed.


Target Architecture (Greenfield)

Added in PRD v3 based on Flight's greenfield CI analysis. The phased proposals above are the migration path; this section describes the end state all phases work toward.

The core insight: organize CI around resource tiers, not feature categories. Every safety feature falls into a resource tier based on what it actually needs to run. The current system often boots a Tier 4 runner (full npm install + build + Playwright — 4 min setup) for Tier 0 work (grep a file — 3 seconds).

Resource Tier Model

Tier What It Needs Setup Time Features Example Checks
Tier 0 — Zero-install actions/checkout only. git diff, grep, node -e (pre-installed). ~45s 14 Changelog gate, publish-policy, workspace-integrity, scope-boundary, version guard
Tier 1 — Node-only actions/setup-node but NO npm install. Runs .mjs scripts with node:* built-ins. ~55s 10 Bootstrap protection, squad leakage, architectural review, security review, impact analysis, exports-map-check
Tier 2 — Sparse install Installs specific tools (markdownlint-cli2, cspell) but not the full monorepo. ~75s 5 Markdown linting, spelling check, docs build
Tier 3 — Full install + build Full npm ci + npm run build. ~180s 5 Export smoke test, samples build, npm publish
Tier 4 — Full install + build + browser Everything in Tier 3 plus Playwright browser install. ~240s 6 Full test suite, CI rerun, insider build+test
API-only actions/github-script or gh CLI. Sparse or no checkout. ~30s 8 Label enforcement, triage, issue assignment, heartbeat

Target Workflow Layout (10 workflows)

The end state consolidates 19 workflows into 10, organized by event lifecycle and resource tier:

PR Lifecycle (3 workflows, 4-5 runners per push)

squad-pr-validate.yml — All read-only PR checks in ONE runner

Trigger: pull_request_target [opened, synchronize, reopened, edited, ready_for_review]
Security: checkout BASE only, fetch PR head as ref, NEVER execute PR code
Runner count: 1

Job: validate (Tier 1, ~60-90s actual work)
  Steps (all with if: always()):
    ├─ Checkout base (fetch-depth: 0, persist-credentials: false)
    ├─ Fetch PR head ref (refs/pull/<N>/head — fork-safe)
    ├─ Setup Node 22
    ├─ Path change detection → outputs: code_changed, docs_changed
    ├─ Changelog gate
    ├─ Changelog protection
    ├─ Publish policy
    ├─ Workspace integrity
    ├─ Prerelease version guard
    ├─ Scope boundary (if repo-health branch/label)
    ├─ Canary check + large deletion guard
    ├─ Exports map check
    ├─ Bootstrap zero-dep protection
    ├─ Diff guard (contamination heuristic)
    ├─ Squad leakage detection → post PR comment
    ├─ Architectural review → post PR comment
    ├─ Security review → post PR comment
    ├─ Impact analysis → post PR comment
    ├─ PR readiness scoring (on all event types)
    └─ Summary → $GITHUB_STEP_SUMMARY with per-check pass/fail table

This consolidates features from 5 current workflows (squad-ci policy gates, squad-repo-health, squad-impact, squad-scope-check, squad-pr-readiness) into 1 runner. The existing repo-health-comment.mjs upsert pattern continues to work — consolidate execution, not comment format.

Security invariant: This workflow NEVER executes PR code. It checks out BASE branch scripts and reads PR content via git diff only. Fork-safe diff access uses refs/pull/<number>/head. No PR metadata is interpolated into shell commands — all metadata access goes through Node + GitHub API.

squad-pr-ci.yml — Build & test (the expensive stuff)

Trigger: pull_request [opened, synchronize, reopened] on [dev, preview, main, insider]
Concurrency: cancel-in-progress: true
Runner count: 1-2 (conditional on what changed)

Job 1: full-ci (Tier 4, ~8-10min) — if code_changed
    ├─ npm install + build + Playwright install
    ├─ npm test
    ├─ [if: always()] Export smoke test (reuses build — no extra runner)
    └─ [if: always()] Samples build (reuses build — no extra runner)

Job 2: docs-quality (Tier 2, ~30s) — if docs_changed
    ├─ npm install --no-save markdownlint-cli2 cspell
    ├─ markdownlint
    └─ cspell

squad-readiness-post-ci.yml — Update readiness after CI

Trigger: workflow_run [Squad PR CI] completed
Runner count: 1 (Tier 1, ~10s)

Issue Lifecycle (1 workflow, 1 runner per event)

squad-issue-ops.yml — All issue operations in one runner

Trigger: issues [labeled, closed], pull_request [closed], workflow_dispatch
Runner count: 1

Job: ops (API-only + sparse checkout, ~15s)
    ├─ Rate limit check
    ├─ [if go:/release:/type:/priority: label] Label enforcement
    ├─ [if 'squad' label] Triage + routing
    ├─ [if 'squad:*' label] Assignment
    ├─ [if 'squad:copilot' label] Copilot agent assignment (PAT)
    ├─ [if closed] Orphan label repair
    ├─ [if closed] Smart triage
    └─ [if closed] Copilot auto-assign

Consolidates: squad-triage, squad-issue-assign, squad-label-enforce, squad-heartbeat (4 → 1).

Release & Publish (3 workflows)

squad-insider.yml — Insider pipeline (push to insider)

Runner count: 2-3
  Job 1: build-and-test (Tier 4)
  Job 2: publish SDK + CLI with insider tag (Tier 3, needs Job 1)
  Job 3: create insider release tag (Tier 1, needs Job 1)

Consolidates: squad-insider-publish + squad-insider-release (2 → 1).

squad-npm-publish.yml — Production publish (release event)

Runner count: 3
  Job 1: validate + build + smoke test (Tier 4)
  Job 2: publish SDK with provenance (Tier 3, needs Job 1)
  Job 3: publish CLI with provenance (Tier 3, needs Job 2)

squad-release.yml — Production release (push to main)

Runner count: 1 (Tier 1)
  - node --test + CHANGELOG validation + tag + GitHub release

Operational (3 workflows, infrequent triggers)

Workflow Trigger Runners Change from Current
squad-docs.yml Push to main (docs path) 2 Unchanged
sync-squad-labels.yml Push to team.md 1 Unchanged
squad-promote.yml Manual 2 Unchanged

Manual-only workflows kept as-is: ci-rerun.yml and squad-docs-links.yml remain separate manual workflows. They fire infrequently and don't contribute to per-PR runner waste.

Target Runner Counts (End State)

Event Current (19 wf) PRD Incremental (9-11) Greenfield Target (4-5)
PR push (code change) ~19 runners 9-11 runners 4-5 runners
PR push (docs-only) ~19 runners 4-5 runners 3 runners
Issue labeled 1-3 runners 1-2 runners 1 runner
Push to insider 5 runners 5 runners 3 runners
Production release 6-7 runners 6-7 runners 4 runners
Manual promote 2 runners 2 runners 2 runners

How Phases Map to Greenfield Target

Each PRD phase moves the architecture closer to the greenfield end state:

Phase PRD Proposal Greenfield Contribution
Phase 0 Branch protection audit Same — prerequisite for all check renaming
Phase 1 Consolidate repo-health (5→1) + policy-gates (6→1) Extended: consolidate BOTH into squad-pr-validate.yml along with impact, scope-check, and readiness
Phase 2 Path filters + concurrency Same — but full-ci job now includes export-smoke-test and samples-build as post-build steps
Phase 3 Issue workflow consolidation (3→1) Extended: also absorb squad-heartbeat into squad-issue-ops.yml (4→1)
Phase 4 Publish pipeline optimization Extended: merge insider-publish + insider-release into squad-insider.yml

Impact Estimate

Metric Current (19 wf) Incremental (Proposals 1-11) Greenfield Target
Runners per PR push (code) ~19 ~9-11 4-5
Runner boot overhead per push ~28 min ~15 min ~6 min
Actual CI work per push ~12 min ~12 min ~10 min
Wasted runner-minutes per push ~16 min ~8 min ~2-3 min
Docs-only PR cost Full CI (~15 min) Early-exit (~1 min) Early-exit (~1 min)
Stacked runs on rapid push Unlimited Cancel/Queue split Cancel/Queue split
Label-event runners 3 1-2 1
Insider push runners 5 5 3
Publish pipeline runners 5-6 5-6 3
Time-to-green (wall clock) ~10-12 min ~10-12 min ~9-10 min

Note: Incremental target revised from 8-10 to 9-11 per review feedback. Greenfield target of 4-5 runners per PR push is the end state, achieved by organizing around resource tiers rather than feature categories. See Flight's analysis for full details.


Implementation Approach

Target state: Each phase below moves toward the greenfield target architecture. The incremental proposals are the migration path; the greenfield layout is the destination.

Phase Items Risk Notes
Phase 0 Branch Protection Audit None Prerequisite for all phases. Audit Settings → Branches → Branch protection rules for dev, main, preview, and insider. Document all required status check names. Renaming/consolidating a required check = merges blocked until branch protection is updated.
Phase 1 Consolidations (1-3) Low Safe, behavior-preserving. Land repo-health consolidation first (lowest risk), then policy-gates, then PR Readiness.
Phase 2 Path filters + concurrency (4-5) Medium Requires branch protection coordination. Use paths-filter action (not paths-ignore). Split concurrency policy for publish safety. Address docs-quality orphaning.
Phase 3 Issue workflow consolidation (6) Medium Requires testing label routing with each event type. Needs COPILOT_ASSIGN_TOKEN secret.
Phase 4 Publish pipeline optimization (7-9) Medium Requires artifact integrity verification, provenance chain testing, and dry-run publish.

Rollback Plan

Each phase can be independently reverted by restoring the original workflow YAML files. No data migrations or external state changes are involved ΓÇö all changes are to .github/workflows/ files.

Phase Rollback Procedure
Phase 0 No changes to revert (audit only)
Phase 1 Restore original job definitions in squad-ci.yml and squad-repo-health.yml. Re-push to branch. Update branch protection rules back to original check names if changed.
Phase 2 Remove paths-filter conditions and concurrency blocks. Restore workflow-level triggers. Move docs-quality back if relocated.
Phase 3 Restore squad-triage.yml, squad-issue-assign.yml, squad-label-enforce.yml. Remove squad-issue-ops.yml.
Phase 4 Remove upload-artifact/download-artifact steps. Restore per-job npm install && npm run build steps in publish workflows.

Canary testing: Before each phase merges, open a test PR that intentionally violates each gate to confirm it still blocks. For publish pipeline changes, do a manual workflow_dispatch dry-run publish with a prerelease tag (e.g., 0.0.0-ci-test).


Non-Goals

  • Changing what checks exist (the safety gates stay, just packaged more efficiently)
  • Modifying test coverage or test behavior
  • Changing CI trigger semantics (same events, fewer runners) ΓÇö note: Proposals 3 and 4 do modify when workflows fire, but preserve the same event coverage

Success Metrics

  • Phase gate: Runners per PR push reduced from ~19 to ~9-11 (incremental)
  • End state: Runners per PR push reduced to ~4-5 (greenfield target)
  • No CI failures introduced by consolidation
  • All existing safety gates still enforced (including publish-policy and changelog-protection)
  • PR readiness still updates after CI completes, on description edit, and on draftΓåÆready
  • Docs-only PRs exit early without leaving required checks in pending state
  • Rapid pushes cancel stale validation runs but queue publish/release runs
  • Skip labels continue to work independently per-check in consolidated jobs
  • $GITHUB_STEP_SUMMARY shows clear per-gate pass/fail in consolidated jobs

Owner

Booster (CI/CD specialist) ΓÇö primary implementer
Flight (Lead) ΓÇö review and approval


Review Feedback Incorporated

PRD v2 ΓÇö updated based on full team review (5 reviewers: PAO, EECOM, RETRO, Booster, FIDO). All reviewers approved with changes.

# Finding Source Resolution
1 Concurrency groups need split policy — cancel-in-progress: true dangerous on publish/release Booster 🔴, RETRO 🔴, FIDO 🔴 Fixed in Proposal 5. Split into cancel (validation) vs queue (publish/release).
2 Don't fully remove pull_request_target — loses edited and ready_for_review events Booster 🔴, FIDO 🔴 Fixed in Proposal 3. Keep pull_request_target for edited/ready_for_review only.
3 changelog-protection is NOT redundant — enforces different policy than changelog-gate Booster 🔴, FIDO 🔴 Fixed in Proposal 11. Moved from "Removals" to "Consolidate into policy-gates."
4 Keep publish-policy as CI check — pre-commit hooks are bypassable RETRO 🟡, FIDO 🔴 Fixed in Proposal 10. Moved from "Removals" to "Consolidate into policy-gates."
5 Debugging visibility in consolidated jobs EECOM 🟡, FIDO 🟡 Added if: always() + $GITHUB_STEP_SUMMARY mitigations to Proposals 1 and 2.
6 paths-ignore breaks required status checks FIDO 🔴, Booster 🔴 Fixed in Proposal 4. Changed to paths-filter action with conditional job execution.
7 Add Phase 0 — Branch Protection Audit Booster 🟡, FIDO 🟡 Added as prerequisite phase in Implementation Approach.
8 docs-quality orphaning on path filters EECOM 🟡 Addressed in Proposal 4. Recommend moving docs-quality to own workflow or squad-repo-health.yml.
9 Artifact integrity for publish pipeline RETRO 🟡 Added checksum verification and provenance requirements to Proposal 7.
10 Rollback plan needed PAO 🟡 Added Rollback Plan section with per-phase procedures.
11 Runner target adjustment Booster 🟡 Updated from 8-10 to 9-11 to reflect proposals 10/11 consolidation instead of removal.

PRD v1 authored by Flight based on CI audit findings. v2 revised by Flight incorporating team review.

Activity

  1. diberry commented on Apr 5, 2026

    @diberry
    ContributorAuthor

    📝 PAO — Clarity & Completeness Review

    Overall Assessment: CLEAR with targeted improvements needed

    Strengths

    ✅ Excellent specificity: Each consolidation item is tied to concrete file names, job counts, and estimated savings. A contributor can immediately identify what to change.
    ✅ Risk stratification: Phased approach (5 phases) with risk levels shows thoughtful sequencing.
    ✅ Quantified impact: Tables showing current/future state make trade-offs visible.
    ✅ Clear non-goals: Explicitly states what's NOT changing (checks remain, just repackaged).
    ✅ Owner assignment: Booster + Flight identified upfront.

    Suggested Improvements

    1. Clarify "How to Verify" for Each Phase
    Each consolidation should include a quick smoke-test. Example for Phase 1:

    • Verify: Trigger a test PR push; confirm Squad CI runs with ≤11 jobs (not 11 separate).
    • Rollback: Revert squad-ci.yml and squad-repo-health.yml changes; re-run CI.

    Currently, success metrics are listed but per-phase verification steps are missing.

    2. Add Rollback Plan
    If a consolidation breaks a safety gate, what's the rollback procedure? Suggest adding a "Rollback Procedure" section:

    • Phase 1 rollback: Restore original job definitions in YAML, re-push to branch.
    • Risk: If consolidation hides errors (e.g., lint failure buried in policy-gates job output), who catches it?

    3. Clarify PR Readiness Double-Run Issue (Item #3)
    The statement "first run produces stale results because CI hasn't completed" needs context:

    • Does "stale" mean outdated artifacts, or old commit state?
    • After removing pull_request_target, will workflow_run still trigger at the right time (after all Squad CI jobs complete)?
    • Include a diagram or sequence: PR pushed → Squad CI jobs finish → PR Readiness triggers (only once).

    4. Missing: Concurrency Group Naming Convention
    Item #5 adds concurrency groups but doesn't specify the naming pattern:

    • Should it follow github.event.number patterns for PR-based workflows?
    • Should release/publish workflows use different groups (e.g., single release at a time)?
    • Add a concurrency design section or point to the convention file.

    5. Item #10 (publish-policy) Needs Validation
    You say "this is a one-time check that never regresses" — but has this been verified?

    • Are there cases where publish-policy should catch a regression (e.g., if someone accidentally adds npm publish to a non-release workflow)?
    • If moving to a pre-commit hook, does the pre-commit hook run in CI for PRs from forks?
    • Suggest: Before removing, verify all equivalent checks are in place elsewhere.

    6. Item #11 (changelog-protection) — Overlap Question
    You mention it's "redundant with changelog-gate," but:

    • Does changelog-gate validate BOTH the presence of changesets AND the absence of direct CHANGELOG edits?
    • Or does it only check changesets?
    • If only changesets, should changelog-protection be moved to Phase 1 (not Phase 3) or clarified as not-redundant?

    7. Missing: Test Coverage for Consolidated Jobs
    When 5 jobs merge into 1, how do you prevent one failing check from masking others?

    • Does the consolidated job use continue-on-error anywhere? If so, which checks and why?
    • Suggest: Document the error-handling strategy per consolidation (fail-fast vs. collect-all).

    8. Docs-Only PR Optimization (Item #4) — Edge Case
    paths-ignore: [docs/*, *.md] will skip CI for docs-only changes.

    • What about changes to .squad/ (which is governance, not docs)? Should those skip CI?
    • Current PRD lists .squad/ as skippable, but the actual paths-ignore line only mentions docs/ and *.md.

    Missing Sections

    1. Acceptance Criteria Checklist: A checkbox list that a reviewer can use to sign off. Example:

      • Phase 1: Squad CI reduced to ≤11 jobs, no new failures
      • Phase 2: Path filters tested on docs-only PR
      • Phase 5: Both publish pipelines execute cleanly
    2. Communication Plan: Will contributors notice the job consolidation in their PR checks? Do they need docs updates?

    3. Monitoring & Metrics: How will you track actual savings post-implementation? GitHub Actions usage reports?

    4. Timeline: Phases are described but no target dates or milestones.


    Summary: This PRD is strong on what and why, but could be sharper on how to verify and how to rollback. Add per-phase smoke tests and clarify design choices (concurrency groups, changelog-protection redundancy, pre-commit hook coverage) and it's ready for Booster.

  2. diberry commented on Apr 5, 2026

    @diberry
    ContributorAuthor

    🔧 EECOM — Developer Workflow Review

    Overall Assessment: APPROVE WITH CHANGES

    I reviewed the PRD against squad-ci.yml (11 jobs), squad-repo-health.yml (5 jobs), squad-pr-readiness.yml, and squad-impact.yml, focusing on daily developer experience impact.


    Developer Experience Impact

    # Proposed Change DX Impact Concern Level Notes
    1 Consolidate repo-health 5→1 job Neutral wall-clock; major runner savings 🟡 Medium See debugging & PR-comment concerns below
    2 Consolidate CI policy gates 5→1 job Neutral wall-clock; major runner savings 🟡 Medium Skip labels must be preserved per-step
    3 Remove PR Readiness pull_request_target trigger Positive — eliminates stale/confusing first run 🟢 Low Clean improvement
    4 Add paths-ignore to squad-ci.yml Positive for docs-only PRs 🟡 Medium docs-quality job orphaning risk — see below
    5 Add concurrency groups to 10 workflows Positive — prevents stacked runs 🟢 Low Confirmed 9 workflows currently lack them
    10 Remove publish-policy job Positive — static check, never regresses 🟢 Low Good cleanup
    11 Remove changelog-protection (redundant with changelog-gate) Needs care 🟡 Medium They check different things — see below

    Detailed Analysis

    1. Feedback Loop (Concern: 🟢 Low)

    Consolidation will NOT slow time-to-green in practice. Current parallel repo-health jobs each incur ~2 min runner boot for <10 sec of actual script work. A single consolidated job = ~2 min boot + ~50 sec total script work = ~3 min total, roughly the same as the parallel wall-clock time. The savings are in runner cost (5 boots → 1), not developer wait time. Same analysis applies to the CI policy gates.

    2. Debugging Experience (Concern: 🟡 Medium — Requires Design Decision)

    This is the most significant DX tradeoff. Currently, each repo-health job appears as a separate status check in the PR checks list. Developers see exactly which check failed at a glance:

    ✅ Bootstrap Protection
    ❌ Squad File Leakage        ← immediately obvious
    ✅ Architectural Review
    ✅ Security Review
    ✅ Diff Size Guard
    

    After consolidation, this becomes:

    ❌ Repo Health               ← which sub-check failed?
    

    Mitigations required:

    • Use if: always() on every step within the consolidated job so all checks run even if one fails (currently, independent jobs run regardless of each other's status)
    • Name steps clearly (GitHub Actions UI shows step names within a job)
    • Consider using job step summaries ($GITHUB_STEP_SUMMARY) to produce a clear pass/fail table at the top of the job output

    3. PR Comment Steps in Repo Health (Concern: 🟡 Medium — Easy to Get Wrong)

    Three of the 5 repo-health jobs (squad-leakage, architectural-review, security-review) post PR comments using actions/github-script@v7 with if: always(). In a consolidated job:

    • Each script step must capture output to $GITHUB_OUTPUT with unique IDs
    • Each comment step must use if: always() to run regardless of earlier step failures
    • The actions/github-script@v7 steps must reference the correct step IDs (not job IDs)

    This is doable but is a common source of bugs during consolidation. Recommend a dedicated test PR with intentional failures in each sub-check to verify all comment steps fire correctly.

    4. Path Filters — docs-quality Orphaning Risk (Concern: 🟡 Medium)

    The PRD proposes paths-ignore: docs/, .squad/, *.md on squad-ci.yml. The docs-quality job currently lives inside squad-ci.yml and is gated by the changes job's path detection. If squad-ci.yml skips entirely for docs-only PRs, docs-quality is also skipped — meaning docs-only PRs lose markdown linting and spell checking.

    Recommendation: Either:

    • (a) Move docs-quality to squad-repo-health.yml or its own workflow (preferred)
    • (b) Use per-job path filters instead of workflow-level paths-ignore
    • (c) Add an explicit note in the PRD that docs-quality stays covered via option (a) or (b)

    Note: GitHub's paths-ignore correctly does NOT skip the workflow when a PR touches both code and docs — it only skips when ALL changes match ignore patterns. This is fine.

    5. Skip Labels (Concern: 🟢 Low — But Needs Explicit Design)

    Current skip labels (skip-changelog, skip-exports-check, skip-workspace-check, skip-version-check, skip-export-smoke) are per-job. In a consolidated "policy-gates" job, each step can still check its own label — the pattern works:

    - name: Check skip-changelog label
      id: skip-changelog
      run: |
        LABELS='${{ toJSON(...) }}'
        if echo "$LABELS" | grep -q "skip-changelog"; then echo "skip=true" >> "$GITHUB_OUTPUT"; fi
    
    - name: Changelog gate
      if: steps.skip-changelog.outputs.skip != 'true'
      run: ...

    Recommendation: Document in the PRD that skip labels are preserved as step-level conditions. Current 6 skip labels in the "Skip Labels Reference" block (lines 191-206 of squad-ci.yml) need to be updated to reflect the new job structure.

    6. Local Testing Comments (Concern: 🟢 None)

    The "Local testing" comments in squad-ci.yml (lines 209-215, 333-339, 408-412, 586-593, 671-678, 773-784) reference the underlying scripts, not CI job structure. They remain valid regardless of consolidation. Example: "Run node scripts/check-exports-map.mjs" works identically whether the script runs in its own job or as a step in a consolidated job.

    7. changelog-protection vs changelog-gate (Concern: 🟡 Medium)

    The PRD proposes removing changelog-protection as redundant with changelog-gate. They're not identical:

    • changelog-gate: Requires a changeset OR changelog entry when SDK/CLI source changes
    • changelog-protection: Blocks non-approved authors from directly editing CHANGELOG.md

    These check different dimensions. If changesets are the enforced workflow, changelog-protection may still have value as a guardrail against someone bypassing changesets by editing CHANGELOG.md directly.

    Recommendation: Either keep changelog-protection as a step in the consolidated policy-gates job (it's ~5 seconds of work), or explicitly document why the guard is no longer needed.


    Recommendations Summary

    1. Must-have: Use if: always() on all steps within consolidated jobs + add $GITHUB_STEP_SUMMARY for clear pass/fail visibility
    2. Must-have: Address docs-quality orphaning before adding paths-ignore to squad-ci.yml
    3. Must-have: Test PR comment posting in consolidated repo-health with intentional failures
    4. Should-have: Preserve skip labels as step-level conditions; update the Skip Labels Reference comment block
    5. Should-have: Reconsider removing changelog-protection — it guards a different dimension than changelog-gate
    6. Nice-to-have: Phase the rollout by landing repo-health consolidation first (lowest risk), then policy-gates, then path filters (highest nuance)

    What I Like About This PRD

    • The runner-cost analysis is solid — 19→8-10 jobs is a meaningful reduction
    • Non-goals section is clear: "safety gates stay, just packaged more efficiently"
    • Phased approach is correct for risk management
    • Concurrency groups (item 5) are a no-brainer win
    • Removing the double PR Readiness run (item 3) is clean DX improvement

    The PRD is well-structured and the core approach is sound. The concerns above are implementation details that the Booster team should address during Phase 1, not blockers on the overall direction.

    — EECOM (Core Dev)

  3. diberry commented on Apr 5, 2026

    @diberry
    ContributorAuthor

    🔒 RETRO — Security Review

    Overall Assessment: ✅ APPROVE WITH CHANGES

    The PRD is well-scoped — consolidation for efficiency, not for changing gates. However, several proposals have security-sensitive edges that need guardrails during implementation.


    Security Findings

    # Proposal Security Impact Severity Recommendation
    1 Consolidate Repo Health (5→1) Failure in early step could silently skip security-review 🟡 Medium Use continue-on-error: true + aggregate exit codes so all 5 scripts always run, even if one fails. Never let bootstrap-protection failure suppress security-review.
    2 Consolidate CI policy gates (5→1) Skip-label logic collision; one gate failure masking others 🟡 Medium Each skip-label (skip-changelog, skip-exports-check, etc.) must remain independently evaluated per-step. Do NOT use a single "skip-policy-gates" label. Use step-level if: conditions and track failures in a variable.
    3 Remove PR Readiness pull_request_target Reduces attack surface — positive change 🟢 Low (improvement) Good. workflow_run runs trusted code from the default branch. Removing pull_request_target eliminates a class of pwn-request risks. Verify PR data is fetched via API (already true — confirmed in the workflow).
    4 Path filters on squad-ci.yml Potential security check bypass on docs-only PRs 🟢 Low Acceptable. squad-ci is the build/test pipeline. Repo-health (security-review, bootstrap-protection) runs separately on pull_request_target and is NOT affected by these path filters. Confirm repo-health stays unfiltered.
    5 Concurrency groups (10 workflows) cancel-in-progress on publish/release = partial publish risk 🔴 High See Concurrency Analysis below — this is the highest-risk proposal.
    7 Share build artifacts in publish Artifact integrity between build and publish jobs 🟡 Medium See Artifact Sharing Analysis below.
    10 Remove publish-policy (move to pre-commit) Pre-commit hooks can be bypassed with --no-verify 🟡 Medium Do NOT rely solely on pre-commit hooks — they are client-side and unenforceable. Keep as a scheduled weekly check or a required status check on release branches.
    11 Remove changelog-protection Redundancy removal 🟢 Low Acceptable if changelog-gate remains a required status check. Verify branch protection rules explicitly require changelog-gate.

    Concurrency Analysis (Proposal 5) — 🔴 HIGH PRIORITY

    The PRD proposes cancel-in-progress: true for all 10 workflows without concurrency groups. This is safe for check/validation workflows but dangerous for publish/release workflows.

    Workflow Safe for cancel-in-progress? Reason
    squad-scope-check ✅ Yes Read-only check, re-runs on latest HEAD
    squad-docs-links ✅ Yes Read-only, no side effects
    sync-squad-labels ⚠️ Caution Writes labels — partial run could leave inconsistent state
    squad-preview ✅ Yes Read-only validation
    squad-release ❌ No Creates git tags + GitHub releases. Cancel mid-run = orphaned tag without release, or release without tag
    squad-promote ⚠️ Caution Pushes to preview/main branches. Cancel between dev→preview and preview→main = inconsistent state
    squad-insider-release ❌ No Creates tags + releases. Same risk as squad-release
    squad-insider-publish ❌ No Publishes to npm. Cancel after SDK publish but before CLI publish = SDK@insider updated but CLI@insider stale
    squad-npm-publish ❌ No Publishes to npm with provenance. Partial publish is the highest-severity failure mode

    Recommendation:

    # SAFE — validation workflows:
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
      cancel-in-progress: true
    
    # UNSAFE — publish/release workflows. Use group WITHOUT cancel:
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
      cancel-in-progress: false   # ← Queue, don't cancel

    For squad-npm-publish and squad-insider-publish: use cancel-in-progress: false to prevent partial publishes. A queued publish will wait for the current one to finish — this is the correct behavior.


    Artifact Sharing Analysis (Proposal 7)

    Sharing build artifacts between jobs in the publish pipeline is a net security improvement IF implemented correctly:

    Good:

    • Build job never sees NPM_TOKEN (principle of least privilege)
    • Publish job only receives pre-built artifacts + token (reduced attack surface)

    Requirements:

    1. Verify artifact digests — Use actions/upload-artifact@v4 which supports immutable artifacts. Download in the publish job and verify the artifact hasn't been tampered with.
    2. Pin action versions — Use SHA-pinned action references (e.g., actions/upload-artifact@sha) not just @v4 to prevent supply chain attacks via tag mutation.
    3. Provenance chain — npm publish --provenance generates SLSA attestations. Verify provenance still works correctly when build and publish are in separate jobs. The publish job must have id-token: write permission (already present in squad-npm-publish).
    4. Don't share node_modules/ — Only share dist/ build outputs. Sharing node_modules/ could allow a compromised dependency to persist across jobs.

    Permission Analysis

    Workflow Current Permissions Post-Consolidation Change Needed?
    Repo Health (5→1) contents: read, pull-requests: write Same ❌ No widening
    CI Policy Gates (5→1) contents: read (default) Same ❌ No widening
    PR Readiness (remove PRT) contents: read, pull-requests: write, issues: write, statuses: read, checks: read Same ❌ No widening
    Publish pipelines (artifact sharing) contents: read (build), contents: read + id-token: write (publish) Same split possible ❌ No widening — actually improved by separating build from token access

    Conclusion: No proposals require broader permissions than the existing jobs. Principle of least privilege is maintained.


    Recommended Security Gates for Implementation

    1. Pre-merge validation: Before each phase merges, run the full CI suite and verify all existing gates still trigger correctly. Create a test PR that intentionally violates each gate to confirm it still blocks.

    2. Canary PR for consolidation: After consolidating repo-health, open a PR that modifies a bootstrap-protected file AND has a .squad/ leakage. Verify both checks report independently.

    3. Publish pipeline dry-run: Before merging artifact-sharing changes, do a manual workflow_dispatch publish to npm with a prerelease tag (e.g., 0.0.0-ci-test) to verify the provenance chain and artifact integrity work end-to-end.

    4. Branch protection audit: After removing changelog-protection (proposal 11) and publish-policy (proposal 10), audit Settings > Branches > Branch protection rules to confirm changelog-gate and other remaining checks are explicitly required.


    Existing Issue Noted (Out of Scope)

    In squad-repo-health.yml, the github-script steps interpolate step outputs into JavaScript template literals:

    output: `${{ steps.leakage.outputs.result }}`

    If a PR contains file names with backtick characters, this is a script injection vector in the pull_request_target context. This is a pre-existing issue outside the PRD's scope, but it should be tracked separately. Recommend creating a follow-up issue to sanitize these outputs or pass them via environment variables instead of expression interpolation.


    Reviewed by RETRO (Security) • Workflow files analyzed: squad-repo-health.yml, squad-ci.yml, squad-pr-readiness.yml, squad-insider-publish.yml, squad-npm-publish.yml, squad-release.yml, squad-promote.yml, squad-insider-release.yml, squad-scope-check.yml, squad-preview.yml, squad-docs-links.yml

  4. diberry commented on Apr 5, 2026

    @diberry
    ContributorAuthor

    ⚙️ Booster — CI/CD Domain Review

    Overall Assessment: APPROVE WITH CHANGES

    I've read every workflow file referenced in the PRD and validated each claim against the actual YAML. The consolidation direction is sound, but there are several technical risks the PRD doesn't account for — two of which could cause outages if shipped as-written.


    Per-Proposal Feasibility

    # Proposal Feasible? Risk Notes
    1 Consolidate Repo Health 5→1 ✅ Yes Low No needs: dependencies between the 5 jobs. bootstrap-protection uses sparse-checkout while others use fetch-depth: 0 — consolidated job needs fetch-depth: 0. Three jobs post PR comments via repo-health-comment.mjs — comment logic needs to handle sequential outputs. UX tradeoff: individual check pass/fail visibility in PR checks tab is lost; one failure blocks all. Savings estimate of ~8 min is realistic.
    2 Consolidate CI policy gates 6→1 ✅ Yes Medium PRD says 5 jobs but there are actually 6 (changelog-gate, changelog-protection, exports-map-check, workspace-integrity, prerelease-version-guard, publish-policy). No needs: between them. Each has its own feature flag (vars.SQUAD_*) and skip label — these become step-level if: conditions. ⚠️ Branch protection risk: if any required status check references these job names (e.g., "changelog-gate"), renaming/consolidating breaks merge requirements. Must audit branch protection rules before implementing.
    3 Remove PR Readiness pull_request_target ⚠️ Partial High The PRD missed two event types. PR Readiness triggers on edited and ready_for_review in addition to opened/synchronize. These events do NOT trigger Squad CI, so the workflow_run trigger won't fire for them. Removing pull_request_target means: (1) editing a PR description doesn't re-evaluate readiness, (2) marking a draft as "ready for review" doesn't update the readiness comment. Keep pull_request_target but only for edited and ready_for_review; remove it for opened/synchronize/reopened where workflow_run covers it.
    4 Add path filters to squad-ci.yml ⚠️ Conditional High Critical interaction with branch protection. If any required status check references job names from squad-ci.yml (e.g., "test", "changelog-gate"), paths-ignore causes the entire workflow to be skipped for docs-only PRs. Skipped workflows do not satisfy required checks in GitHub branch protection — the PR becomes unmergeable. Solution: either (a) configure branch protection to allow skipped checks, or (b) keep the workflow triggering but add path-based early-exit at the job level via the existing changes job pattern. Option (b) is safer.
    5 Add concurrency groups ⚠️ Partial 🔴 CRITICAL cancel-in-progress: true on publish/release workflows is dangerous. If a newer push arrives while squad-npm-publish is mid-publish (SDK published, CLI not yet), the in-progress run gets cancelled, leaving a partial publish (SDK on registry without matching CLI). Same risk for squad-insider-publish, squad-release, squad-insider-release, squad-promote. Fix: Use cancel-in-progress: false for all publish/release workflows (5 of the 9). Only squad-scope-check, squad-preview, sync-squad-labels, and squad-docs-links are safe for cancel-in-progress: true. Also: squad-docs-links is workflow_dispatch only — no rapid-push risk; it can be dropped from this proposal.
    6 Consolidate issue workflows 3→1 ✅ Yes Medium Feasible but savings are overestimated. The if: conditions at job level (== 'squad', startsWith('squad:')) already prevent runner boot for non-matching labels. Typically only 1-2 runners boot per label event, not 3. The real win: squad-label-enforce has no job-level if: — it always boots a runner even for unmanaged labels. Consolidation could add a combined filter. Note: squad-issue-assign uses secrets.COPILOT_ASSIGN_TOKEN PAT — the combined workflow needs this secret.
    7 Share build artifacts in publish ✅ Yes Low Confirmed: squad-insider-publish rebuilds 3 times across jobs; squad-npm-publish rebuilds 2-3 times. upload-artifact/download-artifact within a single workflow run is scoped and ephemeral — no security concerns. Savings estimate of 15-20 min for npm-publish is realistic.
    8 Cache Playwright browsers ✅ Yes Low npx playwright install chromium --with-deps runs every CI pass. Standard actions/cache with Playwright version key works. Note: --with-deps installs system apt packages that won't be cached — only the browser binary (~150MB) benefits. Real savings closer to ~1-1.5 min, not 2 min.
    9 Extract composite action for test ✅ Yes Low Confirmed: ci-rerun.yml duplicates the entire test job verbatim. A composite action in .github/actions/test-squad-ci/ eliminates drift. No minute savings but strong maintainability win.
    10 Remove publish-policy job ⚠️ Modify Low The PRD claims "never regresses per-PR" — not quite true. A new workflow file or edit could introduce bare npm publish. Better approach: keep the job but add paths: ['.github/workflows/*.yml'] filter so it only runs when workflow files change. This preserves the safety gate while eliminating 99% of unnecessary runs. Full removal to pre-commit loses CI enforcement.
    11 Remove changelog-protection ❌ No High These are NOT redundant. They enforce different policies: changelog-gate = "source changes require a changeset OR CHANGELOG edit." changelog-protection = "only approved authors (bradygaster, bots) may directly edit CHANGELOG.md." Without changelog-protection, any contributor can bypass the changeset workflow by editing CHANGELOG.md directly. Together they enforce: "contributors must use changesets; only maintainers may edit CHANGELOG directly." Removing changelog-protection weakens the changeset workflow.

    Missing Considerations

    1. Branch protection audit is prerequisite. Proposals 1, 2, and 4 all rename or remove jobs that may be referenced in branch protection rules. An audit of Settings → Branches → Branch protection rules must happen before any implementation. Suggest adding a "Phase 0: Audit branch protection required checks" to the implementation plan.

    2. PR checks UX degradation. Consolidating 5 jobs into 1 means the PR checks tab shows 1 line instead of 5. When a check fails, developers must read logs to determine which specific gate failed (e.g., was it changelog-gate or workspace-integrity?). Mitigate by using ::error:: annotations with clear prefixes and consider adding a summary step.

    3. samples-build and export-smoke-test are excluded from proposal 2 but should be mentioned. These are NOT lightweight (they build the SDK). The PRD correctly excludes them but doesn't explain why, which could lead to someone adding them to the consolidation later.

    4. Feature flag consolidation. Each policy gate has its own vars.SQUAD_* feature flag. The consolidated job needs a design for how these interact — does a single flag disable the whole job, or does each step keep its own flag? Recommend keeping per-step flags.

    5. Concurrency group design for publish workflows. Even with cancel-in-progress: false, publish workflows should have concurrency groups to queue (not cancel) — this prevents two releases from running simultaneously and conflicting.


    Recommended Changes to PRD

    1. Proposal 3: Change to "Remove pull_request_target for opened/synchronize/reopened only; keep it for edited and ready_for_review." This preserves readiness re-evaluation on PR description edits and draft→ready transitions.

    2. Proposal 4: Add a prerequisite: "Audit branch protection required checks. If any required check name comes from squad-ci.yml, use job-level path filters (not workflow-level paths-ignore) to avoid blocking merges on docs-only PRs."

    3. Proposal 5: Split into two categories:

      • cancel-in-progress: true — squad-scope-check, squad-preview, sync-squad-labels
      • cancel-in-progress: false (queue, don't cancel) — squad-release, squad-promote, squad-insider-release, squad-insider-publish, squad-npm-publish
      • Drop squad-docs-links (workflow_dispatch only, no rapid-push risk)
    4. Proposal 10: Change from "remove" to "add paths: filter on .github/workflows/*.yml" — same savings, preserves the safety gate.

    5. Proposal 11: Remove from PRD. The two jobs are complementary, not redundant. If the goal is to save 1 runner, add a path filter instead (only run when CHANGELOG.md is in the diff).

    6. Add Phase 0: "Audit branch protection rules and document all required check names" — this is a prerequisite for Phases 1-2.

    7. Update runner count: With proposal 11 removed and proposal 3 modified, the target should be ~9-11 runners per PR push (not 8-10). Still a significant improvement from ~19.


    Risk Summary

    Risk Impact Proposals Affected Mitigation
    Branch protection breaks PRs unmergeable 1, 2, 4 Phase 0 audit
    Partial publish Broken npm packages 5 cancel-in-progress: false for publish/release
    Lost event triggers Stale readiness comments 3 Keep edited/ready_for_review on pull_request_target
    Changeset bypass Anyone can edit CHANGELOG directly 11 Don't remove changelog-protection

    Reviewed by Booster (CI/CD Engineer) — all claims validated against workflow source on dev branch.

  5. diberry commented on Apr 5, 2026

    @diberry
    ContributorAuthor

    🧪 FIDO — Quality Gate Review

    Overall Assessment: ⚠️ APPROVE WITH CHANGES

    The PRD is well-structured and the savings are real. However, several proposals carry quality risks that need mitigation before implementation. The safety gates themselves are preserved — it's the packaging that needs care.


    Safety Gate Analysis

    # Proposal Risk Key Concern Recommended Mitigation
    1 Repo Health 5→1-2 🟡 Medium BLOCKING (bootstrap-protection) vs INFORMATIONAL jobs have different failure semantics. In a single job, a failed blocking step stops later informational steps/comments from running. continue-on-error hides real failures. Split into 2 jobs: one for blocking gates, one for informational. Or: capture exit codes per step and aggregate in a final "verdict" step.
    2 CI Policy Gates 5→1 🟡 Medium Each gate has its own skip-label and feature flag. export-smoke-test needs npm ci + build while others are zero-install — consolidation forces all checks to pay that cost. Branch protection rules may reference individual job names. Audit branch protection required checks BEFORE renaming. Keep skip-labels working via conditional step execution. Consider 2 tiers: zero-install gates + build-required gates.
    3 Remove PR Readiness double-run 🔴 High Not safe as written. Removing pull_request_target loses edited and ready_for_review event types — readiness won't update when a PR is marked ready or its description changes. Worse: if Proposal 4 adds paths-ignore and CI is skipped entirely, workflow_run never fires, so readiness never refreshes. The first run is not "stale" — the script handles in-progress checks and provides early feedback. Keep pull_request_target trigger. If double-run cost is the concern, add a deduplication check in the script instead.
    4 Path filters on squad-ci.yml 🔴 High paths-ignore at the workflow level can leave required status checks stuck in "pending", blocking merges for docs-only PRs. GitHub does not auto-pass skipped required checks — they just never report. Use paths-filter action within the workflow (already partially implemented via the changes job) to conditionally skip individual jobs rather than the entire workflow. Or: ensure branch protection uses Require status checks → Do not require for these checks.
    5 Concurrency groups (10 workflows) 🔴 High (partial) cancel-in-progress: true is dangerous for publish/release workflows: squad-release, squad-promote, squad-npm-publish, squad-insider-release, squad-insider-publish. Cancelling an in-flight publish can leave packages partially published (some packages on npm, others not). Add concurrency groups to non-publish workflows only. For publish/release workflows, use cancel-in-progress: false (queue, don't cancel).
    6 Issue workflows 3→1 🟢 Low Straightforward if permissions and conditional logic are preserved. Test label routing with each event type.
    7-9 Publish pipeline optimization 🟡 Medium Artifact sharing changes the dependency graph. Test that downloaded artifacts match what a fresh build produces.

    Removal Risk Analysis

    # Removal Verdict Analysis
    10 publish-policy ❌ Do not remove Moving to a pre-commit hook makes it developer-opt-in, not CI-enforced. A contributor who skips hooks (or a bot) can add a bare npm publish to a workflow file undetected. Better: consolidate into the proposed "policy-gates" job — it's a 2-second grep, costs nothing. Also note: this job currently runs on pushes too (not just PRs), so consolidation must preserve that trigger coverage.
    11 changelog-protection ❌ Do not remove These two gates check different things: changelog-gate verifies a changeset file exists for SDK/CLI changes — and it explicitly allows direct CHANGELOG.md edits as an alternative. changelog-protection restricts who can make those direct edits to approved authors. Without it, any contributor could bypass the changeset workflow by editing CHANGELOG.md directly. Not redundant — complementary. If removing: add a CODEOWNERS entry for CHANGELOG.md at minimum.

    Quality Concerns

    1. Branch protection audit is a prerequisite. Before consolidating or renaming ANY job, enumerate all required status checks in branch protection rules for dev, main, preview, and insider. Renaming a required check = merges blocked until branch protection is updated. This should be Step 0 of Phase 1.

    2. Proposal 3 + 4 interaction is dangerous. If PR Readiness relies on workflow_run from Squad CI, and Squad CI is skipped via paths-ignore, then PR Readiness never runs. Docs-only PRs would have no readiness status — potentially blocking or confusing.

    3. The "non-goal" of not changing CI trigger semantics is violated by Proposals 3 and 4. Both change when workflows fire. The PRD should acknowledge this explicitly.

    4. Error attribution in consolidated jobs. GitHub Actions shows step-level status within a job, but the job-level badge (✅/❌) is what appears in the PR checks list. After consolidation, a failure in any step of "policy-gates" shows the whole job as failed. Contributors will need to click into the job to find which specific gate failed. Consider adding a summary step that prints a clear table of pass/fail per gate.


    Recommended Test Plan

    Phase 1 (Consolidations 1-3):

    • Audit and document all branch protection required checks across all protected branches
    • Test consolidated repo-health with: (a) clean PR, (b) PR that fails bootstrap-protection only, (c) PR that triggers architectural warnings — verify all PR comments still post correctly
    • Verify skip labels still work independently within consolidated jobs
    • Verify PR Readiness still updates on edited and ready_for_review events after changes
    • Test the interaction: docs-only PR with paths-ignore → does PR Readiness still run?

    Phase 2 (Path filters + concurrency):

    • Create a docs-only PR and verify CI is properly skipped WITHOUT leaving required checks in pending
    • Verify concurrency groups on publish workflows use cancel-in-progress: false
    • Test rapid-push cancellation on non-publish workflows

    Phase 3-5 (Issue ops, publish optimization, removals):

    • Test label routing in consolidated issue-ops workflow with each event type
    • Verify downloaded build artifacts produce identical results to fresh builds
    • If publish-policy is kept (recommended), verify it runs on both PR and push events in the consolidated job
    • If changelog-protection is kept (recommended), verify it runs alongside changelog-gate without conflict

    Review by FIDO (Quality Owner) — if it's not tested, it's not done. 🐕

  6. diberry commented on Apr 5, 2026

    @diberry
    ContributorAuthor

    🏗️ Flight — Greenfield CI Architecture Analysis

    Dina asked: if you were designing the CI from scratch to serve these same safety features, would you architect it differently — and would that save more minutes?

    Short answer: yes, substantially. The current system has 19 workflows spawning ~19 runners per PR push. PRD #872 proposes consolidating to 9-11. A greenfield design achieves 4-6 runners by organizing around resource tiers rather than feature categories.


    Feature Catalog

    I cataloged 47 distinct safety features across all 19 workflows. Here's the full inventory grouped by lifecycle:

    # Feature Workflow Trigger Needs Actual Work Blocking?
    PR Push — Policy Gates
    1 Path change detection squad-ci PR push Tier 0 (git diff) ~3s Gate (conditions other jobs)
    2 Changelog gate squad-ci PR push Tier 0 (git diff + file read) ~3s ✅ Required
    3 Changelog protection squad-ci PR push Tier 0 (git diff + grep) ~3s ✅ Required
    4 Publish policy squad-ci PR push Tier 0 (grep YAML) ~2s ✅ Required
    5 Workspace integrity squad-ci PR push Tier 0 (JSON parse) ~3s ✅ Required
    6 Prerelease version guard squad-ci PR push Tier 0 (JSON parse) ~3s ✅ Required
    7 Canary check squad-ci PR push Tier 0 (file existence) ~2s ✅ (inside test job)
    8 Large deletion guard squad-ci PR push Tier 0 (git diff --stat) ~2s ✅ (inside test job)
    9 Scope boundary squad-scope-check PR push Tier 0 (git diff) ~3s ✅ Required (conditional)
    PR Push — Node Script Checks
    10 Exports map validation squad-ci PR push Tier 1 (node script) ~5s ✅ Required
    11 Bootstrap zero-dep protection squad-repo-health PR target Tier 1 (node script) ~5s ✅ Required
    12 Branch contamination heuristic squad-repo-health PR target Tier 0 (git stats) ~3s ⚠️ Warning only
    13 .squad/ leakage detection squad-repo-health PR target Tier 1 (node script) ~5s ⚠️ Warning (comment)
    14 Architectural review squad-repo-health PR target Tier 1 (node script) ~8s ⚠️ Informational (comment)
    15 Security review squad-repo-health PR target Tier 1 (node script) ~8s ⚠️ Informational (comment)
    16 Impact analysis + risk scoring squad-impact PR target Tier 1 (node script) ~10s ⚠️ Informational (comment)
    17 PR readiness scoring squad-pr-readiness PR target + workflow_run Tier 1 (node script) ~5s ⚠️ Informational
    PR Push — Docs Quality
    18 Markdown linting squad-ci PR push Tier 2 (markdownlint-cli2) ~15s ✅ Required (conditional)
    19 Spelling check squad-ci PR push Tier 2 (cspell) ~15s ✅ Required (conditional)
    PR Push — Build & Test
    20 Full monorepo build squad-ci PR push Tier 4 (npm install + build + playwright) ~4min ✅ Required
    21 Full test suite squad-ci PR push Tier 4 (npm test) ~4min ✅ Required
    22 Export smoke test squad-ci PR push Tier 3 (npm ci + build SDK) ~1min ✅ Required
    23 Samples build validation squad-ci PR push Tier 3 (npm install per sample) ~2min ✅ Required (conditional)
    Issue Operations
    24 Label mutual exclusivity squad-label-enforce Issue labeled API-only ~3s ✅ Auto-enforced
    25 API rate limit monitoring squad-triage Issue labeled API-only ~2s ✅ Gate
    26 Issue triage + routing squad-triage Issue labeled ('squad') API + checkout ~5s ✅ Auto-routed
    27 Issue assignment acknowledgment squad-issue-assign Issue labeled ('squad:*') API + checkout ~5s ✅ Auto-assigned
    28 Copilot agent assignment squad-issue-assign Issue labeled ('squad:copilot') API (PAT) ~5s ✅ Auto-assigned
    29 Orphan label repair squad-heartbeat Issue/PR closed, manual API-only ~5s ✅ Auto-repaired
    30 Smart triage (ralph) squad-heartbeat Issue/PR closed, manual API + checkout ~5s ⚠️ Conditional
    31 Copilot auto-assign squad-heartbeat Issue/PR closed, manual API + checkout ~5s ⚠️ Conditional
    Label Management
    32 Label sync from team.md sync-squad-labels Push to team.md, manual API + checkout ~10s ✅ Auto-synced
    Documentation
    33 Docs build squad-docs Push to main (docs/**) Tier 2 (npm ci in docs/) ~2min ✅ Deploy gate
    34 Docs deploy to GitHub Pages squad-docs Push to main (docs/**) Pages action ~30s ✅ Deployment
    35 External link checking squad-docs-links Manual Tier 2 (lychee action) ~2min ⚠️ Creates issue
    CI Operations
    36 Manual CI rerun ci-rerun Manual (PR number) Tier 4 (full CI) ~8min ✅ Status reported
    Insider Pipeline
    37 Insider build + test squad-insider-publish Push to insider Tier 4 (full build + playwright) ~8min ✅ Publish gate
    38 Registry health check squad-insider-publish Push to insider API-only (npm ping) ~5s ✅ Publish gate
    39 Insider npm publish squad-insider-publish Push to insider Tier 3 (build + npm publish) ~3min ✅ Publish
    Production Publish
    40 File reference scanning squad-npm-publish Release published Tier 0 (node -e) ~3s ✅ Publish gate
    41 Lockfile stability check squad-npm-publish Release published Tier 0 (node -e) ~3s ✅ Publish gate
    42 Semver validation squad-npm-publish Release published Tier 0 (node -e) ~3s ✅ Publish gate
    43 CLI packaging smoke test squad-npm-publish Release published Tier 4 (full build + vitest) ~5min ✅ Publish gate
    44 npm publish with provenance squad-npm-publish Release published Tier 3 (build + publish) ~3min each ✅ Publish
    Release Pipeline
    45 Insider release (tag + prerelease) squad-insider-release Push to insider Tier 1 (node --test + git tag) ~30s ✅ Release
    46 Production release (tag + release) squad-release Push to main Tier 1 (node --test + CHANGELOG check) ~30s ✅ Release
    47 Preview validation squad-preview Push to preview Tier 1 (node --test + file checks) ~30s ✅ Validation
    Deployment Operations
    48 Branch promotion (dev→preview→main) squad-promote Manual Tier 0 (git merge + strip paths) ~30s ✅ Deployment

    Resource Tier Grouping

    This is the key insight the PRD doesn't fully exploit. Every safety feature falls into a resource tier, and the current system often boots a Tier 4 runner (full npm install + build + Playwright) for Tier 0 work (grep a file).

    Tier What It Needs Boot + Setup Time Features in This Tier
    Tier 0 — Zero-install actions/checkout only. Uses git diff, grep, node -e (pre-installed on runner), file reads. ~45s (checkout only) #1-9, #12, #40-42, #48 — 14 features
    Tier 1 — Node-only actions/setup-node but NO npm install. Runs .mjs scripts using only node:* built-ins. ~55s (checkout + setup-node) #10-11, #13-17, #45-47 — 10 features
    Tier 2 — Sparse install Installs specific tools (markdownlint-cli2, cspell) but not the full monorepo. ~75s (checkout + setup-node + sparse npm) #18-19, #33-35 — 5 features
    Tier 3 — Full install + build Full npm ci + npm run build. The expensive tier. ~180s (checkout + setup-node + npm ci + build) #22-23, #39, #44 — 5 features
    Tier 4 — Full install + build + browser Everything in Tier 3 plus Playwright browser install. ~240s (checkout + everything + Playwright) #20-21, #36-37, #43 — 6 features
    API-only actions/github-script or gh CLI. No checkout needed, or sparse checkout for reading .squad/team.md. ~30s (no checkout or sparse) #24-31 — 8 features

    The waste problem: Currently, features #2-9 (Tier 0 policy gates, ~25s of actual work combined) each get their own runner, paying ~90s of boot overhead PER CHECK. That's ~10 minutes of runner time for 25 seconds of work. Same story for features #11-16 (Tier 1 reviews, ~40s of actual work across 5 separate runners = ~8 minutes of boot overhead).


    Greenfield Architecture

    Design principles applied:

    1. One runner per resource tier — don't boot Tier 4 for Tier 0 work
    2. Maximize work per boot — if you're already booted with Node, run ALL Tier 0+1 checks
    3. pull_request_target for all read-only validation — the single biggest optimization
    4. Conditional tiers — only boot Tier 3/4 when code actually changed
    5. Preserve per-check observability — use step-level annotations and $GITHUB_STEP_SUMMARY
    6. Fork-safe diff access — use refs/pull/<number>/head, not direct SHA fetch
    Proposed Workflows (10 total)

    1. squad-pr-validate.yml — All read-only PR checks in ONE runner

    Trigger: pull_request_target [opened, synchronize, reopened, edited, ready_for_review]
    Security: checkout BASE only, fetch PR head as ref only, never execute PR code
    Permissions: contents:read, pull-requests:write
    Runner count: 1
    
    Job: validate (Tier 1, ~60-90s actual work)
      Steps:
        ├─ Checkout base (fetch-depth: 0, persist-credentials: false)
        ├─ Fetch PR head ref (refs/pull/<N>/head)
        ├─ Setup Node 22
        ├─ Path change detection → outputs: code_changed, docs_changed
        ├─ [if: always()] Changelog gate
        ├─ [if: always()] Changelog protection
        ├─ [if: always()] Publish policy
        ├─ [if: always()] Workspace integrity
        ├─ [if: always()] Prerelease version guard
        ├─ [if: always()] Scope boundary (if repo-health branch/label)
        ├─ [if: always()] Canary check + large deletion guard
        ├─ [if: always()] Exports map check
        ├─ [if: always()] Bootstrap zero-dep protection
        ├─ [if: always()] Diff guard (contamination heuristic)
        ├─ [if: always()] Squad leakage detection → post comment
        ├─ [if: always()] Architectural review → post comment
        ├─ [if: always()] Security review → post comment
        ├─ [if: always()] Impact analysis → post comment
        ├─ [if: always()] PR readiness scoring
        └─ Summary step → $GITHUB_STEP_SUMMARY with per-check pass/fail table
    

    This consolidates 14 runners (features #1-17) into 1 runner. Each check posts its own annotation or comment independently. The existing repo-health-comment.mjs upsert pattern continues to work — consolidate execution, not comment format.

    Security invariant: This workflow NEVER executes PR code. It checks out BASE branch scripts and reads PR content via git diff only. Shell injection is mitigated by using Node + GitHub API for all PR metadata access (no direct interpolation of PR titles/filenames into shell).

    2. squad-pr-ci.yml — Build & test (the expensive stuff)

    Trigger: pull_request [opened, synchronize, reopened] on [dev, preview, main, insider]
    Concurrency: cancel-in-progress: true
    Runner count: 1-2 (conditional)
    
    Job 1: full-ci (Tier 4, ~8-10min) — if code_changed
      Steps:
        ├─ Checkout + setup-node + npm install (with retry)
        ├─ npm ci in docs/ (for docs test deps)
        ├─ Playwright install chromium
        ├─ npm run build
        ├─ npm test
        ├─ [if: always()] Export smoke test (build already done!)
        └─ [if: always()] Samples build (build already done!)
    
    Job 2: docs-quality (Tier 2, ~30s) — if docs_changed
      Steps:
        ├─ Checkout + setup-node
        ├─ npm install --no-save markdownlint-cli2 cspell
        ├─ markdownlint
        └─ cspell
    

    Key savings: export-smoke-test and samples-build reuse the full-ci runner's build artifacts instead of booting their own runners. Each runs as a post-build step with if: always() so test failures don't prevent them from reporting.

    3. squad-readiness-post-ci.yml — Update readiness after CI completes

    Trigger: workflow_run [Squad PR CI] completed
    Runner count: 1
    
    Job: readiness (Tier 1, ~10s)
      Steps:
        ├─ Sparse checkout (scripts/pr-readiness.mjs only)
        └─ node scripts/pr-readiness.mjs
    

    4. squad-issue-ops.yml — All issue lifecycle operations

    Trigger: issues [labeled, closed], pull_request [closed], workflow_dispatch
    Runner count: 1
    
    Job: ops (API-only + sparse checkout, ~15s)
      Steps:
        ├─ Rate limit check
        ├─ [if: labeled == go:/release:/type:/priority:] Label enforcement
        ├─ [if: labeled == 'squad'] Triage + routing
        ├─ [if: labeled == 'squad:*'] Assignment
        ├─ [if: labeled == 'squad:copilot'] Copilot agent assignment (PAT)
        ├─ [if: closed] Orphan label repair
        ├─ [if: closed] Smart triage
        └─ [if: closed] Copilot auto-assign
    

    Consolidates squad-triage + squad-issue-assign + squad-label-enforce + squad-heartbeat (4 workflows → 1). Conditional steps mean only relevant work runs per event.

    5. squad-insider.yml — Insider build + test + publish + release

    Trigger: push to insider
    Concurrency: cancel-in-progress: false (publish safety)
    Runner count: 2-3
    
    Job 1: build-and-test (Tier 4, ~10min)
      - Full npm install + build + Playwright + vitest
    
    Job 2: publish (Tier 3, ~5min) — needs build-and-test
      - Registry health check
      - Build SDK + CLI (or download artifacts from Job 1)
      - Publish SDK + CLI with insider tag
    
    Job 3: release (Tier 1, ~30s) — needs build-and-test
      - node --test + create insider tag + GitHub prerelease
    

    6. squad-npm-publish.yml — Production publish

    Trigger: release [published], workflow_dispatch
    Concurrency: cancel-in-progress: false (publish safety)
    Runner count: 3
    
    Job 1: validate-and-smoke (Tier 4, ~6min)
      - File reference scan + lockfile check + semver validation
      - npm ci + build + npm pack dry-run + vitest smoke tests
      - Registry health check
    
    Job 2: publish-sdk (Tier 3) — needs validate-and-smoke
      - Download build artifacts OR rebuild SDK
      - npm publish --provenance + verify
    
    Job 3: publish-cli (Tier 3) — needs publish-sdk
      - Download build artifacts OR rebuild SDK+CLI
      - npm publish --provenance + verify
    

    7. squad-release.yml — Production release (push to main)

    Runner count: 1
    - node --test + CHANGELOG validation + tag + GitHub release
    

    8. squad-docs.yml — Docs build + deploy (push to main, docs path)

    Runner count: 2 (build + deploy)
    - Unchanged from current
    

    9. sync-squad-labels.yml — Label sync (push to team.md)

    Runner count: 1
    - Unchanged from current
    

    10. squad-promote.yml — Branch promotion (manual)

    Runner count: 2 (dev→preview, preview→main)
    - Unchanged from current
    

    Removed workflows (absorbed):

    • squad-repo-health.yml → absorbed into squad-pr-validate.yml
    • squad-pr-readiness.yml → split into squad-pr-validate.yml + squad-readiness-post-ci.yml
    • squad-impact.yml → absorbed into squad-pr-validate.yml
    • squad-scope-check.yml → absorbed into squad-pr-validate.yml
    • squad-label-enforce.yml → absorbed into squad-issue-ops.yml
    • squad-triage.yml → absorbed into squad-issue-ops.yml
    • squad-issue-assign.yml → absorbed into squad-issue-ops.yml
    • squad-heartbeat.yml → absorbed into squad-issue-ops.yml
    • squad-insider-publish.yml → merged with squad-insider-release.yml into squad-insider.yml
    • squad-preview.yml → folded into squad-pr-ci.yml as a preview branch validation job
    • ci-rerun.yml → kept as manual workflow (could use reusable workflow from squad-pr-ci.yml)
    • squad-docs-links.yml → kept as manual workflow (unchanged)

    Comparison: Current vs PRD #872 vs Greenfield

    Metric Current (19 workflows) PRD #872 (consolidated) Greenfield (10 workflows)
    Workflow files 19 ~12-14 10 (+2 manual-only)
    Runners per PR push (code) ~19 9-11 4-5
    Runners per PR push (docs-only) ~19 4-5 3
    Runners per issue label 1-3 1-2 1
    Runners per insider push 5 5 3
    Runners per production release 6-7 6-7 4
    Boot overhead per PR push ~28 min (19 × ~90s) ~15 min (11 × ~90s) ~6 min (4 × ~90s)
    Actual work per PR push ~12 min ~12 min ~10 min (export-smoke + samples reuse build)
    Wasted runner-minutes per PR ~16 min ~8 min ~2-3 min
    Time-to-green (wall clock) ~10-12 min ~10-12 min ~9-10 min
    Migration risk n/a Low (incremental) Medium (architectural)
    Branch protection changes n/a Rename ~6 checks Rename ~10 checks

    Key savings breakdown:

    • Consolidating 14 read-only checks into 1 pull_request_target runner: saves ~13 runner boots (~19 min)
    • Moving export-smoke-test + samples-build into the full-ci runner: saves 2 runner boots (~3 min)
    • Consolidating 4 issue workflows into 1: saves 2-3 runner boots per label event
    • Merging insider publish + release: saves 2 runner boots per insider push

    Recommendation

    Adopt the greenfield architecture as the target state, but implement it using the PRD's phased approach.

    The PRD's incremental phases are the right implementation strategy — they're lower risk and independently revertible. But the PRD's target architecture (9-11 runners) leaves significant savings on the table. The greenfield design (4-5 runners per PR push) captures ~85% more waste reduction.

    Specific updates I'd make to the PRD:

    1. Add Phase 0.5: Consolidate ALL read-only PR checks into squad-pr-validate.yml using pull_request_target. This is the single highest-value change — it eliminates ~13 runner boots per PR push. The PRD's Phase 1 consolidates repo-health (5→1) and policy gates (6→1) separately. Instead, combine BOTH into one pull_request_target workflow. Same migration risk, much bigger payoff.

    2. Phase 1 addition: Move export-smoke-test and samples-build into the full-ci job as post-build steps. The build is already done — these just need the artifacts. Use if: always() so they report regardless of test outcomes.

    3. Phase 3 addition: Merge all 4 issue workflows into squad-issue-ops.yml. The PRD already proposes this for 3 of them — add heartbeat too. All run on issues: events and use GitHub API + sparse checkout.

    4. Phase 4 addition: Merge insider-publish and insider-release into one workflow. Both fire on push to insider. The build+test step is already required for both — share it.

    5. Preserve per-check observability. In consolidated workflows, use $GITHUB_STEP_SUMMARY with per-check pass/fail tables, step-level annotations, and existing comment upsert patterns. Don't sacrifice debuggability for runner count.

    6. Codify the pull_request_target security invariant. The consolidated validate workflow must NEVER execute PR code. Add a header comment and a CI check that verifies the workflow doesn't contain actions/checkout with a PR ref.

    Bottom line: The PRD is good engineering. The greenfield insight is that organizing around resource tiers — not feature categories — captures an additional ~10 wasted minutes per PR push. The implementation path is the same (phased, revertible), just with a better target architecture.


    Analysis by Flight (Lead) — requested by Dina Berry
    Data source: All 19 workflow files in .github/workflows/ + PRD #872

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions