# PF-002 C3 analytical slice, version 1: Stage 3 report and launch plan

**Virtual lab - simulated experiment. Analytical model only.** Preparation only. No report has been built or executed. `execution_authorised` is false and the twin is in the reviewed `fixture` lifecycle state. A future report would record that stated algebra and arithmetic hold. It would not be physical validation, mechanism existence, apparatus qualification or a literature exclusion. The original gaps stay recorded in the report itself:

- `P-theta` and the output law
- `Y` and the autonomous ledger
- K2 closure
- no applicable bound on original C3 established by the bounded two-source assessment, which is not a universal absence of bounds

## Files

| File | Role |
| --- | --- |
| `pf002-c3-analytical-v1-protocol.json` | Two lifecycle placeholders added at `f7c0f1a`. The freeze is unchanged, digest `4649adfa77a9f80a75d594a831f82bcaee2656c707ca5ca389cdd72b9481f290` |
| `pf002_c3_analytical_guard_v1.py` | Explicit lifecycle pin, below |
| `pf002_c3_analytical_report_v1.py` | Report builder and strict validator. Stdlib only, spawns no process |
| `pf002_c3_analytical_supervisor_v1.py` | Bounded launch supervisor |
| `test_pf002_c3_analytical_v1.py` | 54 tests. Report and supervisor tests use structural stubs and stub children only |
| Checker and oracle | Unchanged since `035f7fe`. Equations, cases and tolerances unchanged |

## Lifecycle pin, explicit transition

Stage 2's whole-twin pin, `3528ee76...`, could not admit any authority change, so it was replaced explicitly by two parts.

**`SCIENCE_DIGEST`** = `ccee76b0447ae8c1994e261462b28eab64f13c23b83d4e3926065044b9d5484d`. It covers every field except six lifecycle keys:

- `execution_authorised`
- `fixture_verification_authorised`
- `authorised_modes`
- `review_state`
- `stage_3_report_release`
- `stage_3_review_note`

The exact top-level key set is still enforced.

**Exactly two lifecycle states are admitted.** The notes must be non-empty strings of at most 600 characters in both.

| State | `execution_authorised` | `fixture_verification_authorised` | `authorised_modes` | `stage_3_report_release` |
| --- | --- | --- | --- | --- |
| `fixture`, current | false | true | `["analytical_verification_fixtures"]` | null |
| `report`, future | true | true | `["analytical_verification_fixtures", "analytical_report"]` | A 40-hex commit |

A partial transition is refused. So is a malformed release, and so is a science change carried with a transition.

**The twin must not change again after the run.** It is one of the report's `implementation` files, and publication checks that those bytes have not drifted.

## Report schema, `pf002-c3-analytical-v1-report/1`

**Format.** Strict JSON with no floats: at most 256 KiB, 20000 nodes and depth 12. Duplicate keys, non-finite values and non-NFC keys or strings are refused.

**Publication-native provenance**, matching `scripts/research-publication.mjs`:

- `label` is "Virtual lab - simulated experiment".
- `implementation` maps file names in `experiments/pf-001` to `sha256:` plus the raw-byte hex: guard, checker, oracle, report builder and twin.
- `source` is `{commit, mode, released_commit}`. `commit` is the 40-hex HEAD at the run, passed by the supervisor and checked against it.
- `study` and `protocol_revision` are the record's identity.

The record also carries:

- `kind` and `status`, both stating "not physical"
- `inputs`: the sha256 of the dossier and source ledger
- `runtime`: version and interpreter
- the freeze and science digests, and `lifecycle`

**Complete fixed inventory, from the frozen cases only:**

| Section | Entries |
| --- | --- |
| `identities` | 95: V1 3, V2 2, V3 16, V4 15, V5 35, V6 20, V9 4 |
| `numeric` | 10: V7 6, V8 4 |
| `inequalities` | 6 V9 margins |
| `quotients` | 20 |
| `required_cases` | The 14 frozen cases, in frozen order, with 20 labelled subcases |

Each subcase keeps its exact guard request, its label and its state. IDs, items, order and counts must match exactly, and an empty or reordered list fails.

**Values.** Signed exact rationals, `n/d`. Polynomial terms with a checked monomial syntax, unique monomials and nonzero rational coefficients. Finite Decimal text matching `-?d+(.d+)?(E[+-]?d+)?`.

**Recomputation.** The validator recomputes, and does not trust, each of these:

- every identity state, from its three serialised values
- every numeric entry's relative difference, quoted values and state, from its raw values and the frozen claim and tolerance
- every inequality and quotient state
- the summary counts

Every required subcase must reach its case's frozen state, or the report is refused.

**Exact fields:** `provenance`, `gaps`, `prohibited_claims` (equal to the twin's), `unit_checks` (all four true, labelled as assertions, not identity states) and `runtime`. Each must match exactly.

## Launch, only after root's release

**Steps:**

1. **Root reviews this preparation:** the code, schema, supervisor and this plan.
2. **A lifecycle-only commit is made after root's release.** It applies exactly these three edits to the twin:
   - `"execution_authorised": false` becomes `true`
   - `"authorised_modes"` gains `"analytical_report"`
   - `"stage_3_report_release": null` becomes the full hash of the commit root reviewed

   It also updates the two notes. No other byte changes. The commit is pushed clean.
3. **One run, from the repository root:**

   ```sh
   python3 -I -B experiments/pf-001/pf002_c3_analytical_supervisor_v1.py --evidence report-1
   ```

**One global clock** of 300 s starts when the supervisor starts. It bounds everything: git checks, the child, survivor checks, validation and the receipt.

- Every git or `ps` command has a timeout of at most 20 s and never more than the time left.
- The child gets the time left minus a 30 s cleanup reserve.
- The reap after a kill is bounded at 10 s.

**The supervisor refuses, before creating anything, unless all of these hold:**

- the twin is in the `report` state
- the tree is clean and HEAD equals its upstream
- the released commit is an ancestor of HEAD
- the six code files are byte-identical between that commit and HEAD

**It then:**

1. Creates the fresh, ignored `.cache/review-evidence/pf002-c3-analytical-v1/report-1`.
2. Runs one child in its own process group, with stdin closed:

   ```sh
   python3 -I -B experiments/pf-001/pf002_c3_analytical_report_v1.py --report EVIDENCE/report.json --source-commit HEAD_HEX
   ```

3. Drains stdout and stderr through pipes. It kills the group the moment either stream passes 64 KiB, or the child budget ends.
4. Always kills the group, and checks for survivors by `killpg(pgid, 0)` and independently by `ps`.
5. Validates the report, and binds its `implementation`, `inputs` and `source.commit` to the hashes and HEAD taken before launch.

**Signals and exceptions.** TERM, INT and HUP raise inside the supervisor. Facts are recorded as they happen, the group is killed on every path, and the receipt is written whatever stopped the run. Any other exception is recorded by type only, and fails closed.

**Ownership.** The report builder spawns no process. Group cleanup covers the child and anything left in its group. A descendant that leaves the group with `setsid` would be outside this supervisor's ownership, and that is stated, not claimed away.

**The receipt**, written no-clobber as `receipt.json`, with schema `pf002-c3-analytical-v1-launch-receipt/1`, records:

- supervisor PID, parent PID and child PID
- start and end times, elapsed time, stop reason, reap, exit and both survivor checks
- stream bytes and sha256
- HEAD, upstream, clean state and the 11 transitive source hashes, before and after
- runtime version and the executable's sha256, and redacted argv
- the report's bytes, sha256 and summary
- the failures and the outcome

**The raw launch file.** `raw-launch.json` holds the full executable path, the original supervisor argv and the child argv and working directory. It stays in the ignored directory, its sha256 is in the receipt, and it is never published.

**Failure.** Any failure gives outcome `failed` and exit 1, and is retained. There is no retry, replacement run or tuning.

## Preparation record

| Step | Commit | Result |
| --- | --- | --- |
| Preparation | `f7c0f1a` | Builder, schema, supervisor, lifecycle pin, plan, stub tests |
| Fixture invocation 3 | at `f7c0f1a` | **Failed, retained.** Exit 1, 1 error of 51. The validator raised the guard's `GuardRefusal`. Receipt sha256 `414ce40af6a9e6cc42a6ea9add52a9aa0b95cb6267e43a8760668d482a813e0b` |
| Validator fix | `5c88608` | Refusals stay `ReportRefusal` |
| Fixture invocation 4 | at `5c88608` | Exit 0, 51 of 51. Receipt sha256 `fb99eaebc1333df619bc693704c47fc6308be2f87068d618377ca1b27baf96e2` |
| Plan record | `c00cbbb` | First handoff |
| Root interim findings | - | Shape-only validation, provenance shape, stream caps after the wait, unbounded reap, a clock that missed the pre and post steps, no signal handling, redacted argv only |
| Schema and supervisor hardening | `26a8c60` | All of root's findings. Also fixed before any run: `_quoted` could overflow the 28-digit default context at `Cm`'s 1e-28 quote, so it now uses a 60-digit local context. That changes no result that already fitted |
| Fixture invocation 5 | at `26a8c60` | **Failed, retained.** Exit 1, 3 failures of 54. Launcher PID 70435, child 70439, 4.321 s, stderr 9429 bytes, sha256 `02414dac45e64387940b7734335db697b163390170f7df874bd3cb985d924536`, receipt sha256 `6c708cbdf5cdeb76856b2d3f4aa673efea4263275ecfc50fc4d6d7050c264013`. Two test defects: a hand count of 22 subcases where the frozen cases give 20, and a tamper aimed at a quotient that was already verified, so it changed nothing |
| Test corrections | `3be8391` | The test's count is now 20. The tamper now targets a guarded zero quotient. Validator and builder unchanged |
| Fixture invocation 6 | at `3be8391` | Exit 0, 54 of 54. Launcher PID 72028, child 72032, 4.312 s, stdout 0 bytes, stderr 7382 bytes, sha256 `dbb8ada79cdac65cf6e6559d36cfa021e8ff45146477d4f4e3f2c122af6083cf`. No group survivors. HEAD, upstream and all 11 sources unchanged, tree clean. Receipt sha256 `92fc69bd14f1fcd49a360ea91810de38fc96f60c57c43acfbfe96ad418304017` |
| Root final read | - | Two launch blockers. A signal inside the drain lost the bytes already read, and up to 128 KiB could be held before the kill. Required subcases checked only the request kind and the state, so a tampered request that kept its old state passed |
| Blocker fixes | `63256b1` | Stream bytes go to shared buffers as they are read, kept on signals and exceptions, and never above 64 KiB, with the overflow flagged. Each required request is rebuilt from frozen inputs and the report's own validated entries, compared exactly and reclassified, with no checker run. Plan prose no longer implies a universal absence of bounds |
| Fixture invocation 7 | at `63256b1` | Exit 0, 54 of 54. Launcher PID 79134, child 79138, 4.582 s, stdout 0 bytes, stderr 7382 bytes, sha256 `404df0354ce8b389f2a1d143d674b21ab3c8f67deda285fcb6be934d54fd8802`. No group survivors. HEAD, upstream and all 11 sources unchanged, tree clean. Receipt sha256 `2f7139e1467232b1623aa415ed6d2ac74073c6a052ceb3cee841d51b6319918c`. The new checks sit inside existing tests: a flushed sentinel kept across SIGTERM, a stream retained at exactly 64 KiB, and seven request tampers that keep the old state |

Invocations 1 and 2 were in Stage 2. All seven used the scratch launcher from Stage 2 (current sha256 `a5ac2ccdca35d3a7711ee5697d0fb2df38352941e72ea4cfc1b377c830498366`) and the child command `python3 -E -s -B -m unittest -v test_pf002_c3_analytical_v1` in `experiments/pf-001`, on CPython 3.14.6. Evidence is in ignored `.cache/review-evidence/pf002-c3-analytical-v1/fixtures-*`. No report directory exists.

Source hashes at `63256b1`:

| File | sha256 |
| --- | --- |
| `pf002_c3_analytical_guard_v1.py` | `d1460fba4bc8e44179b224ecda26ed21448bd54ec887f893afd73d620ecc6115` |
| `pf002_c3_analytical_checker_v1.py` | `69b284844263cc8654cdd97d4d807599cdecc041fd1bfdc29735900dd1fc762e` |
| `pf002_c3_analytical_oracle_v1.py` | `08fbfc44d0d47bf6bef634dd4cf4bcf29fccf95e7a529529da2947b56a6c3207` |
| `pf002_c3_analytical_report_v1.py` | `107afde6364309e44cfc91142e08387b824ee99a8102d95f031604c6525e1dca` |
| `pf002_c3_analytical_supervisor_v1.py` | `613e0e8b4f35a3010a5c863a2956d764e34b03c8b3fc2a25ecc298b525aeb9d4` |
| `test_pf002_c3_analytical_v1.py` | `108747eaf81aab471af71f3cb34e642c5e4ea8c33cd78cbffe2f1bb88f868442` |
| `pf002-c3-analytical-v1-protocol.json` | `f150471bded296939cdfc56061e98d8bb545c89e26fbf380c7019bc3bade2cb4` |

## Not run, stated plainly

- **Never executed on real data.** As instructed, `compose`, `build` and `render` have not been run on the real twin. The validator has seen only structural stubs. A composition defect, or a real value outside the inventory, would first appear in the single reviewed run. It would be retained as a failure. An in-memory dry composition, never written or retained, would reduce that risk. It needs root's explicit say-so and is not done here.
- **Real-mode supervisor untested.** It has been exercised only through `supervise` with stub children, covering deadline, stream cap, SIGTERM and failure mapping, and through a refusal in the `fixture` state. Its git, release and report-binding steps run only in the `report` state.
- **Signal window.** A signal that arrives during the cleanup steps themselves could interrupt them before handlers are reset. The outer handler then repeats the group kill and still writes the receipt.
- **One Python version.** Only CPython 3.14.6 has run any of this code.

**Review commands for root.** These run tests only; none builds a report. From `experiments/pf-001`:

```sh
python3 -B -m unittest -v test_pf002_c3_analytical_v1
```

From the repository root:

```sh
python3 -I -B -c "import sys; sys.path.insert(0, 'experiments/pf-001'); import pf002_c3_analytical_guard_v1 as g; d = g.read_protocol_bytes(); print(g.freeze_digest(d), g.science_digest(d), g.load_protocol(data=d)['lifecycle'])"
```

## After a reviewed report

Publication preparation follows only after root reviews the actual report:

- a mechanism-first, accessible, static diagram
- three explanation layers
- source-linked forward paths labelled as proposals
- the environment badge before the verdict, and visible limits

A measured capacity proposal comes first. The archive is at 160 of 164 objects and 217 of 221 catalogue entries. There will be no silent cap increase, no deletion and no change to old bytes. No full gate, baseline, PR, merge or deployment is part of this stage.
