feat(CC-434): extract shared detached-launch lib for gate/dispatch supervisors#356
Merged
Conversation
…pervisors CC-433 spike judged the sentinel/setsid mechanics in dispatch-supervisor.sh and gate-supervisor.sh as byte-identical and safely extractable; this lands scripts/lib/detached-launch.sh with the 7 shared functions, migrates both supervisors and their pmctl wait/run_detached counterparts to use it, and adds a fixture test guarding the two inline REPO_ROOT resolution blocks (kept inline due to a bootstrap circular dependency) against drift. Also records the poll->notify IPC evaluation as CC-435: judged not worth the added complexity/risk given the current single-waiter usage pattern, tracked as a conditionally-triggered someday ticket rather than a committed follow-up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-launch tests pr-gate QA blocked on a sleep-based async wait red-line violation in the two under_setsid test cases. Replace the sleep(0.2)-loop-on-marker-file pattern with the codebase's established mkfifo blocking-read signal, matching test-dispatch-lifecycle.sh's _install_fake_codex_blocking idiom. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…isory) detached_launch_generate_nonce relied on the tr|head pipeline's exit status to decide whether to fall back to the weaker $RANDOM-based nonce. Under set -o pipefail (every caller has it), head -c 32 closing its read end SIGPIPEs tr, so the pipeline always exits non-zero even though the captured output is fully valid -- silently discarding the intended 32-char /dev/urandom entropy for the much weaker fallback on every call. Judge success by captured length instead of exit status, and add a regression test that asserts the full-entropy path is reached under pipefail. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ellcheck) The test-skill-refine CI job runs raw shellcheck (no -x) over scripts/, which -- unlike scripts/lint-scripts.sh's local invocation -- doesn't follow dynamically-sourced libs and flags SC2154 on tmp_root as a hard failure. Match the existing convention used by test-pmctl-safe.sh and siblings: explicit `# shellcheck disable=SC1091` above each source line, plus `# shellcheck disable=SC2154` for tmp_root supplied by the sourced harness. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
scripts/dispatch-supervisor.shandscripts/gate-supervisor.shintoscripts/lib/detached-launch.sh(per CC-433 spike, GREEN verdict).resolve_repo_rootstays inline in both supervisors (bootstrap circular dependency); a new fixture test (test-detached-launch.sh) diffs the two marker-comment-delimited blocks to guard against drift.Test plan
scripts/test-detached-launch.sh(new, 13 cases) — all passscripts/test-gate-lifecycle.sh(12 cases) — all passscripts/test-dispatch-lifecycle.sh(38 cases) — all passscripts/test-pmctl-gate.sh(17 cases) — all passscripts/test-pmctl-dispatch.sh(44 cases) — all passscripts/test-dispatch-record.sh(7 cases) — all passscripts/test-pmctl-adapter-generate.sh(16 cases) — all passscripts/lint-scripts.sh— 98 scripts checked, OKpmctl backlog lint— OKscripts/run-all-tests.shfull suite — all green