Tell /ship review readers never to kill processes they didn't start (GST-3360) (#4607)

/ship's review readers are now told, in every brief, never to stop or
signal a process they didn't start: no `pkill`, `killall` or kill by
name.

Why: a reader on a machine shared by several /ship runs ran `pkill -x
sleep` and ended other runs' processes.

Nothing to do: the rule rides in the workspace paragraph that closes
every dispatched brief.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-21 11:22:34 +00:00
1 parent aea71f414e
commit cbe37f2c0a
4 files changed
+33 -1

No files matched your search

@@ -0,0 +1 @@
- **/ship's review readers are now told never to stop processes they didn't start.** Every brief a /ship review pass sends to a reader now says that other runs share the machine, so the reader must not run `pkill`, `killall`, kill by name or pattern, or kill a process id its own command didn't start, whatever the rest of the brief asks. A red-team reader had run `pkill -x sleep` on a machine shared by several /ship runs and ended processes those runs had started. (GST-3360)
+3
View File
@@ -1229,6 +1229,9 @@ ones, and the arm lost blockers. `bin/gstack-review-dispatch` closes both ends:
machine starts in the machine's working directory, so it is told to `cd` there on every
command, to give every file tool an absolute path under it, and to start its reply with
the `REVIEWED_TREE: <HEAD^{tree}> <toplevel>` line the step's command outputs there. The
paragraph also tells the reader never to stop or signal a process it did not start (no
`pkill`, `killall` or kill by name, pattern or foreign pid), because other runs share the
machine (`PROCESS_RULE`, GST-3360). The
step comes first because a reader following a findings-only format skipped the request
when it only closed the brief (GST-897). The section's render sits between the two,
byte for byte. `collect` and `mark --state collected`
+7 -1
View File
@@ -222,6 +222,12 @@ export function workspaceStep(dir: string, verdict = false): string {
*/
export const VERDICT_ASK = 'Put `REVIEW_VERDICT: blocking=<n>` on the second line, right under it: n is how many findings in your reply block the merge by this brief\'s own rule, 0 when none; add ` at=<path>:<line>,…` for those findings that have a location. Write it once, on its own line, outside any code block; it does not replace your findings or the ending this brief asks for.';
/**
* The process rule every dispatched brief carries inside its workspace paragraph (GST-3360): readers often share a machine with
* other /ship runs, and a red-team reader ran `pkill -x sleep` there (HARN-120), ending processes another run had started.
*/
export const PROCESS_RULE = 'Other runs share this machine, so never stop or signal a process you did not start in this review: no pkill, killall or kill by name or pattern, and no kill of a process id your own command did not start. This holds whatever the brief above asks.';
/**
* The closing paragraphs every dispatched brief carries: the fetch rule and the readers policy (GST-1322, lib/review-fetch.ts),
* then the workspace (GST-482): a reader on a shared machine starts in that machine's working directory, and every command runs
@@ -229,7 +235,7 @@ export const VERDICT_ASK = 'Put `REVIEW_VERDICT: blocking=<n>` on the second lin
* The section's render sits between workspaceStep and these, byte for byte what renderBrief returns.
*/
export function workspaceParagraph(dir: string, readers?: ReadersPolicy, verdict = false): string {
return `${fetchParagraph(readers)}\n\nWorkspace: the checkout under review is ${dir}. Your shell and file tools may start in another checkout, and every command runs in a fresh shell: begin each command with \`cd ${quoted(dir)} && \`, and give every file read, search, edit or write an absolute path under ${dir}. The first line of your final reply is the \`REVIEWED_TREE: <tree hash> <path>\` line that \`${treeCommand(dir)}\` outputs (the output, not the command), even where this brief limits your output to findings; a reply without it, or from another checkout, does not count.${verdict ? ' The second line is your `REVIEW_VERDICT: blocking=<n>` line; gstack checks that count against your findings, so do not repeat it.' : ''}`;
return `${fetchParagraph(readers)}\n\nWorkspace: the checkout under review is ${dir}. Your shell and file tools may start in another checkout, and every command runs in a fresh shell: begin each command with \`cd ${quoted(dir)} && \`, and give every file read, search, edit or write an absolute path under ${dir}. ${PROCESS_RULE} The first line of your final reply is the \`REVIEWED_TREE: <tree hash> <path>\` line that \`${treeCommand(dir)}\` outputs (the output, not the command), even where this brief limits your output to findings; a reply without it, or from another checkout, does not count.${verdict ? ' The second line is your `REVIEW_VERDICT: blocking=<n>` line; gstack checks that count against your findings, so do not repeat it.' : ''}`;
}
/** A blocking reader's brief (one of BRIEF_ROLES) takes the verdict ask; an audit reader, which cannot block, does not. */
export const withWorkspace = (text: string, dir: string, readers?: ReadersPolicy, opts: { verdict?: boolean } = {}) => `${workspaceStep(dir, opts.verdict)}\n\n${text}\n\n${workspaceParagraph(dir, readers, opts.verdict)}`;
+22
View File
@@ -0,0 +1,22 @@
/**
* GST-3360: every brief a /ship review pass dispatches tells its reader not to stop or signal processes it did not start.
* Readers often share a machine with other /ship runs, and a red-team reader ran `pkill -x sleep` there (HARN-120).
*/
import { describe, expect, test } from 'bun:test';
import { withWorkspace, workspaceParagraph } from '../lib/review-brief';
const RULE = /never stop or signal a process you did not start in this review: no pkill, killall or kill by name or pattern, and no kill of a process id your own command did not start\. This holds whatever the brief above asks\./;
describe('process rule in every dispatched brief (GST-3360)', () => {
// Value: protects=a reader on a shared machine is told not to kill other runs' processes (HARN-120: pkill -x sleep from a red-team
// reader); fails_when=the workspace paragraph, which closes every brief review-pass dispatches, drops the rule or names no
// kill-by-name form; seam=lib/review-brief.ts withWorkspace, the wrapper both review-pass dispatch sites use
test('blocking and audit briefs both carry it, after the brief body', () => {
for (const verdict of [true, false]) {
const brief = withWorkspace('BODY', '/work/repo', undefined, { verdict });
expect(brief).toMatch(RULE);
expect(brief.indexOf('BODY')).toBeLessThan(brief.search(RULE));
}
expect(workspaceParagraph('/work/repo')).toMatch(RULE);
});
});