Skip to content

test(scaffold): B-0424.5 — dry-run test suite for create-repo.ts (18 tests)#3025

Merged
AceHack merged 3 commits into
mainfrom
feat/B-0424.5-scaffold-dry-run-tests
May 13, 2026
Merged

test(scaffold): B-0424.5 — dry-run test suite for create-repo.ts (18 tests)#3025
AceHack merged 3 commits into
mainfrom
feat/B-0424.5-scaffold-dry-run-tests

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 13, 2026

Summary

  • Adds tools/scaffold/create-repo.test.ts — 18 subprocess-based tests for the B-0424 Stage 1 scaffold tool
  • Tests verify the --dry-run output for both forge and ace before anyone runs --apply (the irreversible GitHub repo creation step)
  • Closes the test gap between B-0424.4 (Scorecard workflow) and the eventual Stage 1 execution PR

What the tests cover

Scenario Assertions
Both repos produce 12 planned operations Step ID inventory, all status:"planned"
Step 01 repo settings public, squash-merge, auto-merge, delete-branch; ace has no homepage
Step 02 branch protection no force-push, linear history, empty required_status_checks (deadlock guard)
Step 04 CodeQL default-setup (not advanced-only) — guards against code_scanning ruleset regression
Step 05 fork targets AceHack org
Step 06 scaffold files core governance files present (README, AGENTS, GOVERNANCE, SECURITY, LICENSE)
Step 07 manual steps budget-cap + CodeQL verification items present
Error handling unknown/missing --repo exits non-zero with usage message

Why subprocess-based tests

create-repo.ts calls process.exit() and runs logic at module load — both break import-time unit testing. Spawning as a subprocess mirrors the actual invocation path, requires zero refactoring, and is zero-network (no GitHub calls, no side effects).

Checks

  • bun test tools/scaffold/create-repo.test.ts18 pass, 0 fail
  • dotnet build -c Release0 warnings, 0 errors

Context

operative-authorization: aaron 2026-05-13: "Cooling period: TBD. The memory file IS the durable record"

🤖 Generated with Claude Code

…tests)

Adds tools/scaffold/create-repo.test.ts with 18 subprocess-based tests
that verify the dry-run output of create-repo.ts for both forge and ace
before anyone runs --apply (the irreversible GitHub repo creation step).

Tests cover:
- All 12 planned operations present for each repo
- Every operation has status:"planned" in dry-run mode
- Step 01: public+squash-merge+auto-merge settings; ace has no homepage
- Step 02: branch protection data (no force-push, linear history, empty
  required_status_checks to avoid deadlock before CI is wired)
- Step 04: CodeQL default-setup (not advanced-only; guards against the
  code_scanning ruleset rule regression)
- Step 05: fork targets AceHack org
- Step 06: scaffold file list includes core governance files
- Step 07: manual-step checklist includes budget-cap and CodeQL items
- Error handling: non-zero exit + usage message for unknown/missing --repo

Build gate: dotnet build -c Release → 0 warnings 0 errors.
Test gate:  bun test tools/scaffold/create-repo.test.ts → 18 pass 0 fail.

operative-authorization: aaron 2026-05-13: "Cooling period: TBD. The memory file IS the durable record"

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 13, 2026 20:07
@AceHack AceHack enabled auto-merge (squash) May 13, 2026 20:07
18 dry-run tests for create-repo.ts; PR #3025.

operative-authorization: aaron 2026-05-13: "Cooling period: TBD. The memory file IS the durable record"

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

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

Note

Copilot was unable to run its full agentic suite in this review.

Adds a subprocess-based Bun test suite to validate create-repo.ts --dry-run output for both forge and ace, ensuring the planned GitHub operations are correct before the irreversible --apply step is used.

Changes:

  • Introduces tools/scaffold/create-repo.test.ts with 18 dry-run subprocess tests covering step inventory, key configuration assertions, and error handling.
  • Adds a hygiene-history tick documenting the work, build, and test status.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tools/scaffold/create-repo.test.ts Adds subprocess-driven dry-run tests that assert the full planned operation set for forge and ace, plus invalid-arg behavior.
docs/hygiene-history/ticks/2026/05/13/2007Z.md Records the work session/tick for B-0424.5, including build/test results and contextual notes.

Comment thread tools/scaffold/create-repo.test.ts
Comment thread tools/scaffold/create-repo.test.ts Outdated
Comment thread tools/scaffold/create-repo.test.ts Outdated
…tdout, MD032

- Move describe-level runDryRun calls into beforeAll so subprocess failures
  report as test failures with clear attribution (Copilot #3237144663)
- Rename `orgName` → `repoName` in assertCommonInvariants for clarity
  (Copilot #3237144697)
- Check `stderr + stdout` for Usage: to survive output-stream differences
  (Copilot #3237144717)
- Add blank line before list in tick shard to fix MD032 markdownlint error

All 18 tests still pass.

Co-Authored-By: Claude <noreply@anthropic.com>
@AceHack AceHack merged commit 18d823c into main May 13, 2026
24 of 25 checks passed
@AceHack AceHack deleted the feat/B-0424.5-scaffold-dry-run-tests branch May 13, 2026 20:15
AceHack added a commit that referenced this pull request May 14, 2026
…tep documented (#3114)

* backlog(b-0424): mark in-progress — document slices 1-8 merged; add --apply next-step

All 8 scaffolding slices (PRs #2994, #2996, #3003, #3019, #3025, #3026,
#3027, #3028) are merged and tests pass (30/30). Update status to
in-progress and document the completed slices table, dry-run verification
(12 ops planned for each repo, 2026-05-14), and the --apply execution
instructions Aaron needs to review before irreversible repo creation.

operative-authorization: aaron 2026-05-13: "Cooling period: TBD. The memory file IS the durable record"

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(b-0424): add blank line before list — resolve MD032 markdownlint

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(b-0424): valid status + route --apply through workflow

- status: in-progress → open (in-progress not in schema enum)
- Next-step instructions now reference scaffold-stage1-create-repos
  GitHub Actions workflow (actor allowlist + CONFIRM gate + PAT
  handling + concurrency protection) instead of raw --apply bash

Resolves Copilot P1 threads on #3114.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
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