Repository navigation
Description
Code Simplification - 2026-10-03
This PR simplifies ApplyEngine.cs in the unskip-closed-tests-tool, splitting the 768-line monolithic file into focused partial class ApplyEngine modules, consistent with the pattern already used for InventoryEngine.
Files Simplified
.github/workflows/unskip-closed-tests-tool/ApplyEngine.cs(768 → 229 lines) — trimmed to the top-levelApplyAsyncorchestration method plus the sharedSourceEdit/VerificationOutcomerecords.
New Files
ApplyEngine.AgentSelection.cs(143 lines) — parses and validates the agent's selected candidate IDs (ReadAgentSelection,RequiredString).ApplyEngine.Edits.cs(113 lines) — Roslyn-based computation of source-text edits (CreateEdit,RejectOverlappingEdits,ApplyTextEdit,DecodeUtf8).ApplyEngine.Verification.cs(139 lines) — per-candidate test verification (VerifyCandidateAsync,CreateVerificationStartInfo, restricted env var list).ApplyEngine.FileIO.cs(87 lines) — safe snapshot/write/restore operations on the working tree (ReadBytes,WriteBytes,RestoreFiles,ResetDirectory,TryDeleteDirectory,RestoreUnexpectedSourceMutations).ApplyEngine.Results.cs(81 lines) — builds theApplyResult/ChangedFileResult/RevertedCandidateResultDTOs (CreateChangedFiles,CreatePrTitle,CreatePrBody,CreateRevertedCandidate,EmptyResult).
Improvements Made
- Reduced Complexity — each file now has a single, clearly named responsibility; every file is under 300 lines (down from one 768-line file).
- Enhanced Clarity — related logic (edit computation, verification, file I/O, result shaping, agent-selection parsing) is grouped together, making it easier to navigate and review in isolation.
- Applied Project Standards — matches the existing
partial classconvention already used forInventoryEnginein the same tool, preserves the required UTF-8 BOM on all.csfiles, and keeps the classinternal staticwith identical public/internal surface.
No Functional Changes
This is a pure code-movement refactor:
- Method bodies, signatures, and logic are unchanged.
- No public API surface changed (class remains
internal static, only split intopartialfiles). - All
usingdirectives were trimmed to only what each partial actually needs.
Testing
- ✅
dotnet build UnskipClosedTests.Tool.csprojsucceeds with 0 warnings/errors. - ✅ The tool's own test suite (
.github/workflows/unskip-closed-tests-tool/Tests) passes all 5 tests:rejects malformed issue reference suffixesremoves GitHub credentials from verificationrecords exact final content hasheskeeps duplicate detection marker in titlesverifies every target-specific TRX
- No functional changes — behavior is identical to before the split.
Review Focus
Please verify:
- Each partial file groups the intended responsibility.
- No behavior or public surface changed.
- File sizes and naming align with the original split proposal in the tracked issue.
Warning
Protected Files — Push Permission Denied
This was originally intended as a pull request, but the change modifies protected files. A human must create the pull request manually.
- .github/workflows/unskip-closed-tests-tool/ApplyEngine.Edits.cs
- .github/workflows/unskip-closed-tests-tool/ApplyEngine.FileIO.cs
- .github/workflows/unskip-closed-tests-tool/ApplyEngine.Results.cs
- .github/workflows/unskip-closed-tests-tool/ApplyEngine.Verification.cs
- .github/workflows/unskip-closed-tests-tool/ApplyEngine.cs
The push was rejected because GitHub Actions does not have
workflowspermission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.
Create the pull request manually
# Download the artifact from the workflow run
gh run download '37130091279' -n agent -D '/tmp/agent-37130091279'
# Resolve the bundle source ref, fetch it into a temporary ref, then create the local branch
bundle_path='/tmp/agent-37130091279/aw-code-simplifier-split-applyengine.bundle'
temp_ref='refs/bundles/create-pr-code-simplifier-split-applyengine-69b2587cda46228e-f2c08f28'
target_ref='refs/heads/code-simplifier/split-applyengine-69b2587cda46228e'
bundle_source_ref=$(git bundle list-heads "$bundle_path" | awk '$2 ~ /^refs\/heads\// { print $2 }')
if [ -z "$bundle_source_ref" ]; then
bundle_source_ref=$(git bundle list-heads "$bundle_path" | awk '$2 == "HEAD" { print $2 }')
fi
if [ "$(printf '%s\n' "$bundle_source_ref" | sed '/^$/d' | wc -l | tr -d ' ')" != "1" ]; then
echo "Expected exactly one bundle source ref, found: $bundle_source_ref" >&2
exit 1
fi
git fetch "$bundle_path" "${bundle_source_ref}:${temp_ref}"
git update-ref "$target_ref" "$temp_ref"
git checkout 'code-simplifier/split-applyengine-69b2587cda46228e'
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d "$temp_ref"
# Push the branch and create the pull request
git push origin code-simplifier/split-applyengine-69b2587cda46228e
gh pr create --title '[code-simplifier] Split ApplyEngine.cs into focused modules' --base main --head code-simplifier/split-applyengine-69b2587cda46228e --repo microsoft/testfxWarning
Firewall blocked 9 domains
The following domains were blocked by the firewall during workflow execution:
96bvsblobprodcus338.vsblob.vsassets.ioapi.github.life-white.ukdc.services.visualstudio.comgithub.life-white.ukkgfvsblobprodcus314.vsblob.vsassets.iol49vsblobprodcus358.vsblob.vsassets.iom6xvsblobprodcus342.vsblob.vsassets.iopkgs.dev.azure.comyluvsblobprodcus367.vsblob.vsassets.io
[!TIP]
api.github.com is blocked because GitHub API access uses the built-in GitHub tools by default. Instead of adding api.github.com to network.allowed, use tools.github.mode: gh-proxy for direct pre-authenticated GitHub CLI access without requiring network access to api.github.com:
tools:
github:
mode: gh-proxySee GitHub Tools for more information on gh-proxy mode.
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
network:
allowed:
- defaults
- "96bvsblobprodcus338.vsblob.vsassets.io"
- "api.github.com"
- "dc.services.visualstudio.com"
- "github.com"
- "kgfvsblobprodcus314.vsblob.vsassets.io"
- "l49vsblobprodcus358.vsblob.vsassets.io"
- "m6xvsblobprodcus342.vsblob.vsassets.io"
- "pkgs.dev.azure.com"
- "yluvsblobprodcus367.vsblob.vsassets.io"See Network Configuration for more information.
🤖 Automated content by GitHub Copilot. Generated by the Code Simplifier workflow. · copilot · auto · 281.4 AIC · ⌖ 19.6 AIC · ⊞ 14.5K · [◷]( · ◷)
Add this agentic workflow to your repo
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/code-simplifier.md@main
- expires on Oct 4, 2026, 2:51 PM UTC
Activity
github-actions commentedon Oct 4, 2026
This issue was automatically closed because it expired on 2026-10-04T14:51:14.923Z.