# Diagnostic sample-sequence evidence kit

This original, dependency-free Python teaching fixture accompanies the ISO 26262
software evidence guide. It executes a **fictional nonvehicle contract**. It does
not implement ISO 26262 or AUTOSAR Dem, assign ASIL, establish real-time behavior,
qualify any tool, or establish vehicle safety.

The flag is true after a sample exactly when the latest three samples are all
FAULT. HEALTHY and UNKNOWN each break the sequence and clear the flag. UNKNOWN
does not pause a sequence. Each independent trace starts with fresh state.
The full policy and exclusions are in `fixture/requirements.md`.

## Reproduce without replacing the retained capture

Use Python 3.10 or newer. No packages, network access or Proof installation are
required. In the extracted kit directory run:

```sh
python3 -B reproduce.py --output local-rerun
```

The output directory must not already exist. The script runs four child
commands, one for each named implementation. Child exit 1 reports a requirement
contradiction; child exit 0 reports no contradiction in these inputs. The
wrapper exits 0 only if the expected contrast was reproduced for all four
implementations. Its success does not mean the deliberately faulty baseline
or alternatives passed. Run commands, timestamps, durations, interpreter,
source hashes, actual child exits and output hashes are retained in
`captured/execution-report.json` for the original capture, and in the equivalent
file under your chosen output directory for your run.

## Inspect the retained evidence

Each implementation has a compact `selected-results.json` containing 12 named
traces, literal expected flags, actual flags and mismatch positions. A whole
trace fails if any flag differs. The selected cases cover threshold boundaries,
continued faults, interrupted partial runs and clearing an already raised flag.

The separate `enumeration-summary.json` reports all 1,093 traces over the three
symbols, of lengths 0 through 6 inclusive, with a few counterexamples. The full
row-by-row observations are in `enumeration-observations.jsonl.gz`; decompress
with a gzip utility or Python. All inputs have fresh state. The selected cases
overlap that campaign, so they are not 12 additional unique inputs. Counts
apply per implementation. Input validation branches are not exercised by this
alphabet campaign.

The baseline accumulates nonconsecutive faults. The correction resets on
HEALTHY or UNKNOWN and uses a saturating counter. Two seeded alternatives delay
the threshold by one sample or treat UNKNOWN as a pause. The independent oracle
inspects trailing three-symbol windows without using the implementation counter.
Literal selected expectations are also checked against that oracle.

Three logical samples do not mean a duration. There is no sampling period,
timestamp, scheduler, jitter, missing-call model, sensor, actuator, vehicle or
physical fault onset in this kit. Corrected agreement is bounded evidence for
the declared contract and inputs, not complete coverage, a proof over arbitrary
trace lengths, a safety validation result or a standard-conformity finding.

`SHA256SUMS` covers kit source and retained capture files. The ZIP checksum is
supplied separately beside the archive; archive self-hashing is not attempted.
