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.authoring.complete_initial_bundle

Requirements index · View definition

evidence Valid

Example

A requirement has an implementation reference in one function, a test reference in another, and a terminology reference. The initial prompt contains the complete requirement, the test function’s source text, and the required terminology definition as evidence inputs. The implementation reference alone does not add that function’s source to the initial prompt. A references request can locate it without creating an evidence input; a subsequent habeas request supplies its source text and records the selected node and hash. cite requirements.authoring_input cite requirements.references.authoring_inputs cite requirements.definitions.authoring_inputs cite requirements.authoring.mandatory_inputs cite requirements.authoring.initial_prompt

Rationale

The example describes a concrete case. A requirement has an {impl} reference in one function, a {test} reference in another, and a terminology reference. It states these outcomes:

  • The initial prompt contains the complete requirement, the test function’s source and the definition.
  • The impl function’s source is not in the initial prompt.
  • A references request locates the impl function without creating an evidence input.
  • A later habeas request supplies its text and records the node and hash.

Three tests check these outcomes.

  • Initial prompt contents. tests/authoring_cli.rs#fn[ollama_cli_delivers_sources_records_fixme_and_keeps_usage_content_free] checks the first request’s prompt.
    • The prompt must contain REQUIREMENT, SECRET_DEFINITION_TEXT and fn ready_test().
    • It must not contain pub fn ready(), the impl function.
    • The recorded evidence inputs must include fn[ready_test] and the definition terms.readiness.
    • They must not include fn[ready].
  • Bundle composition. src/authoring/inputs.rs#mod[tests]/fn[bundle_combines_direct_references_terms_and_current_existing_selectors] checks the mandatory input bundle.
    • It must contain the test fn fn[test_ready].
    • It must not contain the impl item impl[Thing]/fn[run] or the enclosing impl[Thing].
    • It must contain a transitive set of two definitions.
    • It must contain referencing example and requirement declarations, and exclude the distant requirement.
    • It must not carry forward earlier evidence.
    • The example subject’s declaration text is checked exactly.
  • Locate, then read. tests/authoring_cli.rs#fn[implementation_discovery_has_no_text_or_evidence_until_the_model_requests_a_read] checks the discovery flow.
    • A references call with the impl role returns the fn[ready] location, with no requirement text, no function source, and no input or inputs keys.
    • A following habeas read returns the source text, file, item and a hash equal to habeas::outline_input.
    • The evidence record then holds exactly one src/lib.rs fn[ready] input, so the selected node and hash are recorded.
    • Usage inputs do not mention references.

Together these assert each stated outcome, with expectations derived from the example and the cited requirements. I found no gap.

Inputs

Tests

Input 7: outline src/authoring/inputs.rs mod[tests]/fn[bundle_combines_direct_references_terms_and_current_existing_selectors]
  • File: src/authoring/inputs.rs
  • Selector: mod[tests]/fn[bundle_combines_direct_references_terms_and_current_existing_selectors]
  • Kind: fn
  • src/authoring/inputs.rs:955–1058
    // {test}`requirements.authoring.complete_initial_bundle`
    // {test}`requirements.authoring.mandatory_inputs`
    // {test}`requirements.authoring_input`
    // {test}`requirements.examples.authoring_inputs`
    // {test}`requirements.references.authoring_inputs`
    // {test}`requirements.definitions.authoring_inputs`
    // {test}`requirements.ci.authoring_inputs`
    // {test}`requirements.ci.reference_set`
    #[test]
    fn bundle_combines_direct_references_terms_and_current_existing_selectors() {
        let root = project();
        let terms = format!(
            ":::{{definition}} unit\n:phrase: unit\nA {}.\n:::\n\n:::{{definition}} value\n:phrase: value\nA {}.\n:::\n",
            role("term", "terms.value"),
            role("term", "terms.unit")
        );
        fs::write(root.path().join("md/terms.md"), terms).unwrap();
        let declarations = format!(
            ":::{{req}} ready\nReady uses {} and {}.\n:::\n\n:::{{req}} base\nBase cites {}.\n:::\n\n:::{{req}} distant\nDistant MUST work.\n:::\n\n:::{{example}} case\nReady example. {} {}\n:::\n",
            role("cite", "requirements.base"),
            role("term", "terms.unit"),
            role("cite", "requirements.distant"),
            role("cite", "requirements.ready"),
            role("test", "requirements.ready")
        );
        fs::write(root.path().join("md/requirements.md"), declarations).unwrap();
        fs::write(root.path().join("src/lib.rs"), format!("struct Thing;\nimpl Thing {{\n    // {}\n    fn run(&self) {{}}\n    fn unrelated(&self) {{}}\n}}\n// {}\nfn test_ready() {{}}\n", role("impl", "requirements.ready"), role("test", "requirements.ready"))).unwrap();
        fs::write(root.path().join("notes.txt"), "new source text\n").unwrap();
        fs::create_dir(root.path().join("evidence")).unwrap();
        fs::write(
            root.path().join("evidence/requirements.ready.json"),
            json!({
                "determination": false, "rationale": "old secret judgment",
                "inputs": [{"file":"notes.txt", "line_start":1, "line_end":1, "text":["old text"]}]
            })
            .to_string(),
        )
        .unwrap();
        let sources = AssessmentSources::prepare(root.path(), "requirements.ready").unwrap();
        // The recorded digest covers the same `{impl}` and `{test}` edges.
        assert_eq!(
            sources.reference_set,
            crate::evidence::reference_set_digest_for(root.path(), "requirements.ready").unwrap()
        );
        let inputs = sources.mandatory_inputs();
        assert!(sources.recorded_inputs().is_empty());
        assert!(
            !inputs
                .iter()
                .any(|input| input["item"] == "impl[Thing]/fn[run]")
        );
        assert!(inputs.iter().any(|input| input["item"] == "fn[test_ready]"));
        assert!(!inputs.iter().any(|input| input["item"] == "impl[Thing]"));
        assert!(
            inputs
                .iter()
                .any(|input| input["requirements"] == "requirements.case")
        );
        assert!(
            inputs
                .iter()
                .any(|input| input["requirements"] == "requirements.base")
        );
        assert!(
            !inputs
                .iter()
                .any(|input| input["requirements"] == "requirements.distant")
        );
        assert_eq!(
            inputs
                .iter()
                .filter(|input| input.get("definition").is_some())
                .count(),
            2
        );
        // Earlier evidence inputs are not carried forward.
        assert!(!inputs.iter().any(|input| input["file"] == "notes.txt"));
        assert!(
            !serde_json::to_string(inputs)
                .unwrap()
                .contains("old secret judgment")
        );
        let example = AssessmentSources::prepare(root.path(), "requirements.case").unwrap();
        assert!(matches!(
            example.subject_kind,
            AssessmentKind::Definition(DefinitionKind::Example, false)
        ));
        assert_eq!(
            example.mandatory_inputs()[0]["requirements"],
            "requirements.case"
        );
        assert_eq!(
            example.mandatory_inputs()[0]["text"],
            json!([
                ":::{example} case",
                format!(
                    "Ready example. {} {}",
                    role("cite", "requirements.ready"),
                    role("test", "requirements.ready")
                ),
                ":::"
            ])
        );
    }
Input 8: outline tests/authoring_cli.rs fn[implementation_discovery_has_no_text_or_evidence_until_the_model_requests_a_read]
  • File: tests/authoring_cli.rs
  • Selector: fn[implementation_discovery_has_no_text_or_evidence_until_the_model_requests_a_read]
  • Kind: fn
  • tests/authoring_cli.rs:292–364
// {test}`requirements.authoring.mandatory_inputs`
// {test}`requirements.authoring.reference_index`
// {test}`requirements.authoring.delivered_inputs`
// {test}`requirements.authoring.fixme_inputs`
// {test}`requirements.authoring.complete_initial_bundle`
#[test]
fn implementation_discovery_has_no_text_or_evidence_until_the_model_requests_a_read() {
    let server = Server::start(vec![
        reply(vec![call(
            "locate",
            "references",
            json!({"selection": SUBJECT, "roles": ["impl"]}),
        )]),
        reply(vec![call(
            "read",
            "habeas",
            json!({"file": "src/lib.rs", "item": "fn[ready]"}),
        )]),
        reply(vec![call(
            "submit",
            "submit_judgment",
            json!({"determination": true, "rationale": "The tests check the requirement."}),
        )]),
    ]);
    let fixture = Fixture::new(&server.endpoint);
    let output = fixture.run(&["author", SUBJECT]);
    assert!(output.status.success(), "{output:?}");
    let requests = server.finish();
    assert_eq!(requests.len(), 3);
    let prompt = prompt_text(&requests[0].body);
    assert!(prompt.contains("fn ready_test()"));
    assert!(prompt.contains("One acknowledged gap."));
    assert!(!prompt.contains("pub fn ready()"));
    let tool_result = |request: &Request| -> Value {
        let message = request.body["messages"]
            .as_array()
            .unwrap()
            .iter()
            .rev()
            .find(|message| message["role"] == "tool")
            .unwrap();
        serde_json::from_str(message["content"].as_str().unwrap()).unwrap()
    };
    let locations = tool_result(&requests[1]);
    assert!(locations.to_string().contains("fn[ready]"), "{locations:#}");
    for text in [
        REQUIREMENT,
        "One acknowledged gap.",
        "pub fn ready()",
        "\"input\"",
        "\"inputs\"",
    ] {
        assert!(!locations.to_string().contains(text), "{locations:#}");
    }
    let read = tool_result(&requests[2]);
    assert!(read["input"]["text"].to_string().contains("pub fn ready()"));
    assert_eq!(read["input"]["file"], "src/lib.rs");
    assert_eq!(read["input"]["item"], "fn[ready]");
    assert_eq!(
        read["input"]["hash"],
        habeas::outline_input(&fixture.project, "src/lib.rs", "fn[ready]").unwrap()["hash"]
    );
    let record: Value = serde_json::from_slice(&fs::read(&fixture.evidence).unwrap()).unwrap();
    let inputs = record["inputs"].as_array().unwrap();
    assert_eq!(
        inputs
            .iter()
            .filter(|input| input["file"] == "src/lib.rs" && input["item"] == "fn[ready]")
            .count(),
        1
    );
    assert!(!fixture.usage()["inputs"].to_string().contains("references"));
}
Input 9: outline tests/authoring_cli.rs fn[ollama_cli_delivers_sources_records_fixme_and_keeps_usage_content_free]
// {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()
    );
}

Referenced definitions

Input 2: requirements selection requirements.authoring_input
:::{req} authoring_input
When authoring evidence for a requirement, its fenced declaration, including its complete body but excluding anchor option lines, MUST
be included in the mandatory input set defined by
{cite}`requirements.authoring.mandatory_inputs`.
:::
Input 3: requirements selection requirements.references.authoring_inputs
:::{req} authoring_inputs
When authoring evidence, the edges defined by
{cite}`requirements.references.roles` MUST determine the reference
contributions to the mandatory input set defined by
{cite}`requirements.authoring.mandatory_inputs`. A `{cite}` made by the subject
MUST contribute the cited definition's complete fenced declaration. A requirement
or example declaration that references the subject with `{impl}` or `{test}`
MUST contribute that complete declaration. For sources outside such declarations,
an `{impl}` reference or `:impl:` anchor alone MUST NOT contribute source text;
those sources MUST remain discoverable under
{cite}`requirements.authoring.reference_index` and MAY be requested under
{cite}`requirements.authoring.source_tools`. Sources with only edges into the subject
MUST NOT contribute and remain discoverable under
{cite}`requirements.authoring.reference_index`. A `:test:` anchor under
{cite}`requirements.references.anchors` MUST contribute the complete anchored file,
or for a `path#selector` anchor the anchored node.
An in-source `{test}` reference to the subject MUST contribute the source
containing it: for a reference in a supported language, the smallest enclosing
outline node under {cite}`requirements.references.outline_comments`; for a reference in a Markdown requirement, example, or
terminology declaration, that complete declaration; for other references, the
complete containing source file. Literal references, evidence copies, and
generated output MUST remain excluded under the existing reference-discovery
rules.

An in-source `{fixme}` reference alone MUST NOT contribute the containing source
to the mandatory input set. Its acknowledgment MUST instead be supplied under
{cite}`requirements.authoring.fixme_inputs`.

These contribution rules MUST apply only to the assessed subject's direct
references. Including another declaration or source MUST NOT by itself recursively
expand that source's own edges. Reference links MUST NOT be described as proof
that all substantively relevant sources have been found.
:::
Input 4: requirements selection requirements.definitions.authoring_inputs
:::{req} authoring_inputs
When preparing the mandatory input set defined by
{cite}`requirements.authoring.mandatory_inputs`, every terminology definition
referenced by the subject, any contributed source, or an acknowledgment supplied
under {cite}`requirements.authoring.fixme_inputs` MUST contribute its complete
fenced declaration, including its phrase option. Definitions referenced by those
definitions MUST also be included transitively, without duplicates or
nontermination on cycles.

When an additional source read introduces a terminology dependency, the same
complete, transitive definition set MUST be supplied to the model and recorded
before accepting a submission.
:::
Input 5: requirements selection requirements.authoring.mandatory_inputs
:::{req} mandatory_inputs
The harness MUST construct each assessment's mandatory input set by combining
the contributions specified by the requirements applicable to that subject and
its inputs. A requirement that contributes inputs MUST cite this requirement and
define which sources it contributes and when. The harness MUST include every
applicable contribution, deduplicate identical selections, and report
unresolvable mandatory inputs before inference. The complete set MUST be supplied
in the initial model request.
Generated output under project-root `evidence/`, including symlink aliases, MUST
be omitted from mandatory inputs when the default exclusion applies. An explicit
workspace allow MUST permit those selections; an explicit disallow MUST abort
under {cite}`requirements.authoring.read_denial.mandatory`.
:::
Input 6: requirements selection requirements.authoring.initial_prompt
:::{req} initial_prompt
The initial request MUST provide the ten tool definitions above and the
following prompt, the first block as its system prompt and the second as its
subject message under {cite}`requirements.authoring.prompt_parts`. The harness MUST replace `{{subject_kind}}` with `requirement`
or `example`, `{{subject_name}}` with the full subject name,
`{{habeas_background}}`, `{{reference_roles}}`, and `{{distributed_background}}`
under {cite}`requirements.authoring.habeas_background`, `{{judgment_rules}}` under
{cite}`requirements.authoring.judgment_rules`, `{{acknowledgments}}` with the JSON
array of {cite}`requirements.authoring.fixme_inputs`, and `{{mandatory_inputs}}` with the
complete mandatory inputs as a JSON array using
the existing evidence-input formats. It MUST replace `{{subject_task}}`, for a requirement, with the text of
{cite}`requirements.authoring.requirement_task` followed by that of
{cite}`requirements.authoring.testing_bar`, and for an example, with the text of
{cite}`requirements.authoring.example_task`. It MUST replace
`{{distributed_task}}` with the filled text of
{cite}`requirements.authoring.distributed_task` for a distributed requirement,
and with nothing otherwise. The template MUST otherwise
be used as written. Their review guidance MUST follow
{impl}`requirements.ci.review_criteria`, {cite}`requirements.examples.evidence`,
and {cite}`requirements.ci.outcomes`.

```text
# Task

Assess whether a project's tests adequately check one {{subject_kind}}.
Your determination should be the one any careful reviewer would reach from the
same text and sources.

# Background: Habeas terms

{{habeas_background}}

{{reference_roles}}

# Your task

The mandatory inputs at the end contain the subject, the requirements and
examples it cites, the vocabulary definitions it uses, and the source text of
its {test} items and :test: anchors. Requirement and example declarations that
refine the subject through {impl} are also included. Implementation source is
not included merely because it carries an {impl} reference or :impl: anchor.
You can locate it with references and request it with habeas when needed.
Each {fixme} acknowledgment includes the state of the issues it names.

Cited requirements and examples are context: when the subject requires behavior
under or following a cited requirement, check that the subject's tests cover
applying it in the subject's case. Do not reassess the cited requirement's
implementation or tests.

When another requirement's text carries an {impl} reference to the subject,
assess only whether that text carries out the obligations it covers; do not
reassess its implementation or tests, and those obligations need no test here.

Judge test adequacy, rather than whether the current implementation is correct.
Derive expected behavior from the requirement and examples, even if you request
implementation source. A true judgment means the reviewed tests adequately
check the subject under the criteria below. You do not need to find a defect
when those criteria are met.

{{subject_task}}

# How to judge

{{judgment_rules}}

# Submitting

Choose true when your task finds no gap, {"FIXME": ["..."]} when every gap is
acknowledged, and false otherwise. You MUST end by calling submit_judgment
with determination and rationale until one submission is accepted.
A rejected submission does not complete the assessment. A judgment written in your
reply text is not accepted.
```

```text
# Subject

Subject: {{subject_kind}} {{subject_name}}
Judge against: the subject's text.

{{distributed_task}}

# Acknowledgments

{{acknowledgments}}

# Mandatory inputs

{{mandatory_inputs}}
```
:::

Other sources

Input 1: requirements selection requirements.authoring.complete_initial_bundle
:::{example} complete_initial_bundle
A requirement has an implementation reference in one function, a test reference
in another, and a terminology reference. The initial prompt contains the complete
requirement, the test function's source text, and the required terminology
definition as evidence inputs. The implementation reference alone does not add
that function's source to the initial prompt. A references request can locate it
without creating an evidence input; a subsequent habeas request supplies its
source text and records the selected node and hash.
{cite}`requirements.authoring_input`
{cite}`requirements.references.authoring_inputs`
{cite}`requirements.definitions.authoring_inputs`
{cite}`requirements.authoring.mandatory_inputs`
{cite}`requirements.authoring.initial_prompt`
:::