Skip to content

No test pins that the canonical config view serves pools as stored — the hinge is a comment, not a guard #429

Description

@VijitSingh97

What

Nothing in tests/ pins the property _writable_config_canonical exists to hold: that the feed
serves a pool's stored fields as stored, inventing neither user nor pass. The property is
currently carried by a comment in _control_commit (rigforge.sh:4368-4375), and a comment does
not redden.

Why it needs a guard rather than a note

parse_config normalizes pools on the way to XMRig: a missing pass becomes the literal "x"
(rigforge.sh:488) and a missing user becomes "" (rigforge.sh:487, with the rig name filled
later, in generate_xmrig_config). _api_config_json then masks any non-empty string pass to a
__secret__ sentinel (rigforge.sh:5290).

Point the canonical view at the normalized array and the two compose into a live defect: every pool
that stores no password is advertised to the consumer as holding one; the sentinel comes back;
stored finds nothing to keep; the marker survives the merge; and the commit is rejected
unresolvable-secret-marker. Every pools edit on such a rig fails, and the failure names a secret
the operator never set.

That is exactly the substitution a future refactor makes for good-looking reasons — "use the parsed
pools, we already have them" — and today the only thing standing in its way is a paragraph.

Shape the test should take

Tier 1, in tests/run.sh beside the existing _api_config_json rows: drive
_writable_config_canonical / _api_config_json on a config whose pool carries only a url,
and assert the served pool has no user key and no pass key — not that it has empty ones. Assert
absence, not a placeholder value, or a later // "" default passes the test while reintroducing the
defect.

It needs a fired control to be worth anything: a second pool that DOES store a pass must come back
carrying the __secret__ sentinel in the same run, or the row cannot distinguish "serves nothing"
from "serves nothing because the fixture never reached the mask".

Provenance

Raised as a non-blocking finding by the non-author reviewer of PR #427, whose blocking finding was
that the comment describing this hinge named the wrong key. The comment is corrected there; this is
the part that makes it a guard instead of prose. Filed rather than folded into #427: it is a
separate change with its own suite run, and #427 is test-and-comment only.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions