requirements.test-coverage.guidance
Requirements index · View definition
Requirement
Habeas’s bundled agent instructions MUST direct agents in Habeas-enabled Cargo projects to use the coverage workflow of
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
- The bundled agent instructions direct agents in Habeas-enabled Cargo projects to use the
habeas coverageworkflow by default. - That direction covers Rust unit and integration test runs, including focused or filtered runs.
- 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-evidenceandhabeas-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_textrequires the exact directive: “Usehabeas coverageby default for every Rust unit and integration test run, including focused runs (habeas coverage -- -E 'test(name)')”. It also requires “The workflow usescargo nextestfor 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-evidenceandhabeas-bootstrap-requirementsare each asserted to contain “Follow the habeas skill’s “Testing and coverage artifacts”: default tohabeas coveragefor unit, integration and focused runs throughcargo nextest“. They therefore carry the same direction and the nextest clause. - Approved-implementation SOP.
agent-sops/approved-implementation.sop.mdis asserted to say “Usecargo habeas coverage -- <nextest arguments>for every Rust unit and integration test run, including focused or filtered runs” and “executes parallel processes throughcargo 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 testfor 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.doctestsandrequirements.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]
- File:
tests/authoring_cli.rs - Selector:
fn[bundled_skills_default_to_process_coverage_and_keep_artifacts_disposable] - Kind:
fn tests/authoring_cli.rs:3159–3229
// {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
requirements.test-coverage.run:md/requirements/test-coverage.md:33–38
:::{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
requirements.test-coverage.guidance:md/requirements/test-coverage.md:12–22
:::{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`.
:::