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.cli.fixme_summary

Requirements index · View definition

evidence Valid

Requirement

habeas status MUST group the selected requirement and example judgments marked FIXME by issue reference and report how many distinct judgments each issue affects. A recorded FIXME string of the form owner/repo#N under cite requirements.ci.outcomes MUST identify that issue, compared exactly; any other string is a gap description without an issue.

A judgment MUST count at most once for each issue, even when that issue occurs repeatedly or in several FIXME strings. A judgment naming several issues MUST count in each corresponding group. Judgments with no issue string MUST be counted once in a separate “FIXME without an issue” group. Issue groups MUST be ordered by decreasing affected-judgment count, then by reference; the group without an issue MUST follow them. A supplied selection MUST restrict these counts to the selected subjects.

--verbose MUST list the full name and kind of every judgment in each issue group and in the group without an issue, along with its original FIXME strings. The summary MUST include valid FIXME determinations even when other evidence checks fail; grouping MUST NOT hide their validation findings. Malformed determinations MUST remain validation errors under cite requirements.ci.outcomes.

Rationale

The reviewed tests cover every obligation in requirements.cli.fixme_summary. I found no gap, and I did not need to request implementation source.

  • Exact issue identification.
    • src/fixme.rs#mod[tests]/fn[only_exact_issue_references_identify_issues] feeds in a URL, FIXME(owner/repo#8), a sentence containing a reference, a bare #7, and owner/repo#007. Only owner/repo#7 is an issue.
    • The test then renders verbose output. It asserts that the near-miss strings land in the “FIXME without an issue” group and that the count line reads “3 judgments”.
    • tests/commands.rs#fn[status_groups_fixme_judgments_by_distinct_exact_issue] repeats this end to end. It asserts that #123 and github.com never appear as groups.
    • The same test shows Rust-Lang/rust#456 and rust-lang/rust#456 as separate groups, which checks the exact comparison.
  • Counting each judgment once per issue, and once in every group it names.
    • fn[verbose_output_lists_each_judgment_under_every_group_it_belongs_to] adds rules.both with o/r#1, o/r#2 and o/r#1 again.
    • It asserts that rules.both is counted once under o/r#1 (“affects 2 judgments”) and also appears under o/r#2.
  • The group without an issue.
    • The same test asserts that two judgments with no issue string give “2 judgments are marked FIXME without an issue”.
    • The command-level test asserts the group exists in real status output.
  • Ordering.
    • fn[groups_order_by_decreasing_count_before_reference] asserts the order o/r#9, o/r#1, o/r#5. Count takes priority over text order, and the tie between o/r#1 and o/r#5 falls back to reference order.
    • The command-level test asserts that the group without an issue appears after the last issue group.
    • The verbose test also puts that group last when its count ties an issue group.
  • Selection.
    • tests/commands.rs#fn[verbose_status_lists_fixme_judgments_and_globs_scope_issue_groups] selects rules.case. The output keeps only that judgment’s issue group and excludes the other judgments and their issues.
    • It selects rules.unlinked. The output has only the group without an issue and contains no “affects” line.
  • --verbose.
    • The src/fixme.rs verbose test asserts that each judgment is listed with its kind, for example “- rules.both (requirement)”. It also asserts that the original FIXME strings appear, with o/r#1 repeated.
    • It asserts that non-verbose output omits the judgment names.
    • The command-level verbose test checks names, kinds, original strings and HTML escaping for both issue groups and the group without an issue.
  • Valid FIXME shown despite other failures.
    • tests/outcomes.rs#fn[fixme_does_not_hide_stale_inputs_or_uncovered_references] makes the outline input stale. The requirements.timeout row is Invalid, but status still shows example/io#125 and also shows the “outline input changed” finding.
    • fn[valid_fixme_remains_visible_in_status_info_and_book] covers the all-valid case. Status shows “affects 1 judgment” and no validation findings.
  • Malformed determinations stay validation errors.
    • fn[malformed_fixme_is_invalid_and_reports_the_required_shape] uses {"FIXME": []}. validate_repository reports “nonempty array”, the status row is Invalid, and no “affects” summary is produced.
    • Other malformed shapes belong to requirements.ci.outcomes, which this requirement only cites.

Assertions are specific. They check content, order and counts rather than merely running the code.

Inputs

Tests

Input 3: outline src/fixme.rs mod[tests]/fn[only_exact_issue_references_identify_issues]
  • File: src/fixme.rs
  • Selector: mod[tests]/fn[only_exact_issue_references_identify_issues]
  • Kind: fn
  • src/fixme.rs:194–233
    // {test}`requirements.cli.fixme_summary`
    #[test]
    fn only_exact_issue_references_identify_issues() {
        assert_eq!(
            issue_references(&strings(&[
                "owner/repo#7",
                "https://github.com/owner/repo/issues/7",
                "FIXME(owner/repo#8)",
                "See owner/repo#9 for details",
                "#7",
                "owner/repo#007",
            ])),
            BTreeSet::from(["owner/repo#7".to_owned()])
        );
        let mut summary = FixmeSummary::default();
        summary.add("rules.exact", "requirement", &strings(&["owner/repo#7"]));
        summary.add(
            "rules.url",
            "requirement",
            &strings(&["https://github.com/owner/repo/issues/7"]),
        );
        summary.add("rules.unqualified", "example", &strings(&["#7"]));
        summary.add("rules.zero", "example", &strings(&["owner/repo#007"]));
        let output = summary.render(true);
        assert_eq!(
            verbose_groups(&output),
            [
                ("`owner/repo#7`".to_owned(), strings(&["rules.exact"])),
                (
                    "FIXME without an issue".to_owned(),
                    strings(&["rules.url", "rules.unqualified", "rules.zero"])
                ),
            ],
            "{output}"
        );
        assert!(
            output.contains("- 3 judgments are marked FIXME without an issue\n"),
            "{output}"
        );
    }
Input 4: outline src/fixme.rs mod[tests]/fn[verbose_output_lists_each_judgment_under_every_group_it_belongs_to]
  • File: src/fixme.rs
  • Selector: mod[tests]/fn[verbose_output_lists_each_judgment_under_every_group_it_belongs_to]
  • Kind: fn
  • src/fixme.rs:235–282
    // {test}`requirements.cli.fixme_summary`
    #[test]
    fn verbose_output_lists_each_judgment_under_every_group_it_belongs_to() {
        let mut summary = FixmeSummary::default();
        summary.add(
            "rules.both",
            "requirement",
            &strings(&["o/r#1", "o/r#2", "o/r#1"]),
        );
        summary.add("rules.one", "example", &strings(&["o/r#1"]));
        summary.add("rules.none", "requirement", &strings(&["no issue yet"]));
        summary.add(
            "rules.also_none",
            "example",
            &strings(&["o/r#0 is not one"]),
        );
        let output = summary.render(true);
        assert_eq!(
            verbose_groups(&output),
            [
                ("`o/r#1`".to_owned(), strings(&["rules.both", "rules.one"])),
                ("`o/r#2`".to_owned(), strings(&["rules.both"])),
                (
                    "FIXME without an issue".to_owned(),
                    strings(&["rules.none", "rules.also_none"])
                ),
            ],
            "{output}"
        );
        for line in [
            "- `rules.both` (requirement)",
            "- `rules.one` (example)",
            "- `rules.also_none` (example)",
            "<pre><code>o/r#1\no/r#2\no/r#1</code></pre>",
        ] {
            assert!(output.contains(line), "{output}");
        }
        assert!(
            output.contains("- `o/r#1` — affects 2 judgments\n"),
            "{output}"
        );
        assert!(
            output.contains("- 2 judgments are marked FIXME without an issue\n"),
            "{output}"
        );
        // Without --verbose, only the counts appear.
        assert!(!summary.render(false).contains("rules.both"));
    }
Input 5: outline src/fixme.rs mod[tests]/fn[groups_order_by_decreasing_count_before_reference]
  • File: src/fixme.rs
  • Selector: mod[tests]/fn[groups_order_by_decreasing_count_before_reference]
  • Kind: fn
  • src/fixme.rs:284–306
    // {test}`requirements.cli.fixme_summary`
    #[test]
    fn groups_order_by_decreasing_count_before_reference() {
        // `o/r#9` sorts after `o/r#1` as text but affects more judgments, so
        // it comes first; `o/r#1` and `o/r#5` tie and fall back to reference
        // order.
        let mut summary = FixmeSummary::default();
        summary.add("rules.a", "requirement", &strings(&["o/r#9"]));
        summary.add("rules.b", "requirement", &strings(&["o/r#9"]));
        summary.add("rules.c", "requirement", &strings(&["o/r#9", "o/r#5"]));
        summary.add("rules.d", "example", &strings(&["o/r#1"]));
        let output = summary.render(false);
        let order: Vec<_> = output
            .lines()
            .filter(|line| line.starts_with("- `o/r#"))
            .map(|line| line.split('`').nth(1).unwrap().to_owned())
            .collect();
        assert_eq!(order, ["o/r#9", "o/r#1", "o/r#5"], "{output}");
        assert!(
            output.contains("- `o/r#9` — affects 3 judgments"),
            "{output}"
        );
    }
Input 6: outline tests/commands.rs fn[status_groups_fixme_judgments_by_distinct_exact_issue]
// {test}`requirements.cli.status`
// {test}`requirements.cli.fixme_summary`
#[test]
fn status_groups_fixme_judgments_by_distinct_exact_issue() {
    let temp = fixme_fixture();
    let output = habeas(temp.path(), &["status"]);
    assert!(output.status.success(), "{output:?}");
    let text = String::from_utf8(output.stdout).unwrap();
    let summaries: Vec<_> = text
        .lines()
        .filter(|line| line.contains("affects"))
        .collect();
    assert_eq!(summaries.len(), 4, "{text}");
    for (line, reference, count) in [
        (summaries[0], "example/app#123", "affects 2 judgments"),
        (summaries[1], "example/app#45", "affects 2 judgments"),
        (summaries[2], "Rust-Lang/rust#456", "affects 1 judgment"),
        (summaries[3], "rust-lang/rust#456", "affects 1 judgment"),
    ] {
        assert!(line.contains(reference) && line.contains(count), "{text}");
    }
    assert!(
        text.lines()
            .any(|line| line.contains("1 judgment") && line.contains("without an issue")),
        "{text}"
    );
    // Strings that are not exactly `owner/repo#N` name no issue.
    assert!(!text.contains("`#123`"), "{text}");
    assert!(!text.contains("github.com"), "{text}");
    assert!(
        text.find("without an issue").unwrap() > text.find(summaries[3]).unwrap(),
        "{text}"
    );
    for name in ["alpha", "beta", "case", "unlinked"] {
        assert!(!text.contains(&format!("rules.{name}")), "{text}");
    }

    let output = habeas(temp.path(), &["status", "--all"]);
    assert!(output.status.success(), "{output:?}");
    let all = String::from_utf8(output.stdout).unwrap();
    for name in ["alpha", "beta", "case", "unlinked"] {
        assert!(
            all.lines().any(
                |line| line.starts_with(&format!("| `rules.{name}`")) && line.contains("FIXME")
            ),
            "{all}"
        );
    }
    for summary in summaries {
        assert!(all.contains(summary), "{all}");
    }
}
Input 7: outline tests/commands.rs fn[verbose_status_lists_fixme_judgments_and_globs_scope_issue_groups]
  • File: tests/commands.rs
  • Selector: fn[verbose_status_lists_fixme_judgments_and_globs_scope_issue_groups]
  • Kind: fn
  • tests/commands.rs:346–400
// {test}`requirements.cli.status`
// {test}`requirements.cli.fixme_summary`
// {test}`requirements.references.definition_globs`
#[test]
fn verbose_status_lists_fixme_judgments_and_globs_scope_issue_groups() {
    let temp = fixme_fixture();
    let output = habeas(temp.path(), &["status", "--verbose"]);
    assert!(output.status.success(), "{output:?}");
    let text = String::from_utf8(output.stdout).unwrap();
    for name in ["alpha", "beta", "case", "unlinked"] {
        assert!(text.contains(&format!("rules.{name}")), "{text}");
    }
    for detail in [
        "requirement",
        "example",
        "#123 is not a qualified issue",
        "https://github.com/rust-lang/rust/issues/456",
        "Unlinked extra detail",
        "An unrelated note",
        "&lt;script&gt;alert(1)&lt;/script&gt;",
    ] {
        assert!(text.contains(detail), "{text}");
    }
    assert!(!text.contains("<script>"), "{text}");

    let output = habeas(temp.path(), &["status", "rules.case", "--verbose"]);
    assert!(output.status.success(), "{output:?}");
    let filtered = String::from_utf8(output.stdout).unwrap();
    assert!(
        filtered.contains("example/app#45") && filtered.contains("affects 1 judgment"),
        "{filtered}"
    );
    assert!(filtered.contains("rules.case"), "{filtered}");
    for excluded in [
        "rules.alpha",
        "rules.beta",
        "rules.unlinked",
        "example/app#123",
        "rust-lang/rust",
    ] {
        assert!(!filtered.contains(excluded), "{filtered}");
    }

    let output = habeas(temp.path(), &["status", "--verbose", "rules.unlinked"]);
    assert!(output.status.success(), "{output:?}");
    let unlinked = String::from_utf8(output.stdout).unwrap();
    assert!(unlinked.contains("rules.unlinked"), "{unlinked}");
    assert!(
        unlinked
            .lines()
            .any(|line| line.contains("1 judgment") && line.contains("without an issue")),
        "{unlinked}"
    );
    assert!(!unlinked.contains("affects"), "{unlinked}");
}
Input 8: outline tests/outcomes.rs fn[malformed_fixme_is_invalid_and_reports_the_required_shape]
// {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}");
}
Input 9: outline tests/outcomes.rs fn[fixme_does_not_hide_stale_inputs_or_uncovered_references]
// {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"))
    );
}
Input 10: outline tests/outcomes.rs fn[valid_fixme_remains_visible_in_status_info_and_book]
// {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"));
}

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.
:::

Other sources

Input 1: requirements selection requirements.cli.fixme_summary
:::{req} fixme_summary
`habeas status` MUST group the selected requirement and example judgments marked
FIXME by issue reference and report how many distinct judgments each issue
affects. A recorded FIXME string of the form `owner/repo#N` under
{cite}`requirements.ci.outcomes` MUST identify that issue, compared exactly; any
other string is a gap description without an issue.

A judgment MUST count at most once for each issue, even when that issue occurs
repeatedly or in several FIXME strings. A judgment naming several issues MUST
count in each corresponding group. Judgments with no issue string MUST be counted once in a separate "FIXME without an issue" group.
Issue groups MUST be ordered by decreasing affected-judgment count, then by
reference; the group without an issue MUST follow them. A supplied
selection MUST restrict these counts to the selected subjects.

`--verbose` MUST list the full name and kind of every judgment in each issue
group and in the group without an issue, along with its original FIXME strings.
The summary MUST include valid FIXME determinations even when other evidence
checks fail; grouping MUST NOT hide their validation findings. Malformed
determinations MUST remain validation errors under {cite}`requirements.ci.outcomes`.
:::