From 1e227a27e8736c63f8782968e69d742d20d6a68c Mon Sep 17 00:00:00 2001 From: choiyounggi <74581798+choiyounggi@users.noreply.github.com> Date: Fri, 7 Aug 2026 16:44:21 +0900 Subject: [PATCH] knowledge: ingest 1 verified insight (SIGINT delivery to backgrounded processes under test) --- .dev-loop/INGEST_REPORT.md | 142 ++++++++++++------ log.md | 1 + .../non-interactive-cli-invocation.md | 2 +- wiki/testing/index.md | 1 + ...signal-delivery-to-a-process-under-test.md | 66 ++++++++ 5 files changed, 167 insertions(+), 45 deletions(-) create mode 100644 wiki/testing/strategy/signal-delivery-to-a-process-under-test.md diff --git a/.dev-loop/INGEST_REPORT.md b/.dev-loop/INGEST_REPORT.md index 55ccfd1..a2f42e1 100644 --- a/.dev-loop/INGEST_REPORT.md +++ b/.dev-loop/INGEST_REPORT.md @@ -1,53 +1,107 @@ -# Knowledge consolidation — 15 open PRs (#17–#40) → one reconciled state - -The 15 open `knowledge/*` PRs (created 2026-08-04 → 2026-08-05, before the -harvest processed-store dedupe fix in #41) contained 123 file-versions of ~75 -unique pages, with the same insight landing at up to 3 different paths across -up to 8 PRs. Per-PR review would re-import those duplicates, so — as with the -#6–#13 consolidation — this branch carries the reconciled end-state and the 15 -PRs are closed in its favor. +# Knowledge flush — 3 insight(s): 1 ingested, 2 dropped as in-flight duplicates ## Verified best-practice -Every adopted page's sources were carried from its originating PR's flush, where -they were live-verified at flush time; no new URLs were introduced during -consolidation (checked mechanically: every `http(s)` URL in every merged page -appears in a source PR's diff; every added body line in amended pages traces to -a source PR hunk — orphan-line verification). Confidence fields were kept as the -originating flushes set them, except client-side-rate-limiting where the union -of provider-doc citations (Okta, Auth0, GitHub, OpenAI, RFC 6585) supports -`verified` for the load-bearing claims. One subagent's fabricated content (12 -files matching neither main nor any PR, with invented source URLs) was detected -by the same verification and replaced with true PR content. +**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 and +sends `kill -INT "$pid"` never delivers an effective SIGINT — POSIX requires +job-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; +`wait` then hangs to the harness timeout and the failure reads like a product +bug. Deliver the signal from a subprocess driver instead (e.g. +`subprocess.Popen` + `send_signal(SIGINT)`), or `set -m` in the script, or use +SIGTERM when the contract is generic shutdown. + +Sources checked: +- https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html — + §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) +- https://www.gnu.org/software/bash/manual/bash.html#Signals — §3.7.6, verbatim: + "When job control is not in effect, asynchronous commands ignore SIGINT and + SIGQUIT in addition to these inherited handlers." +- https://docs.python.org/3/library/subprocess.html#subprocess.Popen.send_signal — + anchor existence verified by fetch. + +Local reproduction (2026-08-07, macOS): `sh|bash|zsh -c ' & wait'` all report SIG_IGN for the background child and the +default handler in the foreground; with `set -m` the background child reports +the default handler; SIGTERM reports SIG_DFL in both. Matches the harvested +field case (server binary: rc 143 timeout under `kill -INT`+`wait`, immediate +rc 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 -- Merged-main near-dup scan before consolidation: pairwise Jaccard over - title + "When this applies" across all 141 merged pages → **0 flagged pairs**; - previously merged content carries no duplication. -- Cross-PR dedup during consolidation: 10 duplicate clusters collapsed to one - canonical page each (rate limiting 8→1, call-site enumeration 7→folded into - the canonical merged in #20, stderr/exit-0 diagnostics 4→1, sysroot 2→1, - env-off-switch 2→1, completion predicates 2→1, robots.txt 2→1, - harness-mediated results 2→1, leaked artifacts 2→1, orchestration category - naming unified). Three near-pairs kept distinct after trigger comparison, - with mutual `related:` links (differential setup vs interpretation; expansion - semantics vs off-switch design; import-time tactics vs level choice). -- 24 existing pages received union-merged amendments; additions already present - in main (from #16/#20) were skipped, and all non-canonical `related:` ids - were remapped to canonical page ids (post-merge broken-link scan: 0). +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 with +platforms-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 via `gh pr list` and each diffed against main +(`git diff origin/main origin/ -- wiki/`; fork heads #52/#49 fetched via +`pull//head`): + +- #56 (choiyounggi-20260807-153857), #55 (choiyounggi-20260807-144058), + #50 (dch0202-20260806-172420), #47 (dch0202-20260806-130040), + #52 (dch0202-rsquare-20260807-100149), #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). +- #51 (dch0202-20260806-183029): **overlaps candidates 2 and 3 completely.** + 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 -- New categories: `infrastructure/agent-orchestration` (5 pages; unified the - competing `orchestration`/`agent-orchestration` names), `databases/data-survey` - (1), `qa/deliverables` (1). All other pages route into existing categories. -- Canonical-path decisions: rate limiting → `backend/common/reliability/` - (sits beside timeouts-and-retries; 6 of 8 variants chose it); stderr - diagnostics → `platforms/processes/` (concern spans beyond shells); leaked - artifacts → `testing/data/artifact-leakage-from-a-suite`; call-site - enumeration → the existing `backend/common/change-impact/` page. -- All 38 new pages listed in their domain indexes (nearest-index rule; backend - routes via its python sub-index for bytecode-cache-staleness); INDEX.md domain - summaries updated for infrastructure/qa/databases. Full-wiki lint: frontmatter, - ids, related-links, index coverage, size, qualifiers, staleness → 0 findings. +- Candidate 1 → `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 + `strategy` because the directive chooses the harness/driver structure, not an + assertion. 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). +- Candidates 2–3 → no routing; retired as pending duplicates of open PR #51. diff --git a/log.md b/log.md index c930fc2..c4c9365 100644 --- a/log.md +++ b/log.md @@ -43,3 +43,4 @@ Append-only. Format: `## [YYYY-MM-DD] & wait'` reports SIG_IGN for SIGINT in the background child and the default handler in the foreground; with `set -m` the background child reports the default handler; SIGTERM reports SIG_DFL in both. Field case same day: a server binary timed out (rc 143) under `kill -INT $pid; wait` from a script, and exited 0 immediately under `subprocess.Popen` + `send_signal(SIGINT)`