Repository navigation
fix(bin): harden PR check artifacts - #556
Merged
Merged
Conversation
kunchenguid
force-pushed
the
fm/fm-prcheck-security-patch-h5
branch
from
July 14, 2026 09:53
eb567bc to
29cb21a
Compare
added 28 commits
July 15, 2026 23:29
commented
Sep 6, 2026
|
Landed in https://github.com/lquach99/scenely/pull/564, merged to main. The PR body carried no closing keyword, so this stayed open after the merge — closing by hand. NOT YET VERIFIED AGAINST STRIPE: the two Stripe-side checks (e2e Round 5 asserting no live subscription remains after a cancellation, and the repair script's dry run against a real account) could not run in the validation environment and remain outstanding. |
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
Complete the PR-check security remediation on existing PR 556 without merging or runtime activation. Validate task identifiers and canonical GitHub PR URLs before side effects; keep watcher polls byte-static with data-only private state, canonical provenance, exact metadata binding, transactional publication, and fail-closed non-executing migration; preserve merge, custom-check, X-mode, and unrelated lifecycle behavior. Require private single-link artifacts and safe cleanup, authenticate all checks at execution, migrate only the exact legitimate historical X polling identity under watcher exclusion to the strict current identity without execution, reject linked, symlinked, byte-mismatched, wrong-device, wrong-mode, and nonordinary lookalikes, and publish X artifacts through same-directory private temporaries plus guarded atomic rename without following destination symlinks. Preserve all prior pipeline fixes, keep the complete rendered public PR diff disclosure-safe, run focused and full validation without warning suppression, push only the existing branch to existing PR 556, and finish at one exact checks-green head.
What Changed
Risk Assessment
✅ Low: The latest changes are narrowly scoped to hardening X artifact reads/writes through the shared private single-link publication and validation path, and I did not find remaining material contradictions to the stated intent.
Testing
The preexisting baseline full-suite result was already successful; I reran focused PR-check, X-mode, and PR-merge suites, captured an end-to-end CLI transcript proving invalid-input refusal, private static poll publication, metadata binding rejection, non-executing migration, and guarded X outbox publication, then reran the complete configured
tests/*.test.shsuite withtmux 3.6a; all passed and the worktree remained clean.Evidence: PR-check security E2E transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
AGENTS.md- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Review** - 3 issues found → auto-fixed (2) ✅
bin/fm-x-poll.sh:105- Intent requires "publish X artifacts through same-directory private temporaries plus guarded atomic rename without following destination symlinks", but X inbox publication still writes through$INBOX/$REQ.json.tmpand thenmv -fto$INBOX/$REQ.jsonwithout validatingx-inbox, the temp file, or the destination as private single-link ordinary files. A symlinkedstate/x-inboxor temp path can redirect the write outside private state.bin/fm-x-lib.sh:384- Intent requires "Require private single-link artifacts" and guarded X artifact publication, butfmx_context_registry_setcreatesstate/x-contextwith plainmkdir -pand publishes withmv -f "$tmp" "$file"without rejecting a symlinked context directory or validating the final registry file. This leaves the durable X context artifact outside the new private/single-link guarantees.bin/fm-x-reply.sh:301- Intent requires X artifacts be published through private same-directory temporaries and guarded atomic rename, but dry-run outbox still writes directly withprintf ... > "$outbox_file"after plainmkdir -p. A symlinkedstate/x-outboxor destination can receive the would-be reply payload, and readers can observe a partial write.🔧 Fix: Guard X artifact publication
3 errors still open:
bin/fm-x-poll.sh:49- Intent requires "Require private single-link artifacts" and "publish X artifacts through same-directory private temporaries plus guarded atomic rename without following destination symlinks", but the X poll diagnostic still usesprintf ... > "$ERROR_FILE"after plainmkdir -p "$STATE". A preexistingstate/x-poll.errorsymlink or hardlink is still followed/written instead of rejected through the private artifact boundary.bin/fm-x-lib.sh:292- Intent requires private single-link X artifacts, but the reply-context reader still trustsstate/x-inbox/<request_id>.jsondirectly. A symlinked or hardlinked inbox record can be read byfm-x-reply/follow-up context resolution even though the new publisher would reject writing that artifact.bin/fm-x-lib.sh:481- Intent requires private single-link X artifacts, butfmx_context_registry_getreadsstate/x-context/<request_id>.jsonafter only-f; symlinked directories, symlinked files, and hardlinked records can still supply platform/budget data to reply/follow-up resolution. The write path was hardened, but existing unsafe registry artifacts remain trusted.🔧 Fix: Enforce private X artifact reads
✅ Re-checked - no issues remain.
🔧 **Test** - 1 issue found → auto-fixed ✅
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"🔧 Fix: Fix backend compatibility fixture dependencies
✅ Re-checked - no issues remain.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"Baseline already reported successful before this round:command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"bash tests/fm-pr-check-security.test.shbash tests/fm-x-mode.test.shbash tests/fm-pr-merge.test.shManual evidence transcript exercisingfm-pr-check.sh, generated PR poll execution for OPEN and MERGED states,fm-pr-check-migrate.sh, andfm-x-reply.shdry-run symlink guarding, written to/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KXMSQ4Z7DX1WE3CKRY1X98J7/pr-check-security-e2e-transcript.txtcommand -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"git status --short✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Remove unused x-mode test locals
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.