# Protocol 025: the decision map on fresh instances
Status: draft, to be declared by recording the frozen manifest's SHA-256 in HANDOFF.md before any run of pynn_seed 15 to 18
Date: 2026-11-13

## Goal
Test protocol 024's decision rule, with nothing refitted, where 024 could not: on network instances that have never been built, and on signal strengths between and below the three that 024 used. 024 passed on held runs whose readouts were already published, on a 3 × 3 grid. This protocol runs three fresh instances on a 5 × 5 grid and scores the rule on cells fixed now.

## Non-goals
- No change to the rule: readout, calibration, v and T = 0.32 are 024's.
- No market data and no action of any kind.
- No lesion runs, so no claim about the cortex's own connections (024's pilot lesion run passed too).
- No claim about cat cortex.

## Design
- **Signals.** A is a grating at 45°, B one at 135°, shown together for one step with protocol 017's timing (210 ms on, 147 ms grey, 504 ms grey lead-in). Strengths: contrasts of 0, 7.5, 15, 22.5 and 30 %. The 25 cells (a, b) are the blank, eight single gratings and sixteen plaids. The largest summed contrast is 60 %.
- **Steps per instance:** one warm-up step [45°, 30 %], not analysed, then 112 analysed steps: the three calibration cells (blank, A alone at 30, B alone at 30) 8 times each, the other 22 cells 4 times each. 113 steps, 40.8 s of model time.
- **Order:** protocol 022's rule (four quarters, repeats spread evenly, each quarter shuffled, no cell three times in a row), first seed 250000 + 100 K. Each instance has its own order. The files are `work/controller-025/sequences/sequence-025-sK.json`, hashes in the frozen manifest and in `decide_025.py`.
- **Instances.** pynn_seed 15, 16 and 17, with reserve 18: the 2 mm reduction built as every instance since protocol 017 (the pilot's intact command plus `pynn_seed K`). No project file names a seed above 14 except synthetic test fixtures: on 13 November a search of the Mac's run folders and of the workspace for a pynn_seed of 15 to 18 and for run names with s15 to s18 found only `test_seed_search_023.py` and `test_compare_runs_023.py` (fixtures) and unrelated screenshot names. The lost research server cannot be searched; no plan of this project ever named a seed above 14.
- **Runs:** on the Mac, with the model and run files of protocol 023 revision 2, checked byte for byte against that protocol's file list at setup, and its run command and environment. Only the sequence file, the seed and the run name change.
- **The paired rule,** as in 023 revision 2: every instance is run at least twice with identical inputs and is analysed only if two completed runs agree on every field of the export but the run name and the run time (`compare_025.py`). A disagreement brings a third run and, if needed, a fourth. A seed is invalid after four completed runs without an agreeing pair, after two counted failures (a non-zero exit, a timeout, an exit 0 without an export, an interrupted attempt), after a memory kill, or when it would need a tenth attempt. A stop at the disk floor is not counted. One invalid slot gets the reserve. If three valid instances are no longer possible, the outcome is NOT INTERPRETABLE.
- **Limits per job:** memcap at 3.7 GiB with a disk floor of 3 GiB, one heavy job at a time, a 12 h timeout per run. An attempt starts only with 5 GiB free, and after a stop at the disk floor the queue pauses until it is started again. A paused or stopped queue may be started again and goes by its receipts: completed attempts are never rerun, and an attempt that was interrupted counts as a failure. Each completed run's Mozaik folder is packed into a verified archive and removed (023 revision 2's archive tool with its run-name pattern changed, nothing else).
- **Checks before scoring** (`decide_025.py`, refusals): the export is a run of the declared seed and shows exactly the declared sequence with the declared timing; every LGN spike train in the 504 ms lead-in equals protocol 023's reference (the engine check that caught the fault of 8 November); S is at least 1,500; the frozen readout code and the reference are at their recorded hashes. The export analysed is the earlier run of the agreeing pair, and the tool refuses any other file: it reads the queue's status and comparison records beside the export.

## The rule and the scored cells
v and the action are computed exactly as in protocol 024: z0 from the 8 blank steps, S from the 8 + 8 single steps at 30 %, v = −Im(z − z0) / S, action B above +0.32, A below −0.32, hold between.

| Cells | Steps per instance | Intended |
|---|---|---|
| equal strengths: 7.5, 15, 22.5 and 30 % on both | 16 | hold |
| A stronger by 15 points or more: A 15, A 22.5, A 22.5 + B 7.5, A 30 + B 7.5, A 30 + B 15 | 20 | A |
| B stronger by 15 points or more: the mirror cells | 20 | B |

- **Not scored, described:** the eight cells whose strengths differ by 7.5 points (A 7.5 alone, A 15 + B 7.5, A 22.5 + B 15, A 30 + B 22.5 and their mirrors). They are the transition zone; the map there is the descriptive result of this protocol. The calibration cells are not scored either.
- Of the 14 scored cells, 4 were also cells of 024 (15 + 15, 30 + 30, 30 + 15 and its mirror) and 2 more used 024's single gratings at 15 %; the other 8 cells contain 7.5 or 22.5 % and have never been shown to this model.

## Outcome
- **PASS:** every one of the three instances takes the intended action in at least 51 of its 56 scored steps (91 %), and the three together in at least 160 of 168 (95 %).
- **FAIL:** otherwise.
- **NOT INTERPRETABLE:** fewer than three valid instances, or a refusal of `decide_025.py`.
- The tool is run twice and the two result files must be byte-identical; if they differ, one rerun of the unchanged tool is allowed and reported, and if that differs too the outcome is NOT INTERPRETABLE. A NOT INTERPRETABLE or crashed analysis is not rerun with changed code or numbers; any follow-up is a new protocol.
- **Reported with no decision role:** v per cell and instance (the map), the actions in the transition zone, the relay rule on every two-signal cell, every attempt with its receipts, and the number of completed runs that disagreed with their instance's pair (counted from the comparison records).

## What is known beforehand (disclosure)
- 024's results on seven instances for the cells both grids share. They make a PASS on those cells likely. Nothing is known for 7.5 and 22.5 %.
- A FAIL is a real possibility: 024's closest scored step lay 0.026 from a threshold, and equal plaids reached |v| = 0.29.
- Three instances, not six: chosen for time on one laptop (about 4 h per instance). The pass marks are counts, not a test over instances.
- A rehearsal before this declaration ran the queue on built seed 6 with a 6-step sequence (two runs, compared, archived) to prove the tools; it showed four cells of this grid on instance B for one step each. Their readouts were written to a smoke file and not looked at for the rule; nothing in the rule can change anyway.

## Limits to state beside any outcome
- One orientation pair, one timing, one orientation map shared by all instances, single-step decisions, calibration from steps of the same run, three instances.
- The laptop's limits as stated for protocol 023 revision 2 (platform, engine patches, memory wrapper, one-off faults caught by the paired rule but not if identical in both runs).
- The queue is a new, short script, not 023 revision 2's frozen queue; it was rehearsed once on one seed with an agreeing pair, and its paths for disagreeing runs, failures and the reserve were reviewed but not exercised.
- The rule reads the whole model, input stage and cortex together.
- Simulation only; an engineering rule; no market signal, no action.

## Test plan
- `test_025.py`: the sequence rule and the declared files; the cell roles; a clean instance; a relay-like circuit loses steps; refusals; outcome boundaries; the comparison tool on agreeing, disagreeing and same-named exports; the lead-in check on the pilot export and on a changed train.
- The rehearsal above.

## Done when
- [ ] Manifest frozen and its SHA-256 recorded in HANDOFF.md before the queue starts
- [ ] Queue ended; three instances settled, or the reason recorded
- [ ] `decide_025.py` run twice, identical files
- [ ] Package and journal note with the outcome, the map and every attempt
