310 lines
11 KiB
Markdown
310 lines
11 KiB
Markdown
TASK_ID = RF001A_OTA_CAPTURE_003
|
|
TASK_TITLE = Start coordinated RF-001A common-clock OTA capture
|
|
SOURCE_BRANCH = video-development
|
|
EXPECTED_HEAD = bc55d0516dc1ee36cefa1ff096e7d86f60645303
|
|
REQUIRES_APPROVAL = YES
|
|
HARDWARE_ACCESS = YES
|
|
RF_RX = YES
|
|
RF_TX = NO
|
|
ALLOW_COMMIT = NO
|
|
ALLOW_PUSH = RX_RESULT_ONLY
|
|
RISK_LEVEL = YELLOW
|
|
|
|
This file is the authoritative current task for the RX laptop.
|
|
The RX assistant must read RX_NODE_STATE.md and RF_HANDOFF_CHANNEL_TEST.md first, then execute this file.
|
|
If chat history conflicts with these files, the shared RF-001A spec or current Git HEAD, stop and report the conflict.
|
|
|
|
# Current RX task
|
|
|
|
TASK =
|
|
START COORDINATED RF-001A COMMON-CLOCK OTA CAPTURE
|
|
|
|
This is a new YELLOW task. Do not reuse approval or completion state from RF001A_OTA_CAPTURE_001, RF001A_OTA_CAPTURE_002 or any earlier task.
|
|
|
|
One approval for this task covers the model-free channel test, read-only checks, one bounded RF RX capture and publication of the two small allowlisted result files to the existing rx-node branch. It never authorizes RF TX.
|
|
|
|
The preceding RF001A_OTA_CAPTURE_002 produced a real 120.1413067 s, 1920000000-byte capture with CLKIN detected before and after, zero reported overruns and SHA256 99a3e7cb51d3ad4e3b914b63da0695ed6658aa169110c32659aba995b542fa0c. Its READY publication failed, its exact child exit code was not recorded and no synchronized truth metadata was available. Treat that as historical evidence only.
|
|
|
|
## 1. Model-free handoff channel gate
|
|
|
|
After the user chooses [A] Approve for this exact TASK_ID, run before any hardware access:
|
|
|
|
python -B tools/rf_handoff_smoke.py --hold-seconds 7
|
|
|
|
This subtask uses TASK_ID RF_HANDOFF_CHANNEL_TEST_001. It accesses no SDR and keeps RF TX = 0. It publishes fake READY and COMPLETE results through the real origin of the main RX checkout. Require the MAIN watcher to observe both states, require confirmed remote commit hashes, and require COMPLETE to remain as the final origin/rx-node state. Require the MAIN watcher state to contain both channel_test_ready_digest and channel_test_complete_digest for this run.
|
|
|
|
If any channel check or publication fails, do not access HackRF, do not start capture and STOP with RF TX = 0.
|
|
|
|
## 2. Preconditions
|
|
|
|
After the same [A] approval for this exact TASK_ID and after the channel gate passes:
|
|
|
|
1. Run git pull --ff-only origin video-development.
|
|
2. Require branch video-development.
|
|
3. Require git status --short --untracked-files=no to produce no output.
|
|
4. Require local HEAD to equal origin/video-development and EXPECTED_HEAD to be its ancestor.
|
|
5. Run hackrf_info and preserve complete stdout.
|
|
6. Require RX serial 000000000000000097c063dc2e5327d3.
|
|
7. Confirm that configs/rf/rf001a_common_clock.json and configs/rf/rf001a_truth_metadata.json exist. Require the tracked truth metadata test ID, seed, 100 packet hashes, sequence numbers, waveform SHA256 and PHY settings to agree with the shared RF-001A spec.
|
|
8. With MASTER CLKOUT physically connected to SLAVE CLKIN, run:
|
|
|
|
hackrf_clock.exe -d 000000000000000097c063dc2e5327d3 -i
|
|
|
|
9. Preserve complete stdout and require the exact line:
|
|
|
|
CLKIN status: clock signal detected
|
|
|
|
10. Require the remote branch origin/rx-node to exist through both git fetch origin rx-node and git ls-remote --heads origin rx-node. Do not create it in this task.
|
|
11. Create a unique capture directory outside Git. Refuse an existing directory and never overwrite an earlier capture.
|
|
12. Require at least 2500000000 free bytes on the target volume. Record the measured free-byte count.
|
|
|
|
If any condition fails, do not start capture. Report the failed condition, keep RF TX = 0, and STOP.
|
|
|
|
## 3. Authorized bounded RX capture
|
|
|
|
Only this finite receive operation is authorized:
|
|
|
|
RX serial = 000000000000000097c063dc2e5327d3
|
|
center frequency = 1400000000 Hz
|
|
sample rate = 8000000 samples/s
|
|
RX LNA = 24 dB
|
|
RX VGA = 24 dB
|
|
RF amp = OFF
|
|
antenna bias = OFF
|
|
duration = 120 s
|
|
sample count = 960000000 complex samples
|
|
hardware format = cs8
|
|
expected file size = 1920000000 bytes
|
|
common clock = DETECTED
|
|
|
|
The hackrf_transfer.exe arguments are fixed:
|
|
|
|
-d 000000000000000097c063dc2e5327d3
|
|
-r <unique_capture_path>\rf001a_ota_capture.cs8
|
|
-f 1400000000
|
|
-s 8000000
|
|
-n 960000000
|
|
-l 24
|
|
-g 24
|
|
-a 0
|
|
-p 0
|
|
-B
|
|
|
|
Do not add repeat mode. Do not change gain, clock, frequency or sample rate.
|
|
|
|
## 4. Background runner and durable evidence
|
|
|
|
Use the tracked tools/capture_process_runner.ps1. Write the exact hackrf_transfer argument array to a unique local JSON file outside Git. Start the runner itself as a controlled background PowerShell process and pass unique paths for the capture, complete stdout, complete stderr, capture_started.json and capture_result.json. The runner must:
|
|
|
|
- start exactly one hackrf_transfer child;
|
|
- record its PID and start time immediately;
|
|
- record the expected end time as start time plus 120 seconds;
|
|
- redirect complete stdout and stderr to unique local files;
|
|
- wait for that exact child, refresh its process object and read ExitCode only after WaitForExit;
|
|
- record its exact integer exit code, finish time, duration and output size;
|
|
- calculate SHA256 after the file is closed;
|
|
- write started and final JSON atomically;
|
|
- never start a second capture automatically.
|
|
|
|
Start the runner as a controlled background process. Within five seconds, require all four facts:
|
|
|
|
runner process alive = YES
|
|
hackrf_transfer child alive = YES
|
|
capture file created = YES
|
|
capture file growing = YES
|
|
|
|
If any fact is false, publish no READY state. Preserve local evidence, report RX CAPTURE STARTED = NO, keep RF TX = 0, and STOP.
|
|
|
|
## 5. Publish READY immediately
|
|
|
|
As soon as the child is alive and the file is growing, build a local JSON file outside Git with every field below:
|
|
|
|
{
|
|
"schema_version": 1,
|
|
"task_id": "RF001A_OTA_CAPTURE_003",
|
|
"state": "RX_READY_FOR_TX",
|
|
"rx_ready_for_tx": true,
|
|
"process_alive": true,
|
|
"file_growing": true,
|
|
"capture_pid": <actual positive child PID>,
|
|
"published_at": "<current UTC ISO-8601 time>",
|
|
"capture_started_at": "<actual UTC ISO-8601 start time>",
|
|
"expected_capture_end": "<start time plus 120 seconds>",
|
|
"capture_path": "<absolute local capture path>",
|
|
"common_clock_verified": true,
|
|
"source_head": "<current local 40-character Git HEAD>",
|
|
"rf_tx": 0,
|
|
"exit_code": null,
|
|
"file_size": null,
|
|
"duration_seconds": null,
|
|
"overruns": null,
|
|
"usb_errors": null,
|
|
"file_errors": null,
|
|
"sha256": null,
|
|
"clkin_after": "NOT_RUN",
|
|
"rf_tx_observed": "UNKNOWN"
|
|
}
|
|
|
|
Publish it with the approved RX watcher state:
|
|
|
|
python -B tools/rx_agent_watcher.py --publish-result <ready-json-path> --result-branch rx-node
|
|
|
|
The publisher may change only:
|
|
|
|
docs/handoff/results/RX_RESULT.json
|
|
docs/handoff/results/RX_RESULT.md
|
|
|
|
The publisher checks origin/rx-node through the real origin of the main checkout. It creates a temporary Git worktree from that repository, stages exactly the two allowlisted result paths, pushes HEAD:rx-node, confirms the new remote HEAD with git ls-remote and removes the worktree. It must not switch the source checkout, push video-development, or add raw IQ, video, waveform or large logs.
|
|
|
|
Use this order without exception: verify CLKIN, start capture, verify the child is alive, verify the file is growing, publish READY, verify RX RESULT REMOTE HEAD equals the published commit, and only then report RX READY FOR TX = YES.
|
|
|
|
If publication or remote confirmation fails, show the complete error and report RX READY FOR TX = NO. The finite capture may finish normally, but TX coordination does not start and RF TX remains 0.
|
|
|
|
After successful publication, immediately return control to the user without waiting for capture completion:
|
|
|
|
TASK_ID =
|
|
RF001A_OTA_CAPTURE_003
|
|
|
|
RX CAPTURE STARTED =
|
|
YES
|
|
|
|
RX READY FOR TX =
|
|
YES
|
|
|
|
CAPTURE PID =
|
|
|
|
CAPTURE PATH =
|
|
|
|
CAPTURE START TIME =
|
|
|
|
EXPECTED CAPTURE END =
|
|
|
|
RX RESULT PUBLISH =
|
|
PASS
|
|
|
|
RX RESULT REMOTE HEAD =
|
|
|
|
RF TX =
|
|
0
|
|
|
|
The READY state describes a live receiver only. It does not authorize RF TX on either computer.
|
|
|
|
## 6. Capture completion
|
|
|
|
After the child exits, read capture_result.json and require an integer exit_code recorded by the runner. Preserve all local logs and inspect every line for RX overruns, USB errors and file write errors. Do not infer zero when a tool did not report a counter; use JSON null and report NOT_REPORTED.
|
|
|
|
Run the read-only clock check again:
|
|
|
|
hackrf_clock.exe -d 000000000000000097c063dc2e5327d3 -i
|
|
|
|
Require CLKIN to remain detected. The expected complete capture has:
|
|
|
|
exit code = 0
|
|
file size = 1920000000 bytes
|
|
duration = consistent with 120 s
|
|
RX overruns = 0 or NOT_REPORTED
|
|
USB errors = 0 or NOT_REPORTED
|
|
file write errors = 0 or NOT_REPORTED
|
|
CLKIN after capture = DETECTED
|
|
|
|
A shorter file is incomplete. Any reported nonzero error remains evidence. Do not retry automatically.
|
|
|
|
## 7. Publish final result
|
|
|
|
Build a second local JSON document with the same identity and timing fields. Set:
|
|
|
|
state = CAPTURE_COMPLETE
|
|
rx_ready_for_tx = false
|
|
process_alive = false
|
|
file_growing = false
|
|
exit_code = <exact integer>
|
|
file_size = <actual integer bytes>
|
|
duration_seconds = <actual number>
|
|
overruns = <integer or null when not reported>
|
|
usb_errors = <integer or null when not reported>
|
|
file_errors = <integer or null when not reported>
|
|
sha256 = <lowercase 64-character SHA256>
|
|
clkin_after = DETECTED or NOT_DETECTED
|
|
rf_tx_observed = EXPECTED_EXTERNAL_TX or UNKNOWN
|
|
published_at = <current UTC ISO-8601 time>
|
|
rf_tx = 0
|
|
|
|
Use EXPECTED_EXTERNAL_TX only when the coordinated MAIN TX event is known to have occurred inside this capture window. Otherwise use UNKNOWN.
|
|
|
|
Publish with:
|
|
|
|
python -B tools/rx_agent_watcher.py --publish-result <final-json-path> --result-branch rx-node
|
|
|
|
Require RX RESULT REMOTE HEAD to equal the final result commit. If the push or confirmation fails, preserve the local JSON and logs, report the error, and do not claim publication success.
|
|
|
|
## 8. Offline decode
|
|
|
|
Use the tracked synchronized truth artifact without copying TX files manually:
|
|
|
|
python -B -X utf8 tools/qpsk_rf_rx.py --iq-file <capture-path> --iq-format cs8 --truth-metadata configs/rf/rf001a_truth_metadata.json --report <unique-path-outside-git>\rf001a_ota_decode.json
|
|
|
|
Report exact packets, missing packets, duplicates, BER and post-FEC errors from the generated report. Preserve a decoder failure as evidence; do not modify the receiver or invent results.
|
|
|
|
## 9. Prohibited actions
|
|
|
|
On the RX laptop, do not perform:
|
|
|
|
- RF TX;
|
|
- continuous RX;
|
|
- automatic capture retry;
|
|
- firmware or CPLD update;
|
|
- hackrf_spiflash;
|
|
- Zadig or USB driver changes;
|
|
- clock reconfiguration;
|
|
- commit or push to video-development;
|
|
- creation of rx-node;
|
|
- publication of raw IQ, video, waveform or large logs.
|
|
|
|
## 10. Final RX report
|
|
|
|
TASK_ID =
|
|
RF001A_OTA_CAPTURE_003
|
|
|
|
CHANNEL TEST =
|
|
|
|
RX CAPTURE COMPLETE =
|
|
|
|
EXIT CODE =
|
|
|
|
CAPTURE SIZE =
|
|
|
|
CAPTURE DURATION =
|
|
|
|
RX OVERRUNS =
|
|
|
|
USB ERRORS =
|
|
|
|
FILE WRITE ERRORS =
|
|
|
|
RAW IQ SHA256 =
|
|
|
|
CLKIN AFTER =
|
|
|
|
RF TX OBSERVED =
|
|
|
|
FINAL RX RESULT PUBLISH =
|
|
|
|
FINAL RX RESULT REMOTE HEAD =
|
|
|
|
OFFLINE DECODE =
|
|
|
|
EXACT PACKETS =
|
|
|
|
MISSING =
|
|
|
|
DUPLICATES =
|
|
|
|
BER =
|
|
|
|
POST-FEC ERRORS =
|
|
|
|
RF TX =
|
|
0
|
|
|
|
STOP.
|