test(grpc-data-rig): #1115 scale profile (seed --scale N) and the #1026 scale gate

- device: read-only scale block (holding registers 1000..5095) + scale_set control action
- seed: GRPC_DATA_SCALE=N adds SOURCE driver modscale/dev with N UInt16 tags in TagGroups
  small (first 160) / large (rest), one RawTagGroup export + CONSUMER mapping each
  (map-scale-small|large); fixture.json records the counts
- rig.py: seed --scale N; deploy trigger gets a 60 s socket timeout (the AdminUI's
  StartDeployment ask waits up to 45 s; a 2048-tag snapshot read took ~25 s, so the
  general 15 s cap aborted the POST)
- scale_gate.py: opens a >128 and a >1024-item mapping via Client CLI recursive
  subscribes on CONSUMER, requires all Good, churns the block, restarts the SOURCE pair,
  requires all Good with a post-restart value, checks the consumer ResetHistory counter
  and the container logs for 'history expired'; PASS/FAIL + evidence/S1026-results.json

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-12-05 03:34:02 -05:00
parent 961ca2897c
commit 8ddae2f43d
7 changed files with 570 additions and 9 deletions
+28 -2
View File
@@ -199,6 +199,32 @@ python3 scripts/validation/grpc-data/rig.py down --run-id h923-gw
On the gateway the window is a fixed 120 s of the recent past (nothing is accumulated). H08 re-reads the window and answers the
previous full run stored in `evidence/H-gateway-baseline.json`, so run it after a full run on the same run id.
## Scale profile and the #1026 gate (#1115, opt-in)
`rig.py seed --run-id <id> --scale N` (N = 1..4096) adds a second SOURCE Modbus driver `modscale` → device `dev` with N
read-only UInt16 tags `t0000…` on the device fixture's scale block (holding registers 1000..5095, 250 ms poll group; the
driver coalesces contiguous registers, so 2048 tags are ~17 FC03 reads per poll). The first `min(N, 160)` tags are TagGroup
`small`, the rest TagGroup `large`; each group is its own Raw export (`export-scale-small|large`, RootKind `RawTagGroup`) and
CONSUMER mapping (`map-scale-small|large`, branch `remote-scale-small|large`, Browse/Metadata/Read/Subscribe). The manifest's
`fixture.scale` records the counts. Without `--scale` the seed is unchanged. The device's `scale_set` control action
(`{"action":"scale_set","value":v}`) sets every scale register to `v` at once (initially 1).
```bash
python3 scripts/validation/grpc-data/rig.py up --run-id s1026 --timeout 900
python3 scripts/validation/grpc-data/rig.py seed --run-id s1026 --scale 2048
sleep 75 # CONTROL's ClusterNode contact refresh before the first deploy
python3 scripts/validation/grpc-data/rig.py deploy --run-id s1026 --timeout 300
python3 scripts/validation/grpc-data/scale_gate.py --run-id s1026 # PASS/FAIL, evidence/S1026-results.json
python3 scripts/validation/grpc-data/rig.py down --run-id s1026
```
`scale_gate.py` (gate #1026) needs a >128-item and a >1024-item mapping (N >= 1185). On CONSUMER's primary it opens one
Client CLI `subscribe --recursive` per mapping anchor, sets a fresh scale value and requires every item Good with it; reads
the consumer `ProjectedStreamDiagnostics` counters (`projection-diagnostics` node probe) on both CONSUMER nodes; churns the
scale block (`--churn-hz`, default 4) and `docker compose restart`s both SOURCE nodes; waits for the pair's readiness, stops
the churn, sets a never-used value and requires every item Good with it again; then requires the consumer `ResetHistory`
counter ("Source change history expired." resets) unchanged and no "history expired" line in the SOURCE/CONSUMER logs.
## Scenario authoring and node probes
The seeder is available through `LocalRig.seed_helper(action, *arguments)`. Its
@@ -252,7 +278,7 @@ graph. The ordinary Host image/configuration does not enable this fixture.
The standard-library Python fixture listens on Modbus TCP unit 1, container port
5020. Holding register 0 is a deterministic counter; 10–12 start at `[7,11,13]`;
20–63 are writable uint16 registers. Raw/UNS `scalar` both reach register 20;
20–63 are writable uint16 registers; 1000–5095 are the read-only scale block (see "Scale profile"). Raw/UNS `scalar` both reach register 20;
`counter` reaches 0 and `array0`–`array2` expose the fixed samples as individual
scalar registers. No unsupported array representation is invented by the seeder.
FC03/FC04 reads and FC06/FC16 writes are supported. Unmapped spans return exception
@@ -260,7 +286,7 @@ FC03/FC04 reads and FC06/FC16 writes are supported. Unmapped spans return except
The fixture-only HTTP API on container port 8080 has `GET /state` and
`POST /control`. Actions are `{"action":"advance","steps":1}`,
`{"action":"set","address":20,"value":42}`, and
`{"action":"set","address":20,"value":42}`, `{"action":"scale_set","value":7}`, and
`{"action":"drop_next_write_response"}`. The last commits and records one write
before closing its response connection. Bounded ledgers distinguish total requests,
read attempts, rejected writes and committed effects. The control API is never