Repository navigation
Restore isolated Vally evaluation workspace - #38789
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38789Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38789" |
|
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. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Protected control paths remain writable, and tests do not enforce the intended permission boundary.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Restores an isolated temporary workspace for Vally evaluations while preserving Git state and routing evaluation workflows through the copied workspace.
Changes:
- Sanitizes copied Git configuration and protects runtime policy files.
- Routes validation and soak evaluations through the isolated workspace.
- Expands runtime isolation and workflow-ordering tests.
| File | Findings |
|---|---|
.github/workflows/skill-validation.yml |
Routes validation workflows through the isolated workspace. |
.github/workflows/skill-evaluation-soak.yml |
Routes soak evaluation through the isolated workspace. |
.github/scripts/TestSkillWorkflowModes.rb |
Verifies workspace routing and workflow ordering. |
.github/scripts/TestPrepareVallyEvaluation.rb |
Moderate finding (1 vote): permission-boundary assertions were weakened and should verify writable versus protected paths. |
.github/scripts/SetupVallyRuntime.sh |
Critical finding (3 votes): copied checkout control paths remain writable, allowing protected configuration or hooks to be modified. |
Skill Validation Results
|
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Note 🔍
|
|
Azure Pipelines: 3 pipeline(s) were filtered out due to trigger conditions. |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 2 findings
See inline comments for details.
| exit 1 | ||
| fi | ||
| sudo -n chown -R "$workspace_owner:$eval_user" "$workspace_root" | ||
| sudo -n chmod -R g+rwX,o-rwx "$workspace_root" |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
❌ Error — chmod -R g+rwX on the copied evaluator workspace grants the evaluator identity write/rename/delete capability across repository-control paths (for example .mcp.json, .github/hooks/*, .github/copilot/settings*.json, .claude/settings*.json) via writable parent directories. Concrete failure: after pre-run validation, the evaluator can replace those files before/during execution, so immutability of trusted repository-control inputs is no longer enforced.
| assert_includes content, 'sudo -n setfacl -m "u:$eval_user:r-x" "$GITHUB_WORKSPACE"' | ||
| assert_includes content, 'sudo -n -u "$eval_user" /usr/bin/test -r "$GITHUB_WORKSPACE/.git/HEAD"' | ||
| assert_includes content, 'sudo -n -u "$eval_user" /usr/bin/test -w "$protected_path"' | ||
| refute_match(/setfacl .*"\$GITHUB_WORKSPACE"/, content) |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
workspace_root (replace/remove/rename attempts as eval_user). This leaves the new broad workspace write model unguarded by regression tests.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
An unresolved critical packed-refs permission issue may break Git operations, and runtime protection lacks a required executable Linux/ACL gate.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
Resolved since last review (1)
| if [ -e "$git_dir/packed-refs" ]; then | ||
| sudo -n chown "$eval_user:$eval_user" "$git_dir/packed-refs" | ||
| sudo -n chmod 660 "$git_dir/packed-refs" | ||
| fi |
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: 3 pipeline(s) were filtered out due to trigger conditions. |
|
Note 🔍
|
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@PureWeen — new AI review results are available based on commit
07f3da3.
🗂️ 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
PR #38789 Pre-Flight
Context
- Title: Restore isolated Vally evaluation workspace
- PR:
dotnet/maui#38789 - Base / head:
main/pureween-restore-vally-runtime - Reviewed PR SHA:
07f3da32377d832686063c1ea19f2be01ca76394, materialized locally as squashed commite85acde1937bd0ab81d34e6556c74fc8ddd89b30 - Requested platform: Android. The changed implementation is Linux/GitHub Actions infrastructure and has no Android-specific execution path.
- Gate: Already skipped because no tests were detected. The gate was not rerun and
gate/content.mdwas not created or changed.
The existing evaluator runs against the Actions checkout with narrow ACL-based access. The PR replaces that arrangement with a private copy of the prepared checkout under RUNNER_TEMP, preserving prepared working-tree content and the complete Git object database while permitting repeated detached-worktree operations. It sanitizes the copied Git configuration, reconstructs a trusted upstream remote, protects repository-control and Copilot policy paths, provisions the required mutable runtime state, and routes model selection, baseline evaluation, revalidation, live evaluation, hermeticity evaluation, and soak evaluation through the copied workspace.
Direct Diff Inspection
git diff origin/main HEAD changes six files:
| File | Directly observed change |
|---|---|
.github/scripts/PrepareVallyEvaluation.rb |
Rejects symlinks in candidate/fixture Git trees and nested evaluator skill content before copied-workspace use. |
.github/scripts/SetupVallyRuntime.sh |
Creates a private evaluator workspace, copies the prepared checkout, sanitizes and protects copied Git state, provisions Copilot runtime state, checks immutability and Git/worktree behavior, and emits workspace_root. |
.github/scripts/TestPrepareVallyEvaluation.rb |
Adds focused coverage for symlink rejection, copied-workspace permissions, protected controls, Git configuration/worktree behavior, runtime-state lifecycle, and wrapper routing. |
.github/scripts/TestSkillWorkflowModes.rb |
Adds workflow-ordering and evaluator-workspace routing assertions. |
.github/workflows/skill-validation.yml |
Routes validation/evaluation phases through EVALUATOR_WORKSPACE and supplies a trusted upstream URL to runtime setup. |
.github/workflows/skill-evaluation-soak.yml |
Routes soak evaluation through the emitted isolated workspace. |
The submitted mechanism is a whole-checkout archival copy followed by permission repair and Git/configuration sanitization. An alternative must still preserve prepared uncommitted content, all required Git objects (including fixture commits), repeated detached-worktree operations, immutable trusted controls, writable evaluator runtime state, safe symlink/path handling, a trusted baseline-fetch path, and unchanged source-checkout metadata.
The inherited worktree already contains reverse/baseline-like tracked edits in:
.github/scripts/PrepareVallyEvaluation.rb.github/scripts/SetupVallyRuntime.sh.github/scripts/TestPrepareVallyEvaluation.rb.github/scripts/TestSkillWorkflowModes.rb
No .github/.baseline-state.json existed during pre-flight. Each try-fix attempt must therefore let EstablishBrokenBaseline.ps1 decide whether a safe modification allow-list can be created; it must not manually restore, reset, stash, or clean these inherited edits.
Test Boundary
The gate supplied no detected primary test and the request supplied no separate mandatory regression list. The PR's own focused CI coverage is the only permitted verification command:
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.jsonDo not run the gate, the full repository suite, all mandatory Vally-spec validation, actionlint, shellcheck, or the container/runtime self-check in STEP 5a. Each candidate gets one implementation/test pass and at most one focused correction/retest.
🔬 Code Review — Deep Analysis
Code Review — PR #38789
Independent Assessment
What this changes: The submitted diff replaces direct evaluator access to the prepared Actions checkout with a private copy under RUNNER_TEMP. It preserves the prepared working tree and Git object database, rejects symlink-bearing evaluator inputs, rebuilds the copied repository configuration from a narrow allowlist, makes only the Git state needed for detached worktrees mutable, protects repository controls and Copilot policy files, and routes model probes and Vally execution through the copied workspace.
Inferred motivation: The previous read-only access model did not give repeated detached Vally worktrees a complete, independently mutable Git repository while also isolating the original checkout. The change creates that functional boundary without changing evaluator selection or policy.
Approach assessment: The abstraction is sound. Copying the already-prepared checkout is necessary because a fresh clone would lose patched specifications and synthetic/dangling fixture commits. The setup validates both sides of the boundary: the isolated user can perform the required Git operations, but cannot alter the copied worktree, Git configuration, repository controls, installed plugins, or Copilot policy.
Reconciliation with PR Narrative
Author claims: The PR says it restores an isolated Vally workspace, preserves the complete prepared repository, sanitizes Git configuration, permits runtime-state lifecycle operations, and routes evaluation stages through the copy.
Agreement/disagreement: The committed diff supports those claims. The workflows consume workspace_root; the runtime wrapper changes both GITHUB_WORKSPACE and the process working directory; the copied Git configuration is reconstructed and protected; and focused tests cover workspace routing, repeated worktrees, repository-control immutability, and recreated state files. No Vally version, model, or selection-policy change appears in the submitted diff.
Prior Review Reconciliation
No prior ❌ Error finding was available in the supplied review context, and the single expert-review pass produced no inline findings.
Blast Radius Assessment
- Runs for all instances: yes — every GitHub Actions Vally runtime setup now copies and hardens the prepared checkout.
- Startup impact: yes — setup must complete before token selection and evaluation.
- Static/shared state: no application static state; the change does create job-scoped users, directories, Git metadata, and protected runtime state under
RUNNER_TEMP.
CI Status
- Required-check result: Gate skipped (
no tests detected in this PR), as supplied by the trusted pipeline. - Classification: undetermined. The submitted diff does add focused Ruby/workflow coverage, but the trusted Gate did not execute it in this review.
- Action taken: no Gate rerun, per the execution contract; confidence is capped at low.
Findings
No actionable code findings. The required inline-findings.json contains an empty JSON array.
Failure-Mode Probing
- Prepared but unreferenced fixture objects:
cp -a "$GITHUB_WORKSPACE/."copies the complete object database instead of reconstructing it from advertised refs, so dangling fixture commits remain available. - Candidate symlink escape: the preparer rejects symlinks in candidate and fixture Git trees, and runtime setup independently rejects non-Git symlinks in the copied worktree before granting evaluator access.
- Repeated detach/remove cycles: the evaluator receives write access to
objects,worktrees,refs, andlogs; setup executes two complete detached-worktree cycles plus ref packing before exposing the runner. - Configuration replacement: the copied
.gitroot and Copilot-home root use sticky directories, while configuration and policy entries are root-owned and read-only; explicit overwrite, rename, remove, and replacement probes fail closed. - Missing trusted upstream: only the baseline-capable validation job supplies the allowlisted upstream URL. Other jobs retain no checkout remote, and setup asserts that condition.
- Original checkout mutation: copying and hardening occur under
RUNNER_TEMP, and setup compares the original workspace and.gitownership/mode before completing.
External Output Contract
| Consumer token/pattern | Producer location | Producer emission condition | Consumer assumption | Ordinary negative case | Downstream effect |
|---|---|---|---|---|---|
ls-tree mode 120000 |
Git ls-tree -r output consumed by PrepareVallyEvaluation.rb |
Git emits mode 120000 for a symbolic-link tree entry |
Any committed symlink is unsafe for the copied evaluator workspace | A regular file/tree entry uses a non-120000 mode and is not rejected |
A matching candidate or fixture ref fails validation before runtime setup |
Verdict: NEEDS_DISCUSSION
Confidence: low
Summary: The code review and the one expert pass found no concrete defect, and the focused coverage is aligned with the security and Git-lifecycle risks introduced by the change. The trusted Gate was skipped, however, so this review cannot produce an approval-grade verdict under the required evidence rules.
🛠️ Try-Fix — Analysis & Comparison
STEP 5a Final Aggregate — PR #38789
Exactly two alternative candidates were allocated. Both were blocked by the
mandatory baseline boundary before production edits or focused testing.
Candidate 1 — Git Object/Index Materialization
Approach
Candidate 1 proposed replacing whole-checkout archival copying with a Git
object/index-driven materialization model: a private object mirror plus
detached worktrees/checkout-index policy. Evaluator workspaces would be
produced from trusted Git data rather than by duplicating and sanitizing a full
filesystem tree.
Comparison and mechanism-level difference
PR #38789 copies the prepared checkout into private temporary storage,
sanitizes copied .git/config, reconstructs a trusted upstream, repairs and
protects paths, and routes evaluation through the copy. Candidate 1 instead
would derive state from validated Git objects/index and detached worktrees.
The causal shift was from “duplicate the filesystem, then repair its trust
boundary” to “materialize directly from the trusted Git graph under a strict
checkout policy.”
Recorded result
- Result: Blocked
- Baseline:
pwsh .github/scripts/EstablishBrokenBaseline.ps1failed with
DIRTY WORKING DIRECTORY - Cannot establish baseline. - Inherited tracked edits listed:
.github/scripts/PrepareVallyEvaluation.rb,
.github/scripts/SetupVallyRuntime.sh,
.github/scripts/TestPrepareVallyEvaluation.rb, and
.github/scripts/TestSkillWorkflowModes.rb. - Allow-list:
.github/.baseline-state.jsonwas not created; there was no
RevertedFilesallow-list. - Files changed: None (zero attempt-owned tracked-file edits).
- Captured diff: Explicitly empty (
attempt-1/fix.diff). - Test: The required focused command was not run because the attempt was
blocked before editing/testing. - Self-review: 0 findings;
reviewer-findings.jsonwas[]. - Failure analysis: Editing without a baseline allow-list would have
violated the baseline boundary and made safe restoration impossible. - Artifact path:
CustomAgentLogsTmp/PRState/38789/PRAgent/try-fix/attempt-1
Restore proof
Candidate 1 executed exactly:
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore
It reported No baseline state found. Nothing to restore.,
Message: No baseline state found, and Restored: False, consistent with its
verified no-state/no-edit path.
Candidate 2 — Mount-Namespace OverlayFS View
Approach
Candidate 2 proposed mounting the prepared checkout read-only as an OverlayFS
lower layer with root-owned upper/work/merged paths under RUNNER_TEMP.
Trusted preparation and base fetches would write only into the upper layer. A
bubblewrap Vally runner would expose the merged view at /workspace, omit
the original checkout and backing layers from namespace reachability, and
nest read-only binds over repository controls and
.git/{HEAD,config,objects,refs}. Writable paths would be limited to
.git/worktrees, detached worktree destinations, results, and explicit
Copilot runtime state.
The design also called for a sanitized upper-layer Git config and trusted
HTTPS upstream, trusted host-side base fetches, persistent worktree metadata,
canonical component-wise mount-path validation, existing candidate/fixture
symlink rejection, root-owned Copilot policy, and an always() unmount/source
metadata verification step.
Comparison to the PR
The PR uses eager whole-tree duplication followed by sanitization and
permission repair. Candidate 2 uses direct read-only lower-layer
reachability, lazy kernel copy-up, and namespace topology. Prepared
uncommitted content and complete Git objects are visible without archival
copying; writes are redirected into the upper layer; and source/layer paths
are unavailable to the evaluator rather than merely protected after copying.
Explicit comparison to Candidate 1
Candidate 1 would reconstruct evaluator trees from the Git object graph and
index. Candidate 2 would not ask Git to rematerialize anything: the exact
prepared filesystem—including uncommitted or untracked prepared content—is
the OverlayFS lower layer. Thus completeness comes from direct filesystem
reachability, not a Git/index reconstruction or a separate content-capture
fallback.
Recorded result
- Result: Blocked
- Baseline: The exact baseline command exited 1 with
DIRTY WORKING DIRECTORY - Cannot establish baselineand listed the same
four inherited tracked edits. - Allow-list:
.github/.baseline-state.jsonwas not created; there was no
RevertedFilesallow-list. - Files changed: No tracked production files.
- Captured diff: Explicitly empty (
attempt-2/fix.diff). - Test: The permitted focused command was not run because no implementation
could legally be applied.attempt-2/test-output.logrecords this; no other
tests or checks ran. - Self-review: 0 findings;
reviewer-findings.jsonis[]. - Failure analysis: The baseline boundary prevented empirical evaluation;
this is not evidence that the mount/COW design passed or failed. - Artifact path:
CustomAgentLogsTmp/PRState/38789/PRAgent/try-fix/attempt-2
Restore proof
Candidate 2 executed exactly:
pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore
It exited 0 and reported:
No baseline state found. Nothing to restore.
Message No baseline state found
Restored False
This is the expected no-state result because baseline establishment created no
state and Candidate 2 made no tracked-file edits.
Honest aggregate outcome
- Candidates attempted: 2 of 2
- Passed exact focused tests: 0
- Failed exact focused tests: 0
- Blocked before implementation/testing: 2
- Production diffs: both empty
- Aggregate verdict: Blocked
Neither candidate can be reported as passing. Candidate 1 and Candidate 2 are
mechanism-level alternatives to the PR and to each other, but the inherited
tracked edits prevented creation of the mandatory safe modification allow-list
for both. STEP 5a's second and final candidate is complete; no additional
candidate or test run was performed.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winner: pr
The raw submitted PR is the only complete implementation and is the strongest candidate on the available evidence. The single expert-review pass found no actionable defect, inline-findings.json is empty, and the code directly addresses the required isolation while retaining prepared working-tree content, the full Git object database, repeated worktree operations, trusted configuration, and controlled runtime state.
Approval is not permitted by the supplied Gate: it was skipped with no tests detected in this PR. That leaves required-check coverage undetermined even though the PR adds focused Ruby/workflow tests and its description reports successful local validation. The author should make the focused regression coverage visible to a trusted required check (or otherwise obtain equivalent trusted validation evidence); adding redundant tests is not necessary if the existing tests can be detected and executed.
Candidate Comparison
| Rank | Candidate | Implementation | Expert review | Targeted/regression evidence | Comparative result |
|---|---|---|---|---|---|
| 1 | pr |
Complete submitted fix across runtime setup, validation, workflows, and focused tests | No actionable findings | Author-reported focused validation; trusted Gate skipped, so independently undetermined | Winner — complete and technically sound on review, but not approval-eligible without trusted test evidence |
| 2 | pr-plus-reviewer |
Logically identical to pr; reviewer delta is empty |
No actionable feedback to apply | No validation command run because no reviewer change existed | Tie on code, ranked below pr because it adds no improvement or evidence |
| 3 | try-fix-1 |
Proposed Git object/index materialization only; no production diff | Self-review recorded no findings, but there was no code to review | Blocked before tests by baseline establishment | Not a viable candidate |
| 4 | try-fix-2 |
Proposed OverlayFS/bubblewrap copy-on-write workspace only; no production diff | Self-review recorded no findings, but there was no code to review | Blocked before tests by baseline establishment | Not a viable candidate |
No candidate failed a regression test. The two try-fix candidates were blocked before implementation and testing, so they receive no passing credit and cannot outrank either implemented PR candidate. pr-plus-reviewer also receives no additional passing credit because its reviewer patch is empty.
Expert Evaluation
- Behavior: Copies the prepared checkout under
RUNNER_TEMP, rejects unsafe symlink-bearing inputs, sanitizes the copied Git configuration, permits only required Git/runtime mutation, and routes Vally/model/baseline/revalidation/soak execution through the isolated copy. - Security boundary: Repository controls, Copilot settings, installed plugins, and local Git configuration are protected with ownership, mode, sticky-directory, and active mutation probes.
- Functional boundary: Complete objects and prepared working-tree state survive the copy; repeated detached worktree and packed-ref operations are exercised during setup.
- Review result: No concrete correctness, security, portability, workflow-ordering, or regression-test defect was found on an added/modified line.
- Residual uncertainty: Infrastructure-wide blast radius plus a skipped trusted Gate caps confidence at low and prevents approval.
Why the Alternatives Lose
try-fix-1 and try-fix-2 are architectural sketches, not materialized fixes. Both stopped when EstablishBrokenBaseline.ps1 rejected inherited tracked edits, produced empty diffs, and ran no focused validation. Their designs also introduce materially different operational complexity (Git rematerialization or privileged mount lifecycle) without empirical evidence that they preserve every prepared artifact and security invariant better than the submitted copy-and-harden approach.
Required Follow-Up
Obtain trusted execution evidence for the existing focused Ruby/workflow regression tests, or update test detection so the Gate recognizes them. No code change is requested by the expert review itself.
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.

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!
Summary
RUNNER_TEMP, preserving the working tree and complete Git object databaseValidation
ruby .github/scripts/TestPrepareVallyEvaluation.rb ...— 86 tests, 541 assertionsruby .github/scripts/TestSkillWorkflowModes.rb ...— 17 tests, 181 assertionsactionlint -shellcheck= -pyflakes= .github/workflows/skill-validation.yml .github/workflows/skill-evaluation-soak.ymlshellcheck .github/scripts/SetupVallyRuntime.shCI note
The
pull_request_targetlive-evaluation jobs load the runtime setup script from the current default branch. Those jobs therefore continue to exercise the pre-change setup while this PR is open and cannot validate the candidate runtime script before merge. The candidate script is covered by the focused tests and Linux container self-check listed above.The two PowerShell test failures also reproduce on unrelated pull requests and are outside the files changed here.
Operational note
The existing
skill-evaluation-pat-poolenvironment and its configured token pool remain required; this change adds no new environment provisioning.