Skip to content

fix(bin): detect child-process work during supervision (land of upstream #1676) - #44

Merged
sbracewell64 merged 4 commits into
mainfrom
fork-land/wedge
Aug 6, 2026
Merged

sbracewell64 merged 4 commits into
mainfrom
fork-land/wedge

Conversation

@sbracewell64

Copy link
Copy Markdown
Owner

What this is

The already-reviewed fix from upstream PR kunchenguid#1676, moved onto the reconciled fork trunk so it can take effect here. No behaviour was redesigned and nothing was re-reviewed.

It adds process-level evidence (advancement of descendant CPU) alongside the existing semantic sources, so supervision stops raising false alarms when a worker's real work is happening in a child process.

Provenance, stated exactly

This content was pipeline-validated at upstream commit 22f2f2683d83a246be7a044c652e4c92c63b9d5e, which is the exact head of upstream PR kunchenguid#1676. Rebasing its four own commits onto fork trunk ad53e97 produced cb40ab2. The change content is unchanged.

That last clause is proven, not asserted. Comparing the originally-validated diff (e5e8a67..22f2f26) against the delivered diff (ad53e97..cb40ab2), the contributed +/- lines are byte-identical: 871 lines on each side, zero delta.

No attestation

This shipped without no-mistakes and carries NO attestation marker. The genuine Updates from [git push no-mistakes] marker on upstream PR kunchenguid#1676 binds to head 22f2f26 and does not bind to cb40ab2. It has not been copied, carried forward, or implied here.

Three commit subjects begin with no-mistakes(review): and no-mistakes(document):. Those are the original pipeline's own commits from the upstream run, preserved because rewriting them would alter validated content. They describe history and attest nothing about this rebased head.

The expected teardown conflict did not occur, and here is why

This landing was expected to hit a semantic conflict in bin/fm-teardown.sh against the worktree-guard change that introduced bin/fm-landed-lib.sh and replaced commit-reachability with a tree-containment landed test. It rebased clean, with zero conflicts across all four commits.

The reason is worth recording, because the earlier expectation was reasonable against the trunk that existed at the time:

  • This fix's entire teardown change is adding "$STATE/$ID.childcpu" to two cleanup lists. It never touches the landed test, so descendant-CPU liveness and the tree-containment landed test do not actually compete.
  • One of those two lists lives in remote_secondmate_teardown(). On the pre-reconciliation fork trunk 9f914d1 that function had been deleted, which is what made the conflict look semantic. The reconciled base ad53e97 restores it from the upstream side, so both hunks have live targets again.

Verified on the delivered branch: both .childcpu cleanups are present, and bin/fm-teardown.sh still references fm-landed-lib three times. Both behaviours coexist; neither was reverted.

One observation, deliberately not acted on: the local secondmate child-teardown list will not remove .childcpu. That gap exists in the originally-validated content too, and adding a cleanup there would be new, unvalidated content in a change whose whole premise is that its content is unchanged. Flagging it rather than silently widening scope.

Verification, measured on this delivery base

Suite: 22 scripts covering supervision, wake handling, teardown, spawn and brief, including this fix's own tests/fm-watch-triage.test.sh, plus bin/fm-lint.sh.

bin/fm-lint.sh exits 0 on this branch and on base.

This fix's own test passes: tests/fm-watch-triage.test.sh exits 0 (169s, real processes).

Failures are reported as failures. This branch has 3 failing assertions:

  • tests/fm-pi-watch-extension.test.sh - "Pi extension must surface an external healthy watcher as an owned-wake failure"
  • tests/fm-turnend-guard.test.sh - "Pi guard must inject once for no-tool and multi-tool logical runs"
  • tests/fm-watcher-lock.test.sh - "restart did not attach to the verified healthy peer"

All three pre-exist on base ad53e97, measured by running the identical script set on unmodified ad53e97 in the same session. Base fails exactly the same three. The failure set on this branch is identical to the failure set on base.

Net: this branch introduces no new failure and reverts nothing.

Negative control witnessed first. With bin/fm-classify-lib.sh and bin/fm-watch.sh reverted to base and the new test kept, tests/fm-watch-triage.test.sh fails on "active run-step semantic class was not working" (exit 1). Restored, it passes (exit 0). The regression test genuinely exercises the fix.

Merge

Not merged. Merge authority is the captain's.

Supervision's absorb rule consulted only semantic sources: the no-mistakes
run step, the status log, and the harness busy signal. All three correctly
report "not working" the moment an agent backgrounds a long command and
ends its turn, so a crew doing real work in a child process reads as a
wedge. Measured 2026-08-03: one crew running the portable suite in the
background produced seven consecutive false wedge escalations across 42
minutes, each demanding a deep inspection, and at least three other crews
hit the same pattern while pipeline stages ran underneath them.

Add descendant CPU advancement as a third source of positive evidence,
alongside the existing ones rather than in place of them. The agent is
resolved from kernel facts, never a vendor process name: its working
directory is the task's recorded worktree, and it is the leader of the
foreground process group on its pane's terminal. The CPU of everything
below it - live descendants plus already-reaped ones through the leader's
cutime/cstime - is compared against a sample from the previous poll.

Two rules keep it from becoming a blindfold. Each sample is bound to
fm_pid_identity of the agent it came from, so a reused pid is never
compared across the identity change. And only ADVANCEMENT counts: a
descendant that merely exists proves nothing, so a crew whose child is
hung, dead, or absent still escalates on the unchanged schedule. The
agent's own utime/stime is excluded, so a looping wedged agent cannot
vouch for itself.

The stale threshold, escalation ladder, and deep-inspection demand are
untouched. The new evidence folds into the same work_now gate a busy pane
uses, so it inherits the BUSY_TURN_MAX_SECS completed-turn bound: a child
that churns forever can delay an escalation, never cancel one. A definite
parked, done, failed, or blocked run-step verdict is never overridden.

Where /proc is unavailable the probe reports no evidence, which is exactly
today's behaviour.

Verified in all four directions against real processes, and each guarantee
was witnessed failing first under a deliberate breakage: existence instead
of advancement, the agent's own CPU counted, identity ignored, the
freshness bound removed, a definite verdict overridden, and the
completed-turn bound not applied to the new evidence.
@sbracewell64
sbracewell64 merged commit f90ed1d into main Aug 6, 2026
12 of 14 checks passed
sbracewell64 added a commit that referenced this pull request Aug 9, 2026
…eam kunchenguid#1676) (#44)

* fix(bin): see a crewmate's work when it happens in a child process

Supervision's absorb rule consulted only semantic sources: the no-mistakes
run step, the status log, and the harness busy signal. All three correctly
report "not working" the moment an agent backgrounds a long command and
ends its turn, so a crew doing real work in a child process reads as a
wedge. Measured 2026-08-03: one crew running the portable suite in the
background produced seven consecutive false wedge escalations across 42
minutes, each demanding a deep inspection, and at least three other crews
hit the same pattern while pipeline stages ran underneath them.

Add descendant CPU advancement as a third source of positive evidence,
alongside the existing ones rather than in place of them. The agent is
resolved from kernel facts, never a vendor process name: its working
directory is the task's recorded worktree, and it is the leader of the
foreground process group on its pane's terminal. The CPU of everything
below it - live descendants plus already-reaped ones through the leader's
cutime/cstime - is compared against a sample from the previous poll.

Two rules keep it from becoming a blindfold. Each sample is bound to
fm_pid_identity of the agent it came from, so a reused pid is never
compared across the identity change. And only ADVANCEMENT counts: a
descendant that merely exists proves nothing, so a crew whose child is
hung, dead, or absent still escalates on the unchanged schedule. The
agent's own utime/stime is excluded, so a looping wedged agent cannot
vouch for itself.

The stale threshold, escalation ladder, and deep-inspection demand are
untouched. The new evidence folds into the same work_now gate a busy pane
uses, so it inherits the BUSY_TURN_MAX_SECS completed-turn bound: a child
that churns forever can delay an escalation, never cancel one. A definite
parked, done, failed, or blocked run-step verdict is never overridden.

Where /proc is unavailable the probe reports no evidence, which is exactly
today's behaviour.

Verified in all four directions against real processes, and each guarantee
was witnessed failing first under a deliberate breakage: existence instead
of advancement, the agent's own CPU counted, identity ignored, the
freshness bound removed, a definite verdict overridden, and the
completed-turn bound not applied to the new evidence.

* no-mistakes(review): Captain, preserve semantic verdicts over child liveness

* no-mistakes(review): Captain, prevent double-probing child CPU evidence

* no-mistakes(document): Document descendant CPU supervision
sbracewell64 added a commit that referenced this pull request Aug 10, 2026
…eam kunchenguid#1676) (#44)

* fix(bin): see a crewmate's work when it happens in a child process

Supervision's absorb rule consulted only semantic sources: the no-mistakes
run step, the status log, and the harness busy signal. All three correctly
report "not working" the moment an agent backgrounds a long command and
ends its turn, so a crew doing real work in a child process reads as a
wedge. Measured 2026-08-03: one crew running the portable suite in the
background produced seven consecutive false wedge escalations across 42
minutes, each demanding a deep inspection, and at least three other crews
hit the same pattern while pipeline stages ran underneath them.

Add descendant CPU advancement as a third source of positive evidence,
alongside the existing ones rather than in place of them. The agent is
resolved from kernel facts, never a vendor process name: its working
directory is the task's recorded worktree, and it is the leader of the
foreground process group on its pane's terminal. The CPU of everything
below it - live descendants plus already-reaped ones through the leader's
cutime/cstime - is compared against a sample from the previous poll.

Two rules keep it from becoming a blindfold. Each sample is bound to
fm_pid_identity of the agent it came from, so a reused pid is never
compared across the identity change. And only ADVANCEMENT counts: a
descendant that merely exists proves nothing, so a crew whose child is
hung, dead, or absent still escalates on the unchanged schedule. The
agent's own utime/stime is excluded, so a looping wedged agent cannot
vouch for itself.

The stale threshold, escalation ladder, and deep-inspection demand are
untouched. The new evidence folds into the same work_now gate a busy pane
uses, so it inherits the BUSY_TURN_MAX_SECS completed-turn bound: a child
that churns forever can delay an escalation, never cancel one. A definite
parked, done, failed, or blocked run-step verdict is never overridden.

Where /proc is unavailable the probe reports no evidence, which is exactly
today's behaviour.

Verified in all four directions against real processes, and each guarantee
was witnessed failing first under a deliberate breakage: existence instead
of advancement, the agent's own CPU counted, identity ignored, the
freshness bound removed, a definite verdict overridden, and the
completed-turn bound not applied to the new evidence.

* no-mistakes(review): Captain, preserve semantic verdicts over child liveness

* no-mistakes(review): Captain, prevent double-probing child CPU evidence

* no-mistakes(document): Document descendant CPU supervision
sbracewell64 added a commit that referenced this pull request Aug 11, 2026
…eam kunchenguid#1676) (#44)

* fix(bin): see a crewmate's work when it happens in a child process

Supervision's absorb rule consulted only semantic sources: the no-mistakes
run step, the status log, and the harness busy signal. All three correctly
report "not working" the moment an agent backgrounds a long command and
ends its turn, so a crew doing real work in a child process reads as a
wedge. Measured 2026-08-03: one crew running the portable suite in the
background produced seven consecutive false wedge escalations across 42
minutes, each demanding a deep inspection, and at least three other crews
hit the same pattern while pipeline stages ran underneath them.

Add descendant CPU advancement as a third source of positive evidence,
alongside the existing ones rather than in place of them. The agent is
resolved from kernel facts, never a vendor process name: its working
directory is the task's recorded worktree, and it is the leader of the
foreground process group on its pane's terminal. The CPU of everything
below it - live descendants plus already-reaped ones through the leader's
cutime/cstime - is compared against a sample from the previous poll.

Two rules keep it from becoming a blindfold. Each sample is bound to
fm_pid_identity of the agent it came from, so a reused pid is never
compared across the identity change. And only ADVANCEMENT counts: a
descendant that merely exists proves nothing, so a crew whose child is
hung, dead, or absent still escalates on the unchanged schedule. The
agent's own utime/stime is excluded, so a looping wedged agent cannot
vouch for itself.

The stale threshold, escalation ladder, and deep-inspection demand are
untouched. The new evidence folds into the same work_now gate a busy pane
uses, so it inherits the BUSY_TURN_MAX_SECS completed-turn bound: a child
that churns forever can delay an escalation, never cancel one. A definite
parked, done, failed, or blocked run-step verdict is never overridden.

Where /proc is unavailable the probe reports no evidence, which is exactly
today's behaviour.

Verified in all four directions against real processes, and each guarantee
was witnessed failing first under a deliberate breakage: existence instead
of advancement, the agent's own CPU counted, identity ignored, the
freshness bound removed, a definite verdict overridden, and the
completed-turn bound not applied to the new evidence.

* no-mistakes(review): Captain, preserve semantic verdicts over child liveness

* no-mistakes(review): Captain, prevent double-probing child CPU evidence

* no-mistakes(document): Document descendant CPU supervision
sbracewell64 added a commit that referenced this pull request Aug 11, 2026
…eam kunchenguid#1676) (#44)

* fix(bin): see a crewmate's work when it happens in a child process

Supervision's absorb rule consulted only semantic sources: the no-mistakes
run step, the status log, and the harness busy signal. All three correctly
report "not working" the moment an agent backgrounds a long command and
ends its turn, so a crew doing real work in a child process reads as a
wedge. Measured 2026-08-03: one crew running the portable suite in the
background produced seven consecutive false wedge escalations across 42
minutes, each demanding a deep inspection, and at least three other crews
hit the same pattern while pipeline stages ran underneath them.

Add descendant CPU advancement as a third source of positive evidence,
alongside the existing ones rather than in place of them. The agent is
resolved from kernel facts, never a vendor process name: its working
directory is the task's recorded worktree, and it is the leader of the
foreground process group on its pane's terminal. The CPU of everything
below it - live descendants plus already-reaped ones through the leader's
cutime/cstime - is compared against a sample from the previous poll.

Two rules keep it from becoming a blindfold. Each sample is bound to
fm_pid_identity of the agent it came from, so a reused pid is never
compared across the identity change. And only ADVANCEMENT counts: a
descendant that merely exists proves nothing, so a crew whose child is
hung, dead, or absent still escalates on the unchanged schedule. The
agent's own utime/stime is excluded, so a looping wedged agent cannot
vouch for itself.

The stale threshold, escalation ladder, and deep-inspection demand are
untouched. The new evidence folds into the same work_now gate a busy pane
uses, so it inherits the BUSY_TURN_MAX_SECS completed-turn bound: a child
that churns forever can delay an escalation, never cancel one. A definite
parked, done, failed, or blocked run-step verdict is never overridden.

Where /proc is unavailable the probe reports no evidence, which is exactly
today's behaviour.

Verified in all four directions against real processes, and each guarantee
was witnessed failing first under a deliberate breakage: existence instead
of advancement, the agent's own CPU counted, identity ignored, the
freshness bound removed, a definite verdict overridden, and the
completed-turn bound not applied to the new evidence.

* no-mistakes(review): Captain, preserve semantic verdicts over child liveness

* no-mistakes(review): Captain, prevent double-probing child CPU evidence

* no-mistakes(document): Document descendant CPU supervision
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant