requirements.authoring.negative_assessment
Requirements index · View definition
Example
The model reads additional sources and calls
submit_judgmentonce withdetermination: falseand a rationale explaining the discrepancy. The harness saves that judgment with all source inputs it supplied. The authoring operation completes; ordinary evidence validation reports the false determination.![]()
![]()
Rationale
The example requirements.authoring.negative_assessment describes a concrete case. The model makes an additional read, then calls submit_judgment once with determination: false and a rationale. The harness saves the judgment with every source input it supplied. The authoring operation completes. Ordinary validation then reports the false determination.
tests/authoring_cli.rs#fn[negative_assessment_records_additional_reads_and_fails_validation] covers the whole scenario:
- Scenario setup: a scripted server first makes a
habeasread ofextra.txt, then makes onesubmit_judgmentcall withfalseand a rationale. - Authoring completes: the test asserts the CLI exits successfully and that the server saw exactly two requests. The usage record has
outcomeofcompletedanddeterminationoffalse. - Judgment saved: the evidence file has
determinationequal to false andrationaleequal to the submitted text. - All supplied inputs saved: the test asserts the inputs include the mandatory
src/lib.rssource and theterms.readinessdefinition. It also asserts that every input fromoutline_inputs_for_linesfor the additionalextra.txtread is present. - Validation reports it:
habeas::validate_repositorymust return an errorevidence/{SUBJECT}.json: determination is false: {rationale}.
tests/authoring_cli.rs#fn[false_is_a_completed_assessment] adds a second scenario with the same outcome. It checks that the false judgment is written, the inputs are non-empty and record selectors and hashes, and the usage outcome is completed. It also checks that validation rejects the false judgment even though a FIXME acknowledges one gap. This test makes no additional read. It still supports the saved-inputs, completion and validation-failure outcomes.
I found no outcome the example states that the tests leave unchecked. The cited requirements submission, delivered_inputs and persistence are context, and their own tests are out of scope here.
Inputs
Tests
Input 5: outline tests/authoring_cli.rs fn[false_is_a_completed_assessment]
- File:
tests/authoring_cli.rs - Selector:
fn[false_is_a_completed_assessment] - Kind:
fn tests/authoring_cli.rs:924–995
// {test}`requirements.authoring.negative_assessment`
// {test}`requirements.authoring.usage_storage`
// {test}`requirements.authoring.persistence`
// {test}`requirements.ci.fixme_with_unacknowledged_gap`
// {test}`requirements.authoring.reporting`
#[test]
fn false_is_a_completed_assessment() {
let server = Server::start(vec![reply(vec![call(
"submit",
"submit_judgment",
json!({"determination":false,"rationale":"The test checks refusal for a full positive-capacity queue, without acknowledging missing checks for preservation and zero capacity."}),
)])]);
let fixture = Fixture::new(&server.endpoint);
fs::write(fixture.project.join("md/requirements.md"), ":::{req} ready\nInserting into a full queue MUST return false without overwriting its entries, including at zero capacity.\n:::\n").unwrap();
fs::write(fixture.project.join("src/lib.rs"), "// {impl}`requirements.ready`\n// FIXME(#125): zero-capacity insertion panics.\npub fn push(queue: &mut [u8], value: u8) -> bool {\n queue[0] = value;\n true\n}\n\n// {test}`requirements.ready`\n#[test]\nfn full_queue() { let mut queue = [1]; assert!(!push(&mut queue, 2)); }\n").unwrap();
let output = fixture.run(&["author-evidence", SUBJECT, "--config", "mock"]);
assert!(
output.status.success(),
"{}",
String::from_utf8_lossy(&output.stderr)
);
let requests = server.finish();
let prompt = prompt_text(&requests[0].body);
assert!(prompt.contains("and false otherwise."));
assert!(!prompt.contains("FIXME(#125): zero-capacity insertion panics"));
assert!(!prompt.contains("queue[0] = value"));
assert!(prompt.contains("fn full_queue()"));
let evidence: Value = serde_json::from_slice(&fs::read(&fixture.evidence).unwrap()).unwrap();
assert_eq!(evidence["determination"], false);
assert!(!evidence["inputs"].as_array().unwrap().is_empty());
assert!(
evidence["rationale"]
.as_str()
.unwrap()
.contains("without acknowledging")
);
// Outline inputs record selectors and hashes, never the source text.
assert!(
evidence["inputs"]
.as_array()
.unwrap()
.iter()
.any(|input| input["item"].is_string() && input["hash"].is_string())
);
assert!(!evidence["inputs"].to_string().contains("FIXME(#125)"));
assert_eq!(fixture.usage()["outcome"], "completed");
assert_eq!(fixture.usage()["determination"], "false");
let diagnostics = format!(
"{}{}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
);
let stderr = String::from_utf8_lossy(&output.stderr);
assert!(stderr.contains(&format!("{SUBJECT}: false")), "{stderr}");
assert!(
!String::from_utf8_lossy(&output.stdout).contains(&format!("{SUBJECT}: false")),
"{diagnostics}"
);
assert!(
!diagnostics.contains("without acknowledging"),
"{diagnostics}"
);
// CI rejects the false judgment even though a FIXME acknowledges one gap.
let report = habeas::validate_repository(&fixture.project).unwrap();
let evidence_file = format!("evidence/{SUBJECT}.json");
let rejection = report
.errors
.iter()
.find(|error| error.starts_with(&evidence_file) && error.contains("determination is false"))
.unwrap_or_else(|| panic!("{:?}", report.errors));
assert!(rejection.contains("without acknowledging"), "{rejection}");
}
Input 6: outline tests/authoring_cli.rs fn[negative_assessment_records_additional_reads_and_fails_validation]
- File:
tests/authoring_cli.rs - Selector:
fn[negative_assessment_records_additional_reads_and_fails_validation] - Kind:
fn tests/authoring_cli.rs:997–1053
// {test}`requirements.authoring.negative_assessment`
#[test]
fn negative_assessment_records_additional_reads_and_fails_validation() {
let rationale =
"src/lib.rs implements readiness, but `extra.txt` shows the needle case is unhandled.";
let server = Server::start(vec![
reply(vec![call(
"read",
"habeas",
json!({"file":"extra.txt","line_start":6,"line_end":6}),
)]),
reply(vec![call(
"submit",
"submit_judgment",
json!({"determination":false,"rationale":rationale}),
)]),
]);
let fixture = Fixture::new(&server.endpoint);
let output = fixture.run(&["author", SUBJECT]);
assert!(
output.status.success(),
"{}",
String::from_utf8_lossy(&output.stderr)
);
let requests = server.finish();
assert_eq!(requests.len(), 2, "the model made one additional read");
let evidence: Value = serde_json::from_slice(&fs::read(&fixture.evidence).unwrap()).unwrap();
assert_eq!(evidence["determination"], false);
assert_eq!(evidence["rationale"], rationale);
let inputs = evidence["inputs"].as_array().unwrap();
// Every supplied input is saved: the mandatory sources and the additional read.
assert!(
inputs.iter().any(|input| input["file"] == "src/lib.rs"),
"mandatory source input missing from {inputs:?}"
);
assert!(
inputs
.iter()
.any(|input| input["definition"] == "terms.readiness")
);
for line in habeas::outline_inputs_for_lines(&fixture.project, "extra.txt", 6, 6).unwrap() {
assert!(inputs.contains(&line), "additional read {line} missing");
}
assert_eq!(fixture.usage()["outcome"], "completed");
assert_eq!(fixture.usage()["determination"], "false");
// Ordinary evidence validation reports the written false determination.
let report = habeas::validate_repository(&fixture.project).unwrap();
assert!(
report.errors.iter().any(|error| error.contains(&format!(
"evidence/{SUBJECT}.json: determination is false: {rationale}"
))),
"{:?}",
report.errors
);
}
Referenced definitions
Input 2: 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 3: 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 4: 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.negative_assessment
requirements.authoring.negative_assessment:md/requirements/authoring.md:2257–2265
:::{example} negative_assessment
The model reads additional sources and calls `submit_judgment` once with
`determination: false` and a rationale explaining the discrepancy. The harness
saves that judgment with all source inputs it supplied. The authoring operation
completes; ordinary evidence validation reports the false determination.
{cite}`requirements.authoring.submission`
{cite}`requirements.authoring.delivered_inputs`
{cite}`requirements.authoring.persistence`
:::