Skip to content

test: cover PID collisions in harness ancestry detection - #6484

Merged
kunchenguid merged 2 commits into
kunchenguid:mainfrom
ironerumi:fm/upstream-pr-6456
Oct 7, 2026
Merged

kunchenguid merged 2 commits into
kunchenguid:mainfrom
ironerumi:fm/upstream-pr-6456

Conversation

@ironerumi

@ironerumi ironerumi commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Intent

The developer asked to re-run validation on three open upstream pull requests on kunchenguid/firstmate whose earlier no-mistakes runs were cancelled when the local no-mistakes was upgraded to v1.89.0 on 2026-10-07 (the daemon restart cancelled all open runs, which now show as failed):

  • fix: distinguish outdated tools from missing tools #5688 (fix: distinguish outdated tools from missing tools; head branch fm/upstream-5440-outdated-tools; GitHub reports it DIRTY, i.e. conflicting with upstream main)
  • fix: share Pi Calm's working-ship widget slot #1854 (fix: share Pi Calm's working-ship widget slot; head branch fm/firstmate-calm-upstream-pr-v1; UNSTABLE)
  • test: cover PID collisions in harness ancestry detection #6484 (test: cover dash-leading process-name PID collisions; head branch fm/upstream-pr-6456; UNSTABLE): the test's fake ps labels PID 5252 as -codex for every caller, although only the separate fm_harness_pid_alive 5252 liveness probe needs that label. When the OS assigns PID 5252 to a real ancestor of the test process, the ancestry walk selects it rather than the expected PID 4242. Scope the fake -codex label to the liveness probe and assert a forced PID-collision case, as the existing pull request does.

Each pull request should end with a fresh passing no-mistakes run whose attestation names its current head and green checks.

What Changed

  • Scope the fake -codex process label to liveness probes while modeling PID 5252 as an ordinary ancestor during ancestry walks.
  • Add logging and assertions for the forced PID-collision case to ensure PID 4242 is selected.

Risk Assessment

✅ Low: The change is a narrowly scoped test-fixture strengthening that logs and verifies the forced PID-5252 ancestry query without changing production behavior.

Testing

Ran the focused session-lock identity scenarios against the real bin scripts with disposable fake ps data, captured reviewer-visible output, and confirmed both the liveness and forced-collision cases pass. The broader focused suite completed once; a separate rerun timed out in an unrelated later test, so that intermittent timeout is recorded as a warning.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Dash-leading -codex liveness probe ✅ pass live bash tests/.fm-secondmate-harness.identity.test.sh output in fm-secondmate-identity-target.log
Forced PID 5252 ancestry collision ✅ pass live bash tests/.fm-secondmate-harness.identity.test.sh output in fm-secondmate-identity-target.log
Evidence: Targeted session-lock identity regression output

Source: Targeted session-lock identity regression output

ok - A1 fm-harness.sh secondmate resolves the fallback chain; crew mode unchanged
ok - fm-harness detects only Cursor Agent CLI's exact invocation marker
ok - C1 fm-harness.sh secondmate-model/secondmate-effort resolve the optional tokens; bare harness stays empty (backward-compat)
ok - pi-signed identity: authoritative launch selection distinguishes shared wrapper ancestry
ok - harness identity: dash-leading ps command names are basename operands, not options
# targeted identity tests passed
- Outcome: ⚠️ 1 warning across 1 run (13m44s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ tests/fm-secondmate-harness.test.sh - The broader fm-secondmate harness script completed once, but a separate rerun exceeded the 300-second command limit while stalled after unrelated B17; the isolated identity regression completed successfully.
  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Dash-leading -codex liveness probe ✅ pass live bash tests/.fm-secondmate-harness.identity.test.sh output in fm-secondmate-identity-target.log
Forced PID 5252 ancestry collision ✅ pass live bash tests/.fm-secondmate-harness.identity.test.sh output in fm-secondmate-identity-target.log
  • bash tests/fm-secondmate-harness.test.sh (completed successfully once)
  • bash tests/.fm-secondmate-harness.identity.test.sh (isolated targeted identity regression)
  • git status --short
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Test harness adds coverage for process ID collision edge case.

The PR appears safe to merge.

Reviews (3) · Last reviewed commit: "no-mistakes(ci): Updated the collision t..." · Reviewed by Greptile

greptile-apps[bot]