requirements.authoring.acknowledged_gap
Requirements index · View definition
Example
The tests omit a boundary case explicitly required by a requirement. A fenced
{fixme}reference to that requirement describes the missing test and names:github: example/app#125. The model receives that acknowledgment and its open issue state without the containing implementation source. It finds no other gaps and callssubmit_judgmentonce withdetermination: {"FIXME": ["example/app#125"]}and a rationale locating the acknowledgment and explaining the untested boundary. The harness saves that judgment, the source inputs it supplied, and the reference-set digest covering the acknowledgment. CI accepts the FIXME judgment when all other evidence checks pass.![]()
![]()
![]()
![]()
Rationale
Example. requirements.authoring.acknowledged_gap describes a concrete case with stated expected behavior. The requirement requires the empty-string boundary, and the tests omit it. A fenced {fixme} acknowledges the omission and names example/app#125. The model gets the acknowledgment and the open issue state, but not the implementation source. It submits one FIXME judgment with a rationale. The harness saves the judgment, the inputs and the reference-set digest, and CI accepts the record.
Tests. I reviewed two tests, both marked for this example.
-
tests/authoring_cli.rs#fn[acknowledged_empty_input_boundary_is_explained_and_accepted]builds the scenario directly.- Setup. The requirement says the check “MUST accept every string, including the empty string”.
src/lib.rshas a{fixme}fence with:github: example/app#125and the body “The empty-string boundary is not tested.”ready_testchecks only nonempty input. The implementationreadycarries the{impl}reference. - Single submission. The mock server has exactly one scripted reply, a
submit_judgmentcall with{"FIXME":["example/app#125"]}and a rationale. The test assertsrequests.len() == 1. - Acknowledgment delivered. The test asserts the prompt contains the fixme body,
fn ready_test()andexample/app#125. - No implementation source. The test asserts the prompt does not contain
!input.is_empty(). The saved inputs includefn[ready_test]and excludefn[ready]. - Saved judgment. The saved evidence has the exact
FIXMEdetermination and the exact rationale, which namesready_testand the untested empty-string boundary. - CI acceptance.
habeas::validate_repositoryreturns no errors. Validation includes input freshness and reference coverage, and the reference-set digest covers the acknowledgment.
- Setup. The requirement says the check “MUST accept every string, including the empty string”.
-
tests/authoring_cli.rs#fn[ollama_cli_delivers_sources_records_fixme_and_keeps_usage_content_free]supplies the remaining outcomes.- Open issue state. It asserts the prompt contains
"reference": "example/app#125"and"state": "open". - Acknowledgment and implementation. It asserts the acknowledgment body and
:github:line reach the model, and thatfn[ready]is neither in the prompt nor in the inputs. - CI acceptance and rejection. It asserts the FIXME evidence has no validation error. It then rewrites the determination to
falseand asserts a validation error appears, so acceptance is specific to the FIXME outcome.
- Open issue state. It asserts the prompt contains
Outcomes. Each outcome the example states is asserted. I found no gap: the tests cover the acknowledged-boundary scenario, and none of their assertions contradicts the example. The cited requirements (requirements.ci.outcomes, requirements.ci.determination, requirements.authoring.submission, requirements.authoring.delivered_inputs, requirements.authoring.persistence) are applied in this case through the single FIXME submission, the recorded inputs, the written evidence and the validation result.
Inputs
Tests
Input 7: outline tests/authoring_cli.rs fn[ollama_cli_delivers_sources_records_fixme_and_keeps_usage_content_free]
- File:
tests/authoring_cli.rs - Selector:
fn[ollama_cli_delivers_sources_records_fixme_and_keeps_usage_content_free] - Kind:
fn tests/authoring_cli.rs:366–676
// {test}`requirements.authoring.complete_initial_bundle`
// {test}`requirements.authoring.invocation`
// {test}`requirements.authoring.additional_read`
// {test}`requirements.authoring.acknowledged_gap`
// {test}`requirements.authoring.configuration_precedence`
// {test}`requirements.authoring.rig_configuration_mapping`
// {test}`requirements.authoring.configuration_storage`
// {test}`requirements.authoring.initial_prompt`
// {test}`requirements.ci.review_criteria`
// {test}`requirements.authoring.delivered_inputs`
// {test}`requirements.authoring.usage_storage`
// {test}`requirements.authoring.usage_inputs`
// {test}`requirements.authoring.usage_requests`
// {test}`requirements.authoring.mandatory_inputs`
// {test}`requirements.authoring.github_reads`
// {test}`requirements.authoring.invocation`
// {test}`requirements.configuration.serialization`
// {test}`requirements.ci.fixme_implementation_gap`
// {test}`requirements.authoring.finish_search.empty`
// {test}`requirements.authoring.finish_search.completion`
#[test]
// {test}`requirements.authoring.persistence`
// {test}`requirements.authoring.reporting`
fn ollama_cli_delivers_sources_records_fixme_and_keeps_usage_content_free() {
let server = Server::start(vec![
reply(vec![
call("list", "list_files", json!({})),
call(
"search",
"ripgrep",
json!({"path":"extra.txt","pattern":"needle"}),
),
call(
"read",
"habeas",
json!({"file":"extra.txt","line_start":10}),
),
call(
"repeat",
"habeas",
json!({"file":"extra.txt","line_start":10}),
),
call(
"missing",
"habeas",
json!({"file":"absent.txt","line_start":1}),
),
]),
json!({"__finish_latest_search":true}),
reply(vec![call(
"submit",
"submit_judgment",
json!({
"determination":{"FIXME":["example/app#125"]},"rationale":"SECRET_RATIONALE: `src/lib.rs#fn[ready]` documents the gap."}),
)]),
]);
let fixture = Fixture::new(&server.endpoint);
let user_config = fixture.config.join("habeas/config.toml");
let configured = fs::read(&user_config).unwrap();
let output = fixture.run(&["author-evidence", SUBJECT]);
assert!(
output.status.success(),
"{}",
String::from_utf8_lossy(&output.stderr)
);
// The user configuration, with its environment-resolved key, is not
// rewritten.
assert_eq!(fs::read(&user_config).unwrap(), configured);
let requests = server.finish();
assert_eq!(requests.len(), 3);
for request in &requests {
assert!(request.headers.starts_with("POST /api/chat HTTP/1.1\r\n"));
assert!(request.headers.to_ascii_lowercase().contains(&format!(
"authorization: bearer {}",
AUTH.to_ascii_lowercase()
)));
assert_eq!(request.body["model"], MODEL);
assert_eq!(request.body["options"]["temperature"], 0.25);
assert_eq!(request.body["options"]["num_ctx"], 4096);
assert_eq!(request.body["think"], false);
assert_eq!(request.body["stream"], false);
}
let prompt = prompt_text(&requests[0].body);
for text in [
"Assess whether a project's tests adequately check one requirement.",
REQUIREMENT,
"SECRET_DEFINITION_TEXT",
"fn ready_test()",
"You MUST end by calling submit_judgment",
] {
assert!(prompt.contains(text), "prompt missing {text}");
}
assert!(!prompt.contains("pub fn ready()"), "{prompt}");
assert!(!prompt.contains("OLD_RATIONALE_MUST_NOT_REACH_MODEL"));
let mut tools = requests[0].body["tools"]
.as_array()
.unwrap()
.iter()
.map(|tool| tool["function"]["name"].as_str().unwrap())
.collect::<Vec<_>>();
tools.sort();
assert_eq!(
tools,
[
"ast_grep",
"finish_search",
"github",
"habeas",
"list_files",
"next_page",
"outline",
"references",
"ripgrep",
"submit_judgment"
]
);
let results = requests[1].body["messages"]
.as_array()
.unwrap()
.iter()
.filter(|message| message["role"] == "tool")
.collect::<Vec<_>>();
assert_eq!(results.len(), 5);
assert!(results.iter().any(|message| {
message["content"]
.as_str()
.unwrap()
.contains("SECRET_SOURCE_PAYLOAD")
}));
assert!(
results
.iter()
.any(|message| message["content"].as_str().unwrap().contains("absent.txt"))
);
let evidence: Value = serde_json::from_slice(&fs::read(&fixture.evidence).unwrap()).unwrap();
assert_eq!(
evidence["determination"],
json!({"FIXME":["example/app#125"]})
);
assert_eq!(
evidence["rationale"],
"SECRET_RATIONALE: `src/lib.rs#fn[ready]` documents the gap."
);
assert_eq!(evidence["requirement"], REQUIREMENT);
let inputs = evidence["inputs"].as_array().unwrap();
assert!(
inputs
.iter()
.any(|input| input["file"] == "src/lib.rs" && input["item"] == "fn[ready_test]"),
"{inputs:#?}"
);
// The acknowledgment reaches the model as metadata, without the
// containing implementation. Its body is protected by the reference set.
assert!(prompt.contains(":github: example/app#125"));
assert!(prompt.contains("One acknowledged gap."));
// GitHub is unreachable, so the issue is supplied as open, but the state
// is not recorded.
assert!(
prompt.contains("\"reference\": \"example/app#125\"")
&& prompt.contains("\"state\": \"open\""),
"{prompt}"
);
assert!(!evidence.to_string().contains("github_issues"));
assert!(!fixture.usage().to_string().contains("github_issues"));
assert!(
!inputs
.iter()
.any(|input| input["file"] == "src/lib.rs" && input["item"] == "fn[ready]"),
"{inputs:#?}"
);
// CI accepts the FIXME judgment: its evidence has no validation error.
let report = habeas::validate_repository(&fixture.project).unwrap();
let label = format!("evidence/{SUBJECT}.json");
assert!(
!report.errors.iter().any(|error| error.contains(&label)),
"{:#?}",
report.errors
);
// The same record with a false determination is rejected.
let mut rejected = evidence.clone();
rejected["determination"] = json!(false);
let accepted = fs::read(&fixture.evidence).unwrap();
fs::write(&fixture.evidence, rejected.to_string()).unwrap();
let report = habeas::validate_repository(&fixture.project).unwrap();
assert!(
report.errors.iter().any(|error| error.contains(&label)),
"{:#?}",
report.errors
);
fs::write(&fixture.evidence, accepted).unwrap();
assert!(
inputs
.iter()
.any(|input| input["definition"] == "terms.readiness")
);
let extra = inputs
.iter()
.filter(|input| input["file"] == "extra.txt")
.collect::<Vec<_>>();
// The search only locates lines and records nothing; the reads cover
// lines 10-12, one plain-text line node each, and the repeated delivery
// is recorded once, by selector and hash only.
assert_eq!(
extra,
habeas::outline_inputs_for_lines(&fixture.project, "extra.txt", 10, 12)
.unwrap()
.iter()
.collect::<Vec<_>>(),
"repeated delivery is deduplicated in evidence"
);
assert!(
!evidence["inputs"]
.to_string()
.contains("SECRET_SOURCE_PAYLOAD")
);
assert!(
!inputs
.iter()
.any(|input| input["file"] == "absent.txt" || input["file"] == ".")
);
let usage = fixture.usage();
assert_eq!(usage["outcome"], "completed");
assert_eq!(usage["determination"], "FIXME");
assert_eq!(usage["evidence_written"], true);
assert_eq!(usage["request_count"], 3);
assert_eq!(usage["tool_call_count"], 7);
assert_eq!(usage["tool_calls"]["habeas"], 3);
assert_eq!(usage["tool_failures"]["habeas"], 1);
// The directory listing counts as a tool call but is not an input.
assert_eq!(usage["tool_calls"]["list_files"], 1);
assert_eq!(usage["tool_calls"]["ripgrep"], 1);
assert_eq!(usage["tool_calls"]["finish_search"], 1);
let usage_inputs = usage["inputs"].as_array().unwrap();
assert!(
!usage_inputs
.iter()
.any(|input| input["origin"] == "list_files"),
"{usage_inputs:?}"
);
// Search snippets count toward usage, without becoming evidence inputs.
assert!(
usage_inputs.iter().any(|input| input["origin"] == "ripgrep"
&& input["kind"] == "search"
&& input["bytes"].as_u64().unwrap() > 0
&& input["lines"].as_u64().unwrap() > 0),
"{usage_inputs:?}"
);
assert!(
usage_inputs
.iter()
.any(|input| input["origin"] == "habeas" && input["unique"] == true),
"{usage_inputs:?}"
);
assert_eq!(usage["tokens"]["input"], 33);
assert_eq!(usage["tokens"]["output"], 21);
assert_eq!(usage["tokens"]["complete"], true);
assert!(
usage["inputs"]
.as_array()
.unwrap()
.iter()
.any(|input| input["origin"] == "habeas"
&& input["unique"] == false
&& input["sent_in_request"] == 1)
);
assert!(
usage["inputs"]
.as_array()
.unwrap()
.iter()
.any(|input| input["origin"] == "mandatory"
&& input["kind"] == "definition"
&& input["bytes"].as_u64().unwrap() > 0)
);
let serialized = usage.to_string();
for secret in [
"SECRET_REQUIREMENT_TEXT",
"SECRET_DEFINITION_TEXT",
"SECRET_SOURCE_PAYLOAD",
"SECRET_RATIONALE",
AUTH,
"#125",
] {
assert!(
!serialized.contains(secret),
"usage contains source or credential content: {secret}"
);
}
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(stdout.contains(MODEL) && stdout.contains("Evidence:") && stdout.contains("Usage:"));
// By default the report names the subject and backend and identifies the
// evidence file it wrote.
assert!(
stdout.starts_with(&format!("{SUBJECT}: ollama / {MODEL}")),
"{stdout}"
);
let evidence = stdout
.lines()
.find_map(|line| line.strip_prefix("Evidence: "))
.unwrap();
assert!(
evidence.ends_with(&format!("evidence/{SUBJECT}.json")),
"{stdout}"
);
assert_eq!(
fs::canonicalize(evidence).unwrap(),
fs::canonicalize(fixture.project.join(format!("evidence/{SUBJECT}.json"))).unwrap()
);
}
Input 8: outline tests/authoring_cli.rs fn[acknowledged_empty_input_boundary_is_explained_and_accepted]
- File:
tests/authoring_cli.rs - Selector:
fn[acknowledged_empty_input_boundary_is_explained_and_accepted] - Kind:
fn tests/authoring_cli.rs:678–722
// {test}`requirements.authoring.acknowledged_gap`
#[test]
fn acknowledged_empty_input_boundary_is_explained_and_accepted() {
let rationale = "`src/lib.rs#fn[ready_test]` checks nonempty input but omits the required empty-string boundary. The acknowledgment tracks that test gap as example/app#125.";
let server = Server::start(vec![reply(vec![call(
"submit",
"submit_judgment",
json!({"determination":{"FIXME":["example/app#125"]},"rationale":rationale}),
)])]);
let fixture = Fixture::new(&server.endpoint);
common::coverage_setup(&fixture.project);
fs::write(fixture.project.join("md/requirements.md"), ":::{req} ready\nThe readiness check MUST accept every string, including the empty string.\n:::\n").unwrap();
fs::write(fixture.project.join("src/lib.rs"), "// {impl}`requirements.ready`\n// :::{fixme} requirements.ready\n// :github: example/app#125\n// The empty-string boundary is not tested.\n// :::\npub fn ready(input: &str) -> bool { !input.is_empty() }\n// {test}`requirements.ready`\nfn ready_test() { assert!(ready(\"nonempty\")); }\n").unwrap();
let output = fixture.run(&["author", SUBJECT]);
assert!(output.status.success(), "{output:?}");
let requests = server.finish();
assert_eq!(requests.len(), 1);
let prompt = prompt_text(&requests[0].body);
assert!(prompt.contains("The empty-string boundary is not tested."));
assert!(prompt.contains("fn ready_test()"));
assert!(prompt.contains("example/app#125"));
assert!(!prompt.contains("!input.is_empty()"));
let record: Value = serde_json::from_slice(&fs::read(&fixture.evidence).unwrap()).unwrap();
assert_eq!(
record["determination"],
json!({"FIXME":["example/app#125"]})
);
assert_eq!(record["rationale"], rationale);
assert!(
record["inputs"]
.as_array()
.unwrap()
.iter()
.any(|input| input["file"] == "src/lib.rs" && input["item"] == "fn[ready_test]")
);
assert!(
!record["inputs"]
.as_array()
.unwrap()
.iter()
.any(|input| input["file"] == "src/lib.rs" && input["item"] == "fn[ready]")
);
let report = habeas::validate_repository(&fixture.project).unwrap();
assert!(report.errors.is_empty(), "{:?}", report.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.
:::
Input 4: requirements selection requirements.authoring.submission
requirements.authoring.submission:md/requirements/authoring.md:1213–1245
:::{req} submission
The harness MUST expose a `submit_judgment` tool accepting exactly these fields:
```text
submit_judgment({ determination: Judgment, rationale: String })
Judgment = Boolean | { FIXME: Array<String> }
```
The judgment MUST use the three outcomes and nonempty FIXME entries defined by
{cite}`requirements.ci.outcomes`.
`rationale` MUST be nonempty Markdown. This tool call MUST supply the final
assessment result. The model MUST obtain exactly one accepted submission over the entire
assessment. Rejected attempts under
{cite}`requirements.authoring.submission.searches.recovery` and
{cite}`requirements.authoring.line_numbers.rejection` do not count as accepted
submissions. If a response ends without invoking it, and the assessment has
not already been reminded, the harness MUST continue the conversation with one
user message, `Reminder: you MUST submit your result with the submit_judgment
tool.`, naming the assessment's submission tool. If a later response also ends
without invoking it, or a response contains multiple submission calls, the harness MUST
report an error and leave existing evidence unchanged. The reminder MUST be
counted in usage like any other turn.
The harness MUST check the complete model response for multiple submissions
before accepting one. Invalid submission arguments MUST also fail the assessment.
A valid single submission MUST finish the assessment; there is no submission
repair or resubmission loop, except the one continuation after a response cut
off at its output limit under {cite}`requirements.authoring.output_limit`, the
one reminder above, and the one resubmission after a rejection under
{cite}`requirements.authoring.line_numbers.rejection`, and recovery under
{cite}`requirements.authoring.submission.searches.recovery`. An assessment that fails before accepting a valid
judgment MUST emit no evidence JSON to stdout.
:::
Input 5: requirements selection requirements.authoring.delivered_inputs
requirements.authoring.delivered_inputs:md/requirements/authoring.md:2142–2150
:::{req} delivered_inputs
The harness MUST record the sources it supplies to the model, including
mandatory inputs, additional reads, and selected search dependencies under
{cite}`requirements.authoring.finish_search.inputs`, using the evidence input formats
defined by {cite}`requirements.ci.outline_inputs`,
{cite}`requirements.ci.requirements_inputs`, and
{cite}`requirements.definitions.inputs`. The harness MUST create these records
itself so ordinary evidence validation can check them later.
:::
Input 6: requirements selection requirements.authoring.persistence
requirements.authoring.persistence:md/requirements/authoring.md:2152–2161
:::{req} persistence
After one valid judgment, the harness MUST write the subject text, submitted
determination and rationale, and recorded inputs using the existing evidence
schema. {cite}`requirements.ci.schema`
By default, it MUST write the subject's evidence file. With `--stdout`, it MUST
emit a single evidence JSON object followed by a newline to stdout and MUST NOT
create or change evidence files or directories. All three outcomes MUST be
written to the selected destination as completed assessments; their validation
status MUST follow {cite}`requirements.ci.determination`.
:::
Other sources
Input 1: requirements selection requirements.authoring.acknowledged_gap
requirements.authoring.acknowledged_gap:md/requirements/authoring.md:2267–2283
:::{example} acknowledged_gap
The tests omit a boundary case explicitly required by a requirement. A fenced
`{fixme}` reference to that requirement describes the missing test and names
`:github: example/app#125`. The model receives that acknowledgment and its open
issue state without the containing implementation source. It finds no other gaps
and calls `submit_judgment` once with
`determination: {"FIXME": ["example/app#125"]}` and a rationale locating the
acknowledgment and explaining the untested boundary. The harness saves that
judgment, the source inputs it supplied, and the reference-set digest covering
the acknowledgment. CI accepts
the FIXME judgment when all other evidence checks pass.
{cite}`requirements.ci.outcomes`
{cite}`requirements.ci.determination`
{cite}`requirements.authoring.submission`
{cite}`requirements.authoring.delivered_inputs`
{cite}`requirements.authoring.persistence`
:::