SR Method
SR Method EN

SR contracts

loop_contract.json and sr_contract.json.

SR contracts

SR contracts prove that Codex applied the loop and that validated user requests are covered.

The user normally does not edit these files manually. Codex creates, updates and validates them.

loop_contract.json

The Loop Contract answers:

Did Codex apply the SR loop correctly?

It contains:

  • sources read;
  • changed files;
  • commands executed or reason not executed;
  • user E2E tests;
  • memory updates;
  • conversation transition decision;
  • resume protocol.

Validation:

python3 scripts/codex/validate_loop_contract.py --file docs/codex/tasks/YYYY-MM-DD_slug/loop_contract.json

sr_contract.json

Since SR 3.0.0, the SR Contract answers:

Are all validated user requests covered or explicitly moved out of scope?

Its central field is validated_requests. A lot cannot be done if a validated intent remains open.

Validation:

python3 scripts/codex/validate_sr_contract.py --file docs/codex/tasks/YYYY-MM-DD_slug/sr_contract.json

Comparison

ContractQuestionUse
loop_contract.jsonWas the SR loop applied?Method control.
sr_contract.jsonAre validated requests covered?Product / scope control.

Useful prompt

Validate the SR contracts for this lot before closure. Run available validations and only report blocking points.

On this page