From c9cfce441ab7a325cc9e815ef15b80c958259d33 Mon Sep 17 00:00:00 2001 From: goodboy Date: Thu, 27 Aug 2026 18:52:16 -0400 Subject: [PATCH] Harden `run-tests` signal and reaper guidance Prevent unsafe harness guidance from sending SIGUSR1 before `stackscope` installs its handler or using shared-memory scans on unsupported platforms. Deats, - verify `stackscope` in the pytest env before signaling. - target pytest by default and require a separately verified handler before signaling subactors. - keep `tractor-reap --shm*` guidance to Linux and FreeBSD. - pin staged Prompt-IO provenance to `eb3c99c9` and record the PR #510 review direction. Prompt-IO: ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.md (this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`)) --- .claude/skills/run-tests/test-harness-reference.md | 12 +++++++++++- .../opencode/20260822T022526Z_5562fd9a_prompt_io.md | 6 ++++-- .../20260822T022526Z_5562fd9a_prompt_io.raw.md | 8 ++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.claude/skills/run-tests/test-harness-reference.md b/.claude/skills/run-tests/test-harness-reference.md index 4df627d9..38e707c7 100644 --- a/.claude/skills/run-tests/test-harness-reference.md +++ b/.claude/skills/run-tests/test-harness-reference.md @@ -144,10 +144,17 @@ Trio-safe timeout replacement. For live task-tree diagnosis: ```text +uv run --frozen --no-sync python -c 'import stackscope' uv run --frozen --no-sync pytest --enable-stackscope --capture=sys -kill -USR1 +kill -USR1 ``` +The import check and pytest command must use the same environment. Do not send +SIGUSR1 if the import fails or setup warns that stackscope or SIGUSR1 is +unavailable: without the installed handler, SIGUSR1 normally terminates the +target process. Signal a subactor only after separately confirming that it +installed the same handler. + Stackscope appends dumps to `/tmp/tractor-stackscope-.log`, including when pytest capture hides terminal output. SIGUSR1 stackscope is unavailable on Windows and degrades to a no-op there. @@ -173,6 +180,9 @@ against the same UDS bindspace. Use the CLI in inspection-only mode first: +`--shm` and `--shm-only` are Linux/FreeBSD-only and raise +`NotImplementedError` elsewhere. On other platforms, use the UDS-only command. + ```text uv run --frozen --no-sync scripts/tractor-reap -n uv run --frozen --no-sync scripts/tractor-reap --parent -n diff --git a/ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.md b/ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.md index e6bb4b02..0dedc8af 100644 --- a/ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.md +++ b/ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.md @@ -3,7 +3,7 @@ model: openai/gpt-5.6-sol service: opencode session: 76c5d31c-5a2f-4503-9b16-410ee7f4fab3 timestamp: 2026-08-22T02:25:26Z -git_ref: 5562fd9a +git_ref: eb3c99c9 scope: config substantive: true raw_file: 20260822T022526Z_5562fd9a_prompt_io.raw.md @@ -39,4 +39,6 @@ Narrowed `.gitignore` to the three managed `run-tests` deployment blocks. The human required an existing-work scan after duplicate implementation was discovered, approved correcting the landing branch during PR #481 review, and directed removal or reconciliation of unrelated ignore rules. -No direct source-line edits were made by the human. +During PR #510 review, the human required the stackscope and shared-memory +safety clarifications and immutable provenance pointers before landing. No +direct source-line edits were made by the human. diff --git a/ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.raw.md b/ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.raw.md index 03acc640..99c4eec9 100644 --- a/ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.raw.md +++ b/ai/prompt-io/opencode/20260822T022526Z_5562fd9a_prompt_io.raw.md @@ -2,14 +2,14 @@ model: openai/gpt-5.6-sol service: opencode timestamp: 2026-08-22T02:25:26Z -git_ref: 5562fd9a -diff_cmd: git diff HEAD~1..HEAD +git_ref: eb3c99c9 +diff_cmd: git diff eb3c99c9^..eb3c99c9 --- Audit Tractor's repository-wide `ai.skillz` state and correct the `wkt/ai_skillz_run_tests_landing` migration before landing it. -> `git diff HEAD~1..HEAD -- .claude/skills/run-tests/test-harness-reference.md` +> `git diff eb3c99c9^..eb3c99c9 -- .claude/skills/run-tests/test-harness-reference.md` The harness reference is corrected against current Tractor behavior: environment overrides, CI/platform matrices, randomized registry @@ -17,7 +17,7 @@ addresses, interactive debugger capture, timeout mechanisms, stackscope artifacts, reaper platform limits, dry-run expansion, and exact change-to-test mappings. -> `git diff HEAD~1..HEAD -- .gitignore` +> `git diff eb3c99c9^..eb3c99c9 -- .gitignore` Unrelated Taken and broad OpenCode command ignore additions are removed; only the managed canonical `run-tests` link and command blocks remain in