Skip to content
Merged
32 changes: 32 additions & 0 deletions design/70-carried-forward-register.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ Rows added since the triage:
| `R153` | `design/85` block 85a's Windows CI run, 2026-10-13 (not 85a's code) |
| `R154` | `design/87` block 87a's demo gate, scored from artifacts 2026-10-16 |
| `R155`–`R156` | `design/88` block 88a's gate selftest, demo gates and spikes, 2026-10-17 |
| `R157` | `design/88` block 88b's demo gate and spike rerun, scored from artifacts 2026-10-18 |
| `R158` | `design/88` block 88b's Windows CI run, 2026-10-18 (not 88b's code) |


## The work queue
Expand Down Expand Up @@ -231,6 +233,7 @@ Sorted by ease, then by importance. `→` names an existing block; do the block,
| `R96` | [An unterminated acquisition with every frame accounted is summarised to the user as a success](#r96) | MEDIUM | SMALL | |
| `R97` | [The runtime deadline includes Acquisition() construction, and nothing records how much](#r97) | LOW | SMALL | |
| `R155` | [Ctrl-C during a pycro-manager teardown wait can make a live waiter look finished](#r155) | MEDIUM | SMALL | |
| `R158` | [84a's window test reads the final display once, without a wait](#r158) | LOW | SMALL | |

**Demo machine**

Expand All @@ -251,6 +254,7 @@ Sorted by ease, then by importance. `→` names an existing block; do the block,
| `R75` | [Channel preset colliding with a typed actuator - rig coverage](#r75) | LOW | SMALL | |
| `R143` | [A spaced timelapse keeps time worse on an idle machine than beside a busy worker](#r143) | LOW | SMALL | |
| `R154` | [The metrics reader's cost above ~1,300 lines/s is unmeasured on Windows](#r154) | LOW | SMALL | |
| `R157` | [On a slowed demo machine, a disk-following package moves MDA frames onto a ~21 ms gap](#r157) | MEDIUM | SMALL | |
| `R156` | [Opening freshly written files costs ~30 ms each on the demo machine](#r156) | LOW | SMALL | |

**M2**
Expand Down Expand Up @@ -315,6 +319,7 @@ These need a code change and a test. Nothing here is waiting on hardware; the on

- **Status** — OPEN - `microclaw/tools_schema.py:707-713` warns only that zero-interval bursts may resist Stop, still inviting the false converse; design/69a explicitly leaves the finding open.
- **Changed by `design/88` 88a (2026-10-17)** — the premise "Microclaw cannot stop anything mid-tool" is no longer true for `run_mda`: Stop and Ctrl-C abort it within 1.1–1.2 s (demo gate, 4/4 per run), and `serve.html`'s Stop tooltip now says so. Yet in **both** gate sessions (n=2) the agent told the operator that Stop may not stop a zero-interval `run_mda`, attributing `run_timelapse`'s caveat to it as "the tool's own caveat" although `run_mda`'s description said the opposite. `e058daf` puts the contrast on `run_mda`'s `interval_s` description. **Check what the agent says before a zero-interval `run_mda` in 88b's gate session**; no 88a run tests the text.
- **Checked by `design/88` 88b (2026-10-18)** — asked before a 12000-frame, zero-interval `run_mda` with a package attached, the agent was **correct** this time: Stop or Ctrl-C aborts it "within about a second", "unlike `run_timelapse`", and it ran nothing. One slip: it called Stop "the MMStudio MDA control"; it is MicroClaw's "Stop after the current step" button. n=1 against 88a's two wrong sessions, so the `interval_s` wording is not shown to work; the verbatim reply is `r01.json` in 88b's gate evidence.
- **Importance** — HIGH - Misleading interruption advice can cause thousands of unintended exposures, wasting dose, data, and rig time.
- **Where** — LOCAL - The defect is in schema/disclosure wording and agent guidance, so code inspection and off-rig response tests can settle it.
- **Block** — NONE - Block 60 D5 introduced the zero-burst warning but does not disclaim added stoppability at nonzero intervals; Block 12 only requires disposition.
Expand Down Expand Up @@ -3346,3 +3351,30 @@ the model" as the actual blast radius.
- **Importance** — LOW.
- **Effort** — SMALL
- **Provenance** — `design/88` 88a, 2026-10-17.

### R157 — On a slowed demo machine, a disk-following package moves MDA frames onto a ~21 ms gap

**On 2026-10-18 the demo machine imaged a 1000-frame, 10 ms, zero-interval MDA in 14.6–16.9 s instead of 11.3 s, with gaps mixing ~11 ms and ~21 ms frames. In that state, a package following the dataset moved the gap p50 from ~12.7 ms to ~17 ms.**

- **What happened** — `design/88` 88b's two demo-gate runs (10:20, 10:34) were slow with or without a package: every run of the second, and all but two of the first (those two imaged in 11.0–11.3 s). The growing-reader spike (`design/88-spike-growing-reader.py`, no MicroClaw) measured 11.25–11.34 s spans and no reader effect at 08:51, and 15.2–16.5 s spans with the same p50 shift at 10:43. So the slow state is the machine's, and the shift is the package's load, not MicroClaw's supervision. 88b's cadence bound passed (1.064 on `duration_s`); the operator accepted it as measured.
- **Cause** — not identified, for both the slow state and the ~21 ms mode.
- **Why it matters** — SMLM needs a constant frame interval. A ratio on burst duration can pass while the per-frame interval distribution changes; design/89 and SMAPpy on M2 should look at gap p95 and the ~21 ms mode, not only the median duration.
- **What a fix would look like** — measure first: rerun the spike after a reboot with the old datasets deleted, and again with Defender's real-time scan excluded for the data folder (also `R156`), to find what brings back 11.3 s. Then decide whether the cadence bound for MDA should be on gap p95 as well as duration.
- **Where** — DEMO MACHINE.
- **Block** — NONE.
- **Importance** — MEDIUM.
- **Effort** — SMALL
- **Provenance** — `design/88` 88b, 2026-10-18.

### R158 — 84a's window test reads the final display once, without a wait

**`test_84a_fixture_live_pause_final_drain_and_eof` failed on Windows CI at its last line, `assert displayed(output, 3)`: one read of `display.json`, 0.2 s after the result, where every earlier display check uses a bounded `wait_until`.**

- **What happened** — PR #59, run 39113232886, `windows-latest`, 2026-10-18, at commit `100fd8b`. Since the previous green run (`5d418ec`) only files under `design/` had changed, so no code under test differed. 1 failed, 5954 passed. This is the test `R153` named, but a different line: R153 was the 8 s first-frame wait at `:1750`, which design/86 86a fixed.
- **Cause** — not identified. Either the worker had not yet drawn frame 3 within 0.2 s on the runner, or the read met the fixture's `display.json` replace (the race 86a found for the first frame). The assertion carries no `describe()` evidence, so the log cannot tell which.
- **What a fix would look like** — `wait_until(lambda: displayed(output, 3), describe)`, as the earlier checks do, so a failure carries the record, `poll()` and `display.json`.
- **Where** — LOCAL, then Windows CI.
- **Block** — NONE.
- **Importance** — LOW. The test, not the product: the product's result had already been asserted.
- **Effort** — SMALL
- **Provenance** — `design/88` 88b's CI, 2026-10-18.
127 changes: 127 additions & 0 deletions design/88-block88b-demo-gate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# 88b — demo-machine gate: package analysis on ND-TIFF MDA

Use **Windows PowerShell 5.1**, **Firefox**, and Micro-Manager open with the
usual demo config and bridge on port **4827**. Allow **20–30 minutes**;
measure takes about 5 minutes hands-off. No extra configuration or downloads:
prepare builds and installs both stdlib-only fixture packages offline, using
the installed slot's base Python.

Keep **MicroClaw closed except during session**. Prepare sets your package store
aside as `skill-packages.88b-saved`; verify restores it. On interruption use
cleanup below. Datasets stay under the workspace (or the launcher root if none),
in a `block88b-…` folder. Maximum imaging is 29,000 frames at 512 × 512 uint16,
about **15.2 GB**, with a 20% disk margin (about **18.2 GB**) checked first.
The refusal plans reserve an additional conservative 2,000 frames of disk,
so prepare checks about **19.5 GB** in total.
Datasets can be deleted after sending the evidence.

## 0. Install the branch

```powershell
cd D:\Code\microclaw
git fetch origin
if ($LASTEXITCODE -ne 0) { throw 'fetch failed' }
git checkout block-88b
if ($LASTEXITCODE -ne 0) { throw 'checkout failed' }
git pull
if ($LASTEXITCODE -ne 0) { throw 'pull failed' }
git merge-base --is-ancestor 03ab1de HEAD
if ($LASTEXITCODE -ne 0) { throw 'WRONG TREE - stop' }
.\install.bat
if ($LASTEXITCODE -ne 0) { throw 'install failed' }
```

Checking out the branch gives you the gate: **`install.bat` puts this branch in
the installed slot**. If installation pauses for bridge/setup, cancel with
Ctrl+C (Y); installation has completed. Close MicroClaw's console and launcher
windows. The update banner may say "diverged" until reinstalling from `main`.

## 1. Prepare (MicroClaw closed)

```powershell
.\design\88-block88b-demo-gate.ps1 -Phase prepare
```

Expect the operator-store backup, two offline installs
(`fixture-lab/photon-observer` and `weather-lab/thermal-observer`), six rotating
PLAN lines, the disk reservation and `RECORDED: prepare`. The launcher resolves
the installed slot's interpreter and checks MDA analysis support. Exit 2 means
**NOT EXERCISED**, never a pass. Keep the Evidence folder it prints.

## 2. Measure (MicroClaw closed, hands off)

```powershell
.\design\88-block88b-demo-gate.ps1 -Phase measure
```

**Do not click anything in Micro-Manager during measure. If a dialog appears,
leave it open, note its text and send the evidence.** Do not dismiss it or press
Ctrl+C to help the gate. A dialog during measure is a defect to preserve.

Six rotating repetitions of 1000-frame `none / photon` MDA bursts, interval 0,
10 ms, ND-TIFF; repetition 0 is warm-up. Then one thermal burst, two 2000-frame
photon MDAs stopped by the session cancel event at ≥200 frames, and TIFF and
feedback refusals that must start nothing. Each run prints its outcome, saved
frames and writer state, followed by its job ID and actual bound dataset.
The program waits up to the recorded terminal-job bound between runs, so a
late worker cannot contaminate the next measurement.

## 3. Session (Firefox, desktop icon)

```powershell
.\design\88-block88b-demo-gate.ps1 -Phase session
```

Follow the printed steps and **literal chat lines**; do not paraphrase them.
Typing STOP at a prompt abandons the phase.

1. Launch MicroClaw from its desktop icon. Put Firefox and PowerShell side by side.
2. Paste the printed R01 question about stopping a 12000-frame interval-0 MDA.
The agent must run nothing. Wait for its reply, then type DONE. The program
saves the reply verbatim from history in `r01.json`; it is reported, unscored.
3. Paste the printed 12000-frame `run_mda` line, with the actual photon digest.
Approve. You have about two minutes: answer the question and click Stop
promptly. While frames move and metrics are visible, type DONE. The program
takes `working.png` and asks whether photon's block shows changing values
and "up to frame" numbers. Answer YES or NO as you see it.
4. When instructed, click **Stop after the current step**, then type DONE.
The program takes `stop.png`. Wait for MicroClaw's reply, then type DONE.
5. Quit MicroClaw by closing its console and launcher windows; type DONE.

## 4. Verify and restore (MicroClaw closed)

```powershell
.\design\88-block88b-demo-gate.ps1 -Phase verify
```

Expect **B1–B8 and S1–S2 PASS**, R01 REPORTED verbatim, MEASUREMENT lines and
CLEANUP confirming your operator store is restored. Any FAIL or NOT EXERCISED
exits nonzero. A package that never reported during acquisition or fell more
than 200 frames behind is NOT EXERCISED, decided from package-side history.
If the package reported during acquisition but MicroClaw forwarded no live
metrics before completion, B4 FAILs. Only the median product photon/none
`duration_breakdown.duration_s` ratio is bounded, at **1.10** over five scored
repetitions per arm. Gap p50/p95, dispatch, save-path receipt, metrics load/lag
and writer-to-terminal times are reported without bounds.

Verification reads captured files only; it does not reopen datasets or query
hardware. The optional final restore uses the captured store-ownership record.
The 87a metrics scorer receives a temporary file-derived view of MDA's nested
arguments/duration and uses MDA acquisition completion as its live boundary.
The synthetic selftest labels UI and timing controls explicitly; it is no
substitute for this demo-machine run.

For an interrupted restore:

```powershell
.\design\88-block88b-demo-gate.ps1 -Phase cleanup
```

## 5. Send the whole Evidence folder

Send the folder printed by the launcher, even on failure: `gate.log`, prepare
and measurement JSON, releases and test-policy snapshots, `runs\*` (raw inputs,
results, events and receipt times, confirmations, engine state, clocks, dataset
facts, terminal job records and waits, analysis-directory listings), diagnostic
JSONL, `session.json`, `session-history\*`, `session-final\*`, `r01.json`,
`working.png`, `stop.png`, and `verify.json`. Datasets remain on the machine.
42 changes: 42 additions & 0 deletions design/88-block88b-demo-gate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
param(
[Parameter(Mandatory=$true)]
[ValidateSet('prepare','measure','session','verify','cleanup','selftest')]
[string]$Phase,
[string]$Out
)
$ErrorActionPreference = 'Stop'
$root = Join-Path $env:LOCALAPPDATA 'microclaw'
$pointer = Join-Path $root '88b-gate-evidence.txt'
if (-not $Out) {
if ($Phase -in @('prepare','selftest')) {
$Out = Join-Path $env:LOCALAPPDATA ('block88b-' + (Get-Date -Format 'yyyyMMdd-HHmmss'))
} elseif (Test-Path -LiteralPath $pointer) {
$Out = (Get-Content -LiteralPath $pointer -Raw -Encoding UTF8).Trim()
} elseif ($Phase -eq 'cleanup') {
$Out = Join-Path $env:LOCALAPPDATA ('block88b-cleanup-' + (Get-Date -Format 'yyyyMMdd-HHmmss'))
} else { throw 'No evidence folder recorded. Run -Phase prepare first, or pass -Out.' }
}
$active = (Get-Content -LiteralPath (Join-Path $root 'active-slot.txt') -Raw).Trim()
if ($active -notin @('a','b')) { throw 'active-slot.txt must name a or b.' }
$python = Join-Path $root "env-$active\Scripts\python.exe"
if (-not (Test-Path -LiteralPath $python)) { throw "Gate interpreter missing: $python" }
# The installed slot, not this checkout, must carry block 88b.
$previous = $ErrorActionPreference
$ErrorActionPreference = 'Continue'
& $python -I -c "from microclaw.tools_schema import ANALYSIS_TOOLS, TOOLS; assert 'run_mda' in ANALYSIS_TOOLS; assert 'analysis' in next(t for t in TOOLS if t['name'] == 'run_mda')['input_schema']['properties']" 2>&1 | Out-Null
$probe = $LASTEXITCODE
$ErrorActionPreference = $previous
if ($probe -ne 0) {
Write-Host "NOT EXERCISED: $python lacks block 88b. Run step 0 (install.bat on this branch)." -ForegroundColor Red
exit 2
}
New-Item -ItemType Directory -Force -Path $Out | Out-Null
if ($Phase -eq 'prepare') { Set-Content -LiteralPath $pointer -Value $Out -Encoding UTF8 }
Write-Host "Gate interpreter: $python"
$ErrorActionPreference = 'Continue'
$gateArgs = @((Join-Path $PSScriptRoot '88-block88b-demo-gate.py'), $Phase, '--out', $Out)
& $python @gateArgs
$code = $LASTEXITCODE
$ErrorActionPreference = 'Stop'
Write-Host "Evidence: $Out"
exit $code
Loading
Loading