Skip to content

RigForge log-line redactor with a shared test-vector file (rigforge#682 chunk 1/3) #690

Open

Description

@pithead-architect

What's the problem

RigForge has no log redactor. The coordinator log feed (parent rigforge#682, owner decisions of 2026-11-10 item 10; consumer pithead#4017) must never carry API tokens, pool passwords or wallet addresses, and pithead's bundle_redact_log is shell inside the pithead repo, unusable from RigForge. No shared test-vector file exists in either repo, so nothing pins future RigForge redaction to agreed input/output pairs.

What it impacts

Only new code in this chunk: a util/log-redact.py module and a documented vector file. Nothing runs it on a rig or serves it yet — the ring writer (chunk 2) and the route (chunk 3) of rigforge#682 import it. The pithead bundle_redact_log side loads the same vectors later.

How I found it

Parent issue rigforge#682's acceptance criterion "a RigForge implementation tested against a shared test-vector file used by both repos". Read pithead's bundle_redact_log (07-support-bundle section of the built pithead script) and its selftest to learn the shape rules it enforces today (boundary-matched base58 address, two passes for adjacency, flag-value and onion rules).

How important is it

Blocker for chunks 2 and 3 of rigforge#682; security-relevant by construction (credential egress). Medium for the feature release itself.

Acceptance criteria

  • util/log-redact.py (python3 stdlib only; importable and usable as a stdin→stdout filter) redacts API tokens (Bearer values and ACCESS_TOKEN echoes), pool passwords (pass values in config echoes and stratum pass displays), and Monero wallet addresses ([48] + 94 or 105 chars of the 58-char base58 alphabet, boundary-matched, applied twice like pithead's rule so adjacent addresses both die), each to a fixed marker. Near-misses survive (93-char and 95-char runs untouched). Redaction is idempotent.
  • Long lines are handled: input lines are read bounded and truncated past 4096 bytes with a visible truncation marker; no unbounded memory.
  • tests/vectors/log-redaction-vectors.json in a documented format: a top-level note declaring it the shared file both repos test against (pithead's bundle_redact_log loads it later), plus {name, input, expected} vectors — at least one vector whose single line carries a leaked token, a pool password AND a wallet address together; at least one per class; the adjacent-address pair; an over-4096-byte line; the near-miss negatives.
  • tests/run.sh runs the redactor against EVERY vector in the file and fails (not skips) if the module or file is missing; the new case is red on base.

Possible solutions

A small ordered regex pipeline mirroring bundle_redact_log's rule order (flag values → wallet args → onion → address ×2 passes) plus RigForge-specific token/password echo rules; JSON vectors so the bash harness now and a pithead harness later read it identically.

Parent: #682

Worker brief: Test tier: tier1 — GitHub CI only (shellcheck/shfmt on changed files + tests/run.sh; ci.yml runs the suite). The touched paths (new util module, test, vector file) change no worker-to-Pithead contract and no rig-side runtime: nothing loads the redactor until chunks 2-3, which carry the tier4-e2e proof. Requirements: implement exactly the acceptance criteria; keep util/log-redact.py well under 400 lines (new file, file-budget target); no comments or docstrings in code; docs: only the vector file's own documented format note (it is a test artifact, not shipped docs). Before proof run FILE_BUDGET_REQUIRE_BASE=1 bash scripts/lint-file-budget.sh. Land before the rigforge#682 ring-writer and route chunks.

Release: date 2026-12-04
Who: operator

Activity

  1. added
    needs-triage
    size:S
    on Nov 13, 2026
  2. added
    security
    on Nov 13, 2026
  3. added this to the v1.20.0 milestone on Nov 17, 2026
  4. added
    operator-hold
    on Nov 17, 2026
  5. pithead-developer commented on Nov 17, 2026

    @pithead-developer
    Contributor

    Operator hold until RigForge 1.19.0 is cut (#703). v1.20.0 work is held in pd until then because every RigForge PR targets develop, which the 1.19.0 cut is taken from. This issue carries the security label, which bypasses the milestone hold, so it is held by label instead. The hold is lifted at the cut.

  6. removed
    operator-hold
    on Nov 20, 2026
  7. pithead-developer commented on Nov 23, 2026

    @pithead-developer
    Contributor

    Needs an operator action (do it, then remove the operator-action label):

    The runner stopped a respawn loop after 3 fresh workers reached error within six hours. Inspect the repeated outcome, then remove this label to release one new worker.

  8. added
    operator-action
    on Nov 23, 2026
  9. pithead-architect commented on Nov 27, 2026

    @pithead-architect
    Author

    Release regroom (owner request, 2026-11-27): moved from v1.20.0 to v1.21.0. Trimmed from v1.20.0 (update API only) per the owner. Log tail API; the pithead log store depends on it.

  10. added
    operator-hold
    and removed
    operator-action
    on Dec 1, 2026
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

    needs-triageoperator-holdsecuritysize:S

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions