# A documented cancellation promise and its evidence

This is a newly authored teaching requirement, not recovered customer intent
or an approved release policy. The original article's cancellation example
was illustrative and unexecuted. No historical cancellation failure is claimed.

The named synchronous Python interface is
`render(chunks, cancel_after, destination)`. The caller supplies a finite exact
list of byte chunks and either None (complete normally) or a positive exact
integer selecting an after-chunk cooperative cancellation observation. This
fixture admits only the two selected calls: chunks `[b'A', b'B']`, with
cancel_after equal to 1 or None. It is a caller-controlled teaching seam, not
an OS signal, asyncio task, interrupt, HTTP parameter or asynchronous cancellation
test. No input validator, other types, other chunk values/counts or cancellation
positions are exercised.

Each call has a fresh existing regular target file containing exact bytes KEEP
and a separate unrelated regular file containing exact bytes OTHER. Observing
cancellation after the first chunk must return exactly
`{'status': 'cancelled', 'published_bytes': 0}` and leave the target KEEP and
unrelated file OTHER. Normal completion must return exactly
`{'status': 'completed', 'published_bytes': 2}`, replace target contents with AB
and leave OTHER unchanged. Dictionary keys and value types are exact, including
integer fields excluding bool. The observer reads the complete two named files
after the synchronous function returns. This is not a general directory-tree,
crash, fsync, durability, I/O-failure, permission, symlink, concurrency or atomic
replacement promise. There are no temporary files in the correction.

The baseline streams directly into the target and notices the selected
cancellation only after writing A. Its cancelled reply looks right but the
target contains A, violating the authored promise. The corrected implementation
uses an in-memory BytesIO buffer, checks the same seam and only writes the final
target on ordinary completion. A deliberately seeded always-cancel/no-write
control preserves KEEP on cancellation but must fail the required normal case.
It is a sensitivity control, not a discovered product defect.

cases.json fixes the literal whole replies and complete selected file bytes
before execution. The strong witness compares those independently written
values; it does not generate expectations from either implementation. The weak
witness checks only cancellation status on the SAME observations and makes no
extra render calls. The harness profiles the actual selected imported render
code object, exact selected arguments and returned replies. Six actual render
entries/returns are expected: three variants times two fresh cases. The strong
case gates are expected to be baseline 1/2, corrected 2/2 and control 1/2.
Expected failing children are distinct from a passing demonstration wrapper.

The native structural campaign is separate: a single offline current-source
Proof build runs only documented_claim_verified on three fresh snapshot copies,
each with one eligible declared claim. S0 points to an absent witness path.
S1 supplies the existing weak witness and baseline implementation. S2 supplies
the strong witness and corrected implementation. The claim and references stay
the same. Missing path should WARN; existing S1/S2 paths should PASS. That S1
PASS is expected checker behavior, not a Proof defect or evidence its witness
ran. Exact native statuses, severities, selected denominator, fail threshold,
exits and stdout/stderr govern the recorded result; exit 0 alone is insufficient.

Native source inspection establishes the wider checker contract, but the three
snapshots do not exercise manual/signal evidence kinds, Unicode note boundaries,
generic disable policy, empty/nil/load-error paths, every suffix or path shape.
This does not inventory all shipped prose, satisfy documented_contract_tested
for a project, validate a signal, resolve implementing/test symbols, authenticate
manual review or approve a Change. This remains a check reference, separately
published as a reference rather than a promoted general obligation guide.
