Skip to content

fleet i161: launchd suites fail loudly when mktemp fails (D-FLEET-50) - #2578

Closed
sunholo-voight-kampff wants to merge 5 commits into
devfrom
fleet/i161-mktemp-guard
Closed

sunholo-voight-kampff wants to merge 5 commits into
devfrom
fleet/i161-mktemp-guard

Conversation

@sunholo-voight-kampff

Copy link
Copy Markdown
Collaborator

Fleet mission iteration 161. Builds Mark's attended ruling D-FLEET-50 = A: the fleet fixes the harness defect it found first-hand in iteration 155, where a failed mktemp let tools/launchd/test_mission_base.sh commit into the caller's checkout.

What was wrong. On the rig's bash 3.2.57, cd "" is a no-op and cd "" && pwd -P prints the current directory with rc 0. So:

  • test_mission_base.sh ran git init, git config and git commit in the caller's repo when mktemp -d returned nothing (iteration 155's incident).
  • test_mission_worktree.sh, test_mission_slots.sh and test_mission_fire_env.sh wrote T=$(cd "$(mktemp -d)" && pwd -P) and then rm -rf "$T" on exit, so a failed mktemp would have deleted the caller's directory.

Change.

  • tools/launchd/lib/test-tmp.sh: mc_test_mktemp_d / mc_test_mktemp_f refuse a failed, empty, missing or caller-directory result with one FATAL: line and empty stdout.
  • About 50 launchd suite files (LAUNCHD_SUITES, standalone tools/launchd/test_*.sh, the sprint-skill test scripts and their .agents mirrors) allocate through it with a checked assignment, and register EXIT traps only after a validated allocation. install_coordinator.sh checks its plist temp file.
  • New suite tools/launchd/test_mktemp_guard.sh (11 arms): guard behaviour under a failing mktemp shim, two real suites run end to end under that shim inside a sentinel directory with the real checkout's HEAD, local email and origin/dev compared before and after, and a lint over 69 suite files that refuses unguarded allocations.
  • Out of fleet scope and left unchanged (reported): tools/attended/test_codex_oauth_profiles.sh, tools/ci/test_require_checks.sh, scripts/test_worktree_sweep.sh, tools/eval/test_motoko_connection_probe.sh.

Verification (outside any sandbox, darwin/arm64, bash 3.2.57).

  • make test-launchd-drivers: base 433529cd1 64 PASS / 0 FAIL; candidate 65 PASS / 0 FAIL. Every suite that prints a count prints the same count as base.
  • bash -n on 61 changed shell files: clean. shellcheck -S error: rc 0, and no new finding at any severity vs base. make check-changelog rc 0.
  • Mutation drills: raw mktemp in tmpdir, the nested-cd form, removing the empty-output check, removing the caller-directory check, an empty lint file list, one raw allocation in scripts/hooks/test_pre_push.sh, and || true after the helper. Each one turns its named arm red.
  • Independent judge (sonnet): PASS 88 in round 1. Its one objection (the helper form accepted any ||) is fixed in 2c6f6f871.

🤖 Generated with Claude Code

sunholo-voight-kampff and others added 5 commits December 1, 2026 22:56
…50 = A)

A shared guard, tools/launchd/lib/test-tmp.sh (mc_test_mktemp_d/_f), refuses a failed,
empty, missing or caller-CWD mktemp result with a FATAL line. test_mission_base.sh and the
three suites that wrote T=$(cd "$(mktemp -d)" && pwd -P) now stop before any git, cd or
EXIT-trap rm -rf can reach the caller's checkout. install_coordinator.sh checks its plist
temp file. New suite test_mktemp_guard.sh runs the guard and two real suites under a
failing mktemp shim inside a sentinel directory and compares the real checkout's HEAD,
local email and origin/dev before and after.

Co-Authored-By: codex gpt-6.2-sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e guard; lint enforces it

All in-scope suites in LAUNCHD_SUITES, the standalone tools/launchd tests, and the
sprint-skill test scripts (with their .agents mirrors) now take temp paths from
mc_test_mktemp_d/_f with a checked assignment, and register EXIT traps only after a
validated allocation. test_mktemp_guard.sh gains a line-based lint (LINT-BAD/GOOD/LIST/
LIVE) that refuses a raw mktemp outside the guarded assignment form, an unchecked helper
call and a local-masked assignment, across 69 files. Out-of-scope suites (tools/ci,
tools/eval, tools/attended, scripts/test_worktree_sweep.sh) are unchanged and reported.
Changelog fragment added.

Co-Authored-By: codex gpt-6.2-sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fter the guard helper

The independent judge (sonnet, PASS 88) found that the lint accepted any `||` after
$(mc_test_mktemp_d …), so `|| true` or `|| exit 0` would disarm the exit-before-trap
protection unnoticed in test_mission_worktree.sh and test_mission_slots.sh, which have no
end-to-end injection arm. The helper form now needs the same terminal `|| exit N` /
`|| return N` (1-255) as the raw form, or a `|| { …; exit|return N; }` block. Four new
LINT-BAD fixtures and one LINT-GOOD fixture. Mutation-checked: reverting the rule reds
LINT-BAD; planting `|| true` in test_mission_slots.sh reds LINT-LIVE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…check-autopush (SC1091)

The required lint job runs `make shellcheck-autopush`, which lints scripts/hooks/test_pre_push.sh
alone at every severity. It could not follow the new helper source and reported SC1091 (info),
failing the job. `# shellcheck source=/dev/null` on that line. Local: shellcheck-autopush rc 0,
test-shellcheck-autopush rc 0, test_pre_push 37 passed (same as base), guard suite 11/0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n dev's inherited checks red [HARNESS]

Log entry 161, charter STATUS stamp (158's stamp moved to the status archive), dashboard,
regenerated log and status indexes, and evidence under
design_docs/fleet-mission-evidence/iteration161/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sunholo-voight-kampff

Copy link
Copy Markdown
Collaborator Author

Fleet iteration 161 record is stacked on this branch (8c2e0e59a, docs only). Merge is blocked by the required checks job, which fails on dev itself (check-planned-status: design_docs/planned/v1_1_0/m-finetune-round6-useful-12b.md is marked Superseded). The fleet merges this PR on a later fire once dev is green.

sunholo-voight-kampff added a commit that referenced this pull request Dec 2, 2026
…FLEET-46 ticket resolved; PR blocked on dev's inherited checks red [HARNESS]

Iteration 162 built the fleet idle fingerprint (D-FLEET-49 = A) on top of
PR #2578 and recorded it: log entry, STATUS stamp (159 rotated to the
archive), dashboard, regenerated index and evidence under
design_docs/fleet-mission-evidence/iteration162/. Under D-FLEET-46 = A it
resolved pi:openrouter:uncapped-max-tokens-402 after a re-check at HEAD and
left quorum:gpt6-1-sol-openai-api-credits-exhausted open (live seat still
ABSENT on codex quota).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sunholo-voight-kampff added a commit that referenced this pull request Dec 2, 2026
…-credits-exhausted resolved; PRs still blocked on dev's inherited checks red [ADMIN]

Iteration 163 resolved one ticket in the D-FLEET-46 = A class as bookkeeping. With codex headroom
back at 4.9pp, the live 1-seat quorums seated both OpenAI seats on the codex subscription at $0
(gpt-6.2-sol, and gpt-6.2-astra after the judge objected). Fix 41c628b is on origin/dev. The
independent sonnet judge voted RESOLVE 88%.

The resolve's --sha was hand-typed and invalid. A correction naming the full SHA went to both
filing inboxes. Nothing in the code changed.

The record adds the log entry, a STATUS stamp (160 rotated to the archive), the dashboard, an
index row and evidence under design_docs/fleet-mission-evidence/iteration163/. PR #2580, which
carries #2578, still waits on dev's required checks; D-FLEET-52 is unanswered and its default is B.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sunholo-voight-kampff added a commit that referenced this pull request Dec 2, 2026
…FLEET-46 ticket resolved; PR blocked on dev's inherited checks red [HARNESS]

Iteration 162 built the fleet idle fingerprint (D-FLEET-49 = A) on top of
PR #2578 and recorded it: log entry, STATUS stamp (159 rotated to the
archive), dashboard, regenerated index and evidence under
design_docs/fleet-mission-evidence/iteration162/. Under D-FLEET-46 = A it
resolved pi:openrouter:uncapped-max-tokens-402 after a re-check at HEAD and
left quorum:gpt6-1-sol-openai-api-credits-exhausted open (live seat still
ABSENT on codex quota).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sunholo-voight-kampff added a commit that referenced this pull request Dec 2, 2026
…-credits-exhausted resolved; PRs still blocked on dev's inherited checks red [ADMIN]

Iteration 163 resolved one ticket in the D-FLEET-46 = A class as bookkeeping. With codex headroom
back at 4.9pp, the live 1-seat quorums seated both OpenAI seats on the codex subscription at $0
(gpt-6.2-sol, and gpt-6.2-astra after the judge objected). Fix 41c628b is on origin/dev. The
independent sonnet judge voted RESOLVE 88%.

The resolve's --sha was hand-typed and invalid. A correction naming the full SHA went to both
filing inboxes. Nothing in the code changed.

The record adds the log entry, a STATUS stamp (160 rotated to the archive), the dashboard, an
index row and evidence under design_docs/fleet-mission-evidence/iteration163/. PR #2580, which
carries #2578, still waits on dev's required checks; D-FLEET-52 is unanswered and its default is B.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sunholo-voight-kampff added a commit that referenced this pull request Dec 2, 2026
* fleet i161 M1: launchd suites fail loudly when mktemp fails (D-FLEET-50 = A)

A shared guard, tools/launchd/lib/test-tmp.sh (mc_test_mktemp_d/_f), refuses a failed,
empty, missing or caller-CWD mktemp result with a FATAL line. test_mission_base.sh and the
three suites that wrote T=$(cd "$(mktemp -d)" && pwd -P) now stop before any git, cd or
EXIT-trap rm -rf can reach the caller's checkout. install_coordinator.sh checks its plist
temp file. New suite test_mktemp_guard.sh runs the guard and two real suites under a
failing mktemp shim inside a sentinel directory and compares the real checkout's HEAD,
local email and origin/dev before and after.

Co-Authored-By: codex gpt-6.2-sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i161 M2+M3: every launchd suite allocates temp paths through the guard; lint enforces it

All in-scope suites in LAUNCHD_SUITES, the standalone tools/launchd tests, and the
sprint-skill test scripts (with their .agents mirrors) now take temp paths from
mc_test_mktemp_d/_f with a checked assignment, and register EXIT traps only after a
validated allocation. test_mktemp_guard.sh gains a line-based lint (LINT-BAD/GOOD/LIST/
LIVE) that refuses a raw mktemp outside the guarded assignment form, an unchecked helper
call and a local-masked assignment, across 69 files. Out-of-scope suites (tools/ci,
tools/eval, tools/attended, scripts/test_worktree_sweep.sh) are unchanged and reported.
Changelog fragment added.

Co-Authored-By: codex gpt-6.2-sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i161 judge round 1: the lint requires || exit N / || return N after the guard helper

The independent judge (sonnet, PASS 88) found that the lint accepted any `||` after
$(mc_test_mktemp_d …), so `|| true` or `|| exit 0` would disarm the exit-before-trap
protection unnoticed in test_mission_worktree.sh and test_mission_slots.sh, which have no
end-to-end injection arm. The helper form now needs the same terminal `|| exit N` /
`|| return N` (1-255) as the raw form, or a `|| { …; exit|return N; }` block. Four new
LINT-BAD fixtures and one LINT-GOOD fixture. Mutation-checked: reverting the rule reds
LINT-BAD; planting `|| true` in test_mission_slots.sh reds LINT-LIVE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i161: test_pre_push.sh sources the guard without tripping shellcheck-autopush (SC1091)

The required lint job runs `make shellcheck-autopush`, which lints scripts/hooks/test_pre_push.sh
alone at every severity. It could not follow the new helper source and reported SC1091 (info),
failing the job. `# shellcheck source=/dev/null` on that line. Local: shellcheck-autopush rc 0,
test-shellcheck-autopush rc 0, test_pre_push 37 passed (same as base), guard suite 11/0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i161 record: D-FLEET-50 = A built, judged PASS 92; PR blocked on dev's inherited checks red [HARNESS]

Log entry 161, charter STATUS stamp (158's stamp moved to the status archive), dashboard,
regenerated log and status indexes, and evidence under
design_docs/fleet-mission-evidence/iteration161/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(launchd): fleet arm for the idle fingerprint (D-FLEET-49 M1)

lib/idle-fingerprint.sh now accepts MISSION_NAME=fleet. The fleet arm hashes
the open-ticket set (signature, slots_lost, last_seen), the charter's ledger
statuses on origin/dev, allowlisted directives on the current and previous
bookkeeping issue, the unread mission-fleet inbox, and dev's required-check
verdicts (newest completed verdict per classic-protection context across at
most 8 first-parent tips, so a pending tip does not flip the hash). No head
and no nightly-rig rows. Any failed or malformed read prints no fingerprint.
The product arm's rows and output are unchanged. The driver still excludes
fleet until M2.

Co-Authored-By: codex gpt-6.2-sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(launchd): the fleet takes the shared idle pre-check and snapshot (D-FLEET-49 M2)

The driver's MISSION IDLE PRE-CHECK and MISSION IDLE SNAPSHOT blocks no longer
exclude fleet. The fleet ticket count still runs first, so zero tickets exits
before any fingerprint read. Gate 5's IDLE RECORD now covers fleet: record only
a NONE pick the independent judge sustained, with no fleet PR landing owed.
The .agents mirror of gate-5-retro.md is kept byte-identical. Driver tests
cover match, change, failed read, expiry, zero-count precedence, triage,
work-item and dry-run exclusions, and the fleet snapshot.

The executor's run hit its 30-minute cap before the drills. The controller
fixed one test stub (the ticket-count call has 6 arguments, not 5), mirrored
the skill file, and ran drills (e) and (f): each reds its named arm.

Co-Authored-By: codex gpt-6.2-sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(launchd): judge round 1 — pin the green-older-tip lookback; say when a fleet PR bars the idle record

The independent judge (sonnet, PASS 82) found two surviving mutants in the
required-check lookback: with the older verdict already red, a pending run
mis-read as resolved also reads red, so the busy-tip arm could not tell. A new
case starts from an all-green tip and adds a busy tip on top; both mutants
(any-completed, and dropping the completed requirement) now red it.

Its strongest objection: Gate 5 did not say whether a fleet record PR left open
bars recording. A matching next fire exits before it could merge it, so the
record PR would strand until the 24 h expiry. The rule now says: merging an
earlier record PR does not count as a landing; record only if this fire leaves
no fleet PR open, except one blocked only on dev's required red (dev turning
green changes the fingerprint). The .agents mirror stays byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i162 record: D-FLEET-49 = A built, judged PASS 82 -> 86; one D-FLEET-46 ticket resolved; PR blocked on dev's inherited checks red [HARNESS]

Iteration 162 built the fleet idle fingerprint (D-FLEET-49 = A) on top of
PR #2578 and recorded it: log entry, STATUS stamp (159 rotated to the
archive), dashboard, regenerated index and evidence under
design_docs/fleet-mission-evidence/iteration162/. Under D-FLEET-46 = A it
resolved pi:openrouter:uncapped-max-tokens-402 after a re-check at HEAD and
left quorum:gpt6-1-sol-openai-api-credits-exhausted open (live seat still
ABSENT on codex quota).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i162 record: file D-FLEET-52 (may the fleet clear dev's in-scope checks red that blocks its PRs)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i163 record: D-FLEET-46 = A ticket quorum:gpt6-1-sol-openai-api-credits-exhausted resolved; PRs still blocked on dev's inherited checks red [ADMIN]

Iteration 163 resolved one ticket in the D-FLEET-46 = A class as bookkeeping. With codex headroom
back at 4.9pp, the live 1-seat quorums seated both OpenAI seats on the codex subscription at $0
(gpt-6.2-sol, and gpt-6.2-astra after the judge objected). Fix 41c628b is on origin/dev. The
independent sonnet judge voted RESOLVE 88%.

The resolve's --sha was hand-typed and invalid. A correction naming the full SHA went to both
filing inboxes. Nothing in the code changed.

The record adds the log entry, a STATUS stamp (160 rotated to the archive), the dashboard, an
index row and evidence under design_docs/fleet-mission-evidence/iteration163/. PR #2580, which
carries #2578, still waits on dev's required checks; D-FLEET-52 is unanswered and its default is B.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i163 record: correct the astra quorum probe's token count

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: codex gpt-6.2-sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@sunholo-voight-kampff

Copy link
Copy Markdown
Collaborator Author

Landed through #2580, which carried this PR's commits unchanged. Fleet iteration 164 rebased them onto dev a3572ea43 after dev's required checks went green (a66b85410). The rebase was verified by patch-id against the judged diff (identical), and the judge was sonnet, LAND-WITH-CONDITIONS 82%. All 23 checks were green on head 0d9f2816c, and the squash merge is 6b460bdfd07ac30fbdb0ed64300d8b6f6bb2e7c3.

Closing this PR unmerged because its content is already on dev.

sunholo-voight-kampff added a commit that referenced this pull request Dec 3, 2026
…n prod (#2630)

* fleet i164 record: LANDED #2580 (carrying #2578) as 6b460bd [HARNESS]

D-FLEET-50 = A (launchd temp-path guard) and D-FLEET-49 = A (fleet idle
fingerprint) are on dev after dev's required checks went green again
(a66b854). The PR was rebased because the scope guard refuses a dev
merge; its patch-id is identical to the judged diff. Independent
evaluator (sonnet): LAND-WITH-CONDITIONS 82%. STATUS 161 rotated to the
archive; D-FLEET-52 annotated as overtaken (stays OPEN for Mark).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet i165 record: codex-lane fix 509146d inert in prod; no trio ticket resolvable [HARNESS]

D-FLEET-46 = A re-check of the 509146d trio. The cloud completion path
(CompareAndSetTaskStatus, both stores) never writes completed_at, and
credentialLaneHolder skips a failed task without it, so the 11-16 lane
fix has never held in prod. T1's repro recurred on 2026-11-28 under
v0.64.1 (task-a2ab3af9 -> task-0a62d908). Independent sonnet judge
AGREE 90%, root cause reproduced by mutation. Routed to mission-v1
under D-FLEET-39 A; no ticket resolved.

Log entry 165, STATUS 165 (162 rotated to the archive), queue rows
54/55 annotated, dashboard, evidence under iteration165/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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