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.index.file_map.minimum

Requirements index · View definition

evidence Valid

Requirement

Each directory group under cite requirements.test-coverage.index.file_map.directories MUST display the minimum measured file coverage percentage within its directory, including descendant directories.

For the combined gaps overview, the minimum MUST consider all current first-party Rust files represented by the map within that directory, including files hidden because they have no unsatisfied obligations. The minimum MUST use the file coverage fractions of cite requirements.test-coverage.index.file_map before rounding for display, regardless of which groups are expanded. Its label MUST identify it as the minimum measured file coverage. Not-measured and unavailable files MUST NOT contribute a percentage. A group with no measured files MUST show no numerical minimum.

Rationale

I found no adequacy gap in the tests for requirements.test-coverage.index.file_map.minimum. I judged this from the supplied test sources only and did not request implementation source.

Obligations and the tests that cover them

  • Minimum shown per directory group, including descendants.
    • src/execution_coverage/book.rs#mod[tests]/fn[directory_minima_use_exact_fractions_and_count_unmeasured_descendants] renders src/a.rs at 1/2, src/nested/b.rs at 1/4 and src/nested/c.rs as not measured. It asserts that both src and src/nested show Minimum measured file coverage: and 25.0%. This is the index.file_map.minimum.descendants example.
    • In the same test, a nested measured-zero case makes src show 0.0%.
  • Hidden files count in the combined overview. src/execution_coverage/book.rs#mod[tests]/fn[combined_directory_minimum_includes_hidden_passing_files] hides src/nested/passing.rs (4/5, with no unsatisfied obligation) behind visible files at 95% and 100%. It asserts that the src summary carries data-min-covered="4" data-min-instrumented="5" and 80.0%. It also asserts that the passing file has no row. The src minimum is therefore driven by a hidden descendant file. Each of the three groups also shows the Minimum measured file coverage: label.
  • Exact fractions before rounding. directory_minima_use_exact_fractions_and_count_unmeasured_descendants compares 501/1000 with 1001/2000. It asserts that the minimum carries data-min-covered="1001" and data-min-instrumented="2000", so the lower file wins on its exact fraction.
  • Independent of which groups are expanded.
    • The same test replaces open with a closed src/nested group and checks that every summary is unchanged. It does this for several nested directory layouts, and it also checks that file cards and sibling group state are unchanged.
    • In the hidden-file test, the minimum is correct while the passing file is hidden.
  • Label. Minimum measured file coverage: is asserted for every summary in the tests above.
  • Not-measured files add no percentage, and a group with no measured files shows no numeric minimum. directory_minima_use_exact_fractions_and_count_unmeasured_descendants has two cases:
    • A lone not-measured file gives No measured files, 1 not measured and no % in the summary.
    • A nested group holding only an unmeasured file does the same, while its parent still shows 0.0% from the measured-zero file. The unmeasured file does not pull the minimum to 0 or add a percentage of its own.
  • Unavailable coverage contributes no percentage. src/execution_coverage/book.rs#mod[tests]/fn[incomplete_attempts_do_not_label_their_files_as_unmeasured_in_a_partial_map] covers two cases: an unavailable attempt and a stale selected attempt. In both, the map has no data-file=, no class="gap-directory", no data-min-covered= and no “not measured” text. No unavailable file therefore contributes a number.
  • Overview integration. src/execution_coverage/check.rs#mod[tests]/fn[book_verdict_and_gaps_follow_the_native_policy_and_current_reviews] exercises the real overview, including 80.0% and the unavailable state, as a secondary check.

Residual observations

  • The tests assert the displayed text of the exact-fraction case only through its data-min-* attributes. This is not a gap, because the other tests assert displayed percentages for the same rendering path.
  • Unavailable status is tested only as a whole-map state. The tests do not cover a mix of unavailable and measured files within one map. I derived no requirement for that mixed case, because the text says unavailable files “MUST NOT contribute a percentage”, and the tests show the map withholding every number in that situation.

Every obligation in the subject text has a test that exercises it and asserts the outcome, and the tests carry {test} references to the subject.

Inputs

Tests

Input 4: requirements selection requirements.test-coverage.index.file_map.minimum.descendants
:::{example} index.file_map.minimum.descendants
A map lists `src/a.rs` with 1 of 2 instrumented lines covered,
`src/nested/b.rs` with 1 of 4 covered, and `src/nested/c.rs` as not measured.
Both the `src` and `src/nested` groups show a minimum measured file coverage
of 25% and one not-measured file, including while collapsed.
{test}`requirements.test-coverage.index.file_map.minimum`
{test}`requirements.test-coverage.index.file_map.minimum.statuses`
:::
Input 5: outline src/execution_coverage/book.rs mod[tests]/fn[combined_directory_minimum_includes_hidden_passing_files]
    // {test}`requirements.test-coverage.index.file_map.combined`
    // {test}`requirements.test-coverage.index.file_map.directories.initial`
    // {test}`requirements.test-coverage.index.file_map.directories.data`
    // {test}`requirements.test-coverage.index.file_map.minimum`
    // {test}`requirements.test-coverage.index.gaps.summary`
    // {test}`requirements.test-coverage.index.file_map.directories`
    #[test]
    fn combined_directory_minimum_includes_hidden_passing_files() {
        let (temp, mut book) = fixture();
        let root = temp.path();
        fs::create_dir_all(root.join("src/nested/deep")).unwrap();
        fs::write(
            root.join("src/gap.rs"),
            format!("fn gap() {{\n{}}}\n", " let value = 1;\n".repeat(18)),
        )
        .unwrap();
        fs::write(
            root.join("src/nested/passing.rs"),
            "fn passing() {\n let a = 1;\n let b = 2;\n let c = 3;\n}\n",
        )
        .unwrap();
        fs::write(root.join("src/nested/deep/gap.rs"), "fn nested_gap() {}\n").unwrap();
        let path = record(root, "all", 1, "same", &[(1, 0), (2, 1)]);
        let run_path = path.parent().unwrap().parent().unwrap().join("run.json");
        let mut run: Run = load(&run_path).unwrap();
        let mut attempt: Attempt = load(&path.join("attempt.json")).unwrap();
        for (file, total, covered, count) in [
            ("src/gap.rs", 20, 19, 0),
            ("src/nested/passing.rs", 5, 4, 1),
            ("src/nested/deep/gap.rs", 1, 1, 0),
        ] {
            run.sources
                .insert(file.into(), fs::read_to_string(root.join(file)).unwrap());
            attempt.processes[0].lines.insert(
                file.into(),
                (1..=total)
                    .map(|line| (line, u64::from(line <= covered)))
                    .collect(),
            );
            attempt.processes[0].functions.as_mut().unwrap().push(
                super::super::FunctionExecution {
                    file: file.into(),
                    line: 1,
                    column: 1,
                    count,
                },
            );
        }
        save(&run_path, &run).unwrap();
        save(&path.join("attempt.json"), &attempt).unwrap();
        populate(&mut book, root).unwrap();
        let overview = &book.chapters().next().unwrap().content;
        let map = map_html(overview);
        assert!(map.contains("data-directory=\"src\" open"));
        assert!(map.contains("data-min-covered=\"4\" data-min-instrumented=\"5\">80.0%"));
        assert!(map.contains("2 uncovered obligations"));
        for (directory, expected) in [("src", 2), ("src/nested", 1), ("src/nested/deep", 1)] {
            let summary = directory_summary(map, directory);
            assert!(summary.contains(&format!("{expected} uncovered obligations")));
            assert!(summary.contains("Minimum measured file coverage:"));
        }
        assert_directory_contents(map, "src", &["src/nested"], &["src/gap.rs"]);
        assert_directory_contents(map, "src/nested", &["src/nested/deep"], &[]);
        assert_directory_contents(map, "src/nested/deep", &[], &["src/nested/deep/gap.rs"]);
        for directory in ["src", "src/nested", "src/nested/deep"] {
            assert!(map.contains(&format!("data-directory=\"{directory}\" open")));
        }
        assert!(map.contains("data-file=\"code.rs\""));
        assert!(
            map.find("data-file=\"code.rs\"").unwrap()
                < map.find("<details class=\"gap-directory\"").unwrap(),
            "root file rows are outside directory controls"
        );
        assert_eq!(map.matches("data-file=").count(), 3);
        assert!(map.contains("data-file=\"src/gap.rs\""));
        assert!(map.contains("95.0%"));
        assert!(file_card(map, "src/gap.rs").contains("<code>src/gap.rs</code>"));
        assert!(map.contains("zero execution"));
        assert!(!map.contains("data-file=\"src/nested/passing.rs\""));
        assert!(
            book.chapters()
                .all(|chapter| chapter.name != "File notes: src/nested/passing.rs")
        );
        assert!(overview.contains("1 file obligations · 3 function obligations"));
    }
Input 6: outline src/execution_coverage/book.rs mod[tests]/fn[incomplete_attempts_do_not_label_their_files_as_unmeasured_in_a_partial_map]
    // {test}`requirements.test-coverage.index.file_map`
    // {test}`requirements.test-coverage.index.file_map.table`
    // {test}`requirements.test-coverage.index.file_map.combined`
    // {test}`requirements.test-coverage.index.file_map.combined.measurement`
    // {test}`requirements.test-coverage.index.freshness`
    // {test}`requirements.test-coverage.index.file_map.minimum`
    // {test}`requirements.test-coverage.index.file_map.minimum.statuses`
    #[test]
    fn incomplete_attempts_do_not_label_their_files_as_unmeasured_in_a_partial_map() {
        let (temp, book) = fixture();
        let root = temp.path();
        fs::create_dir_all(root.join("src/nested")).unwrap();
        fs::write(root.join("src/nested/other.rs"), "fn other() {}\n").unwrap();
        let good = record(root, "good", 1, "a", &[(1, 1)]);
        let bad = record(root, "bad", 2, "a", &[]);
        let mut attempt: Attempt = load(&bad.join("attempt.json")).unwrap();
        attempt.processes[0].lines =
            BTreeMap::from([("src/nested/other.rs".into(), BTreeMap::from([(1, 1)]))]);
        save(&bad.join("attempt.json"), &attempt).unwrap();
        for path in [&good, &bad] {
            let run_path = path.parent().unwrap().parent().unwrap().join("run.json");
            let mut run: Run = load(&run_path).unwrap();
            run.sources
                .insert("src/nested/other.rs".into(), "fn other() {}\n".into());
            save(&run_path, &run).unwrap();
        }
        fs::remove_file(bad.join("1-1.profraw")).unwrap();
        let mut partial = book.clone();
        populate(&mut partial, root).unwrap();
        let index = &partial.chapters().next().unwrap().content;
        assert!(index.contains("Coverage unavailable"));
        assert!(!map_html(index).contains("data-file="));
        assert!(!map_html(index).contains("not measured"));
        assert!(!map_html(index).contains("class=\"gap-directory\""));
        assert!(!map_html(index).contains("data-min-covered="));
        assert!(!map_html(index).contains("gap-coverage-bar\""));
        assert!(index.contains("1 unavailable test attempts"));
        // A stale selected attempt leaves the same unknown per-file state.
        let run_path = bad.parent().unwrap().parent().unwrap().join("run.json");
        let mut run: Run = load(&run_path).unwrap();
        run.inputs
            .insert("missing-build-input".into(), "old-hash".into());
        save(&run_path, &run).unwrap();
        let mut stale = book;
        populate(&mut stale, root).unwrap();
        let index = &stale.chapters().next().unwrap().content;
        assert!(index.contains("Coverage unavailable"));
        assert!(!map_html(index).contains("data-file="));
        assert!(!map_html(index).contains("class=\"gap-directory\""));
        assert!(!map_html(index).contains("data-min-covered="));
        assert!(!map_html(index).contains("not measured"));
        assert!(index.contains("1 stale test attempts"));
    }
Input 7: outline src/execution_coverage/book.rs mod[tests]/fn[directory_minima_use_exact_fractions_and_count_unmeasured_descendants]
    // {test}`requirements.test-coverage.index.file_map.minimum`
    // {test}`requirements.test-coverage.index.file_map.minimum.statuses`
    // {test}`requirements.test-coverage.index.file_map.minimum.descendants`
    // {test}`requirements.test-coverage.index.file_map.directories`
    // {test}`requirements.test-coverage.index.file_map.directories.data`
    #[test]
    fn directory_minima_use_exact_fractions_and_count_unmeasured_descendants() {
        let render = |files: &[(&str, usize, usize)]| {
            let mut policy = super::super::check::PolicyReport {
                report: super::super::check::CheckReport {
                    passed: false,
                    text: String::new(),
                },
                files: files
                    .iter()
                    .map(|&(file, covered, total)| super::super::check::FilePolicy {
                        file: file.into(),
                        covered,
                        total,
                        obligations: vec![super::super::check::Obligation {
                            selector: String::new(),
                            line: 1,
                            measurement: "below target".into(),
                            exception: None,
                        }],
                    })
                    .collect(),
                counts_complete: true,
                measured: true,
                findings: vec![],
            };
            // Unlisted files with no obligations or accepted exceptions must
            // not inflate the directory's not-measured count.
            for (file, accepted) in [
                ("src/nested/hidden-empty.rs", false),
                ("src/nested/hidden-accepted.rs", true),
            ] {
                policy.files.push(super::super::check::FilePolicy {
                    file: file.into(),
                    covered: 0,
                    total: 0,
                    obligations: if accepted {
                        vec![super::super::check::Obligation {
                            selector: String::new(),
                            line: 1,
                            measurement: "not measured".into(),
                            exception: Some(super::super::check::Exception {
                                accepted: true,
                                review_missing: false,
                                justification: "No instrumented obligations.".into(),
                                findings: vec![],
                            }),
                        }]
                    } else {
                        vec![]
                    },
                });
            }
            gaps_map(&policy, Path::new("coverage.md"), 1)
        };
        let map = render(&[("src/higher.rs", 501, 1000), ("src/lower.rs", 1001, 2000)]);
        assert!(
            directory_summary(&map, "src")
                .contains("data-min-covered=\"1001\" data-min-instrumented=\"2000\"")
        );
        let map = render(&[
            ("src/a.rs", 1, 2),
            ("src/nested/b.rs", 1, 4),
            ("src/nested/c.rs", 0, 0),
        ]);
        for directory in ["src", "src/nested"] {
            let summary = directory_summary(&map, directory);
            assert!(summary.contains("Minimum measured file coverage:"));
            assert!(summary.contains("25.0%"));
            assert!(summary.contains("1 not measured"));
            assert!(!summary.contains("0 unavailable"));
            assert!(!summary.contains("2 not measured"));
        }
        assert_directory_contents(&map, "src", &["src/nested"], &["src/a.rs"]);
        assert_directory_contents(
            &map,
            "src/nested",
            &[],
            &["src/nested/b.rs", "src/nested/c.rs"],
        );
        // Changing one native details control only changes its open attribute;
        // all file identities, measurements, summaries and sibling state remain.
        let opening = "<details class=\"gap-directory\" data-directory=\"src/nested\" open>";
        let closed_opening = opening.replace(" open>", ">");
        let closed = map.replace(opening, &closed_opening);
        assert_ne!(closed, map);
        assert!(closed.contains("data-directory=\"src\" open>"));
        assert!(closed.contains("data-directory=\"src/nested\">"));
        assert_eq!(
            directory_group(&closed, "src/nested")
                .split_once('>')
                .unwrap()
                .1,
            directory_group(&map, "src/nested")
                .split_once('>')
                .unwrap()
                .1
        );
        for file in ["src/a.rs", "src/nested/b.rs", "src/nested/c.rs"] {
            assert_eq!(file_card(&map, file), file_card(&closed, file));
        }
        assert_eq!(closed.replace(&closed_opening, opening), map);
        let map = render(&[("src/unknown.rs", 0, 0)]);
        let summary = directory_summary(&map, "src");
        assert!(summary.contains("No measured files"));
        assert!(summary.contains("1 not measured"));
        assert!(!summary.contains('%'));
        let map = render(&[
            ("src/measured-zero.rs", 0, 4),
            ("src/nested/unmeasured.rs", 0, 0),
        ]);
        let summary = directory_summary(&map, "src");
        assert!(summary.contains("Minimum measured file coverage:"));
        assert!(summary.contains("0.0%"));
        assert!(summary.contains("1 not measured"));
        assert!(!summary.contains("2 not measured"));
        let zero = file_card(&map, "src/measured-zero.rs");
        assert!(zero.contains("data-status=\"measured\""));
        assert!(zero.contains("0.0%"));
        assert!(zero.contains("0/4 instrumented lines covered"));
        assert!(!zero.contains("not measured"));
        let nested = directory_summary(&map, "src/nested");
        assert!(nested.contains("No measured files"));
        assert!(nested.contains("1 not measured"));
        assert!(!nested.contains('%'));
        let map = render(&[
            ("src/direct.rs", 0, 0),
            ("src/nested/a.rs", 0, 0),
            ("src/nested/deep/b.rs", 0, 0),
            ("src/nested/deep/c.rs", 0, 0),
            ("src/sibling/d.rs", 0, 0),
            ("src/measured-zero.rs", 0, 4),
            ("src/positive.rs", 1, 4),
            ("src-other/outside.rs", 0, 0),
        ]);
        for (directory, count) in [
            ("src", 5),
            ("src/nested", 3),
            ("src/nested/deep", 2),
            ("src/sibling", 1),
            ("src-other", 1),
        ] {
            let summary = directory_summary(&map, directory);
            assert!(
                summary.contains(&format!(" · {count} not measured")),
                "{summary}"
            );
        }
        assert!(directory_summary(&map, "src").contains("0.0%"));
        let closed = map.replace(
            "<details class=\"gap-directory\" data-directory=\"src/nested\" open>",
            "<details class=\"gap-directory\" data-directory=\"src/nested\">",
        );
        for directory in [
            "src",
            "src/nested",
            "src/nested/deep",
            "src/sibling",
            "src-other",
        ] {
            assert_eq!(
                directory_summary(&closed, directory)
                    .split_once('>')
                    .unwrap()
                    .1,
                directory_summary(&map, directory)
                    .split_once('>')
                    .unwrap()
                    .1
            );
        }
    }
Input 8: outline src/execution_coverage/check.rs mod[tests]/fn[book_verdict_and_gaps_follow_the_native_policy_and_current_reviews]
    // {test}`requirements.test-coverage.index.gaps`
    // {test}`requirements.test-coverage.index.gaps.summary`
    // {test}`requirements.test-coverage.index.gaps.details`
    // {test}`requirements.test-coverage.index.gaps.details.initial`
    // {test}`requirements.test-coverage.index.gaps.explanations`
    // {test}`requirements.test-coverage.index.gaps.accepted`
    // {test}`requirements.test-coverage.index.file_map.combined`
    // {test}`requirements.test-coverage.index.file_map.combined.measurement`
    // {test}`requirements.test-coverage.index.file_map.minimum`
    // {test}`requirements.test-coverage.index.file_map.combined.details`
    #[test]
    fn book_verdict_and_gaps_follow_the_native_policy_and_current_reviews() {
        use mdbook_preprocessor::book::{Book, Chapter};
        let source = "fn a() {}\n\n/// Invariant fallback, unreachable through the public API.\n// {cite}`habeas:coverage`\nfn b() {}\n";
        let temp = fixture(source);
        let root = temp.path();
        let mut p = process(root, &[(1, 1), (2, 1), (3, 1), (4, 1), (5, 0)], 0);
        p.functions.as_mut().unwrap()[0].count = 0;
        let path = record(root, "both", 1, "same", vec![p]);
        let render = || {
            let mut book = Book::new();
            book.push_item(Chapter::new(
                "Requirements index",
                "# Requirements index\n".into(),
                "requirements-index.md",
                vec![],
            ));
            book::populate_in(
                &mut book,
                root,
                Some(root.join("target")),
                Path::new("requirements-index.md"),
            )
            .unwrap();
            book.chapters()
                .find(|chapter| chapter.name == "Coverage gaps")
                .unwrap()
                .content
                .clone()
        };
        let missing = render();
        exercise_file_click(&missing);
        let permitted_details = regex::Regex::new(r#"<details class="([^"]+)""#).unwrap();
        let assert_details = |html: &str| {
            for tag in permitted_details.captures_iter(html) {
                assert!(
                    matches!(
                        &tag[1],
                        "gap-directory" | "gap-explanation" | "gap-accepted-group" | "gap-footer"
                    ),
                    "unexpected expandable section: {}",
                    &tag[1]
                );
            }
            assert!(!html.contains("Test runs and provenance"));
            assert!(!html.contains("habeas-coverage-test"));
        };
        assert_details(&missing);
        let unresolved_rows = missing
            .split("class=\"gap-obligation-table\"")
            .nth(1)
            .unwrap()
            .split("</tbody></table>")
            .next()
            .unwrap();
        for row in [
            "<code>fn[a]</code><br><span class=\"gap-meta\">code.rs:1</span></td><td>zero execution</td>",
            "<code>fn[b]</code><br><span class=\"gap-meta\">code.rs:5</span></td><td>zero execution</td>",
        ] {
            assert!(unresolved_rows.contains(row));
        }

        assert!(!report(root).passed);
        assert!(missing.contains("CI would fail"));
        assert!(missing.contains("2 unresolved gaps"));
        assert!(missing.contains("0 file obligations · 2 function obligations"));
        assert!(missing.contains("Missing habeas:coverage proposal"));
        assert!(missing.contains("Review missing"));
        assert!(missing.contains("Invariant fallback, unreachable through the public API."));
        assert!(missing.contains("aria-expanded=\"false\""));
        assert!(missing.contains("class=\"gap-detail-row\" id=\"habeas-gap-file-0\" hidden"));
        assert!(missing.contains("code.rs:1"));
        assert!(missing.contains("code.rs:5"));
        reviews(root, json!(true));
        let accepted = render();
        assert_details(&accepted);
        assert!(accepted.contains("1 unresolved gaps"));
        assert!(accepted.contains("Documented gaps — 1 accepted exceptions"));
        assert!(!accepted.contains("class=\"gap-accepted-group\" open"));
        assert!(accepted.contains("fn[b]"));
        assert!(accepted.contains("current and accepted"));
        let documented = accepted
            .split("class=\"gap-accepted-group\"")
            .nth(1)
            .unwrap()
            .split("class=\"gap-footer\"")
            .next()
            .unwrap();
        for field in [
            "fn[b]",
            "code.rs:5",
            "zero execution",
            "Invariant fallback, unreachable through the public API.",
            "current and accepted",
            "Current workspace source notes",
            "coverage-reports/files/",
        ] {
            assert!(
                documented.contains(field),
                "missing documented field: {field}"
            );
        }
        assert!(accepted.contains("80.0%")); // Accepted exceptions add no execution.
        reviews(root, json!(false));
        let rejected = render();
        assert_details(&rejected);
        assert!(
            rejected.contains("<details class=\"gap-footer\"><summary>Coverage-check findings")
        );
        assert!(rejected.contains("2 unresolved gaps"));
        assert!(rejected.contains("Review not accepted"));
        assert!(rejected.contains("determination is false"));
        assert!(rejected.contains("Documented gaps — 0 accepted exceptions"));
        reviews(root, json!(true));
        let mut attempt: Attempt = load(&path.join("attempt.json")).unwrap();
        for entry in attempt.processes[0].functions.as_mut().unwrap() {
            entry.count = 1;
        }
        save(&path.join("attempt.json"), &attempt).unwrap();
        let covered = render();
        assert!(report(root).passed);
        assert!(covered.contains("CI would pass"));
        assert!(covered.contains("0 unresolved gaps"));
        assert!(!covered.contains("data-file=\"code.rs\""));
        assert!(covered.contains("Documented gaps — 0 accepted exceptions"));
        fs::remove_file(path.join("profile.profraw")).unwrap();
        let unavailable = render();
        assert!(!report(root).passed);
        assert!(unavailable.contains("CI would fail"));
        assert!(unavailable.contains("gap counts unavailable"));
        assert!(!unavailable.contains("0 unresolved gaps"));
        assert!(
            !unavailable
                .split("</section>")
                .next()
                .unwrap()
                .contains("zero execution")
        );
        assert!(unavailable.contains("missing or unreadable coverage"));
        fs::write(
            root.join("code.rs"),
            "fn a() {}\n// {cite}`habeas:coverage`\nfn b() {}\n",
        )
        .unwrap();
        record(
            root,
            "both",
            2,
            "same",
            vec![process(root, &[(1, 1), (2, 1), (3, 1)], 0)],
        );
        let no_justification = render();
        assert!(no_justification.contains("No tracked justification is present."));
        // File-level and function-level obligations share the same file control
        // and must both expose their source, measurement and explanation.
        record(
            root,
            "both",
            3,
            "same",
            vec![process(root, &[(1, 1), (2, 0), (3, 0)], 0)],
        );
        let below_target = render();
        exercise_file_click(&below_target);
        let rows = below_target
            .split("class=\"gap-obligation-table\"")
            .nth(1)
            .unwrap()
            .split("</tbody></table>")
            .next()
            .unwrap();
        assert!(
            rows.contains("<code>File root</code><br><span class=\"gap-meta\">code.rs:1</span>")
        );
        assert!(rows.contains("1/3 (33.3%); 80% target; uncovered lines: 2-3"));
        assert!(rows.contains("Missing habeas:coverage proposal"));
        assert!(rows.contains("<code>fn[a]</code>"));
        assert!(rows.contains("<code>fn[b]</code>"));
        assert_details(&below_target);
    }

Referenced definitions

Input 2: requirements selection requirements.test-coverage.index.file_map.directories
:::{req} index.file_map.directories
The table of {cite}`requirements.test-coverage.index.file_map.table` MUST group
its listed files by their directory hierarchy. Each non-root directory
containing a listed file, directly or through descendants, MUST have a group.
Each group MUST be independently expandable and collapsible.

A collapsed group MUST show its workspace-relative path and the summaries
required by {cite}`requirements.test-coverage.index.file_map.minimum` and
{cite}`requirements.test-coverage.index.file_map.minimum.statuses`, while
hiding its file rows and descendant groups.
:::
Input 3: requirements selection requirements.test-coverage.index.file_map
:::{req} index.file_map
A file coverage map MUST identify each file by its workspace-relative path and
show its covered and instrumented line counts and percentage. These counts MUST
use the union rule of {cite}`requirements.test-coverage.index.summary`,
restricted to the file and the records represented by that map, including
associated child processes. The map MUST visually distinguish coverage levels
while also displaying percentages as text. The percentage MUST describe the
map's recorded instrumented lines, rather than all physical source lines.

A listed file with instrumented lines but no positive execution counts MUST
show 0%. A listed file with no recorded instrumented lines in otherwise usable
coverage MUST show "not measured" without a percentage. Coverage whose
completeness cannot be established MUST be identified as unavailable rather
than as 0% or "not measured".
:::

Other sources

Input 1: requirements selection requirements.test-coverage.index.file_map.minimum
:::{req} index.file_map.minimum
Each directory group under
{cite}`requirements.test-coverage.index.file_map.directories` MUST display the
minimum measured file coverage percentage within its directory, including
descendant directories.

For the combined gaps overview, the minimum MUST consider all current
first-party Rust files represented by the map within that directory,
including files hidden because they have no unsatisfied obligations.
The minimum MUST use the file coverage fractions of
{cite}`requirements.test-coverage.index.file_map` before rounding for display,
regardless of which groups are expanded. Its label MUST identify it as the
minimum measured file coverage. Not-measured and unavailable files MUST NOT
contribute a percentage. A group with no measured files MUST show no numerical
minimum.
:::