Repository navigation
Broadcast OS version, rig id and display hints in the sister feed - #694
pithead-developer[bot] wants to merge 2 commits into
Conversation
The enriched feed gains os_version (appliance image marker, null on standalone rigs) and rig_id (echoed from config, never invented). Authenticated summary reads additionally carry rigforge.identity (truncated primary-MAC prefix, truncated board UUID, CPU model); an unauthenticated route never serves it, and none of these values ever authenticates anything. Closes #680 Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
|
FAIL What I investigatedThe code is correct on every check I could run locally. But the diff changes the worker-to-coordinator contract (the sister-feed fixtures and the authenticated API server), and the PR has no
Reviewed head: What are the gaps
|
|
tier4-e2e first attempt |
|
tier4-e2e is blocked by a bench-side defect, not this branch: both attempts ( |
What's the problem
Closes #680
The sister feed (rigforge#452) carried version/stamp/appliance but no OS version, no rig id and no
hardware hints, so the Pithead coordinator cannot tell which rig runs which OS, nor tell clones or
moved sticks apart.
How I fixed it
Additive only — existing
version,stampandapplianceare untouched (the contract fixturediffs by exactly two added keys):
rigforge.os_version: the appliance image's version marker (RIGFORGE_OS_VERSION_FILE,default
/opt/pithead/VERSION), read only in appliance mode;nullon standalone rigs andwhen the marker is absent, unreadable or blank.
rigforge.rig_id: echoes the new optionalrig_idconfig key verbatim; never invented(absent/empty/whitespace/non-string →
null). It is a label, never a credential.rigforge.identity: display hints —mac(first three octets of the default-route NIC),board_uuid(first 13 chars of the lowercased canonical board UUID) andcpu_model. Each isindividually
nullwhen its probe finds nothing. It is written to a separate pre-computedpayload (
summary-authed.json) thatutil/api-server.pyserves only when a token is set(so the request passed the Bearer check); with no token — the open route — it only ever serves
the existing public payload, even though the authed file exists on disk. Missing authed file
falls back to the public payload (upgrade race); missing summary is still 503.
tests/contract/v1/feed.jsongains the two additive keys (still v1, per the fixtureREADME's change rule);
tests/contract/v1/feed-authed.jsonpins the authenticated variant;both are byte-compared against real
api_refreshoutput. Docs corrected indocs/pithead-integration.md,docs/configuration.md,docs/operations.md,config.reference.jsonand the contract README.tests/test-feed-identity.sh(wired intotests/run.sh) covers present/absent/unreadable for every probe, both feed payloads byte-for-byte, and the server-side gating
(open route never serves identity even with the authed file on disk; raw and derived bearers
do; fallback; both-files-gone 503).
identityis not in/health//tuneand not on :8082.rigforge.shgrew 3 lines (feed plumbing) — the probes live inutil/feed-identity.sh,within the file-budget ratchet.
Shortcut:
os_versionreads the version marker only; the image's optional build-label decorationis not appended (upgrade when the coordinator needs RC labels in the feed).
Here is the proof
GitHub CI at head 2f1b0c3 (Tiers 1-3, all pass):
Lint (shellcheck + shfmt),Lint (markdownlint),Lint (yamllint),Test suite(incl.tests/run.shwith the contract guard and the newfeed-identity suite),
Coverage (kcov + diff-cover)(patch coverage on the new lines),End-to-end (Docker)(tier3 container e2e),Stock home setup (current/historical),Secret scan (gitleaks),Workflow audit (zizmor).Local (this Mac):
bash tests/test-feed-identity.sh→ 35 passed, 0 failed (including byte-fixturematches for both payloads);
bash tests/test-pool-fields.sh rigforge.sh tests/contract/v1/feed.jsongreen;
FILE_BUDGET_REQUIRE_BASE=1 bash scripts/lint-file-budget.sh→ OK (rigforge.sh 6202 ≤ 6207,run.sh unchanged count);
scripts/lint-topology-classes.shOK; markdownlint 0 issues.Adversarial review (fresh session, mutation-tested): no defects; its one hardening note
(pin the both-summary-files-missing 503 leg) is the added assertion in this head.
Ponytail pass: cut HMAC-keyed identity hints (a second secret domain buys nothing for display
hints, and truncation stays stable across re-imaging); cut build-label handling; nothing the
issue asked for was cut.
Bench contract proof (reviewer round-1 RETURN): the full
tier4-e2ebattery (phases=all) wassubmitted twice on this head —
4076@2f1b0c375691bd33fb10aa36308ab483b56f7938and4079@2f1b0c375691bd33fb10aa36308ab483b56f7938— and both died on the same first row:connect(
no stratum job within 60s; xmrigauth_errors=2,network_errors=8) inside the runner'sper-job stratum-auth window. Not attributable to this diff (no stratum/connect code touched; stack
healthy at preflight and restore; no bench downtime overlap). Control: that morning's nightly on
bare
developpassedconnectand its lane shows no auth-window step. Filed asp2pool-starter-stack/bench-ci#2537 with both job ids, the control job, and the log lines; the
green
bench-ci evidenceblock goes here when #2537 is fixed and the battery is resubmitted(new attempt, same or updated head). The rows that will exercise this change are
worker-api,network(summary superset + leak sweeps),access-tokens(raw + derived reads),control(fresh-feed publication) and
api-impact.