requirements.ci.fixme_without_issue
Requirements index · View definition
Example
The tests adequately check a requirement except for a platform-specific test gap recorded in the test source:
// :::{fixme} requirements.tasks.cancel // Cancellation races are not tested on Windows. // :::The reviewer records
{"FIXME": ["Cancellation races are not tested on Windows."]}, using the reference’s body without inventing an issue number. The rationale explains the gap and locates the comment in the recorded inputs. CI accepts the evidence when all other checks pass.![]()
Rationale
Example. requirements.ci.fixme_without_issue describes a concrete case. A {fixme} has no :github: option line, and its body reads “Cancellation races are not tested on Windows.” The expected outcome is a recorded determination of {"FIXME": ["<body words>"]} with no invented issue number. CI then accepts the evidence when all other checks pass.
Test. tests/outcomes.rs#fn[an_acknowledged_gap_without_an_issue_records_the_body_words] carries {test} references to the example and to requirements.ci.outcomes and requirements.ci.determination.
- Setup.
fixture()builds a repository with a valid requirement and example. The helperfixme(name, &[], body)writes a fenced{fixme}comment forrequirements.readywith no:github:lines. The body is split across two comment lines: “Cancellation races are not” and “ tested on Windows.“.judge_readywrites that source toreviewed.rs, adds it as a recorded input, and records the judgment. It then runshabeas::validate_repositoryand returns the errors. - Accepted outcome. The test records
{"FIXME": ["Cancellation races are not tested on Windows."]}. Checking this against the comment body joined by single spaces covers the “uses the body without inventing an issue” outcome. It assertserrors.is_empty(), which covers “CI accepts the evidence when all other checks pass” andrequirements.ci.determinationfor a FIXME judgment. - Rejected outcomes. The test records an invented issue,
"example/tasks#1", and a body with doubled whitespace. Each must produce an error containing “is neither an issue”. This checksrequirements.ci.outcomes: the strings must be the issue references or the body words joined by single spaces, and an invented issue number is not acceptable.
Not tested. The example’s statement that the rationale explains the gap and locates the comment is reviewer behavior. CI does not check it, and the test uses a fixed rationale. I do not count this as a test gap. The example uses a single-line body, while the test uses a multi-line body. That makes the test stricter, because it also checks that the lines are joined. The example’s requirement name (requirements.tasks.cancel) differs from the fixture’s (requirements.ready), but the scenario is the same.
I found no unchecked outcome and no assertion that contradicts the example.
Inputs
Tests
Input 4: outline tests/outcomes.rs fn[an_acknowledged_gap_without_an_issue_records_the_body_words]
- File:
tests/outcomes.rs - Selector:
fn[an_acknowledged_gap_without_an_issue_records_the_body_words] - Kind:
fn tests/outcomes.rs:283–314
// {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:?}"
);
}
}
Referenced definitions
Input 2: requirements selection requirements.ci.outcomes
requirements.ci.outcomes:md/requirements/ci.md:112–149
:::{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
requirements.ci.determination:md/requirements/ci.md:19–21
:::{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_without_issue
requirements.ci.fixme_without_issue:md/requirements/ci.md:405–422
:::{example} fixme_without_issue
The tests adequately check a requirement except for a platform-specific
test gap recorded in the test source:
```text
// :::{fixme} requirements.tasks.cancel
// Cancellation races are not tested on Windows.
// :::
```
The reviewer records
`{"FIXME": ["Cancellation races are not tested on Windows."]}`, using the
reference's body without inventing an issue number. The rationale explains the gap and
locates the comment in the recorded inputs. CI accepts the evidence when all
other checks pass.
{cite}`requirements.ci.outcomes`
{cite}`requirements.ci.determination`
:::
Input 5: outline tests/outcomes.rs fn[fixme]
- File:
tests/outcomes.rs - Selector:
fn[fixme] - Kind:
fn tests/outcomes.rs:17–26
/// 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
}
Input 6: outline tests/outcomes.rs fn[judge_ready]
- File:
tests/outcomes.rs - Selector:
fn[judge_ready] - Kind:
fn tests/outcomes.rs:170–186
/// 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
}
Input 7: outline tests/outcomes.rs fn[fixture]
- File:
tests/outcomes.rs - Selector:
fn[fixture] - Kind:
fn tests/outcomes.rs:28–92
/// 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
}