Repository navigation
fix(bin): normalize relative durable paths - #1256
Merged
kunchenguid merged 7 commits intoJul 29, 2026
Merged
kunchenguid merged 7 commits into
kunchenguid merged 7 commits into
Conversation
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.
Intent
Fix the relative-FM_HOME fault that can bake an unresolvable status path into a durable secondmate charter and silently hide replies. Reproduce relative FM_HOME, FM_STATE_OVERRIDE, and FM_DATA_OVERRIDE inputs; normalize relative directory inputs to absolute paths before deriving durable or cross-process paths; fail loudly with the offending variable named when an input cannot be resolved; preserve existing absolute-path output byte-for-byte and preserve charter wording, contracts, and semantics. Survey bin/ and fix only equivalent durable-path or cross-process exposures, leaving transient relative-home consumers unchanged. Preserve safety boundaries, do not rewrite live charters or live data/state, keep the diff proportionate, add regression coverage across affected scripts, and ship a PR without merging.
What Changed
FM_HOME,FM_STATE_OVERRIDE, andFM_DATA_OVERRIDEvalues before generating charters or constructing durable and cross-process paths, while preserving absolute path spellings and naming invalid inputs in errors.Risk Assessment
✅ Low: The change is well-bounded and now closes the reviewed relative FM_HOME, FM_STATE_OVERRIDE, and FM_DATA_OVERRIDE durable/cross-process paths while preserving already-absolute path spelling and existing charter semantics.
Testing
Inspected the exact base-to-target change, ran the four focused regression suites, and manually exercised real secondmate charter generation. Relative home/state/data inputs produced an absolute durable reply path byte-identical to equivalent physical absolute inputs; absolute spelling was preserved; every unresolvable input failed loudly naming its variable. Reviewer-visible CLI and charter evidence was captured. No screenshot applies because this is a shell-only change.
Evidence: Relative status-path CLI transcript
Evidence: Generated charter from relative inputs
Evidence: Absolute-input comparison charter
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
bin/fm-spawn.sh:1478- The required criterion says to “preserve existing absolute-path output byte-for-byte,” but these changed substitutions use BRIEF_REAL and STATE_REAL. Those values are produced with pwd -P, so an already-absolute path containing a symlink now becomes its physical path in Claude/Pi launch commands. Preserve absolute inputs unchanged and normalize only relative FM_DATA_OVERRIDE/FM_STATE_OVERRIDE values.bin/fm-afk-launch.sh:55- The required criterion says to normalize relative directory inputs before deriving durable or cross-process paths and to name an unresolvable variable. This block normalizes only FM_HOME; FM_STATE_OVERRIDE remains relative at line 61. With a relative override, the launcher writes its durable record under the caller's cwd, while a Herdr daemon starts under the normalized FM_HOME and inherits the same relative override, so its lock and replies resolve under a different directory. Normalize FM_STATE_OVERRIDE at this boundary and report it by name on failure.🔧 Fix: Preserve absolute overrides and normalize relative durable paths
1 error still open:
bin/fm-spawn.sh:140- The required criteria say to reproduce relative FM_HOME and normalize relative inputs before cross-process paths, but this hunk normalizes only explicit FM_STATE_OVERRIDE and FM_DATA_OVERRIDE values. WithFM_HOME=homeand no overrides, STATE and DATA remain relative; lines 1497/1499 then embedhome/data/.../brief.mdandhome/state/...pi-ext.tsin a launch executed from the project worktree, so the brief or Pi extension is unresolved. Normalize relative FM_HOME before deriving its default state/data paths, while preserving already-absolute spelling, and cover the no-override case.🔧 Fix: Normalize relative home before deriving durable paths
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Inspectedgit diff 99533c5d7d3702050e6084429dddff6ea4fe1aa0..588276cd97c0cb9911ddd7bf0c97108178a6b3dband confirmed the target checkout.bin/fm-test-run.sh tests/fm-brief.test.sh tests/fm-spawn-dispatch-profile.test.sh tests/fm-afk-launch.test.sh tests/fm-x-mode.test.shRanbin/fm-brief.sh route-proof-2 --secondmate --no-projectswith physical absolute inputs and again with relativeFM_HOME,FM_STATE_OVERRIDE, andFM_DATA_OVERRIDE; compared the charter bytes usingcmp -s.Generated a charter with absolute/var/...inputs and verified that exact spelling remained in the durable status instruction.Invokedbin/fm-brief.shwith separately unresolvable relativeFM_HOME,FM_STATE_OVERRIDE, andFM_DATA_OVERRIDEvalues; captured each named diagnostic and nonzero exit.Read back the evidence transcript and charters, confirmed equal byte sizes, and verifiedgit status --shortremained empty.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.