Skip to content
Agent Field Notes
Course contentsExpand a topic to choose a lesson.

SYSTEMATIC LEARNING / FOUR-LEVEL COURSE

Task contracts and independent acceptance checks

Make the execution environment, permissions, status, evidence and completion judgment of the model into a project contract.

Learning objectives: A harness turns goals into executable boundaries and verifiable artifacts. The model may change the solution, but cannot manufacture success by changing permissions or acceptance criteria. Recovery rebuilds the working view from facts rather than treating a progress summary as authoritative system state.

Content checked: 2026-10-30 · Each level has independent explanations, tasks and inspections

Choose a starting point based on your familiarity with this topic. Current level: Debugging · Diagnose failures. After completing the task, continue to the next level. Reading and self-checks alone do not establish mastery.

On this level

Review the prerequisites

Suitable for: Backend developers learning Agent applications.

Task contracts and independent acceptance checks
A harness turns goals into executable boundaries and verifiable artifacts. The model may change the solution, but cannot manufacture success by changing permissions or acceptance criteria. Recovery rebuilds the working view from facts rather than treating a progress summary as authoritative system state.

How does the mechanism work?

Step-by-step explanation
  1. How to prevent the Agent from modifying the acceptance criteria to pass itself?

    When the model controls the candidate implementation, check again whether it also controls the grader.

  2. A constraint is lost after context compression. How to find out the details at runtime?

    Summarization is lossy and hard limits cannot rely solely on model memory.

  3. What should I do if the recovery record is inconsistent with the current repository version?

    Persisted state may lag behind the actual environment, so reconcile facts before resuming.

Debugging · Diagnose failures

Trace counterexamples and failure windows

Objectives of this level: Repair self-reported grading on missing or foreign receipts.

Visual guide · Facts outrank a pass flag

Facts outrank a pass flag

The checker binds terminal state, tenant/task receipts and cost. Fixture labels are trusted inputs here; real receipt provenance needs an independent authority. Select the figure to open it at full size.

A green result can come from a broken judge

Start with three deliberately wrong rules: return claimed_passed; accept any receipt with the required ID; stop checking after the required receipt is found. The public cases respectively expose self-certification, identity omission and foreign-extra omission. The final status and cost are independent gates, not substitutes for receipt checks.

Trace a failure by boundary: input shape → task identity → terminal state → every receipt's scope/validity → required coverage → consumption. The checker accumulates the published failure codes in their stated order. Do not “repair” a failure by dropping a foreign receipt or converting a string cost into an integer; reject malformed input before computing business verdicts.

Keep two regressions: a genuine successful task whose model pessimistically says false, and a fluent successful claim with missing receipt. If both become the same outcome, the implementation has collapsed claims and facts. Then alter only one condition—cost equal to max_cost versus one unit greater—and explain why equality passes.

This exercise diagnoses the acceptance function. To diagnose a real application, also retain adapter provenance and the business ledger snapshot; a perfectly implemented checker can still receive fabricated facts.

Continue the same implementation

Use the complete function contract and reproduction commands in the implementation layer. Public cases remain in cases/harness-contract.json inside the existing extended-agent-practice-v1.zip. These are local fixtures, not remote-model or production-load measurements.

code example

Trace counterexamples and failure windows

A green result can come from a broken judge

Start with three deliberately wrong rules: return claimed_passed; accept any receipt with the required ID; stop checking after the required receipt is found. The public cases respectively expose self-certification, identity omission and foreign-extra omission. The final status and cost are independent gates, not substitutes for receipt checks.

Trace a failure by boundary: input shape → task identity → terminal state → every receipt's scope/validity → required coverage → consumption. The checker accumulates the published failure codes in their stated order. Do not “repair” a failure by dropping a foreign receipt or converting a string cost into an integer; reject malformed input before computing business verdicts.

Keep two regressions: a genuine successful task whose model pessimistically says false, and a fluent successful claim with missing receipt. If both become the same outcome, the implementation has collapsed claims and facts. Then alter only one condition—cost equal to max_cost versus one unit greater—and explain why equality passes.

This exercise diagnoses the acceptance function. To diagnose a real application, also retain adapter provenance and the business ledger snapshot; a perfectly implemented checker can still receive fabricated facts.

Acceptance task for this level

Use the faulty function below in the learner module, grade the same inputs to a before report, then write your own repair/diff and rerun. Do not edit cases or expected values. The defect is given: this is public repair, not unseen independent diagnosis.

Acceptance self-checks

Reading this browser’s record…

Hide the answer and check your understanding

Can a foreign extra receipt be harmless because the required one exists?

Further explanations and practice

When encountering unfamiliar principles, first read the implementation, continuous questioning and migration cases, and then independently explain the premise and boundaries. Answers and notes are saved to the original account record.

All linked explanations and exercises (1 )

Sources and verification scope

The principles are based on public information; the numbers, cases and tasks are the teaching design of this website. Offline experiments verify the range noted on this page, and the learning effect still needs to be judged through independent tasks and feedback.