Skip to content

fix(gh-aw): preserve bootstrap candidate through resolved validation - #2158

Merged
bradygaster merged 2 commits into
devfrom
bradygaster-bootstrap-cleanup-regression
Oct 3, 2026
Merged

bradygaster merged 2 commits into
devfrom
bradygaster-bootstrap-cleanup-regression

Conversation

@bradygaster

Copy link
Copy Markdown
Collaborator

What

Keep the isolated bootstrap candidate alive through resolved-link validation, Cast provenance, proposals-issue creation, and research-comment creation; remove it in the final finally on success, early returns, and errors. Add executable regression coverage and regenerate the package workflow and manifest digests. Working as agentic-workflows-dev (Agentic Workflows Engineer).

Why

The writer removed the candidate immediately after placeholder validation. Later resolved validation recreated only the payload JSON, so every builtin resource, evidence path, and generated Cast file was missing. No matching cleanup issue was identified; no fabricated closing reference is included.

How

Extend the existing try/finally around the complete writer lifecycle without changing API permissions, recovery policy, branch replacement, or proposal/research semantics. Tests execute the live YAML writer with real filesystem materialization and real bootstrap validators; only GitHub API responses are simulated. Existing extracted-block tests now derive indentation because the writer is nested in the longer try block.

Exact validation commands/results (local npm registry configured with npm config set registry "https://packagefeedproxy.microsoft.io/npm/"; isolated proxy-installed Vitest 3.2.4 used after root restore failed):

  • npm test -- test/gh-aw-bootstrap-workflow.test.ts -t 'keeps the real candidate' against the actual pre-fix dev writer: FAILED as required at resolved validation, naming missing .github/workflows/shared/builtins/scribe-charter.md, evidence package.json, generated .squad/team.md, and other candidate paths. Source selection was restored before committing.
  • npm test -- test/gh-aw-bootstrap-workflow.test.ts -t 'candidate lifetime': PASSED, 5/5. Covers full happy path through provenance, resolved issue link, research comment, complete cleanup; opt-out and permission-denied early returns; propagated post-validation API error; realistic source mutation restoring premature cleanup with missing-path diagnostics.
  • npm test -- test/gh-aw-bootstrap-workflow.test.ts: 50 passed, 2 failed. Strict compilation and compiled contract/mutation tests passed. The two failures are existing POSIX proxy fixtures on Windows: shell runner status null, and spawnSync safeoutputs ENOENT instead of the expected proxy error.
  • npm test -- test/gh-aw-bootstrap-workflow.test.ts -t 'submits seven chunks|fails explicitly without retries' against the actual pre-fix writer: same 2 failures reproduced. These unrelated fixtures were not changed.
  • node workflows\shared\squad-install-verifier.mjs --root <LF scratch archive> --write-source and node workflows\shared\squad-install-verifier.mjs --root <LF scratch archive> --check-source: PASSED. Used an LF-normalized archive in session artifacts because the Windows worktree's CRLF frontmatter breaks the existing renderer. Regenerated package bootstrap and manifest matched committed files exactly after EOL normalization; no unrelated EOL changes committed.
  • npm ci --ignore-scripts --no-audit --no-fund: FAILED, required Microsoft proxy returned 404 for eslint-plugin-n-18.4.0.tgz.
  • $env:SKIP_BUILD_BUMP='1'; npm run build: FAILED after bounded isolated TypeScript 6.0.3 / @types/node 26.6.3 recovery: TS2307 missing @github/copilot-sdk, ws, @opentelemetry/api, sql.js, and consequent implicit-any errors. No version churn; no further dependency repair.
  • git diff --cached --stat, git diff --cached --diff-filter=D --name-only, and git diff --cached --check: PASSED, intended scope only, no file deletions or whitespace errors.
  • Full repository npm test, npm run lint, and npm run lint:eslint: not run, dependency restore blocked; CI must validate.

Fresh hosted happy-path evidence supplied by the bootstrap diagnosis workstream; each run succeeded with Cast PR #2 and research-proposals issue #3. These demonstrate fresh bootstrap only, not rerun recovery:

Commits: e1f2d4e4bb785ed8a2424f749b24b91880bfe14f (fix/generated metadata), e6857f4824650866224bd64c1dd54407c8e47902 (regressions). Reviewed applicable reviewer, architecture, and security checklists: no new permissions, dependencies, public exports, or input-authorization changes. No downstream installs, resets, force pushes, or merge authorization.


⚠️ Quick Check

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

N/A: no SDK/CLI source or package-template changes; workflow/test paths do not trigger the changeset gate.

PR Readiness Checklist

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

Branch & Commit

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

Started from fetched origin/dev commit cc90916b; this PR targets dev, not the diagnosis feature branch. Intentionally draft pending CI.

Build & Test

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

Build and full validation remain pending CI for the reasons above. Migration item N/A: four files.

Changeset

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

N/A: infrastructure workflow/test change, no gated product-source/template paths. No skip label applied.

Docs

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

N/A: fixes existing workflow behavior; no new feature/module or public API.

Exports

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

N/A: no SDK changes or new modules.


Breaking Changes

None.

Waivers

User explicitly approved “Open a draft PR and let CI validate (Recommended)” after receiving the dependency-restore proxy 404 and two baseline Windows failures. This waives build-before-push for this PR only, not build/test requirements before merge. Draft must remain unmerged until CI and reviewer gates are satisfied. No merge or auto-merge requested.

brady gaster and others added 2 commits October 2, 2026 18:16
The resolved-link validation ran after the candidate tree was deleted,
so every builtin, evidence, and payload path reported missing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Execute the live writer with real candidate validation through Cast provenance, linked proposals, and research comments. Cover success, early returns, API failure, and a premature-cleanup mutation. Verified the happy path fails against pre-fix dev source.

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

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #2158

Risk tier: 🟡 MEDIUM

📊 Summary

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

🎯 Risk Factors

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

📦 Modules Affected

root (3 files)
  • workflows/package/squad-bootstrap.md
  • workflows/squad-bootstrap.md
  • workflows/squad-workflows.manifest.json
tests (1 file)
  • test/gh-aw-bootstrap-workflow.test.ts

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

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

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

PR Scope: 🔧 Infrastructure

⚠️ 2 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 No Copilot review threads
✅ CI passing All checks passing

Files Changed (4 files, +876 −692)

File +/−
test/gh-aw-bootstrap-workflow.test.ts +187 −3
workflows/package/squad-bootstrap.md +343 −343
workflows/squad-bootstrap.md +343 −343
workflows/squad-workflows.manifest.json +3 −3

Total: +876 −692


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

@bradygaster
bradygaster marked this pull request as ready for review October 3, 2026 01:23
Copilot AI balanced review requested due to automatic review settings October 3, 2026 01:23

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.

🔵 Needs a closer look

The workflow logic appears consistent, but full CI validation remains pending for an operationally sensitive bootstrap path.

0 open findings

What changed in this PR

Preserves the bootstrap candidate until all validation and artifact creation complete, while guaranteeing cleanup.

Changes:

  • Extends candidate cleanup across the full writer lifecycle.
  • Adds realistic lifecycle and mutation regression tests.
  • Regenerates packaged workflow and integrity digests.
File Description
workflows/​squad-bootstrap.md Moves cleanup to the final lifecycle boundary.
workflows/​package/​squad-bootstrap.md Regenerates the packaged workflow.
workflows/​squad-workflows.manifest.json Updates workflow integrity digests.
test/​gh-aw-bootstrap-workflow.test.ts Tests candidate lifetime and cleanup paths.

🧠 Review effort: Balanced


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

@bradygaster
bradygaster merged commit deee440 into dev Oct 3, 2026
20 checks passed
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