# Checking the failure review

This small package lets you recalculate the failure categories for all 15 gains
and seven losses in the original coding-model comparison. It covers both models'
primary attempts: 44 attempts and 88 saved final test stages. It does not run
models or repository tests, and it does not change the original results.

## Download and run

Save these four files in the same directory:

- [Test-level records](https://www.invarlock.ai/evidence/paired-coding-study/failure-records.json)
- [Python checker](https://www.invarlock.ai/evidence/paired-coding-study/check_failure_records.py)
- [Previously published review](https://www.invarlock.ai/evidence/paired-coding-study/changed-task-review.json)
- [Original task measurements](https://www.invarlock.ai/evidence/paired-coding-study/allocated-outcomes.csv)

Run with Python 3 (standard library only):

```sh
python3 check_failure_records.py
```

The checker reads the files beside the script; an optional directory argument
selects another folder. It makes no network requests and writes no files. It
checks the published file hashes, recomputes each stage's score and each original
grade, and reconstructs every changed task's failure category. It also checks
the 27 recorded patch-request rejections across the two empty-patch cases.

Expected categories:

| Losing attempt failed | Among 15 gains | Among seven losses |
| --- | ---: | ---: |
| Requested-fix requirements only | 15 | 5 |
| Existing-behavior requirements only | 0 | 2 |

The output lists each task, so you can inspect more than the aggregate totals.
The checker calculates the categories from test outcomes; the old review and
original CSV supply comparison values, not the new classifications.

## What the records contain

`failure-records.json` uses compact rows with column names in `test_columns`:

1. A task-local test ID (`T001`, `T002`, …).
2. The original requirement group: `bug_fix` or `preservation`.
3. The required number of observations for that identity.
4. GPT-6's preservation-stage outcomes.
5. GPT-6's combined-stage outcomes.
6. GPT-6.1's preservation-stage outcomes.
7. GPT-6.1's combined-stage outcomes.

`P` means a recorded pass; `F` means a recorded failure. Each character is one
observation, retaining multiplicity. `null` means the requested-fix requirement
does not belong to the preservation-only stage, not that a required observation
is missing. Missing, extra or invalid required observations are rejected.

For example, to inspect the actual rows for a task:

```sh
python3 -m json.tool failure-records.json
```

A stage passes only if every observation required there passed. A primary attempt
passes only if both stages pass. Requested-fix failures are read from the combined
stage; existing-behavior failures are read from either stage. An identity failing
in both stages is counted once within its group. Unrelated tests outside the
original required sets are omitted and do not affect the original grade.

Test IDs are assigned by sorting the original identities within each task and
replacing them with sequential labels. The same label connects both models and
both stages within that task. Labels do not identify tests across tasks. The
full private identity-to-label mapping is not published. The separate
[patch excerpt supplement](https://www.invarlock.ai/evidence/paired-coding-study/patch-excerpts.html)
identifies only three public upstream tests: Cookiecutter T002 and python-semver
T024/T025, with the relevant code and saved assertions.

Each stage retains completion flags and hashes of its original grade, JUnit
file and archive member. Each task retains its original requirement-contract
hash. For the two empty-patch cases, `request_columns` describes the retained
request ordinal, success flag, presence of an error and source-record hash.
Error messages and proposed edits are omitted. The empty patch hash identifies
an empty file; no nonempty patch is included.

## What was checked before publication

The extractor checked selected source bytes against the previously retained
archive-member pins, parsed all 88 saved JUnit files, matched their observations
to the saved grades, and checked the original required identities and counts.
All 44 grades and all 22 categories match the unchanged public results.

The public projection includes 796 task-specific required test identities. It
exports only existing public task/model names, fixed labels, counts, booleans,
pass/fail outcomes and hashes. Source code, patches, test names and parameters,
prompts, paths, timestamps, raw output, stack traces and error text are excluded.
No third-party source or test text is redistributed in this package.

## Verification boundary

These are **author-extracted, redacted records**, not original signed evidence.
The checker verifies their internal consistency and agreement with the original
public results. File hashes identify the downloaded version; source hashes let
archive holders compare originals. Neither proves to a public reader that the
redaction faithfully represents the private archive. The package has no new
signature and is not an independent audit.

Without the private mapping and originals, readers cannot validate every test
group's meaning or membership, or verify that a test ran as recorded. The separate
patch excerpt supplement makes the two authored code explanations inspectable;
it does not authenticate their extraction from the private archive or establish
every effect of the patches. Neither package establishes failure severity or a
model-wide error profile.

The original study archive, measurements, grades, uncertainty intervals and
evidence anchors remain unchanged. No new experiments were performed.
