fix(diode): remove hardcoded token path and internal snapshot tags from public code - #38
Open
zenprocess wants to merge 1 commit into
Open
fix(diode): remove hardcoded token path and internal snapshot tags from public code#38zenprocess wants to merge 1 commit into
zenprocess wants to merge 1 commit into
Conversation
…ate tags)
Two residual internal-data leaks on public main, both fixed with
env-var-driven generic example defaults.
1) lib/components/fabro-referee/src/gate/backend.rs:24 — const
FORKD_TOKEN_FILE was hardcoded to an absolute /home/<name>/
path. Renamed to FORKD_TOKEN_FILE_DEFAULT with a generic
/etc/forkd/token example, and added forkd_token_file() that
resolves the operator's actual path from the FORKD_TOKEN_FILE
env var (defaulting to the example). forkd_token() now uses the
resolved path. The hardcoded operator home path is gone.
2) The 'zen-gate-*' snapshot-tag family was hardcoded across
six files. Replaced with a generic 'forkd-base' example
default everywhere, kept env-var driven via the existing
FORKD_SNAPSHOT_TAG knob:
- lib/components/fabro-referee/src/gate/backend.rs:104
JSON literal in forkd create call -> forkd_snapshot_tag()
- lib/components/fabro-referee/src/gate/backend.rs doc
comment updated
- lib/components/fabro-referee/src/gate.rs:74 dropped
the 'zen-gates' alias from BackendKind::from_str_loose
- lib/components/fabro-sandbox/src/config.rs doc comment
updated
- lib/components/fabro-sandbox/src/forkd/mod.rs:40
DEFAULT_SNAPSHOT_TAG constant -> 'forkd-base'
- .forgejo/workflows/gate.yml:15-18 comment + env-var
names (Z*_GATES_* -> FORKD_*) so the public workflow
does not advertise internal secret names
- specs/forkd-e2e/behavior.feature -> 'forkd-base' in
the two scenarios that named the tag
This is a behaviour-preserving refactor: when FORKD_TOKEN_FILE and
FORKD_SNAPSHOT_TAG are unset (as in the public default), the
harness falls back to the same generic examples a downstream
operator would configure. The fix is a removal of internal data
from public code, which is the legitimate-direction flow per the
diode.
cargo check -p fabro-referee -p fabro-sandbox was attempted
locally but blocked by the egress boundary: the workspace's
daytona-sdk git dep at rev fc58e22 has no cached checkout on
this worktree, and the sandbox blocks new file creation in
~/.cargo/git/checkouts/. The diff is mechanical (added consts,
added two 4-line env-var readers, renamed one constant,
replaced four string literals); reviewer should re-run
'cargo check -p fabro-referee -p fabro-sandbox' on a host with
the daytona-sdk cache populated before merging.
Co-Authored-By: Claude <noreply@anthropic.com>
Owner
Author
|
Independent diode verification of this PR (orchestrator):
Diode-clean from my side. Note the standing rule this PR is implementing: defaults in public code must be generic and overridable by environment; anything host-specific belongs in the private ops repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes internal identifiers from public code, per the diode standing order. This PR reduces what the public fork exposes; it adds nothing internal.
Verified before/after (orchestrator-run scans)
forkd-tokenzen-gateWhat changed
lib/components/fabro-referee/src/gate/backend.rs—FORKD_TOKEN_FILEno longer hardcodes an absolute/Users/<name>/home path. NowFORKD_TOKEN_FILE_DEFAULT = "/etc/forkd/token", overridable via theFORKD_TOKEN_FILEenv var. This is the "env var with a generic example default" pattern the standing order requires..forgejo/workflows/gate.yml,fabro-referee/src/gate.rs,fabro-referee/src/gate/backend.rs,fabro-sandbox/src/config.rs,fabro-sandbox/src/forkd/mod.rs,specs/forkd-e2e/behavior.feature.lib/components/fabro-referee/src/gate.rs:10still names an internal service in a doc comment:That is an internal brokered-path name and should be genericised before merge. Left in deliberately rather than silently edited, so the decision is visible.
Not verified
Crate-scoped builds (
cargo check -p fabro-referee,-p fabro-sandbox) were not run by the orchestrator. Reviewer should confirm before merge; changes are intended to be behaviour-preserving.