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_example_test_gaps

Requirements index · View definition

evidence Valid

Example

A named example describes recovery after a timeout and a partial write. Its test source records the two missing cases:

// :::{fixme} requirements.io.recovery_example
// :github: example/io#125
// :github: rust-lang/rust#123
// Retry-after-timeout and partial-write recovery are untested.
// :::

The reviewer finds no other gaps and records {"FIXME": ["example/io#125", "rust-lang/rust#123"]}. The rationale identifies both missing tests, and the inputs include the reference. CI accepts this documented incomplete coverage; the example does not receive a true judgment. cite requirements.ci.outcomes cite requirements.ci.determination cite requirements.examples.evidence

Rationale

Example. requirements.ci.fixme_example_test_gaps describes a concrete case. An example’s test source carries a {fixme} naming example/io#125 and rust-lang/rust#123, with a body listing two untested recovery cases. The reviewer records {"FIXME": ["example/io#125", "rust-lang/rust#123"]}. CI accepts that, and the example does not get a true judgment.

Fixture. tests/outcomes.rs#fn[fixture] builds this case:

  • An example requirements.timeout, which has no {test} reference.
  • An observed.rs containing a fenced {fixme} to requirements.timeout. It names example/io#125 and rust-lang/rust#123, and its body is “Retry-after-timeout and partial-write recovery are untested.”
  • An evidence record for the example whose determination is {"FIXME": ["example/io#125", "rust-lang/rust#123"]}. Its input is the outline of observed.rs, so the inputs include the reference.

Assertions.

  • fixme_examples_pass_without_test_references_but_true_examples_do_not checks that the FIXME evidence validates with no errors. It then swaps the determination to true and asserts an error containing “no {test} reference”. It then swaps to false and asserts “determination is false”. Together these cover the outcomes the example states: CI accepts FIXME without a test reference, and the example cannot receive true.
  • fixme_strings_list_each_issue_of_an_acknowledging_fixme_once checks that the FIXME list must name both issues from the acknowledging {fixme}. It asserts the exact error when example/io#125 is omitted and when it is listed twice. This covers recording both issue references, as the cited requirements.ci.outcomes requires.

Not tested. The tests don’t check that the rationale identifies both missing tests. That is reviewer-authored prose, and the cited requirements don’t have validation check it. The fixture’s rationale mentions the missing timeout tests, but no test asserts on it. I treat this as outside what automated tests can check, not as a gap.

Both tests carry {test} references to the example, and the assertions match the outcomes the example and its cited requirements state.

Inputs

Tests

Input 5: outline tests/outcomes.rs fn[fixme_examples_pass_without_test_references_but_true_examples_do_not]
  • File: tests/outcomes.rs
  • Selector: fn[fixme_examples_pass_without_test_references_but_true_examples_do_not]
  • Kind: fn
  • tests/outcomes.rs:144–168
// {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"))
    );
}
Input 6: outline tests/outcomes.rs fn[fixme_strings_list_each_issue_of_an_acknowledging_fixme_once]
  • File: tests/outcomes.rs
  • Selector: fn[fixme_strings_list_each_issue_of_an_acknowledging_fixme_once]
  • Kind: fn
  • tests/outcomes.rs:316–341
// {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:#?}"
        );
    }
}

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.
:::
Input 4: requirements selection requirements.examples.evidence
:::{req} evidence
Every defined example MUST have an `evidence/<full-example-name>.json` file whose `example` string exactly matches the current example body. A true determination MUST have at least one `{test}` reference to the example, covered by an evidence input. The reviewer MUST assess its tests under {cite}`requirements.ci.review_criteria` and use the outcomes defined by {cite}`requirements.ci.outcomes`; the no-test justification for a requirement MUST NOT establish a true example judgment. Habeas MUST apply the same missing-evidence, determination, input validation, and reference-coverage checks used for requirements. It MUST report a true determination with no test reference and changed example text with a compact line-oriented diff.
:::

Other sources

Input 1: requirements selection requirements.ci.fixme_example_test_gaps
:::{example} fixme_example_test_gaps
A named example describes recovery after a timeout and a partial write. Its test
source records the two missing cases:

```text
// :::{fixme} requirements.io.recovery_example
// :github: example/io#125
// :github: rust-lang/rust#123
// Retry-after-timeout and partial-write recovery are untested.
// :::
```

The reviewer finds no other gaps and records
`{"FIXME": ["example/io#125", "rust-lang/rust#123"]}`. The rationale identifies
both missing tests, and the inputs include the reference. CI accepts this documented incomplete
coverage; the example does not receive a `true` judgment.
{cite}`requirements.ci.outcomes`
{cite}`requirements.ci.determination`
{cite}`requirements.examples.evidence`
:::