---
title: "No Duck Left Behind · Agentic Atlas"
description: "No Duck Left Behind: a deterministic duck census rejects one manifest and turns its errors into a bounded redispatch."
canonical: "https://agentic-atlas.dev/nodes/no-duck-left-behind"
last-updated: "2026-08-19"
---

# No Duck Left Behind · Agentic Atlas

[← the survey](https://agentic-atlas.dev/atlas)

1. example of [The Contract Keystone](https://agentic-atlas.dev/nodes/the-contract-keystone)
   No Duck Left Behind
   Hook
   a deterministic duck census rejects one manifest and turns its errors into a bounded redispatch
   Thesis
   A deterministic duck census at the return seam rejects a manifest that merely looks complete, returns bounded clause errors, and re-dispatches with those errors, so the receiver never authors a duck assignment.
   Laws & fences
  - Reconstruct the keystone at the return seam: the spec names the exact CSV shape and every supplied duck exactly once, the assertion is a deterministic census that returns bounded clause errors, and recovery rejects the manifest and re-dispatches with those errors.
  - Letting the coordinator patch the manifest makes the receiver a second sorter that must invent the missing duck's assignment and choose which duplicate row to preserve; the whole candidate is rejected instead.
  - The census can name a missing duck and a duplicated duck without deciding where either duck belongs; it proves only the mechanically expressible clauses, not that Moby Duck belongs on shore crew or that Professor Waddles deserves ceremonial duty.
   When to reach
  - Reach for it when a return looks plausible, every row recognizable and fluent, but nothing at the seam distinguishes a complete manifest from one that merely looks complete.
  - Skip it for whether every useful semantic clause was captured or whether redispatch is allowed after external effects; those are Verification Asymmetry and Effect Discipline questions, and neither is part of this example.
   Provenance
   [no-duck-left-behind/choice](https://agentic-atlas.dev/nodes/no-duck-left-behind#choice) · v1.0.2
   Addresses
   atlas_cards no-duck-left-behind
2. [
   The Contract Keystone
   ](https://agentic-atlas.dev/nodes/the-contract-keystone)

The card, in place · its connections drawn edges from atlas_links no-duck-left-behind

On this plate

[context](https://agentic-atlas.dev#context)[problem-signal](https://agentic-atlas.dev#problem-signal)[choice](https://agentic-atlas.dev#choice)[before](https://agentic-atlas.dev#before)[implementation](https://agentic-atlas.dev#implementation)[result](https://agentic-atlas.dev#result)[verification](https://agentic-atlas.dev#verification)[lessons](https://agentic-atlas.dev#lessons) [relationships](https://agentic-atlas.dev#relationships)

Every section is addressable on its own. Read only the ground you need.

## Context

[](https://agentic-atlas.dev#context)

context.md

The annual bathtub parade has twelve rubber ducks and three flotillas. Each duck arrives with a short biography; a model assigns every duck to `adventure_crew`, `shore_crew`, or `ceremonial_crew` and gives a reason.

Three specimens establish the tone:

```
D-03  Moby Duck          enormous, dramatic, afraid of deep water
D-07  Professor Waddles  wears spectacles and audits breadcrumbs
D-11  Quack Sparrow      tiny hat, unreliable around crackers
```

The complete roster lives in [`ducks.py`](ducks.py). The sorter is represented by a frozen two-attempt fixture so the failure and recovery remain reproducible; the [seam](https://agentic-atlas.dev/glossary/seam) machinery around it is executable.

## Problem signal

[](https://agentic-atlas.dev#problem-signal)

problem-signal.md

The first manifest looks plausible. Every row has a recognizable duck, a valid flotilla, and a fluent reason. But Professor Waddles is absent and Moby Duck appears twice:

```
duck_id,flotilla,reason
D-03,shore_crew,Afraid of deep water
D-03,ceremonial_crew,Has undeniable stage presence
```

The receiver cannot repair the omission. It can see that `D-07` is missing, but choosing Professor Waddles's flotilla requires interpreting the biography the sorter was asked to judge.

## Choice

[](https://agentic-atlas.dev#choice)

choice.md

Reconstruct the keystone at this [return](https://agentic-atlas.dev/glossary/return) seam:

```
spec:       exact CSV shape + every supplied duck exactly once
assertion:  deterministic census returns bounded clause errors
recovery:   reject the manifest and re-dispatch with those errors
```

The nearest alternative is to let the parade coordinator patch the manifest. That makes the receiver a second sorter: it must invent Professor Waddles's assignment and choose which Moby Duck row to preserve. This example rejects the whole candidate instead.

## Before

[](https://agentic-atlas.dev#before)

before.md

The baseline stops after declaration:

```
duck biographies ──▶ sorter instructed to return CSV ──▶ coordinator trusts it
```

The [contract](https://agentic-atlas.dev/glossary/contract) is legible, but nothing at the seam distinguishes a complete manifest from one that merely looks complete. A twelve-row file can still contain eleven ducks.

## Implementation

[](https://agentic-atlas.dev#implementation)

implementation.md

The single structural shift is inserting an **enforcing return seam** whose failure has a declared recovery.

### Spec

[`contract.py`](contract.py) owns the mechanically expressible clauses:

```
EXPECTED_HEADER = ("duck_id", "flotilla", "reason")
ALLOWED_FLOTILLAS = frozenset(
    {"adventure_crew", "shore_crew", "ceremonial_crew"}
)
MAX_ERRORS = 3
```

Every supplied `duck_id` must appear exactly once, every flotilla must come from the allowlist, and every reason must be non-empty.

### Assertion

[`checker.py`](checker.py) parses the return, checks its exact header and field rules, then compares the returned ID multiset with the supplied roster. The first attempt produces a bounded report in contract vocabulary:

```
missing duck_id: D-07 Professor Waddles
duplicate duck_id: D-03 Moby Duck
```

The census can name both violations without deciding where either duck belongs.

### Recovery

[`demo.py`](demo.py) rejects that candidate and invokes the same sorting task again with the two errors. The fresh return contains one row for Professor Waddles and one for Moby Duck:

```
duck_id,flotilla,reason
D-03,shore_crew,Afraid of deep water
D-07,ceremonial_crew,Can audit the breadcrumb budget
```

The checker returns no errors, so the seam accepts the manifest. The receiver never authors a duck assignment.

## Result

[](https://agentic-atlas.dev#result)

result.md

The same roster and the same contract produce two candidates separated by one assertion:

```
attempt 1 ──▶ REJECT: D-07 missing; D-03 duplicated
                         │
                         └── bounded error report ──▶ fresh attempt

attempt 2 ──▶ ACCEPT: twelve ducks, twelve rows, twelve unique IDs
```

The declaration became operational. A failed clause now selects a defined recovery instead of becoming an inconsistency the coordinator works around.

## Verification

[](https://agentic-atlas.dev#verification)

verification.md

Run the example from its directory:

```
python3 demo.py
```

The script asserts that the first return fails for exactly one missing and one duplicated duck, its report stays under the three-error bound, the sorter is invoked again rather than repaired by the receiver, and the second return passes. The checker is deterministic: the same roster, bytes, and contract produce the same verdict.

This proves only the clauses expressed in [`contract.py`](contract.py). It does not prove that Moby Duck belongs on shore crew, that Professor Waddles deserves ceremonial duty, or that every useful semantic clause was captured. It also does not license [redispatch](https://agentic-atlas.dev/glossary/re-dispatch) after external effects. Those are Verification Asymmetry and Effect Discipline questions; neither is part of this example.

## Lessons

[](https://agentic-atlas.dev#lessons)

lessons.md

**No duck left behind; no duck counted twice.** The spec names the acceptable crossing, the assertion distinguishes a candidate from it, and recovery gives rejection somewhere to go.

Rubber ducks are furniture. The three-role loop travels to ticket manifests, batch classifications, generated files, and return envelopes. What matters is that the assertion speaks the contract's clauses and that failure selects recovery at the seam.

The relationships ledger

Evidence-bearing references

## Relationships

Every connection keeps the section where it was found. The map above orients; this ledger carries the evidence.

### Outbound references 0

1. No outbound references.

### Inbound references 2

1. in-slice · occurrence 1
   [The Contract Keystone](https://agentic-atlas.dev/nodes/the-contract-keystone#evidence-what-the-argument-rests-on)
   a deterministic duck census rejects one manifest and turns its errors into a bounded redispatch
   Evidence: [Evidence](https://agentic-atlas.dev/nodes/the-contract-keystone#evidence-what-the-argument-rests-on) · occurrence 1
2. in-slice · occurrence 1
   [The Contract Keystone](https://agentic-atlas.dev/nodes/the-contract-keystone#examples)
   a deterministic duck census rejects one manifest and turns its errors into a bounded redispatch
   Evidence: [Examples](https://agentic-atlas.dev/nodes/the-contract-keystone#examples) · occurrence 1

[↑ back to the top](https://agentic-atlas.dev#content) [← the survey](https://agentic-atlas.dev/atlas)

Node no-duck-left-behind · corpus 31de4cb · Catalog revision 35263c4c415da742953d0462804fb14424e2244dae4c63efd27e468988de70ab