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.ci.fixme_with_unacknowledged_gap

Requirements index · View definition

evidence Valid

Example

The queue implementation acknowledges its zero-capacity bug and the missing zero-capacity test with a {fixme} reference naming example/queue#125. The reviewer also finds that the positive-capacity test checks the Full result but never asserts that existing entries are preserved, as the requirement demands. An implementation that returns Full while overwriting an existing entry would pass that test. No {fixme} reference acknowledges this assertion gap. The judgment is false, with a rationale describing both testing gaps and their source locations. The existing FIXME does not account for the additional gap. CI rejects the false determination. cite requirements.ci.outcomes cite requirements.ci.determination

Rationale

Concrete case. requirements.ci.fixme_with_unacknowledged_gap is concrete. It describes a queue with a {fixme} naming example/queue#125 for the zero-capacity gap. It also describes a positive-capacity test that checks Full but never asserts that entries are preserved. The expected outcome is a false judgment whose rationale describes both gaps and their locations, and CI then rejects that judgment.

Tests that cover it.

  • tests/outcomes.rs#fn[an_unacknowledged_gap_beside_an_acknowledged_one_is_false] builds a fixture with a real fenced {fixme} on requirements.ready. The {fixme} names example/queue#125 and describes only the capacity-zero gap. It records a false judgment with a rationale and runs validate_repository. It asserts that validation reports evidence/requirements.ready.json: determination is false: <rationale>. This covers three outcomes: an acknowledged {fixme} does not rescue a false judgment, CI rejects false, and the rationale is reported with the rejection.
  • tests/authoring_cli.rs#fn[false_is_a_completed_assessment] models the example’s setup: a requirement about a full queue and zero capacity, a push implementation, and a full_queue test that asserts !push(..) but never checks that existing entries are preserved. A mock reviewer submits false with a rationale that mentions not acknowledging missing checks.
    • It asserts that the evidence records determination == false with the rationale and with inputs that hold only selectors and hashes. It also asserts that usage records a completed false.
    • It asserts that the CLI reports false on stderr, and that the rationale text is not echoed in the diagnostics.
    • It asserts that validate_repository rejects the record with a “determination is false” error that contains the rationale.

Limitations.

  • In false_is_a_completed_assessment, the zero-capacity acknowledgment is a plain FIXME(#125) comment, not a {fixme} reference. The test’s own comment and prompt checks treat it as source the reviewer does not see. The real {fixme} case is covered by the tests/outcomes.rs test.
  • The mock reviewer’s rationale is canned, so no test shows that a real reviewer would find the missing preservation assertion. That is model behavior and cannot be tested deterministically. The testable obligations are that false is recorded, that it is not accepted as FIXME or true, and that CI rejects it with its rationale. Both tests assert these obligations, and the cited requirements.ci.outcomes and requirements.ci.determination are applied in the example’s case.

I found no unresolved gap, and there is at least one {test} reference to the example.

Inputs

Tests

Input 4: outline tests/authoring_cli.rs fn[false_is_a_completed_assessment]
// {test}`requirements.authoring.negative_assessment`
// {test}`requirements.authoring.usage_storage`
// {test}`requirements.authoring.persistence`
// {test}`requirements.ci.fixme_with_unacknowledged_gap`
// {test}`requirements.authoring.reporting`
#[test]
fn false_is_a_completed_assessment() {
    let server = Server::start(vec![reply(vec![call(
        "submit",
        "submit_judgment",
        json!({"determination":false,"rationale":"The test checks refusal for a full positive-capacity queue, without acknowledging missing checks for preservation and zero capacity."}),
    )])]);
    let fixture = Fixture::new(&server.endpoint);
    fs::write(fixture.project.join("md/requirements.md"), ":::{req} ready\nInserting into a full queue MUST return false without overwriting its entries, including at zero capacity.\n:::\n").unwrap();
    fs::write(fixture.project.join("src/lib.rs"), "// {impl}`requirements.ready`\n// FIXME(#125): zero-capacity insertion panics.\npub fn push(queue: &mut [u8], value: u8) -> bool {\n    queue[0] = value;\n    true\n}\n\n// {test}`requirements.ready`\n#[test]\nfn full_queue() { let mut queue = [1]; assert!(!push(&mut queue, 2)); }\n").unwrap();
    let output = fixture.run(&["author-evidence", SUBJECT, "--config", "mock"]);
    assert!(
        output.status.success(),
        "{}",
        String::from_utf8_lossy(&output.stderr)
    );
    let requests = server.finish();
    let prompt = prompt_text(&requests[0].body);
    assert!(prompt.contains("and false otherwise."));
    assert!(!prompt.contains("FIXME(#125): zero-capacity insertion panics"));
    assert!(!prompt.contains("queue[0] = value"));
    assert!(prompt.contains("fn full_queue()"));
    let evidence: Value = serde_json::from_slice(&fs::read(&fixture.evidence).unwrap()).unwrap();
    assert_eq!(evidence["determination"], false);
    assert!(!evidence["inputs"].as_array().unwrap().is_empty());
    assert!(
        evidence["rationale"]
            .as_str()
            .unwrap()
            .contains("without acknowledging")
    );
    // Outline inputs record selectors and hashes, never the source text.
    assert!(
        evidence["inputs"]
            .as_array()
            .unwrap()
            .iter()
            .any(|input| input["item"].is_string() && input["hash"].is_string())
    );
    assert!(!evidence["inputs"].to_string().contains("FIXME(#125)"));
    assert_eq!(fixture.usage()["outcome"], "completed");
    assert_eq!(fixture.usage()["determination"], "false");
    let diagnostics = format!(
        "{}{}",
        String::from_utf8_lossy(&output.stdout),
        String::from_utf8_lossy(&output.stderr)
    );
    let stderr = String::from_utf8_lossy(&output.stderr);
    assert!(stderr.contains(&format!("{SUBJECT}: false")), "{stderr}");
    assert!(
        !String::from_utf8_lossy(&output.stdout).contains(&format!("{SUBJECT}: false")),
        "{diagnostics}"
    );
    assert!(
        !diagnostics.contains("without acknowledging"),
        "{diagnostics}"
    );
    // CI rejects the false judgment even though a FIXME acknowledges one gap.
    let report = habeas::validate_repository(&fixture.project).unwrap();
    let evidence_file = format!("evidence/{SUBJECT}.json");
    let rejection = report
        .errors
        .iter()
        .find(|error| error.starts_with(&evidence_file) && error.contains("determination is false"))
        .unwrap_or_else(|| panic!("{:?}", report.errors));
    assert!(rejection.contains("without acknowledging"), "{rejection}");
}
Input 5: outline tests/outcomes.rs fn[an_unacknowledged_gap_beside_an_acknowledged_one_is_false]
// {test}`requirements.ci.outcomes`
// {test}`requirements.ci.determination`
// {test}`requirements.ci.fixme_with_unacknowledged_gap`
#[test]
fn an_unacknowledged_gap_beside_an_acknowledged_one_is_false() {
    let temp = fixture();
    let source = fixme(
        "requirements.ready",
        &["example/queue#125"],
        "Capacity-zero insertion does not return Full yet.",
    );
    let errors = judge_ready(temp.path(), &source, json!(false));
    assert!(
        errors.iter().any(|error| error.contains(
            "evidence/requirements.ready.json: determination is false: The fixture's gaps and their locations."
        )),
        "{errors:?}"
    );
}
Input 6: outline tests/outcomes.rs (whole file)
mod common;

use std::fs;
use std::path::Path;

use habeas::judgment::Judgment;
use mdbook_preprocessor::book::{Book, BookItem, Chapter};
use serde_json::{Value, json};
use tempfile::TempDir;

// {cite}`habeas:util`
/// A role written so this file's own source does not contain it.
fn role(kind: &str) -> String {
    format!("{{{kind}}}")
}

/// A fenced `{fixme}` in Rust comments: an opening fence naming `name`,
/// option lines for `issues`, the `body`, and a closing fence.
fn fixme(name: &str, issues: &[&str], body: &str) -> String {
    let mut text = format!("// :::{} {name}\n", role("fixme"));
    for issue in issues {
        text.push_str(&format!("// :github: {issue}\n"));
    }
    text.push_str(&format!("// {body}\n// :::\n"));
    text
}

/// The example `requirements.timeout`, judged FIXME and acknowledged by a
/// `{fixme}` in `observed.rs` naming two issues.
// {test}`requirements.examples.evidence`
fn fixture() -> TempDir {
    let temp = TempDir::new().unwrap();
    fs::create_dir(temp.path().join("md")).unwrap();
    fs::create_dir(temp.path().join("evidence")).unwrap();
    fs::write(
        temp.path().join("Cargo.toml"),
        "[package]\nname = 'fixture'\n",
    )
    .unwrap();
    fs::write(temp.path().join("book.toml"), "[book]\nsrc = 'md'\n").unwrap();
    let example = "Timeout handling retries. {cite}`requirements.ready`".to_owned();
    let example_lines = vec![
        ":::{example} timeout".to_owned(),
        example.clone(),
        ":::".to_owned(),
    ];
    fs::write(
        temp.path().join("md/requirements.md"),
        format!(
            ":::{{req}} ready\nThe behavior MUST work.\n:::\n\n{}\n",
            example_lines.join("\n")
        ),
    )
    .unwrap();
    let source = fixme(
        "requirements.timeout",
        &["example/io#125", "rust-lang/rust#123"],
        "Retry-after-timeout and partial-write recovery are untested.",
    );
    fs::write(
        temp.path().join("observed.rs"),
        format!("{source}const RETRIES: u32 = 1;\n"),
    )
    .unwrap();
    let source_input = habeas::outline_input(temp.path(), "observed.rs", "").unwrap();
    write_record(
        temp.path(),
        "ready",
        json!({
            "requirement": "The behavior MUST work.",
            "determination": true,
            "rationale": "The requirement is supported by the fixture.",
            "inputs": [{
                "requirements": "requirements.timeout",
                "matches": ["requirements.timeout"],
                "text": example_lines
            }]
        }),
    );
    write_record(
        temp.path(),
        "timeout",
        json!({
            "example": example,
            "determination": { "FIXME": ["example/io#125", "rust-lang/rust#123"] },
            "rationale": "The recorded comments acknowledge the missing timeout tests.",
            "inputs": [source_input]
        }),
    );
    common::coverage_setup(temp.path());
    temp
}

// {cite}`habeas:util`
fn write_record(root: &Path, name: &str, mut value: Value) {
    if value.get("references").is_none() {
        value["references"] =
            json!(habeas::reference_set_digest_for(root, &format!("requirements.{name}")).unwrap());
    }
    fs::write(
        root.join(format!("evidence/requirements.{name}.json")),
        serde_json::to_string_pretty(&value).unwrap(),
    )
    .unwrap();
}

// {cite}`habeas:util`
fn replace_judgment(root: &Path, name: &str, judgment: Value) {
    let path = root.join(format!("evidence/requirements.{name}.json"));
    let mut record: Value = serde_json::from_str(&fs::read_to_string(path).unwrap()).unwrap();
    record["determination"] = judgment;
    write_record(root, name, record);
}

// {test}`requirements.ci.outcomes`
// {test}`requirements.ci.schema`
#[test]
fn judgments_round_trip_and_reject_invalid_fixme_shapes() {
    for value in [
        json!(true),
        json!(false),
        json!({ "FIXME": ["#125", "rust-lang/rust#123"] }),
        json!({ "FIXME": ["cancellation races are not tested on Windows"] }),
    ] {
        assert_eq!(Judgment::from_value(&value).unwrap().to_value(), value);
    }
    for invalid in [
        Value::Null,
        json!("FIXME"),
        json!(["#125"]),
        json!({}),
        json!({ "FIXME": [] }),
        json!({ "FIXME": [""] }),
        json!({ "FIXME": ["   "] }),
        json!({ "FIXME": ["#125", 125] }),
        json!({ "FIXME": "#125" }),
        json!({ "FIXME": ["#125"], "extra": true }),
        json!({ "fixme": ["#125"] }),
    ] {
        assert!(Judgment::from_value(&invalid).is_err(), "{invalid}");
    }
}

// {test}`requirements.ci.determination`
// {test}`requirements.examples.evidence`
// {test}`requirements.ci.fixme_example_test_gaps`
#[test]
fn fixme_examples_pass_without_test_references_but_true_examples_do_not() {
    let temp = fixture();
    let report = habeas::validate_repository(temp.path()).unwrap();
    assert!(report.errors.is_empty(), "{:?}", report.errors);
    replace_judgment(temp.path(), "timeout", json!(true));
    let report = habeas::validate_repository(temp.path()).unwrap();
    assert!(
        report
            .errors
            .iter()
            .any(|error| error.contains("no {test} reference"))
    );
    replace_judgment(temp.path(), "timeout", json!(false));
    let report = habeas::validate_repository(temp.path()).unwrap();
    assert!(
        report
            .errors
            .iter()
            .any(|error| error.contains("determination is false"))
    );
}

/// Writes `source` to `reviewed.rs` and records `judgment` for
/// `requirements.ready` with that file among its inputs, returning the
/// validation errors.
fn judge_ready(root: &Path, source: &str, judgment: Value) -> Vec<String> {
    fs::write(root.join("reviewed.rs"), source).unwrap();
    let path = root.join("evidence/requirements.ready.json");
    let mut record: Value = serde_json::from_str(&fs::read_to_string(path).unwrap()).unwrap();
    record["determination"] = judgment;
    record["rationale"] = json!("The fixture's gaps and their locations.");
    // The new source changes the reference set; record its current digest.
    record.as_object_mut().unwrap().remove("references");
    let inputs = record["inputs"].as_array_mut().unwrap();
    inputs.retain(|input| input.get("file").and_then(Value::as_str) != Some("reviewed.rs"));
    inputs.push(habeas::outline_input(root, "reviewed.rs", "").unwrap());
    write_record(root, "ready", record);
    habeas::validate_repository(root).unwrap().errors
}

// {test}`requirements.ci.determination`
// {test}`requirements.ci.outcomes`
// {test}`requirements.ci.fixme_implementation_gap`
#[test]
fn an_acknowledged_implementation_gap_records_its_issue() {
    let temp = fixture();
    let source = fixme(
        "requirements.ready",
        &["example/queue#125"],
        "Capacity-zero insertion does not return Full yet and has no test.",
    );
    let errors = judge_ready(
        temp.path(),
        &source,
        json!({ "FIXME": ["example/queue#125"] }),
    );
    assert!(errors.is_empty(), "{errors:?}");
    let path = temp.path().join("evidence/requirements.ready.json");
    let mut without_source: Value = serde_json::from_slice(&fs::read(&path).unwrap()).unwrap();
    without_source["inputs"]
        .as_array_mut()
        .unwrap()
        .retain(|input| input["file"] != "reviewed.rs");
    write_record(temp.path(), "ready", without_source);
    let report = habeas::validate_repository(temp.path()).unwrap();
    assert!(report.errors.is_empty(), "{:?}", report.errors);
    fs::write(
        temp.path().join("reviewed.rs"),
        source.replace("has no test", "has no boundary test"),
    )
    .unwrap();
    let errors = habeas::validate_repository(temp.path()).unwrap().errors;
    assert!(
        errors
            .iter()
            .any(|e| e.contains("requirements.ready.json: reference set changed")),
        "{errors:?}"
    );
    assert!(
        !errors
            .iter()
            .any(|e| e.contains("requirements.ready.json:") && e.contains("outline input changed")),
        "{errors:?}"
    );
    fs::write(temp.path().join("reviewed.rs"), &source).unwrap();
    // Moving the same acknowledgment to another source changes its location,
    // even when no implementation source is a recorded input.
    fs::write(temp.path().join("relocated.rs"), &source).unwrap();
    fs::write(temp.path().join("reviewed.rs"), "").unwrap();
    let errors = habeas::validate_repository(temp.path()).unwrap().errors;
    assert!(
        errors
            .iter()
            .any(|e| e.contains("requirements.ready.json: reference set changed")),
        "{errors:?}"
    );
    fs::remove_file(temp.path().join("relocated.rs")).unwrap();
    fs::write(temp.path().join("reviewed.rs"), &source).unwrap();
    // The strings must be the issues as written after `:github:`.
    for judgment in [json!(["#125"]), json!(["FIXME(example/queue#125)"])] {
        let errors = judge_ready(temp.path(), &source, json!({ "FIXME": judgment }));
        assert!(
            errors
                .iter()
                .any(|error| error.contains("is neither an issue named by a {fixme}")),
            "{errors:?}"
        );
    }
    let errors = judge_ready(temp.path(), &source, json!({"FIXME":["example/io#125"]}));
    assert!(
        errors
            .iter()
            .any(|error| error.contains("is neither an issue named by a {fixme}")),
        "{errors:?}"
    );
    // Plain FIXME/TODO markers and prose acknowledge nothing.
    for source in [
        "// FIXME(example/queue#125): capacity-zero insertion does not return Full yet.\n",
        "// TODO(example/queue#125): capacity-zero insertion does not return Full yet.\n",
        "// Capacity-zero insertion still needs a test; tracked by example/queue#125.\n",
    ] {
        let errors = judge_ready(
            temp.path(),
            source,
            json!({ "FIXME": ["example/queue#125"] }),
        );
        assert!(
            errors
                .iter()
                .any(|error| error.contains("\"example/queue#125\" is neither an issue")),
            "{source}: {errors:?}"
        );
    }
}

// {test}`requirements.ci.determination`
// {test}`requirements.ci.outcomes`
// {test}`requirements.ci.fixme_without_issue`
#[test]
fn an_acknowledged_gap_without_an_issue_records_the_body_words() {
    let temp = fixture();
    let source = fixme(
        "requirements.ready",
        &[],
        "Cancellation races are not\n//   tested on Windows.",
    );
    let errors = judge_ready(
        temp.path(),
        &source,
        json!({ "FIXME": ["Cancellation races are not tested on Windows."] }),
    );
    assert!(errors.is_empty(), "{errors:?}");
    // An invented issue number, or the words not joined by single spaces,
    // matches no `{fixme}`.
    for entry in [
        "example/tasks#1",
        "Cancellation races are not  tested on Windows.",
    ] {
        let errors = judge_ready(temp.path(), &source, json!({ "FIXME": [entry] }));
        assert!(
            errors
                .iter()
                .any(|error| error.contains("is neither an issue")),
            "{entry}: {errors:?}"
        );
    }
}

// {test}`requirements.ci.outcomes`
// {test}`requirements.ci.fixme_example_test_gaps`
#[test]
fn fixme_strings_list_each_issue_of_an_acknowledging_fixme_once() {
    let temp = fixture();
    let path = "evidence/requirements.timeout.json";
    for (judgment, expected) in [
        (
            json!(["rust-lang/rust#123"]),
            "FIXME entries omit \"example/io#125\" named by the acknowledging {fixme} to requirements.timeout at observed.rs:1",
        ),
        (
            json!(["example/io#125", "rust-lang/rust#123", "example/io#125"]),
            "FIXME entry \"example/io#125\" is listed more than once",
        ),
    ] {
        replace_judgment(temp.path(), "timeout", json!({ "FIXME": judgment }));
        let errors = habeas::validate_repository(temp.path()).unwrap().errors;
        assert!(
            errors
                .iter()
                .any(|error| error == &format!("{path}: {expected}")),
            "{expected}: {errors:#?}"
        );
    }
}

// {test}`requirements.ci.outcomes`
// {test}`requirements.ci.determination`
// {test}`requirements.ci.fixme_with_unacknowledged_gap`
#[test]
fn an_unacknowledged_gap_beside_an_acknowledged_one_is_false() {
    let temp = fixture();
    let source = fixme(
        "requirements.ready",
        &["example/queue#125"],
        "Capacity-zero insertion does not return Full yet.",
    );
    let errors = judge_ready(temp.path(), &source, json!(false));
    assert!(
        errors.iter().any(|error| error.contains(
            "evidence/requirements.ready.json: determination is false: The fixture's gaps and their locations."
        )),
        "{errors:?}"
    );
}

// {test}`requirements.ci.schema`
// {test}`requirements.ci.outcomes`
// {test}`requirements.index.state`
// {test}`requirements.cli.fixme_summary`
// {test}`requirements.ci.determination`
// {test}`requirements.examples.evidence`
#[test]
fn malformed_fixme_is_invalid_and_reports_the_required_shape() {
    let temp = fixture();
    replace_judgment(temp.path(), "timeout", json!({ "FIXME": [] }));
    let report = habeas::validate_repository(temp.path()).unwrap();
    assert!(
        report
            .errors
            .iter()
            .any(|error| error.contains("nonempty array"))
    );
    let status = habeas::status_markdown(temp.path(), false).unwrap();
    let row = status
        .lines()
        .find(|line| line.starts_with("| `requirements.timeout`"))
        .unwrap();
    assert!(row.contains("Invalid"), "{row}");
    assert!(status.contains("nonempty array"), "{status}");
    assert!(!status.contains("affects"), "{status}");
}

// {test}`requirements.ci.determination`
#[test]
fn fixme_does_not_excuse_missing_or_malformed_evidence() {
    let temp = fixture();
    let errors = |root: &Path| habeas::validate_repository(root).unwrap().errors;
    assert!(errors(temp.path()).is_empty(), "{:?}", errors(temp.path()));
    let path = temp.path().join("evidence/requirements.timeout.json");
    let original: Value = serde_json::from_str(&fs::read_to_string(&path).unwrap()).unwrap();

    // A malformed record judged FIXME: an unknown field and a wrong example
    // text are each still reported.
    let mut malformed = original.clone();
    malformed["extra"] = json!(1);
    malformed["example"] = json!("Timeout handling does not retry.");
    fs::write(&path, serde_json::to_string_pretty(&malformed).unwrap()).unwrap();
    let found = errors(temp.path());
    for expected in ["unexpected field \"extra\"", "example text changed"] {
        assert!(
            found.iter().any(
                |error| error.starts_with("evidence/requirements.timeout.json")
                    && error.contains(expected)
            ),
            "missing {expected:?}: {found:#?}"
        );
    }

    // A definition whose gap a {fixme} acknowledges still needs evidence.
    fs::remove_file(&path).unwrap();
    let found = errors(temp.path());
    assert!(
        found
            .iter()
            .any(|error| error
                .starts_with("evidence/requirements.timeout.json: missing for example")),
        "{found:#?}"
    );
}

// {test}`requirements.ci.outline_inputs`
// {test}`requirements.ci.determination`
// {test}`requirements.references.evidence_coverage`
// {test}`requirements.ci.fixme_stale_input`
// {test}`requirements.index.state`
// {test}`requirements.cli.fixme_summary`
#[test]
fn fixme_does_not_hide_stale_inputs_or_uncovered_references() {
    let temp = fixture();
    let observed = temp.path().join("observed.rs");
    let source = fs::read_to_string(&observed).unwrap();
    fs::write(&observed, source.replace("= 1;", "= 2;")).unwrap();
    let report = habeas::validate_repository(temp.path()).unwrap();
    assert!(
        report
            .errors
            .iter()
            .any(|error| error.contains("outline input changed: observed.rs <root>")),
        "{:?}",
        report.errors
    );
    let status = habeas::status_markdown(temp.path(), false).unwrap();
    let row = status
        .lines()
        .find(|line| line.starts_with("| `requirements.timeout`"))
        .unwrap();
    assert!(row.contains("Invalid"), "{row}");
    assert!(status.contains("example/io#125"), "{status}");
    assert!(status.contains("outline input changed"), "{status}");
    fs::write(
        temp.path().join("other.txt"),
        "{test}`requirements.timeout`",
    )
    .unwrap();
    let report = habeas::validate_repository(temp.path()).unwrap();
    assert!(
        report
            .errors
            .iter()
            .any(|error| error.contains("no input covers") && error.contains("other.txt:1"))
    );
}

// {test}`requirements.cli.status`
// {test}`requirements.cli.fixme_summary`
// {test}`requirements.cli.info`
// {test}`requirements.index.state`
// {test}`requirements.index.detail_format`
// {test}`requirements.index.detail_pages`
// {test}`requirements.examples.index`
#[test]
fn valid_fixme_remains_visible_in_status_info_and_book() {
    let temp = fixture();
    for all in [false, true] {
        let status = habeas::status_markdown(temp.path(), all).unwrap();
        assert_eq!(status.contains("requirements.timeout"), all, "{status}");
        assert!(status.contains("FIXME"));
        assert!(status.contains("example/io#125"));
        assert!(status.contains("rust-lang/rust#123"));
        assert!(status.contains("affects 1 judgment"), "{status}");
        assert!(!status.contains("## Validation findings"));
    }
    let verbose = habeas::status_markdown_with_options(temp.path(), false, None, true).unwrap();
    assert!(verbose.contains("requirements.timeout"), "{verbose}");
    assert!(verbose.contains("example"), "{verbose}");
    let info = habeas::info_markdown(temp.path(), "requirements.timeout").unwrap();
    assert!(info.contains("## FIXME references"));
    assert!(info.contains("rust-lang/rust#123"));

    let mut book = Book::new();
    book.push_item(Chapter::new(
        "Requirements",
        fs::read_to_string(temp.path().join("md/requirements.md")).unwrap(),
        "requirements.md",
        Vec::new(),
    ));
    book.push_item(Chapter::new(
        "Index",
        ":::{requirements-index}\n:::\n".to_owned(),
        "requirements-index.md",
        Vec::new(),
    ));
    habeas::preprocess_book(&mut book, temp.path()).unwrap();
    let index = book
        .chapters()
        .find(|chapter| chapter.name == "Index")
        .unwrap();
    assert!(index.content.contains("FIXME"));
    let detail = index
        .sub_items
        .iter()
        .find_map(|item| match item {
            BookItem::Chapter(chapter) if chapter.name == "requirements.timeout" => Some(chapter),
            _ => None,
        })
        .unwrap();
    assert!(detail.content.contains("evidence-FIXME"));
    assert!(detail.content.contains("## FIXME references"));
    assert!(detail.content.contains("rust-lang/rust#123"));
}

// {test}`requirements.ci.reference_set`
// {test}`requirements.references.evidence_coverage`
// {test}`requirements.authoring.fixme_inputs`
#[test]
fn editing_or_adding_a_fixme_makes_evidence_stale_without_requiring_source_reads() {
    let temp = fixture();
    let observed = temp.path().join("observed.rs");
    let source = fs::read_to_string(&observed).unwrap();
    // Comments do not change the input's hash, but the `{fixme}` body is
    // part of the reference set.
    fs::write(&observed, source.replace("are untested", "remain untested")).unwrap();
    let errors = habeas::validate_repository(temp.path()).unwrap().errors;
    assert!(
        errors.iter().any(
            |error| error.contains("evidence/requirements.timeout.json: reference set changed")
        ),
        "{errors:?}"
    );
    assert!(
        !errors
            .iter()
            .any(|error| error.contains("outline input changed")),
        "{errors:?}"
    );
    fs::write(&observed, &source).unwrap();
    fs::write(
        temp.path().join("other.rs"),
        fixme("requirements.timeout", &[], "Another gap."),
    )
    .unwrap();
    let errors = habeas::validate_repository(temp.path()).unwrap().errors;
    assert!(
        errors.iter().any(
            |error| error.contains("evidence/requirements.timeout.json: reference set changed")
        ),
        "{errors:?}"
    );
    assert!(
        !errors
            .iter()
            .any(|error| error.contains("no input covers {fixme}")),
        "{errors:?}"
    );
}

Referenced definitions

Input 2: requirements selection requirements.ci.outcomes
:::{req} outcomes
Every assessment judgment MUST use one of these outcomes, applying
{cite}`requirements.ci.review_criteria`:

- `true`: the reviewed tests adequately check a requirement or example under
  {cite}`requirements.ci.review_criteria`, including applicable testing
  exemptions and obligations assessed by a refining requirement or a site's
  own review. For a citation or site review, the review finds no gap under its
  own task.
- `false`: the sources do not support the subject, or information is missing,
  and the gaps are not all acknowledged by `{fixme}` references to it.
- `FIXME`: some aspects remain unmet or untested, and `{fixme}` references to
  the subject acknowledge every one of those gaps. The reviewer MUST explain the
  gaps and their source locations in the rationale and record their issue
  references or other identifying content from the supplied acknowledgments or
  inputs.

The JSON `determination` MUST be `true`, `false`, or an object containing exactly
`"FIXME"` with a nonempty array of nonempty strings, such as
`{"FIXME": ["example/queue#125", "rust-lang/rust#123"]}`. A gap MUST count as
acknowledged only by a `{fixme}` reference under
{cite}`requirements.references.roles` whose body describes that gap and that
references the assessed definition, or, for a site review, the distributed requirement from within that site; a citation review MUST NOT accept a `{fixme}`; a plain
`FIXME` comment, another marker such as `TODO`, or prose MUST NOT. The strings
MUST list each distinct issue reference the acknowledging `{fixme}` references
name in their option lines, as written after `:github:`, and, for a `{fixme}`
naming no issue, its body's words, without comment delimiters, joined by single
spaces. A `{fixme}` reference describing a gap that the review establishes no
longer exists within its task's scope MUST itself be treated as a gap. A reference
describing only an implementation defect MUST NOT create a test-adequacy gap or
require implementation review; it MUST acknowledge a testing gap only when its
body describes that same gap. A `{fixme}` naming a GitHub issue that
{cite}`requirements.authoring.github_reads` reports closed MUST NOT count as
acknowledging its gap. A FIXME judgment MUST be grounded in recorded evidence
inputs or, for an acknowledgment supplied under
{cite}`requirements.authoring.fixme_inputs`, the reference-set digest covering
that acknowledgment.
:::
Input 3: requirements selection requirements.ci.determination
:::{req} determination
For requirement and example evidence, both `true` and `FIXME` MUST satisfy the determination check in `habeas::validate()`. A false determination MUST fail validation and be reported with its rationale. Each definition's determination MUST be checked on its own; a false determination MUST NOT fail the definitions it implements, tests, or cites. All other evidence checks MUST still pass: FIXME MUST NOT excuse malformed, missing, or stale evidence or uncovered references. Validation MUST check the recorded outcome, schema, input freshness, and reference coverage without inference or reassessing whether a source comment adequately acknowledges a gap.
:::

Other sources

Input 1: requirements selection requirements.ci.fixme_with_unacknowledged_gap
:::{example} fixme_with_unacknowledged_gap
The queue implementation acknowledges its zero-capacity bug and the missing
zero-capacity test with a `{fixme}` reference naming `example/queue#125`.
The reviewer also finds that the positive-capacity test checks the `Full` result
but never asserts that existing entries are preserved, as the requirement
demands. An implementation that returns `Full` while overwriting an existing
entry would pass that test. No `{fixme}` reference acknowledges this assertion
gap. The judgment is `false`, with a rationale describing both testing gaps and
their source locations. The existing FIXME does not account for the additional
gap. CI rejects the false determination.
{cite}`requirements.ci.outcomes`
{cite}`requirements.ci.determination`
:::