interplane.Get Omega
Read in your language

spark-rsi-mv

Native Rust recursive self-improvement engine with paired bootstrap evaluation and cryptographic ledger

Brought by drakestapleton

branch main Branches Tags History

spark-rsi-mv / fixtures / canary-target / README.md

42 lines · 2208 bytes Raw Blame History Rendered
1# canary-target
2
3The first canary target: a small standalone worker that speaks the canary wire protocol
4(version 1, [docs/CANARY-CONTRACT.md](../../docs/CANARY-CONTRACT.md)) so the supervisor's execution pipeline can be exercised
5and qualified. It does not depend on spark_rsi.
6
7Build (offline, from the repository root):
8
9 cargo build --release --offline --locked --manifest-path fixtures/canary-target/Cargo.toml
10
11The adapter manifest `canary-adapter.toml` names `release/canary-target` relative to this
12crate's `target` directory. `workload.json` is the pinned workload: 10 requests, 2000 ms deadlines.
13
14## Worker behaviour
15
16The supervisor launches it with `--socket <rsi_root>/workers/<generation_id>.sock`. It takes the
17generation id from the socket file name, sends `Ready` with `protocol_version` 1, answers the
18`AuthChallenge` with HMAC-SHA256(secret, "<generation_id>:<nonce>") using the `SUPERVISOR_SECRET`
19environment variable, waits for `Ping`, then answers each `ExecuteRequest` with an `ExecuteResult`.
20
21Correct answers: "ping" gives "pong", "add A B" gives the sum, anything else echoes the input.
22
23## Scripted misbehaviour
24
25Set `RSI_CANARY_FIXTURE_MODE` (default `correct`). `RSI_CANARY_FIXTURE_FAIL_AT` (default 3) is
26the request number the mode acts on.
27
28| Mode | Behaviour |
29|---|---|
30| `correct` | Answers every request correctly. |
31| `wrong_answer` | Answers request N wrongly. |
32| `fabricate_success` | Sends `CanaryReport` success frames and `worker_latency_us` 1 while answering wrongly. |
33| `duplicate` | Sends every `ExecuteResult` twice. |
34| `replay` | After answering request N, reconnects and resends all earlier results without a handshake. |
35| `timeout` | Never answers request N. |
36| `wrong_request` | Answers request N with a different request id. |
37| `premature_promotion` | Sends `DrainComplete`, extra `Ready` and `CanaryReport` frames to try to be promoted, while answering correctly. |
38| `old_protocol` | Sends `Ready` without a protocol version (reads as 0). |
39| `wrong_generation` | Sends `Ready` naming another generation. |
40| `bare_connection` | Connects and says nothing. |
41
42`RSI_CANARY_FIXTURE_PROTOCOL_VERSION` (default 1) sets the version stated in `Ready`.