Repository navigation
fix: use injective watcher marker keys - #18
Merged
Merged
Conversation
adibirzu
force-pushed
the
fm/fm-window-key-injective-2878
branch
from
August 30, 2026 05:17
b6533cb to
f463e9b
Compare
Encode endpoint bytes into a versioned filename-safe key for every watcher marker.\n\nLegacy unversioned markers are intentionally ignored because their identity may be ambiguous; live endpoints begin with fresh v2 evidence rather than trusting or deleting shared legacy state.
Use a pure-Bash v2 encoder and route away-mode watcher-marker cleanup through the shared key owner.
Main added write-deferral and secondmate-hold watcher tests after this branch forked; they still named markers with the colliding tr fold. Point those fixtures at the shared public v2 key so they exercise the same identity the watcher now persists.
adibirzu
force-pushed
the
fm/fm-window-key-injective-2878
branch
from
August 30, 2026 08:15
f216b35 to
ca88aa1
Compare
adibirzu
pushed a commit
that referenced
this pull request
Aug 30, 2026
Bring origin/main (88cce04) into fm/fm-upstream-sync-0829 to clear the PR's conflict with its base. Merged rather than rebased so the fork-only history and the two upstream-sync merge commits this PR is built from stay intact. One conflict, in docs/scripts.md: base rewrote the `fm-marker-lib.sh` row to name it the single owner of the persistent per-window watcher marker key (#18), while this branch had added an adjacent `fm-task-inbox-lib.sh` row. Kept both - base's one-owner description is accurate in the merged tree (fm-watch.sh, fm-supervise-daemon.sh, and backends/herdr.sh all call the single fm_window_marker_key definition), and the fork's inbox row documents a fork-only script that still exists.
adibirzu
pushed a commit
that referenced
this pull request
Aug 30, 2026
…rmat Resolve a semantic conflict the merge of origin/main (#18) could not flag. #18 made fm-marker-lib.sh the single owner of the per-window marker key and moved it to an injective `v2-<hex>` format, converting every fixture in tests/fm-watch-triage.test.sh to the watch_marker_key oracle - base leaves zero inline derivations in that file. Two fixtures added on this branch (kunchenguid#3147, kunchenguid#3155) live in regions #18 never touched, so git merged them cleanly while they kept deriving the key with the pre-v2 `tr ':/.' '___'` form. They therefore seeded .stale-since-/ .wedge-escalations- markers under a name the watcher no longer reads, and the away-mode lifted-pause phase waited for an escalation that could not arrive: not ok - a lifted pause on an away-mode over-age busy pane no longer wedge-escalates Point both at watch_marker_key, matching how base keys every other fixture in this file. The task-keyed `_stale_key` families in fm-supervise-daemon.sh, fm-push-transition-lib.sh and their fixtures are a separate contract that base ships in the old form deliberately, and are left alone.
adibirzu
pushed a commit
that referenced
this pull request
Aug 30, 2026
`Require no-mistakes` failed on this PR with Pipeline attestation head_sha does not match the current PR head. attestation.head_sha: aae0fe9 PR head: dc2d00f The attestation in the PR body was produced for aae0fe9. The gate then advanced the head itself - `origin/main` moved to #18, that merge landed as 59bc336, and dc2d00f repaired the fixtures it broke - and pushed those commits (synchronize event 87) while the body still attested the older head, so the required check reports a head mismatch. CONTRIBUTING.md step 8 only described the two cases where the contributor moved the head: a plain `git push` (permanently stale) and the transient red between a gate push and the body rewrite that follows it. Neither covers a head the gate advanced mid-pipeline, which is stale until the gate pushes again and rebinds the attestation - exactly the remediation the action's own error text gives. Nothing in the tree is broken: `bin/fm-lint.sh` and `bin/fm-test-run.sh --check-coverage` pass locally, and all 12 CI checks are green on the attested head. Re-running the gate on this commit binds the attestation to the current head and clears the check.
adibirzu
added a commit
that referenced
this pull request
Sep 14, 2026
…ssions (#73) PR #18 (commits 4621615a, 26d1b380) added test_window_marker_keys_are_injective_and_ignore_legacy_state and test_window_marker_key_is_stable_across_bash_generations to prove fm_window_marker_key (bin/fm-marker-lib.sh) is injective and produces identical keys across bash generations for a non-ASCII endpoint. The production code from those commits (fm_window_marker_key, window_key wrapping it, the shared owner used by fm-supervise-daemon.sh and bin/backends/herdr.sh) is already on main. The two regression tests themselves were silently dropped when the PR18 branch was first merged into main at 44c296b (an unrelated docs commit whose merge diff reverted several fixtures back to the old colliding tr encoder and never carried the two new test functions forward), even though bin/fm-marker-lib.sh's header comment still names them as pinning tests. Restore both tests verbatim from 88cce04 (the PR18 merge), verified passing in isolation against current main's fm_window_marker_key (including its byte-masking refinement) and against tests/wake-helpers.sh's independent od-based watch_marker_key oracle. Claude-Session: https://claude.ai/code/session_014crY8agKaxBLcWeGkh2NZY Co-authored-by: Claude Sonnet 5 <[email protected]>
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.
Intent
Finish the existing open PR 18 (#18) on branch fm/fm-window-key-injective-2878. Do not open a second PR. Do not merge.
Goal: make per-window watcher marker keys injective, stable, and filename-safe so distinct window names cannot collide (issue 2878). The old folding (
tr ':/.' '_') mapped ':', '/', and '.' to the same character, so names like a:b and a.b shared one marker file. The accepted design is a shared v2 byte-hex encoder (v2-+ hex bytes, with& 0xffmasking) owned by bin/fm-marker-lib.sh asfm_window_marker_key, used by the watcher, away-mode daemon, and herdr escalation markers. Keep fm-marker-lib.sh as the from-firstmate compatibility entry plus that function. Ignore unversioned legacy markers; do not migrate or delete them. Daemon-own.subsuper-*markers keep the legacy_stale_keypath; shared watcher markers must usefm_window_marker_key`.This branch was rebased onto current main so it keeps BOTH the injective-key fix AND main's newer watcher behavior (inbox steer, captain-held pause, write-deferral, key-taking pause helpers). The superseded Pi/OpenCode arm-ready timeout-widen commit was skipped on purpose; do not claim to fix that flake.
Two later
no-mistakes: apply CI fixescommits (2d00a5a0 comment-only on the daemon, f216b350 two-line marker-lib edit) are already on the branch from a prior pipeline and must be kept. They advanced GitHub HEAD without rebinding the PR-body attestation, which is why the required GitHub check "PR must be raised via no-mistakes" is currently red on HEAD f216b350 even though the rest of CI is green. This run exists to re-run the pipeline on the current rebased HEAD so the push and PR steps rebind that attestation to the live SHA. Do not "fix" that check by editing source; the CI agents cannot rebind the PR body. Do not drop prior gate-fix commits.What Changed
Risk Assessment
✅ Low: The focused v2 byte-hex marker migration consistently covers watcher state, daemon cleanup, and Herdr escalation dedupe while deliberately ignoring ambiguous legacy markers.
Testing
Focused end-to-end watcher, herdr, and daemon tests passed. The real watcher persisted distinct v2 markers for formerly colliding names while ignoring legacy ambiguity; the non-ASCII byte key matched across available Bash interpreters; and herdr used the same shared marker identity. Evidence logs were written outside the worktree.
Evidence: Watcher marker-key behavioral transcript
Source: Watcher marker-key behavioral transcript
Actual watcher process test: collision-prone endpoint spellings created distinct filename-safe v2 markers, legacy ambiguous state was ignored, and a non-ASCII key remained stable across available Bash generations.Evidence: Herdr shared-marker behavioral transcript
Source: Herdr shared-marker behavioral transcript
Herdr escalation dedupe marker used the same shared v2 identity as the watcher.Evidence: Daemon targeted transcript
Source: Daemon targeted transcript
Focused daemon behavioral transcript.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh tests/fm-watch-triage.test.shbin/fm-test-run.sh tests/fm-backend-herdr.test.shbin/fm-test-run.sh tests/fm-daemon.test.shgit status --short✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.