Skip to content

fix(xtask): stop overriding the provided HostPlatform - #2205

Merged
eric8810 merged 1 commit into
mainfrom
dim/1295-fix-xtask-platform-fixture
Nov 26, 2026
Merged

eric8810 merged 1 commit into
mainfrom
dim/1295-fix-xtask-platform-fixture

Conversation

@eric8810

Copy link
Copy Markdown
Collaborator

Refs #1295 · Follow-up to #2002

Why

main is red after #2002: verify (macos) fails in three xtask scenario tests with

HostPlatform is already provided by HostPlatform.

The served App Server already provides HostPlatform. The scenario fixture also injected a second HostPlatform with builder.process_value(...), which was valid before #2002 made HostPlatform a provided data service.

Change

  • The xtask served profile points ServerConfig::platform_home at its isolated home, so every served run keeps the isolated platform home.
  • The scenario fixture no longer constructs or injects a second HostPlatform.

Verification

  • cargo test -p xtask --features eval-tests scenario_eval::tests::a_rejudge_judges_the_selected_saved_runs_from_their_views
  • cargo test -p xtask --features eval-tests scenario_eval::tests::a_pool_refuses_runs_that_recorded_different_texts
  • cargo test -p xtask --features eval-tests scenario_eval::tests::a_pool_reports_several_finished_evaluations_under_one_rule
  • cargo clippy -p xtask --all-targets --features eval-tests -- -D warnings
  • cargo fmt --all -- --check

The served profile now points HostPlatform at its isolated home instead of injecting a second process value, so scenario assemblies no longer fail with a duplicate provider.
@eric8810
eric8810 requested a review from yyhhyyyyyy November 25, 2026 23:12

@yyhhyyyyyy yyhhyyyyyy 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.

Review: #2205 fix(xtask): stop overriding the provided HostPlatform

Reviewed head 8661e3a, round 1, against base ade8597 (origin/main). Scope: restore the rejudge and pool scenario tests that #2002 broke while keeping their runs on an isolated platform home.

What changed

xtask/src/app_server.rs:224 sets ServerConfig::platform_home to the served home. xtask/src/scenario_eval.rs removes the fixture's own HostPlatform and the process_value injection it passed to the rejudge and pool servers.

Before and after

#2002 marked HostPlatform as a rutis service (crates/dim-agent-capabilities/src/host_platform.rs:732), while the App Server already provides it (crates/dim-app-server/src/lib.rs:1160-1171). The fixture's second provider made the in-process rejudge and pool servers fail at assembly with "HostPlatform is already provided by HostPlatform" (main push run 45711912303, the three tests named in the PR description). The injected value was not ignored; there was no server to use it. After the change the App Server's platform is the only one, and HostPlatformPlugin copies config.home onto it (host_platform.rs:2433-2435), so <home>, the user AGENTS.md read and the user skills root resolve inside the served home (prompt_sources.rs:265, prompt_sources.rs:512, skills/catalog.rs:789).

Isolation is preserved on every path. Rejudge and pool go through served (scenario_eval.rs:933, 963, 984-998); evaluate goes through each child's serve_home (scenario_eval.rs:3415, 3569). Every scenario run's served home is a fresh directory under --out (scenario_eval.rs:985-987) or the output root's homes (scenario_eval.rs:4585-4593), and the evaluate child's HOME stays the run root's env/home (scenario_eval.rs:4569), so no path reaches the developer's home. For evaluate children the platform home moves from the disposable HOME to the run's Dim home; both are fresh and empty, so the isolation contract and the preflight home check (scenario_eval.rs:4403-4416) are unchanged.

Ordering

platform_home is set before product_session_defaults and the run.defaults block. The first only fills session_defaults; the second only plugin settings and the defaults path (app_server.rs:225-251), so neither can overwrite it. serve_home is xtask-only and the daemon path never sets platform_home (ServerConfig default at crates/dim-app-server/src/lib.rs:148), so real users are unchanged. serve_product shares the function, so catalog, graph and summary-eval profiles now also report their isolated home as the platform home instead of the process home; I found no assertion that depends on the old value.

P3 (optional): no test pins the new wiring

The three tests fail without the fixture removal, but they would still pass if line 224 were dropped because none observes the platform home. A future edit could silently send rejudge and pool back to the developer's ~/AGENTS.md and user skills, which is the risk the removed fixture comment described. A small flow assertion can serve a fixture home and compare the platform home the server reports (for example through RunningServer::service::<HostPlatform>()). Optional.

Main and cross-PR

The base is origin/main. git diff --check and the merge tree against main are clean. Pairwise merge trees with #1881 ff9825d, #2178 b1387a0, #2197 42b2599, #2174 4b22d77 and #2202 d43ba13 are clean; their hunks do not overlap this diff (#2202 changes scenario_eval.rs in another test module).

Merging this does not make main green, but that is outside this diff. The #2002 merge also left host_platform_flow::the_host_platform_service_removes_output_and_composes_a_path and host_platform_flow::output_removal_refuses_traversal_and_links failing on macOS with Invalid("outside the exec root") (crates/dim-agent-capabilities/tests/host_platform_flow.rs:1696, 1877); main was green at 3adc6a0 and red at ade8597. Those files are untouched here; a follow-up is needed for a green verify (macos).

Verification

Full main...head diff reviewed. cargo fmt --all -- --check passes locally. CI at 8661e3a: verify (linux) and macos-native pass; ci-ok was still queued when read; the path-filtered jobs are skipped. The PR is open, not draft, head unchanged.

Unverified

  • The three targeted tests at this head; the author reports them passing on macOS.
  • Whether the two macOS-only host_platform_flow failures are deterministic.

Verdict: APPROVE

@zerob13 zerob13 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.

The scenario fixture no longer installs a second HostPlatform. The shared served profile passes its isolated home to the standard provider, preserving the boundary for user instructions and skills. All three previously failing scenario tests passed by name in exact-head Linux CI, with xtask/eval-tests enabled, and ci-ok passed.

This approves the fixture fix only. The PR's macOS native job did not run those three xtask tests, and the two separate legitimate-output-path failures in the main macOS job are outside this change. The main workspace gate still needs to be verified after the fixes.

@eric8810
eric8810 merged commit 9b5420d into main Nov 26, 2026
@eric8810
eric8810 deleted the dim/1295-fix-xtask-platform-fixture branch November 26, 2026 00:25
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.

3 participants