Skip to content

os/rig: mint a random rig id on the stick once and hand it to RigForge's feed echo #4180

Open

Description

@pithead-architect

What's the problem

A rig carries no identity of its own. Rig setup mints the control token once into rig.json (rig_access_token in lib/pithead/14-local-miner.sh) and render_rig_miner_config rebuilds RigForge's config from rig.json every boot, but nothing on the stick carries a rig id, so the coordinator can only match rigs by worker name. rigforge#694 (closing rigforge#680) is merged: RigForge now accepts an optional rig_id config key and echoes it verbatim in the sister feed as a label. This is the stick-side slice split from #4014: mint the id once, keep it beside the token, pass it through.

What it impacts

Appliance rigs (RigForge role) and their coordinators: the coordinator-side matching (#4014's remaining slice) and the coordinator verbs (#4016) cannot start until sticks carry an id.

How I found it

Owner decisions of 2026-11-10 (item 8) filed #4014; rigforge#694 merged 2026-11-16 and supplies the echo. Split from #4014 for the local session file budget.

How important is it

Medium for 2.1.0: it gates the identity chain (#4014 coordinator slice, then #4016). User-visible behaviour is unchanged until a later slice consumes the id.

Acceptance criteria

  • Rig setup and the every-boot render mint a random rig id ONCE, store it in rig.json beside the token using the same mktemp-and-rename, 0600 pattern as the token mint, never re-mint it, and pass it as RigForge's rig_id key in the rendered config.json every boot.
  • Id shape mirrors the token: 32 lowercase hex from /dev/urandom.
  • An existing rig.json without an id (old stick or old image) gains one at the next config render and keeps it across later renders and reboots — the every-boot render is the "first boot of the new image" mint, so the updater needs no change.
  • A rig.json that already carries a rig_id passes it through unchanged.
  • The token's stdout contract is untouched: the token mint function still prints only the token; the id mint prints nothing to a caller's stdout.
  • A tier-1 selftest, registered where CI runs it (never sourced), asserts: first render mints and persists; a second render keeps the same id; the rendered config carries exactly that id; a token-only rig.json keeps its token and gains an id; a hand-set id survives; 0600 holds.
  • One tier4-kvm rig-phase leg: on a rig boot the sister feed, fetched with the rig's own token, echoes the same rig_id the stick's rig.json holds, and the existing quiet-state legs stay green.

Possible solutions

  • A sibling function to the token mint in the same slice, merged by jq into the rendered config exactly as the token is today.

Parent: #1837

Worker brief: Test tier: tier-1 selftest (tests/os, registered where CI runs it) plus one tier4-kvm rig-phase leg for the feed echo. Scope: lib/pithead/14-local-miner.sh, its selftest, and the rig-phase leg only — no coordinator changes (a sibling chunk owns adoption and matching), no updater changes, no config-schema changes. Spec is #4014 acceptance criteria 1 and 7; read #4014 and the rig-role section of lib/pithead/14-local-miner.sh first. Keep rig_access_token's stdout contract (token-only). No comments in code; house docs, not code comments, carry any explanation.

Activity

  1. added this to the v2.1.0 milestone on Nov 17, 2026
  2. added
    installer
    appliance
    needs-triage
    size:S
    on Nov 17, 2026
  3. pithead-developer commented on Nov 27, 2026

    @pithead-developer
    Contributor

    Grouped with #4012, but PR #4616 does not close it: Unrelated area (rig id minting in the rig-role config render) needing its own tier-1 selftest and a separate rig-phase leg; kept out to keep this PR to the signing-key and clock work for #4012.. Released for its own pick.

  4. added
    bug
    on Nov 27, 2026
  5. pithead-developer commented on Dec 3, 2026

    @pithead-developer
    Contributor

    Waiting on a transient bench_hold condition, not on another issue. bench-submit exit 75: "held: tier1/tier2 not passed for the head: Build image (tor)" — that row fails identically on every head (Alpine repo retired the pinned tor=0.4.9.17-r0; apk: breaks: world[tor=0.4.9.17-r0]); no job was created, so re-check whether the head can go CI-green once the pin bump merges. The runner re-checks it every 15 minutes until the bench hold ends; the durable fix is tracked in #4674.

  6. pithead-developer commented on Dec 4, 2026

    @pithead-developer
    Contributor

    Waiting on a transient bench_hold condition, not on another issue. re-check 2 (2026-12-04): resubmit held again, exit 75 "tier1/tier2 not passed for the head: Build image (tor)"; precondition verified unchanged — origin/develop still 495c6d3 with ARG TOR_VERSION=0.4.9.17-r0 (retired upstream), head 8f3b41e still carries the recorded 11s failure (run 47030709270 job 143994576823); submits cannot clear before the bump merges. The runner re-checks it every 15 minutes until the bench hold ends; the durable fix is tracked in #4674.

  7. pithead-developer commented on Dec 4, 2026

    @pithead-developer
    Contributor

    Waiting on a transient bench_hold condition, not on another issue. re-check (2026-12-04 cycle 2): resubmit held again, exit 75 "tier1/tier2 not passed for the head: Build image (tor)"; precondition unchanged — origin/develop still 495c6d3, build/tor/Dockerfile still ARG TOR_VERSION=0.4.9.17-r0 (retired upstream), head 8f3b41e keeps its recorded failure; submits cannot clear before the #4674 bump merges. The runner re-checks it every 15 minutes until the bench hold ends; the durable fix is tracked in #4674.

  8. pithead-developer commented on Dec 4, 2026

    @pithead-developer
    Contributor

    Blocked on #4674. PR #4673 is complete at head 8f3b41e, but its only red required check is Build image (tor). That failure comes from develop, not from this change: build/tor/Dockerfile pins tor=0.4.9.17-r0, Alpine retired it, and apk reports 0.4.9.18-r0 breaking the pin (run 47030709270). origin/develop still has the same pin (checked 2026-12-04). The tier4-kvm rig-phase job can't be submitted because bench-submit holds it, exit 75, until tier1/tier2 pass on the head. #4674 tracks the fix and it is not merged. After it lands, merge develop into the branch, push, and submit the rig-phase tier4-kvm job. I posted this explanation on the PR.

    The runner resumes this issue when that one closes.

  9. added
    blocked
    on Dec 4, 2026
  10. pithead-developer commented on Dec 4, 2026

    @pithead-developer
    Contributor

    Waiting on a transient bench_hold condition, not on another issue. re-check (2026-12-04 cycle 3): resubmit held again, exit 75 "tier1/tier2 not passed for the head: Build image (tor)"; develop now at 17ae627 (dependabot only, merge-tree clean vs head) but build/tor/Dockerfile still ARG TOR_VERSION=0.4.9.17-r0 and develop's own run 47349759614 still fails Build image (tor) — upstream Alpine has not restored 0.4.9.17-r0 and the #4674 bump is unmerged, so submits cannot clear. The runner re-checks it every 15 minutes until the bench hold ends; the durable fix is tracked in #4674.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    applianceblockedbuginstallerneeds-triagesize:S

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions