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.submission_count

Requirements index · View definition

evidence Valid

Example

A model finishes with prose but no submit_judgment call: the harness reminds it once, and when it then calls submit_judgment, the assessment succeeds. When it ends with prose again, the assessment fails without writing evidence. A response with two submit_judgment calls also fails, even when their payloads are identical. A single call with invalid arguments fails without requesting a replacement submission. cite requirements.authoring.submission

Rationale

requirements.authoring.submission_count describes a concrete case with four expected outcomes. Two reviewed tests carry {test} references to it, and together they check each outcome. I did not read the CLI test’s helpers (Server, Fixture, reply, call). I judged their behavior from how the test uses them.

  1. Prose, then a reminder, then submit_judgment, succeeds.

    • In src/authoring/mod.rs#mod[tests]/fn[a_response_without_a_submission_is_reminded_once], the first scenario has an empty first turn followed by a valid submit_judgment.
    • The test asserts two requests, that the second request contains the exact reminder text, and that the result is Ok with rationale “Fine.”.
    • It also asserts that both turns are counted in usage.
  2. Prose again fails without writing evidence.

    • The same unit test has scenarios with two empty turns, and with empty, habeas call, empty turns. It expects an error containing “even after a reminder”.
    • It also asserts that only one reminder is sent.
    • tests/authoring_cli.rs#fn[missing_duplicate_and_invalid_submissions_preserve_existing_evidence] covers the empty-calls case end to end. It runs with and without --stdout.
    • It asserts that the exit is unsuccessful, stdout is empty, and the evidence file is byte-identical to the original.
    • It asserts that usage has evidence_written false, outcome “failed”, and request_count 2.
  3. Two submit_judgment calls in one response fail, even with identical payloads.

    • The CLI test sends one response containing two calls with the same valid payload.
    • It asserts failure, empty stdout, unchanged evidence, evidence_written false, and exactly one request.
    • It also asserts a null determination, so the first call was not accepted.
  4. A single call with invalid arguments fails without requesting a replacement.

    • The CLI test sends an empty rationale and an empty FIXME array, each as a single call.
    • The server is given one reply, and the test asserts server.finish().len() == 1 and request_count == 1. So no replacement submission was requested.
    • It also asserts failure, empty stdout, and unchanged evidence.

The cited requirements.authoring.submission is covered by the same tests. They check the reminder text, the single reminder, usage counting, and no evidence on failure. I found no scenario the example states that goes unchecked, and no assertion that contradicts it.

Inputs

Tests

Input 3: outline src/authoring/mod.rs mod[tests]/fn[a_response_without_a_submission_is_reminded_once]
    // {test}`requirements.authoring.submission`
    // {test}`requirements.authoring.submission_count`
    #[tokio::test]
    async fn a_response_without_a_submission_is_reminded_once() {
        let submit = json!({"determination": true, "rationale": "Fine."});
        for (turns, accepted, count) in [
            (
                vec![vec![], vec![("submit_judgment", submit.clone())]],
                true,
                2,
            ),
            (vec![vec![], vec![]], false, 2),
            (
                vec![
                    vec![],
                    vec![("habeas", json!({"file":"src/lib.rs","item":"fn[work]"}))],
                    vec![],
                ],
                false,
                3,
            ),
        ] {
            let project = inputs::tests::project();
            fs::write(project.path().join("src/lib.rs"), "fn work() {}\n").unwrap();
            let mut sources =
                AssessmentSources::prepare(project.path(), "requirements.ready").unwrap();
            let state = tempfile::tempdir().unwrap();
            let mut usage =
                UsageLog::start(state.path(), project.path(), &sources.subject_name).unwrap();
            let provider = RemindedProvider {
                turns,
                requests: RefCell::default(),
            };
            let result = assess(&provider, &mut sources, &mut usage).await;
            let requests = provider.requests.borrow();
            assert_eq!(requests.len(), count);
            assert!(!requests[0].contains("Reminder:"));
            assert!(
                requests[1].contains(
                    "Reminder: you MUST submit your result with the submit_judgment tool."
                ),
                "{}",
                requests[1]
            );
            // Both turns are counted in usage.
            let record = serde_json::to_value(&usage.record).unwrap();
            assert_eq!(record["requests"].as_array().unwrap().len(), count);
            assert_eq!(
                requests
                    .last()
                    .unwrap()
                    .matches("Reminder: you MUST")
                    .count(),
                1
            );
            if accepted {
                assert_eq!(result.unwrap().1["rationale"], "Fine.");
            } else {
                let error = result.unwrap_err().to_string();
                assert!(error.contains("even after a reminder"), "{error}");
            }
        }
    }
Input 4: outline tests/authoring_cli.rs fn[missing_duplicate_and_invalid_submissions_preserve_existing_evidence]
// {test}`requirements.authoring.submission_count`
// {test}`requirements.authoring.submission`
// {test}`requirements.authoring.usage_storage`
#[test]
fn missing_duplicate_and_invalid_submissions_preserve_existing_evidence() {
    let valid =
        json!({"determination":true,"rationale":"The reviewed sources support the subject."});
    for calls in [
        vec![],
        vec![
            call("one", "submit_judgment", valid.clone()),
            call("two", "submit_judgment", valid),
        ],
        vec![call(
            "bad",
            "submit_judgment",
            json!({"determination":true,"rationale":""}),
        )],
        vec![call(
            "empty",
            "submit_judgment",
            json!({"determination":{"FIXME":[]},"rationale":"No gap identified."}),
        )],
    ] {
        for stdout in [false, true] {
            let count = if calls.is_empty() { 2 } else { 1 };
            let server = Server::start(vec![reply(calls.clone()); count]);
            let fixture = Fixture::new(&server.endpoint);
            let mut args = vec!["author-evidence", SUBJECT];
            if stdout {
                args.push("--stdout");
            }
            let output = fixture.run(&args);
            assert!(!output.status.success());
            assert!(output.stdout.is_empty());
            assert_eq!(server.finish().len(), count);
            if calls.is_empty() {
                assert!(String::from_utf8_lossy(&output.stderr).contains("even after a reminder"));
            }
            assert_eq!(
                fs::read_to_string(&fixture.evidence).unwrap(),
                fixture.original
            );
            let usage = fixture.usage();
            assert_eq!(usage["outcome"], "failed");
            assert_eq!(
                usage["evidence_output"],
                if stdout { "stdout" } else { "file" }
            );
            assert_eq!(usage["evidence_written"], false);
            // A response without a submission is reminded once.
            assert_eq!(usage["request_count"], if calls.is_empty() { 2 } else { 1 });
            assert!(usage["determination"].is_null());
        }
    }
}

Referenced definitions

Input 2: requirements selection requirements.authoring.submission
:::{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.
:::

Other sources

Input 1: requirements selection requirements.authoring.submission_count
:::{example} submission_count
A model finishes with prose but no `submit_judgment` call: the harness reminds
it once, and when it then calls `submit_judgment`, the assessment succeeds. When
it ends with prose again, the assessment fails without writing evidence. A response with two `submit_judgment` calls also
fails, even when their payloads are identical. A single call with invalid
arguments fails without requesting a replacement submission.
{cite}`requirements.authoring.submission`
:::