Skip section navigation

Relay / fictional worked example

Sample bounded agent work order: intake replay behaviour

On this page

An example task that can be handed to an agent. It is intentionally narrower than “implement request management”.

Objective

Implement the RequestStore.create_if_absent contract and its tests so re-delivery of a previously seen external event cannot create a second request or silently overwrite conflicting data.

Authoritative context (read first)

In scope

  • 04-executable-example/relay/models.py
  • 04-executable-example/relay/store.py
  • 04-executable-example/tests/test_intake.py (store-related tests)

Out of scope

  • Product/UI policy, assignment workflow, notifications.
  • Changing the contract or schema without an explicit decision.
  • Adding a database, new framework, external packages or generic service infrastructure.
  • Introducing fuzzy or semantic duplicate detection.

Expected outcomes

  • New key creates a request with a stable ID and version=1.
  • Exact replay returns the existing request unchanged, created=False.
  • Same key with different canonical payload raises DuplicatePayloadConflict with no mutation.
  • Invalid required fields raise ValidationError without side effects.
  • Tests exercise both positive and negative cases.

Stop conditions

Stop and report, rather than work around, if:

  1. The contract and schema cannot both be met.
  2. A required library capability appears absent or contradictory to supplied documentation.
  3. The implementation requires edits outside permitted scope.
  4. Two substantial repair attempts produce no new diagnostic evidence.
  5. The local execution budget agreed for this task is reached.

Completion evidence

Return:

  • list of modified files;
  • concise explanation of key contract behaviour;
  • exact test command and output;
  • any deviations or open questions;
  • explicit declaration if the requested contract could not be implemented.

Do not state “tests passed” unless tests were actually run. Do not convert a stop condition into implicit permission to change architecture.

Consulting

Need help with the work?

We can review a design, help set up an AI-assisted workflow or work with your team on implementation.