slit gap readbacks) is directly queryable by the agent. PVs that the
archiver *doesn't* record (e.g., the computed σ samples inside the
Python script's memory) must be saved to a text/CSV file by the operator
and inspected via shared filesystem.
### 6.2 Test sequence
| # | Test | What operator does | What agent verifies (archiver / shared file) |
|---|---|---|---|
| T1 | Beam-off smoke test | Run flying_chi with `startCHI=-0.2, endCHI=+0.2, flight_velocity=0.1`, beam **off**. Capture console output to `/SNS/users/6ov/BL4B/<date>/flying_chi-T1.txt`. | (a) `chis.RBV` swept monotonically across the window. (b) All flight-mutated PVs (`VELO` if set, `VMAX` if set, `BDST`, `EventUpdatePeriod`, three slit Y-gaps) match pre-window values post-window. (c) Console log reports ≥30 samples per profile PV. |
| T2 | Pre-flight cadence-check failure | Run with `event_update_period_ms = 10`. | Script aborts before the sweep starts (no chis motion in archiver). Console shows the explicit cadence-check error. Verifies §5.3 defensive code path. |
| T3 | Back-to-back with CHI_scan.py, beam on | Run CHI_scan.py to completion; immediately run flying_chi.py on the same sample/slit geometry. Save both scripts' console output. | (a) Archiver shows the 11 discrete dwell steps of CHI_scan.py followed by one continuous sweep of flying_chi.py. (b) Fitted chi centres from the two scripts agree within the larger of the two reported fit error bars. (c) flying_chi wall-clock time ≤ CHI_scan.py wall-clock time for the same sweep span. |
| T4 | MoveToXFit follow-through | Same as T3 with `MoveToXFit=True`. | Archiver shows a final `chis.put` to the fitted centre after the sweep ends. RBV converges to that value within `.RDBD`. |
| T5 | Restore-on-interrupt | Operator runs the sweep and hits Ctrl-C mid-flight. | Archiver shows `EventUpdatePeriod`, `VELO`, `VMAX`, `BDST`, and slit Y-gaps restored to pre-run values, even though the sweep did not reach `endCHI`. Proves the `try/finally` guards cover the interrupt path. |
### 6.3 Archiver query recipe for the agent
Per-test template the agent runs on the dev machine:
```bash
# Wrap the operator-reported run window; pad by ±30s for restore visibility
@@ -469,3 +469,10 @@ You are working in the tasking project, bl4b-alignment-integration branch. The c
> The script output for Q5 is at /SNS/users/6ov/BL4B/2026/04/14/baseline-event-update-period.txt, please review it. You may write your plan into the tasking project, plan/refactor-chi-scan-with-flying-callback-technique.md
Claude developed [refactor-chi-scan-with-flying-callback-technique.md](refactor-chi-scan-with-flying-callback-technique.md)
### Prompt 3.3
> Great! Regarding 'Testing', you are executing on a development machine which has only archiver access. Where testing is needed, please prompt me to perform the needed operations on the instrument, while you observe the response through the archiver. I like your plan to validate by using the archiver data script we developed. Please update the plan to document this. Should we start a new context to execute the plan?