Skip to content

Fix security review archive exclusions - #1771

Merged
bradygaster merged 2 commits into
devfrom
squad/security-review-archive-exclusion
Aug 20, 2026
Merged

Fix security review archive exclusions#1771
bradygaster merged 2 commits into
devfrom
squad/security-review-archive-exclusion

Conversation

@bradygaster

Copy link
Copy Markdown
Owner

Summary

  • Exclude rotated .squad/agents/*/history-archive-*.md files from unsafe-git prose findings, matching active history.md behavior.
  • Keep agent charters in scope so instruction surfaces still report unsafe git phrases.

Context

PR #1754 is blocked by a security-review false positive in restored agent history archives. This change narrows the exclusion to rotated history archives only.

Validation

  • npm test -- test/scripts/security-review.test.ts
  • npm run build

No changeset: changelog gate excludes scripts/ and test/ paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 20, 2026 16:46
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1771

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 2
Files added 1
Files modified 1
Files deleted 0
Modules touched 2

🎯 Risk Factors

  • 2 files changed (≤5 → LOW)
  • 2 modules touched (2-4 → MEDIUM)

📦 Modules Affected

scripts (1 file)
  • scripts/security-review.mjs
tests (1 file)
  • test/scripts/security-review.test.ts

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

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

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

PR Scope: 🔧 Infrastructure

⚠️ 4 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 1 unresolved Copilot thread(s) — fix and resolve before merging
CI passing 6 check(s) still running

Files Changed (2 files, +84 −0)

File +/−
scripts/security-review.mjs +3 −0
test/scripts/security-review.test.ts +81 −0

Total: +84 −0


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

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.

Pull request overview

This PR updates the security-review script’s “unsafe git” scanner to ignore rotated agent history archive files (matching the existing exclusion for active history.md), and adds a regression test to ensure charters remain in scope.

Changes:

  • Exclude .squad/agents/*/history-archive-*.md from unsafe-git prose findings.
  • Add a Vitest regression test covering both the archive exclusion and the charter inclusion.
Show a summary per file
File Description
test/scripts/security-review.test.ts Adds coverage to prevent unsafe-git false positives for rotated history archives while ensuring charters still trigger findings.
scripts/security-review.mjs Narrows the unsafe-git excluded paths to include rotated history archives, leaving instruction surfaces in scope.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +1 to +12
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { execFileSync } from 'node:child_process';
import { mkdirSync, rmSync, writeFileSync } from 'node:fs';
import { randomBytes } from 'node:crypto';
import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';

const __dirname = dirname(fileURLToPath(import.meta.url));
const repoRoot = resolve(__dirname, '..', '..');
const scriptPath = join(repoRoot, 'scripts', 'security-review.mjs');
const testRoot = join(repoRoot, `.test-security-review-${process.pid}-${randomBytes(4).toString('hex')}`);

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster
bradygaster merged commit b0ce60e into dev Aug 20, 2026
8 checks passed
@bradygaster
bradygaster deleted the squad/security-review-archive-exclusion branch August 20, 2026 16:50
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