Skip to content

feat(ci): add repo health checks#769

Merged
diberry merged 2 commits intodevfrom
squad/repo-health-initiative
Apr 4, 2026
Merged

feat(ci): add repo health checks#769
diberry merged 2 commits intodevfrom
squad/repo-health-initiative

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Apr 2, 2026

Add 4 automated repo health scripts and a GitHub Actions workflow:

  • check-bootstrap-deps.mjs (BLOCKING): Validates 5 protected bootstrap files use only
    ode:*\ imports
  • check-squad-leakage.mjs (WARNING): Detects .squad/ file changes in feature PRs
  • architectural-review.mjs (INFORMATIONAL): Checks module boundaries, exports, cross-package imports, template sync, sweeping refactors
  • security-review.mjs (INFORMATIONAL): Checks for eval, command injection, unsafe git ops, secrets, permissions

Workflow: \squad-repo-health.yml\ runs all 4 on PRs targeting dev with \pull_request_target\ for fork write token support.

All scripts use only
ode:*\ built-ins (no npm install needed). Each informational check posts a PR comment with HTML markers for upsert.

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

@tamirdresher
Copy link
Copy Markdown
Collaborator

Smart idea - the zero-dependency node:* approach is the right call for CI scripts.

Few notes:

No rush on this one, but the direction is good.

@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Apr 3, 2026

📁 Files in this PR (11)

# File Type
1 .github/workflows/squad-repo-health.yml Workflow
2 scripts/architectural-review.mjs Script
3 scripts/check-bootstrap-deps.mjs Script
4 scripts/check-squad-leakage.mjs Script
5 scripts/repo-health-comment.mjs Script
6 scripts/security-review.mjs Script
7 test/scripts/architectural-review.test.ts Test
8 test/scripts/check-bootstrap-deps.test.ts Test
9 test/scripts/check-squad-leakage.test.ts Test
10 test/scripts/helpers.ts Test helper
11 test/scripts/security-review.test.ts Test

11 files — 1 workflow, 5 scripts, 4 tests, 1 test helper.

@diberry diberry force-pushed the squad/repo-health-initiative branch from 2fcc8f2 to 95657f1 Compare April 3, 2026 13:05
@diberry diberry marked this pull request as ready for review April 3, 2026 13:09
Copilot AI review requested due to automatic review settings April 3, 2026 13:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a “repo health” CI workflow plus four Node-only scripts (and Vitest coverage) to enforce/bootstrap-check dependencies and surface architectural/security signals as PR comments.

Changes:

  • Introduces health-check scripts for bootstrap dependency enforcement, .squad/ leakage detection, architectural review, and security review.
  • Adds a pull_request_target workflow to run these checks on PRs targeting dev, including PR-comment upserts via a shared comment helper.
  • Adds Vitest integration/unit tests plus shared test helpers for the new scripts.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.github/workflows/squad-repo-health.yml New PR-target workflow to run health checks and post PR comments.
scripts/check-bootstrap-deps.mjs Blocking gate to ensure protected bootstrap files only use built-in/relative imports.
scripts/check-squad-leakage.mjs Informational detector for .squad/ files in PR diffs.
scripts/architectural-review.mjs Informational checks for module boundaries, template sync signals, sweeping refactors, deletions.
scripts/security-review.mjs Informational checks for common risky patterns in diffs/workflows/deps.
scripts/repo-health-comment.mjs Shared PR comment upsert utility (marker-based).
test/scripts/helpers.ts Shared subprocess + JSON-extraction helpers for script tests.
test/scripts/check-bootstrap-deps.test.ts Unit/integration tests for bootstrap dependency checker.
test/scripts/check-squad-leakage.test.ts Integration tests for .squad/ leakage checker.
test/scripts/architectural-review.test.ts Unit/integration tests for architectural review script.
test/scripts/security-review.test.ts Unit/integration tests for security review script.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🛫 PR Readiness Check

⚠️ 3 item(s) to address before review

Status Check Details
Single commit 2 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 All 6 Copilot thread(s) resolved
CI passing 4 check(s) still running

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

@diberry diberry force-pushed the squad/repo-health-initiative branch 2 times, most recently from b987467 to 3626ba0 Compare April 3, 2026 14:31
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Apr 3, 2026

Closing and reopening to trigger PR readiness workflow (workflow was added to dev after this PR was opened).

@diberry diberry closed this Apr 3, 2026
@diberry diberry reopened this Apr 3, 2026
@diberry diberry force-pushed the squad/repo-health-initiative branch from 3626ba0 to 6b926d0 Compare April 3, 2026 20:47
Add repo health check workflows and scripts: dependency audit,
security scanning, lint config validation, and PR comment reporting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/repo-health-initiative branch from 6b926d0 to 4869017 Compare April 3, 2026 20:53
Copy link
Copy Markdown
Collaborator

@tamirdresher tamirdresher left a comment

Choose a reason for hiding this comment

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

LGTM. Well-structured CI with modular scripts, 900+ LOC of tests, proper pull_request_target security model. 4 concurrent checks are clean.

@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Apr 4, 2026

Files in this PR:

  • .github/workflows/squad-repo-health.yml
  • scripts/architectural-review.mjs
  • scripts/check-bootstrap-deps.mjs
  • scripts/check-squad-leakage.mjs
  • scripts/repo-health-comment.mjs
  • scripts/security-review.mjs
  • test/scripts/architectural-review.test.ts
  • test/scripts/check-bootstrap-deps.test.ts
  • test/scripts/check-squad-leakage.test.ts
  • test/scripts/helpers.ts
  • test/scripts/security-review.test.ts

@diberry diberry merged commit 7a4dbfd into dev Apr 4, 2026
12 checks passed
@diberry diberry deleted the squad/repo-health-initiative branch April 4, 2026 14:14
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.

4 participants