requirements.ci.fixme_stale_input
Requirements index · View definition
Example
A current evidence record has
{"FIXME": ["example/queue#125"]}and passes CI. The code in one of its recorded outline inputs then changes. CI rejects the record because the input’s hash no longer matches, even though its determination is still FIXME. Validation reports the changed input without running a model or reassessing the documented gap.![]()
Rationale
Verdict: the tests adequately check requirements.ci.fixme_stale_input.
Scenario. The example describes a current FIXME record that passes CI. A recorded outline input then changes. CI rejects the record for the changed hash, even though the determination is still FIXME. Validation reports the changed input without running a model or reassessing the gap.
Main test. tests/outcomes.rs#fn[fixme_does_not_hide_stale_inputs_or_uncovered_references] carries the {test} reference. It builds the shared fixture().
- The fixture has
requirements.timeoutas an example judged{"FIXME": ["example/io#125", "rust-lang/rust#123"]}. - A
{fixme}inobserved.rsnames both issues. - The record’s single recorded input is the outline input
observed.rswith an empty item, which is the root node. - Another test,
fixme_does_not_excuse_missing_or_malformed_evidence, asserts that this fixture validates with no errors. That establishes the “current record that passes CI” precondition.
Outcomes checked.
- Change and rejection. The test edits the code in
observed.rs(= 1;becomes= 2;) and leaves the record’s FIXME determination untouched. It asserts thatvalidate_repositoryreturns an error containingoutline input changed: observed.rs <root>. This is the hash-mismatch rejection the example describes, and it is reported even though the determination is still FIXME. - Not a model or gap reassessment.
validate_repositoryis called directly on the fixture, with no model involved. The reported error is the changed outline input. - Status. The test also asserts that the status row for
requirements.timeoutshowsInvalid. The FIXME issue and the “outline input changed” finding both appear in the status output.
Supporting test. tests/evidence_boundaries.rs#fn[outline_inputs_survive_moves_and_unhashed_comments_but_not_edits] also carries a {test} reference. It checks the requirements.ci.outline_inputs side: an edit makes the input stale with the message “outline input changed: file selector (now lines …) no longer has the recorded hash”. Moves and unhashed comment edits do not make it stale.
Cited requirements.
requirements.ci.determination: the record stays FIXME, and the stale-input error is still reported.requirements.ci.outline_inputs: the hash comparison is exercised in both tests.
Gaps. I found none. A passing FIXME record becoming invalid after an input change is both exercised and asserted. The “no model” clause cannot fail in an in-process validator that takes no model, so it needs no separate test.
Inputs
Tests
Input 4: outline tests/evidence_boundaries.rs fn[outline_inputs_survive_moves_and_unhashed_comments_but_not_edits]
- File:
tests/evidence_boundaries.rs - Selector:
fn[outline_inputs_survive_moves_and_unhashed_comments_but_not_edits] - Kind:
fn tests/evidence_boundaries.rs:64–182
// {test}`requirements.ci.outline_inputs`
// {test}`requirements.ci.input_containment`
// {test}`requirements.ci.diagnostics`
// {test}`requirements.ci.schema`
// {test}`requirements.ci.fixme_stale_input`
// {test}`requirements.references.selector_raw_lines`
// {test}`requirements.references.structural_hash`
#[test]
fn outline_inputs_survive_moves_and_unhashed_comments_but_not_edits() {
let temp = fixture();
let root = temp.path().join("project");
// Citation reviews of the cited functions are checked elsewhere.
let errors = |inputs: Vec<Value>| {
write_inputs(&root, inputs);
without_citation_reviews(validate_repository(&root).unwrap().errors).join("\n")
};
let rust = "// {cite}`rules.ready`\nfn alpha() { work(1); }\n\n/// Docs.\n// {cite}`rules.ready`\n#[allow(dead_code)]\nfn beta() {}\n";
fs::write(root.join("src/lib.rs"), rust).unwrap();
let inputs = vec![
outline(&root, "src/lib.rs", "fn[alpha]"),
outline(&root, "src/lib.rs", "fn[beta]"),
habeas::outline_inputs_for_lines(&root, "data.txt", 2, 2)
.unwrap()
.remove(0),
];
assert_eq!(errors(inputs.clone()), "");
// Moving nodes and lines, and editing unhashed comments, keeps inputs valid.
fs::write(
root.join("src/lib.rs"),
format!("// {{cite}}`rules.ready` moved below a new line\n\n{rust}")
.replace("fn alpha() { work(1); }", "fn alpha() {\n work(1);\n}"),
)
.unwrap();
fs::write(root.join("data.txt"), "zero\nfirst\nsecond\n").unwrap();
assert_eq!(errors(inputs.clone()), "");
// Editing another node must not invalidate beta's recorded input.
fs::write(root.join("src/lib.rs"), rust.replace("work(1)", "work(2)")).unwrap();
assert_eq!(errors(vec![inputs[1].clone()]), "");
// Editing a node's code or its doc comment makes the input stale, naming the
// file, selector, and current line range.
fs::write(
root.join("src/lib.rs"),
rust.replace("work(1)", "work(2)")
.replace("/// Docs.", "/// Changed docs."),
)
.unwrap();
let found = errors(inputs.clone());
for expected in [
"inputs[0]: outline input changed: src/lib.rs fn[alpha] (now lines 1-2) no longer has the recorded hash",
"inputs[1]: outline input changed: src/lib.rs fn[beta] (now lines 4-7) no longer has the recorded hash",
] {
assert!(found.contains(expected), "missing {expected:?}: {found}");
}
assert!(!found.contains("inputs[2]"), "{found}");
assert!(!found.contains("work(2)"), "no diff: {found}");
// An edited plain-text line is a different node.
fs::write(root.join("data.txt"), "first\nchanged\n").unwrap();
let found = errors(inputs[2..].to_vec());
assert!(
found.contains("data.txt: no outline node matches \"line@"),
"{found}"
);
fs::write(
root.join("src/lib.rs"),
"// {cite}`rules.ready`\n#[cfg(a)]\nfn dup() {}\n// {cite}`rules.ready`\n#[cfg(b)]\nfn dup() {}\n",
)
.unwrap();
let hash = "0".repeat(64);
for (input, expected) in [
(
json!({"file":"src/lib.rs", "item":"fn[missing]", "hash":hash}),
"src/lib.rs: no outline node matches \"fn[missing]\"",
),
(
json!({"file":"src/lib.rs", "item":"fn[dup]", "hash":hash}),
"src/lib.rs: outline selector \"fn[dup]\" is ambiguous",
),
(
json!({"file":"src/lib.rs", "item":"fn[unclosed", "hash":hash}),
"src/lib.rs: invalid outline selector \"fn[unclosed\"",
),
(
json!({"file":"src/lib.rs", "item":"fn[dup]#2", "hash":"ABC"}),
"hash must be a lowercase hexadecimal SHA-256 digest",
),
(
json!({"file":"missing.txt", "item":"", "hash":hash}),
"cannot open missing.txt",
),
(
json!({"file":"data.txt", "line_start":1, "line_end":1, "text":["first"]}),
"unexpected field \"line_start\"",
),
(
json!({"rust_file":"src/lib.rs", "rust_item":"fn[dup]#1", "text":["fn dup() {}"]}),
"unexpected field \"rust_file\"",
),
(
json!({"file":"src/lib.rs", "item":"fn[dup]#1", "hash":hash, "text":["fn dup() {}"]}),
"unexpected field \"text\"",
),
] {
let found = errors(vec![input]);
assert!(found.contains(expected), "missing {expected:?}: {found}");
}
fs::write(root.join("src/broken.rs"), "fn {").unwrap();
let found = errors(vec![
json!({"file":"src/broken.rs", "item":"", "hash":hash}),
]);
assert!(
found.contains("src/broken.rs: cannot parse rust source"),
"{found}"
);
}
Input 5: outline tests/outcomes.rs fn[fixme_does_not_hide_stale_inputs_or_uncovered_references]
- File:
tests/outcomes.rs - Selector:
fn[fixme_does_not_hide_stale_inputs_or_uncovered_references] - Kind:
fn tests/outcomes.rs:428–469
// {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"))
);
}
Referenced definitions
Input 2: 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.
:::
Input 3: requirements selection requirements.ci.outline_inputs
requirements.ci.outline_inputs:md/requirements/ci.md:172–183
:::{req} outline_inputs
For an outline input, Habeas MUST parse `file` with its language's grammar under
{cite}`requirements.references.outlines` and resolve `item` to exactly one
outline node under {cite}`requirements.references.outline_selectors`. It MUST
compare `hash` with the node's current structural hash under
{cite}`requirements.references.structural_hash`. It MUST derive the node's
inclusive line range, including attached comments and attributes, during
validation for display and reference coverage. Moving the node, editing other
nodes, or editing comments its profile does not hash MUST NOT invalidate the
input. Habeas MUST report a missing file, unsupported language, parse failure,
invalid or ambiguous selector, or changed hash.
:::
Other sources
Input 1: requirements selection requirements.ci.fixme_stale_input
requirements.ci.fixme_stale_input:md/requirements/ci.md:458–465
:::{example} fixme_stale_input
A current evidence record has `{"FIXME": ["example/queue#125"]}` and passes CI. The code in one
of its recorded outline inputs then changes. CI rejects the record because the
input's hash no longer matches, even though its determination is still FIXME. Validation reports the changed input without running a model or
reassessing the documented gap.
{cite}`requirements.ci.determination`
{cite}`requirements.ci.outline_inputs`
:::