knowledge: SIGINT to a shell-backgrounded process under test is discarded — deliver via subprocess driver (1 ingested, 2 dropped as in-flight dups of #51) - #57
Open
choiyounggi wants to merge 1 commit into
Conversation
… processes under test)
This was referenced Aug 7, 2026
Open
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.
Knowledge flush — 3 insight(s): 1 ingested, 2 dropped as in-flight duplicates
Verified best-practice
1. SIGINT delivery to
&-backgrounded processes in non-interactive shells (INGESTED)Claim: a test harness that starts a program with
cmd &from a shell script andsends
kill -INT "$pid"never delivers an effective SIGINT — POSIX requiresjob-control-disabled shells to start asynchronous-list commands with SIGINT and
SIGQUIT set to SIG_IGN, so the kill succeeds and the child discards the signal;
waitthen hangs to the harness timeout and the failure reads like a productbug. Deliver the signal from a subprocess driver instead (e.g.
subprocess.Popen+send_signal(SIGINT)), orset -min the script, or useSIGTERM when the contract is generic shutdown.
Sources checked:
§2.11 Signals and Error Handling, verbatim: "If job control is disabled …
when the shell executes an asynchronous list, the commands in the list shall
inherit from the shell a signal action of ignored (SIG_IGN) for the SIGINT
and SIGQUIT signals." (fetched and grepped the spec text directly)
"When job control is not in effect, asynchronous commands ignore SIGINT and
SIGQUIT in addition to these inherited handlers."
anchor existence verified by fetch.
Local reproduction (2026-08-07, macOS):
sh|bash|zsh -c '<print SIGINT disposition> & wait'all report SIG_IGN for the background child and thedefault handler in the foreground; with
set -mthe background child reportsthe default handler; SIGTERM reports SIG_DFL in both. Matches the harvested
field case (server binary: rc 143 timeout under
kill -INT+wait, immediaterc 0 under Popen+send_signal).
Confidence: verified.
2. worktree_escape guardrail escalation budgeting (DROPPED — in-flight duplicate)
Claim: the worktree_escape guardrail escalates read-shaped cross-worktree
access, so orchestration briefs referencing other worktrees must budget the
escalation round trip. Not re-verified here — open PR #51 already carries this
exact insight with a stronger local reproduction (see Open-PR check).
3. Orca terminal bind-failure stage branching (DROPPED — in-flight duplicate)
Claim: check for the idle prompt before binding the next unit to a worker's
terminal; branch on the failure stage (runtime_unavailable → wait and rebind,
agent_unconfigured → replace the agent; always pass --worktree with
--terminal). Not re-verified here — open PR #51 already carries all four rows
with the same field evidence.
Existing-layer check
Routed via INDEX.md → testing domain. Read the full testing domain index (all
"load when" lines) — no existing page covers signal delivery or process
lifecycle in tests; nearest neighbors (diagnosing-flaky-tests, async-testing,
test-level-choice) have non-overlapping triggers. Checked platforms as the
alternative home: background-services covers process persistence (nohup/launchd/
systemd), non-interactive-cli-invocation covers prompt-capable CLIs hanging —
neither covers signal dispositions of
&jobs, so this is a new trigger →new page (merge-before-create satisfied: nothing to merge into). Repo-wide
grep -ril sigint wiki/confirmed no page mentions the mechanism.Created:
wiki/testing/strategy/signal-delivery-to-a-process-under-test.md(confidence verified, 3 sources + local repro). Updated
wiki/testing/index.md(strategy table row) and
log.md. Related-links added both ways withplatforms-processes-non-interactive-cli-invocation (same interactive-vs-
automation divergence family). No conflicts with existing directives.
Pages read: platforms-processes-background-services, platforms-processes-non-interactive-cli-invocation, infrastructure-agent-orchestration-pane-delivery-confirmation, infrastructure-agent-orchestration-worktree-isolated-workers
Open-PR check
Open
knowledge/*heads listed viagh pr listand each diffed against main(
git diff origin/main origin/<head> -- wiki/; fork heads #52/#49 fetched viapull/<n>/head):knowledge: one test per success-return site when a handler applies one policy at several returns #50 (dch0202-20260806-172420), knowledge: bats/bash-3.2 assertion trap + 4 orchestration/guard edges; 5 duplicates retired #47 (dch0202-20260806-130040),
knowledge: 4 verified insights — surviving-mutant triage, source-text wiring assertions, query state vs fetch state, python text-io encoding #52 (dch0202-rsquare-20260807-100149), knowledge: 3 verified testing-quality insights (value-preserving refactor tests, unasserted return fields, stale artifact baselines) #49 (dch0202-rsquare-20260806-142309):
no overlap with any of the 3 candidates (testing-quality, ML, platforms
pages; nothing touches signals or the two orchestration insights).
Its worktree-isolated-workers.md diff contains the read-only escalation
budgeting row verbatim ("Budget the round trip … state in the worker's first
brief that reads are approved") plus a stronger reproduction showing pure
reads pass and ask fires only when a write verb/absolute redirect co-occurs
— a correction that supersedes candidate 2's broader claim. Its
pane-delivery-confirmation.md diff contains all of candidate 3: idle-prompt
check before binding, runtime-unavailable → wait, agent-unconfigured →
replace agent, pane/worktree mismatch → pass worktree, same i43/i45 field
evidence.
Verdicts: candidate 1 → new (ingested here); candidate 2 → drop
(pending duplicate of #51, nothing unique to fold); candidate 3 → drop
(pending duplicate of #51, nothing unique to fold). No sibling duplicate PR
opened.
Routing decision
testing/strategy/signal-delivery-to-a-process-under-test.Domain: the trigger is test-harness-shaped (harvester hint: testing) and the
testing INDEX line "writing or structuring automated tests" matches; category
strategybecause the directive chooses the harness/driver structure, not anassertion. No new category needed. The shell mechanism is cross-referenced to
platforms via the related-link rather than a second page (one case, one page).