Skip to content

aprender-orchestrate: test_resolve_project_root_nonexistent_falls_back is host-dependent (stray /tmp/Cargo.toml) #4191

Closed

Description

@noahgift

aprender-orchestrate cli::falsify::tests::test_resolve_project_root_nonexistent_falls_back depends on the host.

The test creates std::env::temp_dir()/batuta_test_no_project_root and asserts that resolve_project_root returns that dir. The function walks up looking for Cargo.toml / .git / pyproject.toml. On lambda, a stray /tmp/Cargo.toml exists, so the walk stops at /tmp:

assertion `left == right` failed
  left: "/tmp"
 right: "/tmp/batuta_test_no_project_root"

Measured 2026-09-24 in the #4175 packaged-tarball RED run (v0.69.1).

Fix. The test must build its own root with no marker above it, which a tempdir under the system temp dir cannot guarantee. Options:

  • make the walk's ceiling injectable, e.g. stop at a given dir, and test with the ceiling set to the tempdir's parent;
  • or assert only that the result is not inside the tempdir's subtree when a marker exists above.

Do NOT delete or depend on /tmp/Cargo.toml. It is not ours, and a test must not rely on the host being clean.

Found by #4175 step (c).

Activity

  1. added this to the 0.70.0 milestone on Sep 24, 2026
  2. added 3 commits that reference this issue on Sep 24, 2026
  3. modified the milestones: 0.70.0, 0.70.1 on Sep 24, 2026
  4. noahgift commented on Sep 24, 2026

    @noahgift
    MemberAuthor

    Milestone 0.70.0 → 0.70.1 (gate triage). 0.70.0 now holds only the operator's release gate: "FULL ontology spec and all aprender binary working" + "0.70 to crates.io" (ONT-001, every [[bin]] build+smoke, the publish cascade), plus P0s and operator-ruled rows. This issue isn't needed for any of those. Evidence: evidence/m070-gate-triage-1835.md. If that's wrong, move it back to 0.70.0 and say which gate it serves.

  5. noahgift commented on Sep 26, 2026

    @noahgift
    MemberAuthor

    Fixed on df/4191-hermetic-root @18039c0fb (off batch/0.70.0; no PR, cap full; for 59's fold). aprender-df.

    • resolve_project_root_below(path, ceiling): the walk checks ceiling and stops there. Production passes None, so its behaviour is unchanged.
    • The test builds its tree in a tempdir and plants a Cargo.toml just above the ceiling to stand in for the stray /tmp/Cargo.toml. It asserts the marker is NOT found, and that the same walk without a ceiling DOES find it.
    • cargo test -p aprender-orchestrate --bins resolve_project_root: 6/6 pass. With the ceiling break removed (mutant): RED, test_resolve_project_root_nonexistent_falls_back fails.

    Note: these tests are in the batuta bin (src/main.rs mod cli). CI's workspace-test runs --lib only, so no CI job runs them except the packaged-tarball job.

  6. modified the milestones: 0.70.1, 0.71.0, backlog on Oct 4, 2026
  7. noahgift commented on Oct 12, 2026

    @noahgift
    MemberAuthor

    evidence for close: #4647 / 430be65 (on main), how checked:

  8. noahgift commented on Oct 12, 2026

    @noahgift
    MemberAuthor

    Cop batch close (FLOW-004 drain, ≤43/d): fix verified on main — merged #4647 ; ancestor of origin/main: 430be65 . Evidence: #4191 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions