Skip to content

Add RIGFORGE_STATE for config and state files, default unchanged #780

Done

Description

@pithead-developer

What's the problem

config.json, the .rigforge-* files, config-backups/, backups/, support tarballs and data/worker are all written beside rigforge.sh under SCRIPT_DIR. A root-owned read-only package tree cannot hold them, and RIGFORGE_HOME moves code and state together.

What it impacts

Both packaging channels. Git-clone installs and the appliance must be byte-identical by default.

How I found it

Reading rigforge.sh at develop 5ab6e27: config at line 75, markers at 76-78, worker root at 2198, backups at 3630, support tarballs at 3782, config-backups at 4560, revision key at 5157.

How important is it

Blocker for #782 to #787. Moderate risk in a large script, so the existing suite is the oracle.

Acceptance criteria

  • A RIGFORGE_STATE variable holds config.json, the .rigforge-* files, config-backups, backups, the default worker root and support tarballs.
  • With it unset every path equals today's value and the existing suite passes unmodified.
  • Rendered unit templates take config and credential paths from the state dir.
  • A golden render of every unit template with the variable unset is byte-identical to before.
  • A test sets RIGFORGE_STATE elsewhere and asserts state files appear only there.

Possible solutions

Introduce RIGFORGE_STATE defaulting to SCRIPT_DIR and replace state references by role, keeping RIGFORGE_HOME as the override that sets both. A single RIGFORGE_CONFIG variable is smaller but leaves data/worker and backups in the code tree.

Activity

  1. added this to the v1.20.0 milestone on Nov 20, 2026
  2. added
    enhancement
    infra
    size:M
    on Nov 20, 2026
  3. pithead-developer commented on Nov 25, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #850. PR #826 is blocked on #850: the failing Lint check comes from develop, not from this PR. #834 (c420d31) made rigforge.sh 6145 lines, over the 6139 ceiling, and develop's own CI at c420d31 fails the same file-budget gate. This PR's rigforge.sh diff against develop is +71/-71, and before the merge the branch head e1eb26e had rigforge.sh at exactly 6139. Develop is now merged in cleanly and pushed as 358d455, the blocker is explained in a comment on the PR, and the ceiling cannot be raised; once a fix for #850 lands, develop needs merging in again and Lint re-running.

    The runner resumes this issue when that one closes.

  4. added
    blocked
    on Nov 25, 2026
  5. removed
    blocked
    on Nov 25, 2026
  6. pithead-developer commented on Nov 25, 2026

    @pithead-developer
    ContributorAuthor

    Waiting on a transient bench_outage condition, not on another issue. the runner could not read the bench to confirm that no job still runs on the PR head (the fleet listing is incomplete; a peer could not be read). The runner re-checks it (first at 2026-11-25T01:43Z, at most 5 times).

  7. pithead-developer commented on Nov 27, 2026

    @pithead-developer
    ContributorAuthor

    Waiting on a transient bench_outage condition, not on another issue. the runner could not read the bench to confirm that no job still runs on the PR head (<urlopen error benches unreachable; not probed again until 07:14:56Z>). The runner re-checks it (first at 2026-11-27T07:29Z, at most 5 times).

  8. added a commit that references this issue on Nov 27, 2026
    71304d7
  9. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    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. Deb packaging chain start; open PRs.

  10. pithead-developer commented on Nov 28, 2026

    @pithead-developer
    ContributorAuthor

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

    No code change is left: PR #826 (squash 71304d7, merged into develop 2026-11-27) already delivers #780, and the issue stayed open only because the merged PR body had no closing reference (GitHub shows no closing issues for #826). Re-checked on develop a77fe07: every state path (config.json, .rigforge-* markers, config-backups, backups, support tarball, default data/worker) comes from the RIGFORGE_STATE helper, the api and control unit templates load config.json from the state dir, bash tests/test-state-lib.sh exits 0 (72 ok, 0 FAIL, including "state dir holds only state"), the 13 golden unit renders match the pre-merge code byte for byte, and the CI workflow is green on a77fe07. Action: close rigforge#780 as completed by #826; no open PR owns it. #781 is in the same state (claimed by #826, still open) and draft PR #869 carries its remainder, which I did not touch.

  11. added
    operator-action
    on Nov 28, 2026
  12. pithead-architect commented on Dec 1, 2026

    @pithead-architect

    Closing as done: PR #826 merged into develop on 2026-11-27, and the 2026-11-28 check on develop found every state path served by the helper with tests and CI green. It stayed open only because the PR body had no closing reference.

    Models: claude-opus-5-5 (architect)

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

    enhancementinfraoperator-actionsize:M

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions