# Requirement and harness contract for this new teaching execution

The governing text is the byte-identical retained `requirement.json`, draft
SW-REQ-241 revision1. Its author supplied the rule; no customer or policy
approval is claimed. A same-key retry with `0 <= elapsed_hours < 24` must
return the original reservation and create no second reservation. This new
execution does not approve or expand that draft.

The named interface is the retained Python
`ReservationStore.reserve(key, now_hours)`, not an HTTP endpoint. There is no
HTTP header, payload-conflict, replica, retry-transport, concurrency or process
restart test. Each case starts a new single-process in-memory SQLite store,
reserves `client-key-1` at logical hour0, then schedules one same-key retry.
The tested incoming values are exactly0,1,12,23,23.5,24,24.5 hours. Those
selected values are a finite sample, not the full numeric domain. Clock values
are injected; no wall-clock waiting occurs. The half-hour neighboring values
are exactly representable selected examples, not an asserted clock granularity
or exhaustive boundary coverage. Types, parsing, nonfinite times and negative
times are outside this execution; no validator is exercised.

`cases.json` owns literal expectations independently of retention config and
the implementation's `expires > now` calculation. For five in-promise cases,
the complete returned value is exact integer1, and the complete ordered
`reservations` table is `[[1]]`, with exact integer row fields. A fresh SQLite
table's first generated ID1 is a checked fixture starting condition, not a
general product requirement. Setup is checked to return1 with exactly that
row before retry evidence is evaluated. The requirement then demands the
original identity and no additional reservation. Table rows are queried
directly by the harness; they are not supplied by the adapter or inferred
from the implementation's `count()` method. `retry_keys` rows and actual
transaction settings are recorded as diagnostics, without inventing a rule
that internal key metadata must remain unchanged.

At24 and24.5 hours this draft supplies no permitted/forbidden outcome. Those
rows receive an unresolved oracle and are reported as characterization only,
never pass/fail requirement evidence. The historical case expecting a new
reservation at24 remains archived as the implementation convention it was.
This exercise deliberately leaves that policy decision open.

Honest adapter execution must enter the exact retained `reserve` code object
twice with the declared key and hours: once for setup and once for retry.
A single-thread `sys.setprofile` hook records entry/return, arguments, phase,
source path/hash, function name/first source line and bytecode hash. It is a
bounded local observation of those calls, not an adversarial security monitor,
proof of every branch, or automatic model-to-product semantic validation.
The previous profile hook must be absent and is restored afterward.

One deliberately wrong test-only `skip_retry` adapter returns the setup ID
without invoking retry. On B at12 hours it makes the business observations
look correct while the expected retry call is missing. The grounding gate
rejects that row as invalid harness evidence. It is a designed sensitivity
control, not a discovered product defect, an implementation repair or evidence
that all bad harnesses are detectable.

Configuration A retains keys for24 hours, B for12, and C restores24. These
new runs reuse the retained implementation and exact snapshot JSON bytes;
they do not rerun the historical Proof audits/packages or authenticate a
customer incident. Changing B's configuration back to24 is the implemented
correction under this draft. A wrapper accepts the demonstration only when
the actual child gates are A=0,B=1,C=0,skip-retry-B-at12=1 with the specified
observations. Expected failing children are separate from passing acceptance
of the corrected implementation. A green wrapper does not mean B passed.

Reads occur on the same live in-memory connection after the implementation's
commit. They establish in-process stored rows at that point, not disk/restart
durability, power-loss recovery, SQL-failure atomicity or concurrent safety.
The actual runtime/SQLite versions, legacy/autocommit settings and transaction
state are recorded rather than retroactively pinned in the unchanged source.
Fresh local call traces do not fill the archived package's missing traced
per-requirement execution records or change its Change acceptance status.
