Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

requirements.test-coverage.guidance

Requirements index · View definition

evidence Valid

Requirement

Habeas’s bundled agent instructions MUST direct agents in Habeas-enabled Cargo projects to use the coverage workflow of cite requirements.test-coverage.run by default for Rust unit and integration test runs, including focused or filtered runs. That workflow MUST execute tests through cargo nextest.

Rationale

The reviewed test adequately checks requirements.test-coverage.guidance.

Obligations derived from the requirement

  1. The bundled agent instructions direct agents in Habeas-enabled Cargo projects to use the habeas coverage workflow by default.
  2. That direction covers Rust unit and integration test runs, including focused or filtered runs.
  3. The workflow executes tests through cargo nextest.

The workflow’s own behavior belongs to requirements.test-coverage.run. It is a cited context requirement, so it is not reassessed here.

Test mapping The only test is tests/authoring_cli.rs#fn[bundled_skills_default_to_process_coverage_and_keep_artifacts_disposable]. It checks the instruction text itself, which is the right level for a requirement about what the instructions say.

  • Every skill that mentions test running. For habeas, habeas-evidence and habeas-bootstrap-requirements, it asserts the whitespace-collapsed text contains `habeas coverage`, `cargo nextest` and “focused runs”. It also asserts “by default” or “default to”.
  • Home skill. For habeas, assert_text requires the exact directive: “Use habeas coverage by default for every Rust unit and integration test run, including focused runs (habeas coverage -- -E 'test(name)')”. It also requires “The workflow uses cargo nextest for parallel process runs…”. Together these cover the default use, the unit and integration scope, the focused-run case and the nextest execution.
  • Other two skills. habeas-evidence and habeas-bootstrap-requirements are each asserted to contain “Follow the habeas skill’s “Testing and coverage artifacts”: default to habeas coverage for unit, integration and focused runs through cargo nextest“. They therefore carry the same direction and the nextest clause.
  • Approved-implementation SOP. agent-sops/approved-implementation.sop.md is asserted to say “Use cargo habeas coverage -- <nextest arguments> for every Rust unit and integration test run, including focused or filtered runs” and “executes parallel processes through cargo nextest”. This covers the filtered-run wording and the repository’s local alias.

Other bundled instructions Searching assets for cargo test and nextest found no other bundled skill, habeas-requirements or habeas-refactor included, that tells agents how to run tests. No instruction was found that contradicts the default. A weaker check cannot hide such a conflict.

Possible gaps considered

  • The assertions are substring checks, so wording that tells agents to run raw cargo test for ordinary runs could slip through. The required phrases are specific and directive, and the instructions contain no such conflicting text, so I do not count this as a gap.
  • The doctest and artifact obligations are covered by the sibling requirements requirements.test-coverage.guidance.doctests and requirements.test-coverage.guidance.artifacts. Those are outside this subject.

No unacknowledged gap remains.

Inputs

Tests

Input 3: outline tests/authoring_cli.rs fn[bundled_skills_default_to_process_coverage_and_keep_artifacts_disposable]
// {test}`requirements.test-coverage.guidance`
// {test}`requirements.test-coverage.guidance.doctests`
// {test}`requirements.test-coverage.guidance.artifacts`
#[test]
fn bundled_skills_default_to_process_coverage_and_keep_artifacts_disposable() {
    for name in ["habeas", "habeas-evidence", "habeas-bootstrap-requirements"] {
        let text = bundled_skill(name)
            .split_whitespace()
            .collect::<Vec<_>>()
            .join(" ");
        for required in [
            "`habeas coverage`",
            "`cargo nextest`",
            "focused runs",
            "`cargo test --doc --workspace`",
            "disposable",
            "Cargo target directory",
        ] {
            assert!(text.contains(required), "{name} omits {required}");
        }
        assert!(
            text.contains("by default") || text.contains("default to"),
            "{name}"
        );
        assert!(
            text.to_lowercase().contains("never stage or commit"),
            "{name}"
        );
        if name != "habeas" {
            assert!(text.contains("Follow the habeas skill's \"Testing and coverage artifacts\""));
        }
    }
    let home = bundled_skill("habeas");
    assert_text(
        "default coverage directive",
        &collapse(&home),
        &[
            "Use `habeas coverage` by default for every Rust unit and integration test run, including focused runs (`habeas coverage -- -E 'test(name)'`)",
            "The workflow uses `cargo nextest` for parallel process runs and retains independent process coverage",
            "Run doctests separately with `cargo test --doc --workspace`",
        ],
    );
    for name in ["habeas-evidence", "habeas-bootstrap-requirements"] {
        assert_text(
            name,
            &collapse(&bundled_skill(name)),
            &[
                "Follow the habeas skill's \"Testing and coverage artifacts\": default to `habeas coverage` for unit, integration and focused runs through `cargo nextest`",
                "run doctests separately with `cargo test --doc --workspace`",
            ],
        );
    }
    assert_text(
        "approved implementation SOP",
        &collapse(include_str!("../agent-sops/approved-implementation.sop.md")),
        &[
            "Use `cargo habeas coverage -- <nextest arguments>` for every Rust unit and integration test run, including focused or filtered runs",
            "It executes parallel processes through `cargo nextest` and retains coverage for each process",
            "Run doctests separately with `cargo test --doc --workspace`",
            "profiles, reports, and source snapshots under the Cargo target directory are disposable build output: never stage or commit them to Git",
        ],
    );
    for required in [
        "Profiles, reports, and captured source",
        "cargo install cargo-nextest --locked",
        "rustup component add llvm-tools-preview",
        "target/habeas/coverage/",
    ] {
        assert!(home.contains(required), "coverage home omits {required}");
    }
}

Referenced definitions

Input 2: requirements selection requirements.test-coverage.run
:::{req} run
`habeas coverage [-- <nextest arguments>]` MUST run LLVM-instrumented Rust tests
through `cargo nextest run`, forwarding the supplied arguments and preserving
nextest's configured test concurrency, filtering, and retries. With no supplied
arguments it MUST select the workspace.
:::

Other sources

Input 1: requirements selection requirements.test-coverage.guidance
:::{req} guidance
Habeas's bundled agent instructions MUST direct agents in Habeas-enabled Cargo
projects to use the coverage workflow of
{cite}`requirements.test-coverage.run` by default for Rust unit and integration
test runs, including focused or filtered runs. That workflow MUST execute tests
through `cargo nextest`.
:::