Skip to content

test(watcher): de-flake and leak-proof the watcher-lock suite - #904

Closed
mattwwatson wants to merge 2 commits into
kunchenguid:mainfrom
mattwwatson:up/watcher-lock-deflake
Closed

mattwwatson wants to merge 2 commits into
kunchenguid:mainfrom
mattwwatson:up/watcher-lock-deflake

Conversation

@mattwwatson

Copy link
Copy Markdown

Intent

Upstream contribution from the mattwwatson/firstmate fork: de-flake and leak-proof the watcher-lock test suite at the root. Peer watcher starts are now exec-confirmed with durable-file synchronization instead of sleeps, a self-checking bash peer, and an injectable FM_ARM_CONFIRM_TIMEOUT; tests/lib.sh gains file-backed pid and temp registries with a home-scoped reaper (fm_test_track_pid) so no failure path leaks background processes or holds a temp home's watcher lock, and CONTRIBUTING.md documents the convention (nothing reaped by process-name pattern). The CONTRIBUTING.md paragraph was hand-merged onto the current upstream testing-docs rewrite, keeping upstream's fm-test-run.sh section intact and appending only the two new convention sentences. Suite passes 28/28 locally on the upstream base.

What Changed

  • Replaced sleep-based peer-watcher startup in the watcher-lock suite with exec-confirmed durable-file synchronization: a self-checking bash peer, an injectable FM_ARM_CONFIRM_TIMEOUT, and an fm-watch-arm.sh tweak that surfaces the finished child's stand-down output before the successor-confirmation wait so tests can synchronize on it.
  • Added file-backed pid and temp-dir registries to tests/lib.sh (stored in a private mktemp -d directory) with a home-scoped reaper via fm_test_track_pid, so failing test paths no longer leak background processes or hold a temp home's watcher lock — nothing is reaped by process-name pattern. Suites that install custom EXIT traps now drain these registries in their own cleanup.
  • Documented the process-tracking convention in CONTRIBUTING.md, appending two sentences to the existing fm-test-run.sh testing section. Suite verified 28/28 across three consecutive runs in the pipeline, including its built-in no-leaked-process/no-held-lock audit.

Risk Assessment

✅ Low: The final commit cleanly closes the round-2 registry-dir leak by adding idempotent, exit-status-preserving fm_test_cleanup calls to the exact three non-conforming suites, and the full branch now satisfies every stated intent criterion with no outstanding source findings.

Testing

Ran the watcher-lock suite three times through the canonical runner (28/28 each, no flakes), ran the three other touched suites (pass/clean self-skip), and demonstrated the leak-proofing end-to-end with a fail()-aborted real-arm demo (children reaped, lock released, 5s pipe EOF) against a pre-change contrast that hung the pipe 76s; before/after audits show zero leaked processes or temp dirs and the user's real watcher untouched. No UI surface — this is CLI/test infrastructure, so transcripts are the reviewer-visible evidence.

Evidence: watcher-lock suite run 1 transcript (28/28 ok)
FM_TEST_BEGIN 2026-07-23T09:11:05Z tests/fm-watcher-lock.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - simultaneous watcher starts leave exactly one live process
ok - fm_pid_identity is locale-invariant across LC_ALL/LC_TIME
ok - Linux process identity clock-step regression skipped on non-Linux host
ok - killed watcher stale lock is reclaimed
ok - live watcher lock with stale heartbeat is actionable
ok - guard banner leads when down with pending wakes (repair-after-drain) and stays silent when fresh
ok - concurrent fm_lock_try_acquire yields exactly one winner
ok - dead-pid stale lock is reclaimed by a single acquirer
ok - concurrent stale-lock steal yields exactly one winner
ok - live steal mutex is not reclaimed
ok - live-held lock is not stolen
ok - empty mid-acquire lock keeps a minimum grace
ok - late original claimant cannot claim a recreated lock
ok - paused mid-acquire claimant backs off to active stealer
ok - watch restart refuses to signal a reused pid
ok - watch restart attaches to a verified healthy peer and later surfaces a successor gap
ok - watcher self-evicts when the lock pid no longer names it
ok - arm turns clean self-eviction without a successor into a typed failure
ok - arm attaches to a live fresh watcher and fails loudly when that cycle has no successor
ok - attached arm signals record a classified lifecycle entry
ok - arm starts+confirms a fresh watcher on a clean lock and self-heals a dead-pid lock (never healthy off a dead pid)
ok - arm cleans child watcher and temp output on HUP
ok - arm propagates an immediate watcher wake before confirmation
ok - arm attaches to a peer watcher after child stands down and surfaces a missing successor
watcher: lock held by live pid 46486 but heartbeat is stale for 838152738s (>300s); inspect or stop that watcher before re-arming.
ok - arm reports FAILED and exits non-zero when no fresh watcher can be confirmed
ok - cycle-exit ledger links a verified successor and remains size-capped
ok - SIGSTOP distinguishes live PID from stale beacon and termination records the exit class
ok - every case leaves no background process and no watcher holding a temp home lock
FM_TEST_END 2026-07-23T09:13:06Z tests/fm-watcher-lock.test.sh exit=0 duration_ms=121237 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=121336
FM_TEST_SUMMARY_FAMILY family=watcher-wake-lock count=1 duration_ms=121237 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-watcher-lock.test.sh duration_ms=121237
Evidence: watcher-lock suite run 2 transcript (28/28 ok)
FM_TEST_BEGIN 2026-07-23T09:13:50Z tests/fm-watcher-lock.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - simultaneous watcher starts leave exactly one live process
ok - fm_pid_identity is locale-invariant across LC_ALL/LC_TIME
ok - Linux process identity clock-step regression skipped on non-Linux host
ok - killed watcher stale lock is reclaimed
ok - live watcher lock with stale heartbeat is actionable
ok - guard banner leads when down with pending wakes (repair-after-drain) and stays silent when fresh
ok - concurrent fm_lock_try_acquire yields exactly one winner
ok - dead-pid stale lock is reclaimed by a single acquirer
ok - concurrent stale-lock steal yields exactly one winner
ok - live steal mutex is not reclaimed
ok - live-held lock is not stolen
ok - empty mid-acquire lock keeps a minimum grace
ok - late original claimant cannot claim a recreated lock
ok - paused mid-acquire claimant backs off to active stealer
ok - watch restart refuses to signal a reused pid
ok - watch restart attaches to a verified healthy peer and later surfaces a successor gap
ok - watcher self-evicts when the lock pid no longer names it
ok - arm turns clean self-eviction without a successor into a typed failure
ok - arm attaches to a live fresh watcher and fails loudly when that cycle has no successor
ok - attached arm signals record a classified lifecycle entry
ok - arm starts+confirms a fresh watcher on a clean lock and self-heals a dead-pid lock (never healthy off a dead pid)
ok - arm cleans child watcher and temp output on HUP
ok - arm propagates an immediate watcher wake before confirmation
ok - arm attaches to a peer watcher after child stands down and surfaces a missing successor
watcher: lock held by live pid 65710 but heartbeat is stale for 838152901s (>300s); inspect or stop that watcher before re-arming.
ok - arm reports FAILED and exits non-zero when no fresh watcher can be confirmed
ok - cycle-exit ledger links a verified successor and remains size-capped
ok - SIGSTOP distinguishes live PID from stale beacon and termination records the exit class
ok - every case leaves no background process and no watcher holding a temp home lock
FM_TEST_END 2026-07-23T09:15:49Z tests/fm-watcher-lock.test.sh exit=0 duration_ms=119233 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=119426
FM_TEST_SUMMARY_FAMILY family=watcher-wake-lock count=1 duration_ms=119233 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-watcher-lock.test.sh duration_ms=119233
Evidence: watcher-lock suite run 3 transcript (28/28 ok)
FM_TEST_BEGIN 2026-07-23T09:15:50Z tests/fm-watcher-lock.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - simultaneous watcher starts leave exactly one live process
ok - fm_pid_identity is locale-invariant across LC_ALL/LC_TIME
ok - Linux process identity clock-step regression skipped on non-Linux host
ok - killed watcher stale lock is reclaimed
ok - live watcher lock with stale heartbeat is actionable
ok - guard banner leads when down with pending wakes (repair-after-drain) and stays silent when fresh
ok - concurrent fm_lock_try_acquire yields exactly one winner
ok - dead-pid stale lock is reclaimed by a single acquirer
ok - concurrent stale-lock steal yields exactly one winner
ok - live steal mutex is not reclaimed
ok - live-held lock is not stolen
ok - empty mid-acquire lock keeps a minimum grace
ok - late original claimant cannot claim a recreated lock
ok - paused mid-acquire claimant backs off to active stealer
ok - watch restart refuses to signal a reused pid
ok - watch restart attaches to a verified healthy peer and later surfaces a successor gap
ok - watcher self-evicts when the lock pid no longer names it
ok - arm turns clean self-eviction without a successor into a typed failure
ok - arm attaches to a live fresh watcher and fails loudly when that cycle has no successor
ok - attached arm signals record a classified lifecycle entry
ok - arm starts+confirms a fresh watcher on a clean lock and self-heals a dead-pid lock (never healthy off a dead pid)
ok - arm cleans child watcher and temp output on HUP
ok - arm propagates an immediate watcher wake before confirmation
ok - arm attaches to a peer watcher after child stands down and surfaces a missing successor
watcher: lock held by live pid 95414 but heartbeat is stale for 838153023s (>300s); inspect or stop that watcher before re-arming.
ok - arm reports FAILED and exits non-zero when no fresh watcher can be confirmed
ok - cycle-exit ledger links a verified successor and remains size-capped
ok - SIGSTOP distinguishes live PID from stale beacon and termination records the exit class
ok - every case leaves no background process and no watcher holding a temp home lock
FM_TEST_END 2026-07-23T09:17:52Z tests/fm-watcher-lock.test.sh exit=0 duration_ms=121856 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=121931
FM_TEST_SUMMARY_FAMILY family=watcher-wake-lock count=1 duration_ms=121856 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-watcher-lock.test.sh duration_ms=121856
Evidence: Fail-path leak demo transcript — tracked arm+watcher reaped after mid-case fail(), lock released, 5s pipe EOF

demo exit=1 (expected nonzero: fail() aborted the case) seconds-to-EOF=5 (a leaked child would hold the pipe open and hang this read) arm pid 65278: gone (reaped) watcher grandchild pid 65293: gone (reaped) temp root .../fm-leak-demo.lDnZPj: removed (watcher lock released with it)

== driver: run fail-path demo, reading its output to EOF (the hang symptom) ==
demo exit=1 (expected nonzero: fail() aborted the case)
seconds-to-EOF=5 (a leaked child would hold the pipe open and hang this read)
demo output: not ok - simulated mid-case assertion failure (arm=65278 watcher=65293 still live)

== recorded live pids at moment of failure ==
arm=65278 watcher=65293 tmp_root=/var/folders/mz/9drvc3ms7w9c8vzk0j1gj2vm0000gp/T//fm-leak-demo.lDnZPj

== after exit: are they reaped? ==
  PID COMMAND
arm pid 65278: gone (reaped)
  PID COMMAND
watcher grandchild pid 65293: gone (reaped)
temp root /var/folders/mz/9drvc3ms7w9c8vzk0j1gj2vm0000gp/T//fm-leak-demo.lDnZPj: removed (watcher lock released with it)
Evidence: Pre-change contrast transcript — untracked children held the output pipe 76s past the abort
== driver: run OLD-STYLE demo (no pid registry), reading output to EOF with a 15s cap ==
driver read returned rc=1 after 76s (142=ALRM: the leaked children held the pipe open past the 15s cap)

== recorded pids at moment of failure ==
arm=71892 watcher=71925

== after the case aborted: still running? ==
  PID 
arm gone
  PID 
watcher gone

== driver cleans up the deliberately leaked fixture pids ==
  PID 
leaked fixtures now cleaned up by driver
Evidence: Fail-path demo script (replicates a watcher-lock case with the new registry convention)
#!/usr/bin/env bash
# Demonstrates the leak-proofing this change adds to tests/lib.sh:
# a watcher-lock-style case starts a REAL fm-watch-arm.sh (which forks a real
# fm-watch.sh grandchild that takes the temp home's singleton lock), registers
# the arm with fm_test_track_pid exactly as the suite does, and then aborts
# mid-case via fail() - the exact path that used to leak the arm + watcher
# forever and hold the suite's stdout pipe open.
#
# Usage: fail-path-leak-demo.sh <worktree> <status-file>
# The status file (outside TMP_ROOT, which the reaper deletes) records the pids
# and temp home so the driver can verify everything was reaped after exit.
set -u
WT=$1
STATUS=$2
# shellcheck source=/dev/null
. "$WT/tests/wake-helpers.sh"
WATCH_ARM="$ROOT/bin/fm-watch-arm.sh"
TMP_ROOT=$(fm_test_tmproot fm-leak-demo)

# Same cleanup convention as tests/fm-watcher-lock.test.sh.
watcher_lock_cleanup() {
  fm_test_reap_tracked_pids
  fm_wake_reap_temp_watchers "$TMP_ROOT"
  fm_test_cleanup
}
trap watcher_lock_cleanup EXIT

dir=$(make_case leak-demo)
state="$dir/state"
fakebin="$dir/fakebin"
armout="$dir/arm.out"
printf '%s\n' fm-pr-check-migration-scan-v1 > "$state/.pr-check-migration-scan-v1"
printf '%s\n' fm-pr-check-migration-v1 > "$state/.pr-check-migration-v1"
chmod 0600 "$state/.pr-check-migration-scan-v1" "$state/.pr-check-migration-v1"

PATH="$fakebin:$PATH" FM_HOME="$dir" FM_STATE_OVERRIDE="$state" FM_POLL=5 \
  FM_SIGNAL_GRACE=1 FM_CHECK_INTERVAL=999999 FM_HEARTBEAT=999999 \
  "$WATCH_ARM" > "$armout" &
armpid=$!
fm_test_track_pid "$armpid"

i=0
while [ "$i" -lt 80 ]; do
  grep -qF 'watcher: started pid=' "$armout" 2>/dev/null && break
  sleep 0.1
  i=$((i + 1))
done
grep -qF 'watcher: started pid=' "$armout" || fail "demo arm never started a watcher"
watcher_pid=$(cat "$state/.watch.lock/pid" 2>/dev/null || true)
printf 'arm=%s watcher=%s tmp_root=%s\n' "$armpid" "$watcher_pid" "$TMP_ROOT" > "$STATUS"

# Abort mid-case with a live arm + live watcher grandchild holding the lock -
# the leak scenario. fail() exits 1; the EXIT trap must reap everything.
fail "simulated mid-case assertion failure (arm=$armpid watcher=$watcher_pid still live)"
Evidence: Other touched suites transcript (tmux 4/4 ok; herdr e2e clean opt-in skips)
FM_TEST_BEGIN 2026-07-23T09:17:59Z tests/fm-tmux-submit-busy.test.sh family=pure-contract-unit expected_gate_skip=none
ok - fm_tmux_submit_enter_core: busy pane + pending composer returns empty (message queued)
ok - fm_tmux_submit_enter_core: idle pane + pending composer stays pending (genuine swallow preserved)
ok - fm_tmux_submit_enter_core: busy pane clears composer on first Enter - returns empty
ok - fm_tmux_submit_enter_core: idle pane clears composer on first Enter - returns empty as before
FM_TEST_END 2026-07-23T09:18:01Z tests/fm-tmux-submit-busy.test.sh exit=0 duration_ms=2526 gate_skip=false
FM_TEST_BEGIN 2026-07-23T09:18:01Z tests/fm-afk-pi-herdr-return-e2e.test.sh family=live-harness-optin expected_gate_skip=optin-env
skip: set FM_AFK_PI_HERDR_E2E=1 to run the real Pi/Herdr away-return regression
FM_TEST_END 2026-07-23T09:18:02Z tests/fm-afk-pi-herdr-return-e2e.test.sh exit=0 duration_ms=107 gate_skip=true
FM_TEST_BEGIN 2026-07-23T09:18:02Z tests/fm-send-secondmate-marker-herdr-e2e.test.sh family=live-harness-optin expected_gate_skip=optin-env
skip: set FM_SEND_MARKER_HERDR_E2E=1 to run the real Pi/Herdr secondmate-marker regression
FM_TEST_END 2026-07-23T09:18:02Z tests/fm-send-secondmate-marker-herdr-e2e.test.sh exit=0 duration_ms=83 gate_skip=true
FM_TEST_SUMMARY total=3 failed=0 skipped_gate=2 duration_ms=2922
FM_TEST_SUMMARY_FAMILY family=live-harness-optin count=2 duration_ms=190 failed=0
FM_TEST_SUMMARY_FAMILY family=pure-contract-unit count=1 duration_ms=2526 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-tmux-submit-busy.test.sh duration_ms=2526
FM_TEST_SLOWEST rank=2 script=tests/fm-afk-pi-herdr-return-e2e.test.sh duration_ms=107
FM_TEST_SLOWEST rank=3 script=tests/fm-send-secondmate-marker-herdr-e2e.test.sh duration_ms=83
Evidence: Leak audit: TMPDIR fm-* dirs and watcher processes before/after all runs (zero suite leftovers)
fm-test-registry.LSGxKZ
fm-wake-tangle-root.HEPx5S
fm-wedge-rec.tJ6Rr5

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed (2) ✅
  • ⚠️ tests/lib.sh:85 - The file-backed registries use predictable world-tmp paths (${TMPDIR:-/tmp}/fm-test-cleanup.$$ and fm-test-pids.$$), and fm_test_cleanup later rm -rfs every path read back from the cleanup log (guarded only against empty and /). On a multi-user machine another user can pre-create or symlink those names — sticky-bit /tmp even makes the source-time rm -f of a foreign-owned planted file fail silently — letting planted content steer the rm -rf. The in-code rationale for rejecting mktemp (that an assignment would die inside a command-substitution subshell) does not apply at source time: these variables are assigned when lib.sh is sourced in the main shell, where a mktemp'd path would be equally visible to every subshell; the only real trade-off is the documented lazy-creation/no-stray-file property. Consider a mktemp'd per-process registry directory created at source time (fixed filenames inside, created lazily), which keeps laziness for the files while removing name predictability. Flagged ask-user because the current scheme is explicitly documented as deliberate.
  • ℹ️ bin/fm-watch-arm.sh:418 - A commit scoped test(watcher): changes production behavior in bin/fm-watch-arm.sh: the arm now prints its finished child's output (and deletes the temp file) before spending the successor-confirmation window, so the child's stand-down explanation surfaces up to FM_ARM_CONFIRM_TIMEOUT seconds earlier. I verified the change is safe (wait_for_healthy_successor/healthy_watcher never read child/child_out; the signal handler behaves identically since the child is already reaped on this path; relative stdout order and cycle-ledger timing are unchanged) and it is load-bearing for the new durable-file synchronization in test_arm_waits_for_peer_beacon_after_child_stands_down, which greps the arm's own output for the stand-down line before the beacon exists. Only noting that the commit-type label understates a production output-timing change.

🔧 Fix: harden test registries with private mktemp dir
1 info still open:

  • ℹ️ tests/lib.sh:85 - The round-1 hardening makes the registry directory eager: sourcing tests/lib.sh now always runs mktemp -d (tests/lib.sh:85), so any suite that sources lib.sh but overrides the EXIT trap without calling fm_test_cleanup leaks one small empty registry dir per run. Exactly three suites do this: tests/fm-tmux-submit-busy.test.sh (trap 'rm -rf "$TMP_ROOT"' EXIT), tests/fm-afk-pi-herdr-return-e2e.test.sh (custom cleanup that rm -rfs its own TMP_ROOT but never drains the registries — it already leaked the lazy cleanup-log file under the previous commit since it uses fm_test_tmproot), and tests/fm-send-secondmate-marker-herdr-e2e.test.sh. All three violate the trap convention this branch documents in lib.sh and CONTRIBUTING.md, and the leak is bounded to a tiny OS-reaped tmp dir. Making their traps call fm_test_cleanup is a mechanical follow-up, but it would expand this focused upstream-contribution branch to unrelated suites — asking rather than auto-fixing; deferring entirely is also reasonable.

🔧 Fix: drain test registries in suites with custom EXIT traps
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • bin/fm-test-run.sh tests/fm-watcher-lock.test.sh ×3 consecutive runs — 28/28 ok each, exit=0, including the suite's built-in no-leaked-process/no-held-lock audit case
  • bin/fm-test-run.sh tests/fm-tmux-submit-busy.test.sh tests/fm-afk-pi-herdr-return-e2e.test.sh tests/fm-send-secondmate-marker-herdr-e2e.test.sh — tmux suite 4/4 ok; both herdr e2e suites self-skip cleanly behind their opt-in env gates with the new fm_test_cleanup trap line in place
  • Fail-path leak demo: real fm-watch-arm.sh + watcher grandchild registered via fm_test_track_pid, aborted mid-case with fail() — verified both pids reaped, temp home watcher lock released, and suite output pipe reached EOF in 5s
  • Pre-change contrast demo (untracked pid, dirs-only EXIT trap) — reproduced the old symptom: output pipe held 76s past the abort by lingering arm/watcher before driver cleanup
  • Leak audit: diffed TMPDIR fm-* dirs and fm-watch/fm-watch-arm processes before vs after all runs — zero suite leftovers, TMPDIR restored to exact baseline, user's real-home watcher untouched
  • Reviewed CONTRIBUTING.md diff — two convention sentences appended after upstream's intact fm-test-run.sh testing-docs section
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@mattwwatson
mattwwatson force-pushed the up/watcher-lock-deflake branch from 0a0d42c to de7c31a Compare July 24, 2026 19:32
@kunchenguid

kunchenguid commented Jul 29, 2026 •

Copy link
Copy Markdown
Owner

Automated reminder: thanks for the PR! This branch currently has a merge conflict with the base branch.

When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again.

Noted for firstmate#904 at de7c31a0.

@kunchenguid

Copy link
Copy Markdown
Owner

Automated reminder: this PR still looks blocked on a rebase or merge conflict fix.

If you are still interested, please rebase onto the current base branch, resolve the conflict, and push.

If I do not hear back, I may close this as inactive.

@kunchenguid kunchenguid removed the wheelhouse:pending-contributor-action Managed by Wheelhouse label Aug 11, 2026
The watcher-lock suite raced its peer processes (peers were assumed
started without confirmation) and leaked background children on failure
exits, which could hang the suite's output pipe and hold a temp home's
watcher lock. De-flake it at the root: exec-confirmed peer starts,
durable-file synchronization instead of sleeps, a self-checking bash
peer, and an injectable FM_ARM_CONFIRM_TIMEOUT. Leak-proof the harness
with file-backed pid and temp registries in tests/lib.sh plus a
home-scoped reaper (fm_test_track_pid), and document the convention in
CONTRIBUTING.md: nothing is ever reaped by process-name pattern.
@Harrison-Booth

Copy link
Copy Markdown

Checked on a Windows 11 build of main (11bb6738, gridcraft-cli 0.12.1, release, GNU toolchain) and in real Excel (Microsoft 365, en-US regional settings) driven through COM with a temporary workbook.

Still broken. Workbook with sheets Sheet1 and D, D!C7 = 1, formulas entered on Sheet1:

Formula Excel GridCraft main
=CELL("address",D!C7) [Book2]D!$C$7 $C$7
=CELL("address",C7) n/a (same sheet) $C$7

ADDRESS(7,3,1,TRUE,"D") returns D!$C$7 in GridCraft, so only CELL("address") still drops the sheet. #1529, which is linked here, fixed the quoting side of sheet names, not this.

1 similar comment
@Harrison-Booth

Copy link
Copy Markdown

Checked on a Windows 11 build of main (11bb6738, gridcraft-cli 0.12.1, release, GNU toolchain) and in real Excel (Microsoft 365, en-US regional settings) driven through COM with a temporary workbook.

Still broken. Workbook with sheets Sheet1 and D, D!C7 = 1, formulas entered on Sheet1:

Formula Excel GridCraft main
=CELL("address",D!C7) [Book2]D!$C$7 $C$7
=CELL("address",C7) n/a (same sheet) $C$7

ADDRESS(7,3,1,TRUE,"D") returns D!$C$7 in GridCraft, so only CELL("address") still drops the sheet. #1529, which is linked here, fixed the quoting side of sheet names, not this.

@zzzRYT

zzzRYT commented Nov 3, 2026

Copy link
Copy Markdown

라이브 QA 결과 (iPhone 17 시뮬레이터, dev 서버, head 05b4ee49c)

본문 QA 표의 untested 항목을 시뮬레이터에서 직접 돌린 결과예요. 요청 헤더·본문은 런타임 fetch 래퍼(저장소 코드 수정 없음)로 확인했어요. 테스트용 계산기는 새로 만들어 쓰고 삭제했고, 기존 계산기·대표 설정은 건드리지 않았어요.

# 시나리오 판정 근거
a 날짜 시트: 닫힘→행 탭→열림 / 열림→행 탭→유지 / 행 밖 탭→닫힘 통과 등록 화면·수정 화면(입영일 설정) 모두 세 동작 확인
b 스크롤·화면 전환 뒤에도 (a) 동작 통과 (수정 화면 기준) 나갔다 → 수정 화면 스크롤 → 재진입 뒤 같은 동작. 시트를 열어 둔 채 가장자리 스와이프로 뒤로 가는 경로는 판정 불가
c 상세유형만 바꿔 저장 → 서버 반영, 카드는 서버 기본값 통과 현역병→상근예비역(육군 유지). UpdateCalculatorService(category) → UpdateCalculatorService(category+branch) 모두 200, 각각 Idempotency-Key 포함. 비기본 카드 구성을 저장해 둔 뒤였는데 UpdateSoldierPreviewPropertyTypeList는 한 번도 나가지 않았고, 이후 GetPreviewItemSettingsScreen 응답이 서버 기본 목록으로 돌아와 있음
d 「확인이 필요해요」 표시·같은 값 저장 시 꺼짐·Idempotency-Key·실패 시 성공처럼 보이지 않음 부분 통과 서버에 플래그가 켜진 dev 계산기가 없어 앱 캐시 값을 강제로 켜서 확인함. 표시 ✔, 같은 값 저장 시 confirm mutation(Idempotency-Key 포함) 200 후 표시 사라짐 ✔, 요청을 네트워크 오류로 실패시키면 오류 토스트만 뜨고 성공 토스트·플래그 해제 없음 ✔. 서버가 실제 플래그를 끄는지는 미확인
e 등록·수정·미리보기·삭제 전체 흐름 통과 RegisterCalculator(Idempotency-Key: calculator-register-…) 200, 미리보기 PreviewCalculatorChange 200, 이름·카드 저장 200, DeleteCalculatorServiceSoldier 200 후 서버 목록에서 사라짐
f 전역일·진급일·구간이 서버 응답과 일치 통과 서버 endDate 2028-05-01T15:00Z(=KST 5/2), 진급 2027-02-01 / 2027-08-01 / 2028-02-01 모두 등록 검토·상세·수정 화면과 일치, D-day·복무일(547/546)도 일치
g 셀럽 군인프로필 복사 중 네트워크 오류 시 대화상자 한 번 조건부 통과 + 결함 후보 복사 요청을 실패시켰을 때 화면에는 오류 토스트가 1개만 보임(30fps 영상 확인)

확인한 결함 후보 (고치지 않음)

  • g — 오류 안내 이중 호출: features/cheer/celebrity-header/components/celebrity-header.tsx의 복사 핸들러가 onError: handleMutationError와 try/catch를 함께 써서, 네트워크 오류 시 onError가 "인터넷에 연결되어 있지 않아요" 안내를 호출한 뒤 data가 비어 catch가 "문제가 발생했습니다…" 안내를 다시 호출해요. 화면에는 나중 것만 보여서 오프라인 안내가 사라져요(수정 화면 저장 실패에서는 오프라인 안내가 정상 표시됨). 재현: 셀럽 상세에서 "군인프로필 복사" → 확인 → 광고 종료 시점에 네트워크 오류. 토스트 호출 횟수를 직접 세지는 못해서 "화면에 1개"는 확인, "호출 1회"는 코드 읽기로만 추정이에요.

관찰 (결함 여부 미확정)

  • 등록 직후 홈 캐러셀에 새 계산기가 바로 보이지 않고, 목록 화면을 열어 대시보드 목록이 재조회된 뒤에 나타나요. PR 이전 동작과는 비교하지 못했어요.
  • 상세유형 변경 한 번에 쓰기 요청이 2번(category / category+branch) 나가요. 서로 다른 Idempotency-Key를 쓰고 있어 의도된 흐름이면 문제없어요.
  • 셀럽 복사 CreateSoldierFromCelebrity 요청에는 Idempotency-Key가 없어요. 계약상 필요한지는 확인하지 못했어요.

확인하지 못한 것

  • d의 서버 측 플래그 해제(서버 플래그가 켜진 dev 계산기 필요).
  • 시트가 열린 채 화면 전환(b 일부), 등록 화면에서의 스크롤 후 재검증.
  • 호봉 승급 등 클라이언트 계산 값은 서버 응답과 대조하지 않았어요.

테스트 광고(App Store 시트, 전면 광고, 인앱 브라우저)가 겹쳤지만 닫고 진행했고 판정이 막힌 항목은 없어요.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @mattwwatson for this, and I'm sorry it sat so long without a real review.

I read head 8ebfe562 against main 69023626. A lot has changed under it since August. Main is about 725 commits ahead, and the watcher-lock suite has been reworked several times: #6887 stabilized its race fixtures, #8018 and #8025 changed watcher arming and interrupted-lock recovery, and #8070 hardened the fixtures again. tests/lib.sh now has its own $$-keyed registries that reap process-event homes and armed watchers per test home, and FM_ARM_CONFIRM_TIMEOUT is already on main. So much of what this PR set out to do now looks covered another way. The PR body also has no no-mistakes attestation for this head, and the quick checks (coverage guard, repo invariants) never ran on it.

Waiting on you, no rush: is there still a part main doesn't cover? Two examples would be fm_test_track_pid for general background pids, or surfacing the child's stand-down output in fm-watch-arm.sh. If so, the simplest path is a fresh raise of just that part through git push no-mistakes on top of current main, so the attestation binds the head with every step and live evidence where it applies. If main already covers what you needed, feel free to close this. Either is fine. You don't need to fix the merge conflicts for us. That's ours.

Contract-class: cannot-tell for now, because the branch can't be judged against current main. VISION.md: test hygiene and leak-proof fixtures align ("field incidents become regression coverage"). Nothing here conflicts with the vision.

@mattwwatson

Copy link
Copy Markdown
Author

Closing this - it has drifted a long way behind main and no longer applies cleanly. If the problem still reproduces on current main I'll raise it fresh. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants