Repository navigation
Fix activation snapshots for symlinked agent configuration - #80390
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
❌ Test Quality Sentinel failed during test quality analysis. Incomplete workTest Quality Sentinel could not review tests because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ PR Specification Reviewer completed successfully!
|
This comment has been minimized.
This comment has been minimized.
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. The No-op messageLean already. Ship.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. The No-op messageCompleted PR #80390 code review: submitted one unified no-findings review, recorded the review-history outcome, and posted no inline comments.
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines in business-logic directories) but does not have a linked Architecture Decision Record (ADR). It Fixes #80360, where activation fails when an agent folder symlinks to a path outside the sparse checkout. 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify that the implementation matches the decision. ❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
There was a problem hiding this comment.
Reviewed PR head 26406eca609f998fea96fc441b7f2808e1077695 against Checkout Behavior Specification v1.3.4, requirements §3.3 and §5.3, and compliance coverage T-CHK-017. The implementation and tests intentionally change trusted base snapshot activation to a full shallow checkout while preserving base-ref selection, credential isolation, and symlink confinement.
Synchronized docs/src/content/docs/specs/checkout-behavior-specification.md to v1.3.5: clarified full snapshot versus sparse non-snapshot behavior, preserved repository-root confinement, and added T-CHK-022 for mode-dependent checkout and linked-skill materialization. The specification commit was queued to the same-repository PR branch. No blocking contract violations found.
Generated by PR Specification Reviewer for #80390 · copilot · gpt50 · ~5 AIC · ⌖ ~2 AIC · ⊞ 1.8K
Comment /review-specs to run again
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
No actionable correctness or maintainability findings on the changed lines. The full-checkout behavior is consistent with the stated requirement to snapshot trusted base configuration with symlink targets available; the specialist suggestions do not establish a merge-blocking defect in this diff.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review to run again
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
🟡 Changes recommended
The activation checkout name collides with agent-checkout detection, causing test failures, while snapshot gating still forces unnecessary full checkouts for workflows that never restore a snapshot.
2 open issues
What changed in this PR
Updates the workflow compiler’s activation checkout so trusted configuration snapshots can resolve symlink targets outside the sparse checkout, addressing #80360.
Changes:
- Use full, shallow checkouts for base snapshots while retaining sparse checkout otherwise.
- Add linked-skill snapshot/restore and checkout-mode regression coverage.
- Update checkout documentation and compiler golden fixtures.
| File | Description |
|---|---|
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden |
Updates snapshot checkout expectations for imports. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden |
Updates full checkout while retaining PR base pinning. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/playwright-cli-mode.golden |
Updates snapshot checkout expectations for Playwright mode. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/custom-safe-output-max-length.golden |
Refreshes snapshot checkout output. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden |
Updates basic Copilot snapshot checkout. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/pi.golden |
Updates Pi snapshot checkout. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/gemini.golden |
Updates Gemini snapshot checkout. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/copilot.golden |
Updates Copilot snapshot checkout. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/codex.golden |
Updates Codex snapshot checkout. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/claude.golden |
Updates Claude snapshot checkout. |
pkg/workflow/runtime_import_checkout_test.go |
Checks full snapshot checkout for runtime imports. |
pkg/workflow/compiler_jobs_steps_test.go |
Updates activation checkout ordering expectations. |
pkg/workflow/compiler_builtin_presteps_test.go |
Updates pre-step ordering for the renamed checkout. |
pkg/workflow/compiler_activation_steps.go |
Selects checkout mode from snapshot eligibility. |
pkg/workflow/compiler_activation_steps_test.go |
Updates snapshot-step assertions. |
pkg/workflow/compiler_activation_job.go |
Passes checkout mode through existing ref/token handling. |
pkg/workflow/compiler_activation_job_test.go |
Adds checkout-mode cases and updates helper calls. |
pkg/workflow/compiler_activation_checkout_test.go |
Verifies full snapshots without persisted credentials. |
pkg/workflow/checkout_step_generator.go |
Supports full and sparse activation checkouts. |
docs/src/content/docs/specs/checkout-behavior-specification.md |
Specifies snapshot-dependent activation checkout behavior. |
docs/src/content/docs/reference/checkout.md |
Explains full versus sparse activation checkout. |
actions/setup/sh/base_github_folders_test.cjs |
Tests restoration of linked skills from trusted snapshots. |
Review effort: Max (adaptive)
|
|
||
| sb.WriteString(" - name: Checkout .github and .agents folders\n") | ||
| if fullCheckout { | ||
| sb.WriteString(" - name: Checkout repository for base branch snapshot\n") |
There was a problem hiding this comment.
Fixed in e618556: the activation checkout has a distinct name. The pre-step and checkout optimization tests pass.
| ctx.steps = append(ctx.steps, checkoutSteps...) | ||
| stageCopilotSDKAgents := data.EngineConfig != nil && data.EngineConfig.CopilotSDK | ||
| if len(checkoutSteps) > 0 && (!isPRCheckoutDisabled(data) || dynamicWorkflowsEnabled(ctx.engine, data.EngineConfig) || stageCopilotSDKAgents) { | ||
| saveBase := !isPRCheckoutDisabled(data) || dynamicWorkflowsEnabled(ctx.engine, data.EngineConfig) || stageCopilotSDKAgents |
There was a problem hiding this comment.
Fixed in e618556: snapshot saving and full checkout now share the restore predicate, with SDK staging included.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd (pr-triage classified this as a bug fix). Requesting changes because the compiler output change leaves every committed activation lock stale.
📋 Key Themes & Highlights
Key Themes
- Stale generated locks: compiling this head rewrites 370
.lock.ymlfiles, and the PR regenerates none. The PR-triggered CI does not run the drift check, but a push tomainthat touchespkg/**does run it, so it would fail after merge. - Symlink coverage gap: the sparse path still only scans three fixed directories, so symlink targets outside them are still missed.
- Weak test: the new
.cjsregression test exercises unchanged shell scripts and does not guard the Go change. - Fragile assertions: some tests slice YAML text on indentation.
Verified
TestActivationSnapshotCheckoutIncludesSymlinkTargetspasses.- All 15 tests in
base_github_folders_test.cjspass. - The 3 workflows that fail to compile (
deep-report,go-pattern-detector,mcp-inspector) fail on npm registry certificate errors in this sandbox, not because of the PR.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~12 AIC · ⌖ ~2 AIC · ⊞ 6.8K
Comment /matt to run again
| assert.NotContains(t, activationJobSection, "name: Checkout repository", "Should not have a full repository checkout step") | ||
| // The trusted snapshot needs the complete base tree to resolve symlink targets. | ||
| require.Contains(t, activationJobSection, "name: Checkout repository for base branch snapshot") | ||
| checkout := strings.SplitN(strings.SplitN(activationJobSection, "name: Checkout repository for base branch snapshot", 2)[1], "\n - name:", 2)[0] |
There was a problem hiding this comment.
[/tdd] Splitting the job text on the step-name marker and the next - name: depends on exact YAML indentation and step order. A reformat or an extra step breaks this assertion even without a real regression.
Parse the activation job YAML and select the step by its name instead.
@copilot please address this.
There was a problem hiding this comment.
Fixed in e618556: the test parses the workflow YAML and selects the activation step by name.
| assert.equal(execution.stdout.trim(), "ok"); | ||
| }); | ||
|
|
||
| test("save: materializes skills linked outside agent folders before PR checkout", t => { |
There was a problem hiding this comment.
[/tdd] This test drives only save_base_github_folders.sh, and this PR does not change that script. It would also pass against the base commit, so it does not guard the Go checkout change. The Go test TestActivationSnapshotCheckoutIncludesSymlinkTargets is the real regression test.
💡 Suggested fix
Remove this test, or rename it so it reads as a save-script behavior spec and does not claim to cover checkout ordering.
@copilot please address this.
There was a problem hiding this comment.
Fixed in e618556: the shell test is named as a save-and-restore behavior test; checkout regression coverage remains in the Go test.
| compilerActivationJobLog.Print("Adding .github, .agents, and engine-specific dirs to sparse checkout for activation job") | ||
| return cm.GenerateGitHubFolderCheckoutStep("", activationCheckoutRef(data, "github.sha"), activationToken, c.getActionPin, extraPaths...) | ||
| compilerActivationJobLog.Printf("Adding activation checkout: full=%t", fullCheckout) | ||
| return cm.generateActivationCheckoutStep("", activationCheckoutRef(data, "github.sha"), activationToken, c.getActionPin, fullCheckout, extraPaths...) |
There was a problem hiding this comment.
[/codebase-design] resolveSymlinkExtraPaths still scans only .github/agents, .github/skills, and .github/prompts. The sparse path (saveBase == false) therefore still misses symlink targets outside those folders, such as per-skill links inside a real .agents/skills/ tree. The new comment says symlink targets must be fetched, but this branch does not do that.
💡 Suggested fix
Either route symlink-bearing configs through the full checkout, or extend the scan to every symlink under the sparse-checked folders. If activation never reads those targets on this path, document that in the comment.
@copilot please address this.
There was a problem hiding this comment.
Fixed in e618556: sparse checkout scans nested symlinks in configuration and extra paths, with repository confinement and regression coverage.
|
|
||
| sb.WriteString(" - name: Checkout .github and .agents folders\n") | ||
| if fullCheckout { | ||
| sb.WriteString(" - name: Checkout repository for base branch snapshot\n") |
There was a problem hiding this comment.
[/diagnosing-bugs] This PR changes compiler output for every activation job, but none of the 370 committed .lock.yml files are regenerated. Compiling ab-testing-advisor.md on this head rewrites its lock: the step name changes and the sparse-checkout block is removed. CI check-workflow-drift will fail on push to main until make recompile is run and the locks are committed.
💡 Verification
I compiled all workflows on this head and 370 tracked lock files changed. The PR touches no lock files, so the stored output is stale.
@copilot please address this.
There was a problem hiding this comment.
Regenerated in e618556 and verified again after merging main in c1e1ce84. Full package validation is currently blocked by npm registry DNS; compilation without that external validation succeeded.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "053eefbeb9eac87307ae71d14525a9fc8557f5e5",
"kind": "requested",
"schema_version": "1",
"state": "48f7d3f9532f7525b447509389da09e70600de60319d25a28fe265066c9adb1e",
"work": [
"00c67337de75cbb14e7e442f3cd0c94ae2f69d353cccd0b2cd3b3a7b77eb9ebc",
"27425e0e4db5588b43dad3f80bdec3198af1ba8c43811054ce7c5ae0adf369e0",
"36e076c28e0e06d5330da117de3948e76bcdebf7d93004eb02987b761024a0ea",
"3c1b3fdf88de0357818b2f24752d6e38d0ca576ae0e3ccd34f16be5284a50c64",
"42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
"9450faf1e4ff9b3315e8e1e8d65e2367a6d9d2999b52f1d9f957dc88d380bc28",
"b77d07d26e864a24aacc064374c789ed2c3ec9eea8238314683244d46525a736",
"e36728481b4ae4ee1503f6cd0ad01254eda77ffba7c3fc3573848a1188950f24"
],
"workflow": "pr-sous-chef"
}
|
…der-symlinks Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
@copilot merge main and recompile |
…der-symlinks Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Merged main in c1e1ce8. All 371 workflows compiled; full validation was blocked by npm registry DNS.
Merged main in c1e1ce8; review fixes are in e618556. Targeted tests pass. Compilation succeeded without external package validation; the full gate reports npm DNS and custom-linter failures. |


Activation can fail when an agent configuration symlink points to a repository path omitted by the sparse checkout.