Skip to content

Fix fork skill validation with trusted checkouts and bounded Git data - #38745

Closed
morning4coffe-dev wants to merge 2 commits into
dotnet:mainfrom
morning4coffe-dev:fix/skill-validation-fork-data-20260921
Closed

morning4coffe-dev wants to merge 2 commits into
dotnet:mainfrom
morning4coffe-dev:fix/skill-validation-fork-data-20260921

Conversation

@morning4coffe-dev

@morning4coffe-dev morning4coffe-dev commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Fix fork skill-validation content acquisition without opting into unsafe PR checkout.

The Static validation jobs for #38533 and #38534 fail before validation because actions/checkout@v4 refuses the fork checkout in pull_request_target. The aggregate Skill Validation check reports that same failure; no Vally lint or UI test failed in those jobs.

This independent change starts from canonical main at f8a2f062a8e1b4686a5a3de93bb69cabc02c8c4a. It adapts the bounded Git-data design from local commit 304700740f, not that commit's old workflow/preparer/reporting implementation. It contains no UI-evidence or performance-analyzer implementation.

Security rationale

  • Every checkout uses the base repository at github.workflow_sha, with credentials not persisted. No allow-unsafe-pr-checkout, PR ref checkout, archive extraction, or candidate script execution is introduced.
  • A trusted helper reads the gated repository and exact head through GitHub commit/tree/blob endpoints. It rejects redirects, truncated responses, invalid object hashes, links/gitlinks, path traversal/aliases, and skill-local auto-loaded configuration. Acquisition is bounded to 1,024 files, 2 MiB/file, 32 MiB total, 4 MiB/response, 4,096 tree entries, and ten minutes.
  • Only candidate skill data is installed in the checkout; executable bits are removed. Agent/plugin metadata stays in a data-only Git snapshot. Trusted scripts, repository controls, and HEAD remain unchanged. A read-only token is scoped to acquisition, not model execution.
  • Candidate workflow-policy validation is preserved: the two workflow YAML files and rollback JSON are acquired as inert data into a fresh directory outside the trusted checkout. Trusted policy tests consume those candidate bytes. Missing candidate files do not fall back to trusted copies.
  • Discovery, baseline preparation and restoration use the exact candidate snapshot, not the now-trusted HEAD. Fixture fetching accepts only workflow-revision-approved pins and the trusted sanitized-fixture source revisions.

The current #38572 provider/executor restrictions, #38040 sanitized historical fixtures and runtime isolation, and #38573 static-only mode, default-branch manual-source gates, skill-evaluation-pat-pool, and reporting semantics are retained. The soak workflow, token selector and isolated runtime implementation are unchanged. No permission, secret, environment, model, or paid evaluation configuration is added.

Validation

On Windows with session-local Ruby 3.4.10 and actionlint 1.7.12:

  • Bounded acquisition: 26 tests / 352 assertions passed.
  • Workflow operating-mode policy: 19 tests / 233 assertions passed. Post-review checks parse the static job, bind acquisition and validator inputs to the same external policy directory, and verify the actual trusted validator invocation. Negative mutations reject checkout fallbacks, a mismatched acquisition directory, and replacement of validation with inert path substrings.
  • Preparer safety: 78 tests / 459 assertions passed with the nine environment-limited cases excluded explicitly; no committed tests were skipped or disabled.
  • The full preparer invocation ran 87 tests and encountered seven Windows symlink-creation permission errors and two Git Bash mocked-token-selector fixture failures. The symlink failure and both selector failures were reproduced using unchanged upstream test source. A Linux full-suite run remains required; this PR does not claim that the entire suite passed here.
  • All 17 existing Vally specs, across nine skills, passed trusted structural validation; all eight mandatory paths passed.
  • Actual sanitized/synthetic fixture preparation and model-list validation passed for code-review, try-fix, and verify-tests-fail-without-fix after fetching the exact trusted historical source commits. No model was invoked.
  • Final credential-gate ordering/comment-verdict tests: 3 tests / 38 assertions passed.
  • actionlint passed for both skill workflows; git diff --check passed.

The new tests cover candidate policy-byte isolation and missing-file behavior, immutable heads, object/size/path bounds, control-file rejection, snapshot restoration, approved fixture refs, and preservation of sanitized-history dispatch.

Rollout and limitations

This is a base-workflow prerequisite. A fork PR cannot repair its own pull_request_target workflow by carrying these changes. Maintainers must review and land the prerequisite, then obtain fresh runs using that workflow revision. Old-run reruns may retain old workflow code.

No workflows or model evaluations were manually dispatched, and no cloud settings were changed. Tokenless local tests do not prove a deployed credentialed Actions run.

Automatic PR checks also expose two unchanged canonical-main Pester failures: CopilotPipeline.Tests.ps1 and Review-PR.Tests.ps1 expect the local test reviewer to select gpt-5.6-sol, while Review-Tests.ps1 selects gpt-6-astra. The CI run reports 2,268 tests, 2,266 passed and those two failed. Both were reproduced locally; all three files are byte-identical to canonical main. This PR deliberately does not change model policy or weaken those tests. See Pester job. The automatic static job still uses the old base-side fork checkout and fails as expected before this prerequisite lands.

The automatic agent job also failed before agent execution: downloading Copilot CLI v1.0.85 SHA256SUMS.txt returned HTTP 504 on all retries, and the install step exited 22. It was not manually retriggered.

Issues Fixed

Addresses the shared checkout blocker observed in #38533 and #38534. Does not close either UI-evidence PR or claim to resolve their measurement review findings.

Preserve current workflow-policy, provider, static-only and sanitized-fixture controls while keeping all checkouts trusted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 14:51
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38745

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38745"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Skill Validation Results

@morning4coffe-dev — new skill validation results are available based on this last commit: d0c9ceb.
To request a fresh validation after new comments or commits, comment /evaluate-skills.

Overall Failed Static Failed LLM Skipped Skills 0 Agents 0

❌ Skill Validation Results — d0c9ceb · Fix fork skill validation with trusted checkouts and bounded Git data · 2026-09-21T15:42:23Z

❌ Static Checks Failed

Skills: 0 | Eval specs linted:

⏭️ LLM Evaluation: Skipped

💡 LLM evaluation was not run for this external PR.
A repository contributor can post /evaluate-skills on this PR to trigger full evaluation.

🔍 Full results and investigation steps

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@morning4coffe-dev! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @morning4coffe-dev! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@kubaflo

kubaflo commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

/azp run

@kubaflo

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
3 pipeline(s) were filtered out due to trigger conditions.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Note

🔍 /review started

AzDO build 15398322 is running for android.

The s/agent-review-in-progress label stays on this PR while the run is active. The final recommendation and outcome labels are posted only after Gate, expert review, and Deep UI tests finish.

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.

Copilot review overview

🔵 Needs a closer look

It changes credentialed workflow infrastructure and trusted fixture acquisition, requiring final human security review and live CI validation.

Review effort: Lite
Findings: None

What changed in this PR

Moves fork skill validation to trusted workflow checkouts with bounded Git-data acquisition, preserving candidate policy isolation and fixture safety.

Changes:

  • Adds hash-, path-, size-, and control-validation for candidate content.
  • Uses snapshot-based discovery, baseline, restoration, and trusted fixture refs.
  • Adds comprehensive acquisition and workflow-policy regression tests.
File Description
.github/​workflows/​skill-validation.yml Uses trusted checkouts and bounded candidate acquisition.
.github/​scripts/​AcquireSkillValidationContent.rb Implements secure Git-data acquisition and snapshots.
.github/​scripts/​PrepareVallyEvaluation.rb Restricts fixture refs to trusted sources.
.github/​scripts/​TestAcquireSkillValidationContent.rb Tests acquisition boundaries and isolation.
.github/​scripts/​TestPrepareVallyEvaluation.rb Tests fixture-ref and history behavior.
.github/​scripts/​TestSkillWorkflowModes.rb Verifies candidate policy validation wiring.
.github/​instructions/​ci-copilot-pipeline-security.instructions.md Documents fork-validation security requirements.

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) and removed s/agent-review-in-progress AI review is currently running for this PR labels Sep 21, 2026
Bind the acquisition directory, exact single-assignment candidate paths, trusted test runner invocation and step ordering; add negative mutation regressions for fallback paths and missing validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 21, 2026 15:41

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.

Copilot review overview

🔵 Needs a closer look

Candidate soak workflow validation is only regex-based and does not reject malformed YAML, allowing invalid workflows through the policy gate.

Review effort: Lite
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Candidate soak workflow is not parsed as YAML during validation

.github/​scripts/​TestSkillWorkflowModes.rb:102

The candidate skill-evaluation-soak.yml is passed through this suite, but the soak checks only use substring matching and job_block; unlike skill-validation.yml, it is never parsed as YAML. A malformed candidate soak workflow can therefore satisfy these assertions and be accepted, breaking the scheduled/manual soak workflow after merge. Add a trusted YAML-parse assertion (or run actionlint) for the candidate soak file before reporting validation success.

@kubaflo

This comment has been minimized.

@kubaflo

kubaflo commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
3 pipeline(s) were filtered out due to trigger conditions.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Note

🔍 /review started

AzDO build 15398967 is running for android.

The s/agent-review-in-progress label stays on this PR while the run is active. The final recommendation and outcome labels are posted only after Gate, expert review, and Deep UI tests finish.

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

@morning4coffe-dev — new AI review results are available based on commit d0c9ceb.

Gate No Tests Confidence Low Platform Github Actions


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ⚠️ SKIPPED

No tests were detected in this PR.

Recommendation: Add tests to verify the fix using the write-tests-agent.


📋 Pre-Flight — Context & Validation

Issue: No standalone issue; prerequisite for #38533 and #38534
PR: #38745 - Fix fork skill validation with trusted checkouts and bounded Git data
Platforms Affected: GitHub Actions / skill-validation infrastructure (platform-neutral; review requested with Android)
Files Changed: 3 implementation, 3 test, 1 instruction

Key Findings

  • Fork pull_request_target validation currently fails before static validation because actions/checkout refuses the fork checkout. The PR keeps the checkout on the trusted base revision and acquires candidate content as bounded, inert Git data.
  • The PR adds AcquireSkillValidationContent.rb, changes PrepareVallyEvaluation.rb to restrict fixture refs to trusted pins, and rewires skill-validation.yml so only candidate skill data is installed while candidate workflow-policy files remain outside the trusted checkout.
  • The security boundary requires exact head/object validation, bounded commit/tree/blob responses, rejection of unsafe paths and Git object modes, no candidate-script execution, no fallback to trusted policy bytes, and preservation of the existing provider/executor and token-isolation controls.
  • No inline review comments were present. The public discussion only contained review/build commands and automation status. The automatic static check still used the old base-side workflow and therefore could not validate this prerequisite.
  • Gate result supplied by the caller: SKIPPED because no tests were detected. It was not rerun and gate/content.md was not modified.
  • The targeted regression command must run only the acquisition, preparer, and workflow-mode Ruby suites required by the pipeline-security instructions; no full suite is requested.

Code Review Summary

Verdict: SKIPPED
Confidence: N/A
Errors: 0 | Warnings: 0 | Suggestions: 0

The dedicated expert review belongs to STEP 5b and was intentionally not launched during this context-only STEP 5a pre-flight.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #38745 Keep HEAD trusted; acquire the exact fork head as bounded Git commit/tree/blob data; install only inert candidate skill content; validate policy bytes from a separate temporary directory; restrict fixture refs to trusted workflow pins. ⚠️ SKIPPED (Gate found no tests) 7 files Original PR; author reports targeted Windows runs, but this phase does not treat that narrative as gate evidence.

Targeted Test Command

ruby .github/scripts/TestAcquireSkillValidationContent.rb && ruby .github/scripts/TestPrepareVallyEvaluation.rb .github/scripts/PrepareVallyEvaluation.rb .github/skills/try-fix/tests/eval.restore.vally.yaml .github/skills/verify-tests-fail-without-fix/tests/eval.protocol.vally.yaml .github/scripts/SetupVallyRuntime.sh .github/scripts/SelectVallyToken.sh .github/workflows/skill-validation.yml && ruby .github/scripts/TestSkillWorkflowModes.rb .github/workflows/skill-validation.yml .github/workflows/skill-evaluation-soak.yml .github/scripts/fixtures/skill-workflow-policy/rollback-drill.json

🔬 Code Review — Deep Analysis

Expert PR Evaluation

Verdict: NEEDS_DISCUSSION

Confidence: low

The submitted PR adds a bounded GitHub Git-data acquisition path and wires it into the trusted pull_request_target skill-validation workflow. The expert pass initially reported that .github/scripts/AcquireSkillValidationContent.rb:143 used a literal masked value for the authorization header.

Direct semantic inspection reconciled that report as an output-sanitization artifact: the committed source uses the GitHubData instance token with the Bearer scheme, does not contain a six-asterisk literal, and the focused request test expects the same authenticated header with its local token. The false positive was removed from inline-findings.json; there are no verified actionable inline findings.

The trusted Gate skipped because it detected no tests, so the review cannot recommend approval from Gate evidence alone. The focused Ruby validation is assessed separately for the materialized pr-plus-reviewer candidate.

Prior Review and CI Reconciliation

Anonymous retrieval found no prior error-severity top-level reviews or inline review comments. The only matching issue comment was the skill-validation bot's static-check failure on the external PR; pre-flight evidence and the PR description identify that as the old base-side workflow failing before Vally, which is the prerequisite this PR changes rather than an independent code-review finding.

gh pr checks --required could not run because the CLI is unauthenticated. Required-check state is therefore undetermined and confidence remains low.


🛠️ Try-Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 gpt-5.3-codex try-fix Policy-only candidate ingestion with hard failure for missing allowlisted workflow-policy files, while executable workflow/scripts remain trusted. ⚠️ BLOCKED 0 files Mandatory baseline setup refused the pre-existing reverse/materialized target-file diff. No implementation or tests ran; restore reported no baseline state.
2 gpt-5.6-sol try-fix Quarantined exact-SHA Git object ingestion without checkout, distinct from the PR's REST acquisition and Candidate 1's policy-only mechanism. ⚠️ BLOCKED 0 files Mandatory baseline setup refused the same pre-existing reverse/materialized target-file diff. No implementation or tests ran; restore reported no baseline state.
PR PR #38745 Keep HEAD trusted; acquire the exact fork head as bounded Git commit/tree/blob data; install only inert candidate skill content; validate policy bytes from a separate temporary directory; restrict fixture refs to trusted workflow pins. ⚠️ SKIPPED (Gate found no tests) 7 files Original PR; author-reported validation is not gate evidence.

Candidate 1 Details

Model: gpt-5.3-codex
Result: Blocked
Approach: Enforce policy-only candidate ingestion and fail closed when any allowlisted candidate policy file is absent.
Diff: Empty.
Test Results: Not run. The try-fix skill's mandatory baseline step failed before edits because the target files already had a reverse/materialized working-tree diff.
Failure Analysis: The baseline script refused D .github/scripts/AcquireSkillValidationContent.rb, M .github/scripts/PrepareVallyEvaluation.rb, D .github/scripts/TestAcquireSkillValidationContent.rb, M .github/scripts/TestPrepareVallyEvaluation.rb, and M .github/scripts/TestSkillWorkflowModes.rb as pre-existing changes. Manual restoration is prohibited. The required script-only restore ran and reported No baseline state found.
Self-Review: 0 findings; there was no candidate diff.

Candidate 2 Details

Model: gpt-5.6-sol
Result: Blocked
Approach: Ingest exact-SHA Git objects into a quarantined data area without checkout, rather than using the PR's GitHub REST acquisition helper or Candidate 1's policy-only ingestion boundary.
Prior Approaches Avoided: The PR's bounded REST commit/tree/blob retrieval and Candidate 1's policy-only candidate ingestion were not repeated.
Diff: Empty.
Test Results: Not run. The try-fix skill's mandatory baseline step failed before edits because the target files still had the caller-provided reverse/materialized working-tree diff.
Failure Analysis: With no generated baseline state, the skill's edit allow-list did not exist. Bypassing that boundary or manually cleaning the caller's changes was prohibited. The required script-only restore ran and reported No baseline state found / Restored False.
Self-Review: 0 findings; there was no candidate diff.

Cross-Pollination

Skipped by STEP 5a contract.

Exhausted: Yes - both permitted model invocations completed; no additional agents or retries were launched.
Selected Fix: PR #38745 provisionally - neither alternative reached implementation or testing, so there is no passing candidate that can supersede the PR. The supplied gate also skipped testing, so this is not a validation claim.


🏁 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Winner: pr

The raw submitted PR is the best available candidate because it is the only implemented fix, the expert pass produced no verified actionable finding, and pr-plus-reviewer proved byte-equivalent after the reviewer's apparent authorization issue was identified as secret-output masking. This is not an approval recommendation: the trusted Gate skipped test verification, and the one permitted targeted Linux validation stopped with two Ruby 3.0 compatibility errors before all three required suites could run.

Comparative ranking

Rank Candidate Implementation Validation Assessment
1 pr Complete bounded Git commit/tree/blob acquisition, inert candidate-skill installation, external policy-data staging, and trusted fixture-pin enforcement Gate ⚠️ SKIPPED; author-reported Windows results are not trusted Gate evidence Winner. No verified expert-review defect and no alternative implemented a superior fix, but approval remains blocked by missing trusted validation.
2 pr-plus-reviewer Byte-equivalent to pr; no reviewer change was warranted after reconciling output masking ❌ Targeted chain stopped at 26 runs / 249 assertions / 2 errors under Ruby 3.0; later suites did not run Adds no improvement over pr and did not produce a passing regression result.
3 try-fix-1 No diff; proposed policy-only candidate ingestion ⚠️ BLOCKED before tests by the STEP 5a baseline guard Cannot supersede an implemented candidate.
4 try-fix-2 No diff; proposed quarantined exact-SHA Git-object ingestion ⚠️ BLOCKED before tests by the STEP 5a baseline guard Cannot supersede an implemented candidate.

No candidate produced a passing trusted regression run. Candidates with failed or blocked validation are therefore not elevated over the submitted implementation.

Expert review reconciliation

The single expert pass initially interpreted the displayed authorization value as a hardcoded literal. A direct semantic check showed the committed line uses the instance token and Bearer scheme and that the request test expects the matching local-token header; the six asterisks were output sanitization. The invalid finding was removed, leaving inline-findings.json as an empty JSON array. No second audit or per-candidate review was run.

Anonymous review-surface reconciliation found no prior error-severity review bodies or inline findings. The public skill-validation bot reports a static failure on the external PR, but the pre-flight evidence and submitted description identify it as the old base-side checkout failure that this prerequisite PR is designed to fix. Required-check state could not be independently enumerated because gh is unauthenticated, so CI coverage remains undetermined.

Required follow-up

Run the acquisition, preparer, and workflow-mode Ruby suites in the supported Linux CI Ruby environment and obtain a complete pass. The submitted implementation remains the recommended design, but the skipped Gate and incomplete targeted run do not permit approval under the review contract.


🧭 Next Steps — review latest findings

No alternative fix was selected for this run. Review the session findings and CI results before merging.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Sep 21, 2026
@kubaflo kubaflo closed this Sep 30, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community ✨ Community Contribution s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants