Repository navigation
fix(bin): green the fork CI and give the fm scripts AXI help, empty state and refusals - #3
Merged
Merged
Conversation
…henguid#6530) Pi 1.0.1's createToolHtmlRenderer reads getToolRenderers and ignores getToolDefinition. Calm /export still includes stock grep HTML; the fixture has to pass the lookup key the installed Pi actually reads. (cherry picked from commit fede619)
…--external-sources (kunchenguid#6443) * fix(lint): retry memory-bound roots without external sources * no-mistakes(review): Make fallback tests portable and correct source-following telemetry * no-mistakes(review): Remove committed parity fixtures and use disposable test roots * no-mistakes(document): Document ShellCheck memory fallback and telemetry * no-mistakes(review): Cover bounded and unbounded fallback RSS behavior * no-mistakes(document): Correct stale lint fallback documentation * no-mistakes(document): Correct stale lint test documentation * no-mistakes(ci): The memory fallback (the retry without --external-sources) now gets only the time left in its root's original deadline, so it can no longer outlast the CI job. Invariant: one root's first attempt plus its fallback must fit inside a single FM_LINT_ROOT_SECONDS deadline, plus the cleanup grace. Only one site started a new deadline: the fallback call in fm_lint_run_root. The deadline is the only budget involved, because the memory limit already applies to each process separately. Changes in bin/fm-lint.sh: - fm_lint_exec_root now takes a <seconds> argument instead of always reading FM_LINT_INTERNAL_ROOT_SECS. - The first attempt passes the full deadline. - The fallback passes floor((start + deadline - now) / 1000) seconds. - When bounds are enforced and less than 1 second is left, no retry starts. fm_exec_timed rejects 0 seconds, so the retry cannot run with no time. The root keeps reason=memory, and the shard output says "no time left in its Ns deadline to retry without it". - Unbounded local runs have no deadline and behave as before. - The header comment now describes the shared deadline. Changes in tests/fm-lint.test.sh: a new test, test_memory_fallback_spends_only_the_remaining_root_deadline, runs only on hosts that can enforce bounds. It uses a 6 s deadline and 1 s grace. - Case 1: the first attempt runs 3 s and then fails with memory status 251. The test asserts one fallback ran, reported reason=timeout, and the root's recorded duration is under 7000 ms. - Case 2: the first attempt runs 5.2 s. The test asserts no fallback starts, the skip is explained, and the sidecar records memory with source-following 1. Verification: - Full `nice -n 10 bash tests/fm-lint.test.sh` passed, including the new test, in about 5 minutes. - Case 1 run against the HEAD script: the root took 9168 ms, so the under-7000 ms check fails before the fix. - `bin/fm-lint.sh bin/fm-lint.sh tests/fm-lint.test.sh` reported no findings. - The CI workflow is unchanged, so the Test step still runs only tests/fm-lint.test.sh with nice -n 10 and the 12 GiB ShellCheck limit (cherry picked from commit d719ef3)
fm-teardown.sh sources fm-sbx-lib.sh, so the fake roots refused teardown before reaching the temp-dir cleanup under test.
…nstead of a guessed delay The attempt started on the exact second boundary, where the kernel's coarse file timestamps stamp the write in the previous second, so every attempt crossed a ctime second. Start just past the boundary and hold the reader's first capture open so the rewrite lands between the capture and the next poll.
Drop the unused argument pass-through from broker_once and start_daemon, replace ls|grep with find, make the leftover-file check a real assertion, and remove unused variables.
…run a same-named session
…s axi-style help, empty state and refusals The wake drain reports a definitive "wakes: 0" on an empty queue, and its consumers ignore that line. Each script answers --help with an example and exits 2 on an unknown flag with the error and a next-step line on stdout. Also renames two unused loop variables in the sandbox-run test that ShellCheck flagged.
…owner, teardown refusals
…cal partition" step. 251 is the code ShellCheck's runtime returns when it runs out of heap, so one file hit the memory cap. I couldn't read the CI log or telemetry: the sandbox returns 403 for the log and artifact downloads. The probable culprit comes from upstream PR kunchenguid#6443: bin/fm-teardown.sh with followed sources peaks at about 8.38 GB resident. That is right at the ~8 GiB usable heap the 12 GiB per-file cap leaves. bin/fm-teardown.sh is in partition 1, and this PR adds usage and flag handling to it, which pushed it past the cap. Lint 2 passed. Rule broken: every file in the lint set must finish full source-following analysis under the per-file cap. The cap is set in one place, `ROOT_MEMORY_KIB` in bin/fm-lint.sh, and both CI partitions and local lint use it, so one change covers every file. The user rejected the upstream fallback and named raising the limit as an acceptable fix, so I raised the default `ROOT_MEMORY_KIB` from 12582912 to 16777216 (16 GiB of address space, ~10.7 GiB usable heap). CI lints one file at a time (`FM_LINT_JOBS=1`), so peak use of ~10.7 GiB plus overhead fits the 16 GiB public runner. No check is skipped or reduced: `--external-sources` and the SC codes are unchanged. I updated the sizing comments in the header and beside the default. The pinned memory test in tests/fm-lint.test.sh now expects the recorded value 16777216. Verification: `bash -n` passes on both edited files, `ulimit -v 16777216` is accepted on this Linux host, and the partition file list is unchanged (235 files in 1of2). The local run of tests/fm-lint.test.sh failed at its first partition check. The log shows that "actionlint not found" error, and actionlint isn't installed in this sandbox. The real pinned ShellCheck isn't here either: the installer gets HTTP 403, and pip has no wheel. So the pinned memory test that checks the new value was skipped, and I couldn't measure teardown's memory locally. Whether 16 GiB is enough will only be confirmed by the next CI Lint 1 run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Make the ICBreakerLA/firstmate fork's CI fully green with no waivers, and land the open PR #2 (a CI step that runs the launch-env-allowlist regression under stock macOS Bash) on that green main. The fork's main was failing on ShellCheck findings in the sandbox broker and its tests, tests/fm-calm-pi-extension.test.sh, tests/fm-gotmp.test.sh and tests/fm-remote-delta-read.test.sh; tests/fm-remote-reply.test.sh was flaky (could not be reproduced locally, left unchanged). Fix root causes: never skip, weaken or delete a check or test, and never edit the gate workflows to exempt authors. The pull request must be raised by the no-mistakes pipeline against the fork's main (ICBreakerLA/firstmate), never against kunchenguid/firstmate. PR 2's commit is already folded into this branch. Also in scope: a BASHPID guard in bin/fm-timeout-lib.sh for macOS bash 3.2 with a regression; keeping config/worker-sandbox out of the inheritable items for remote secondmate homes with a regression; making remote teardown resolve its herdr presentation lock per user and socket with a regression simulating two same-named sessions (based on an assumed cause, not run against real herdr); and AXI conventions (definitive empty state such as 'wakes: 0', exit 2 on unknown flags with the error on stdout, --help exiting 0 with an example, a next-step line on refusals, backward-compatible parsed output) for bin/fm-wake-drain.sh, fm-teardown.sh, fm-send.sh, fm-peek.sh and fm-crew-state.sh. The upstream ShellCheck memory-fallback commit (2ed39fe, kunchenguid#6443) is deliberately not wanted because it weakens the lint. Out of scope: SportsMeet, tokens, and the shipped gate workflows.
What Changed
/bin/bashand expects 4 passing cases. The ShellCheck findings infm-sbx-verify-broker.shand several tests (calm-pi-extension, gotmp, remote-delta-read, sbx-run, sbx-verify-broker, wake-drain) are fixed in the code, with no checks skipped or weakened.fm-timeout-lib.shno longer usesBASHPID, which macOS bash 3.2 doesn't have. The owner check now happens inside the perl watchdog throughgetppid().fm-config-inherit-lib.shadds a local-only list (worker-sandbox). Remote secondmate homes no longer inheritconfig/worker-sandbox, and the docs and skill text say so./tmpnamespace exists but this user can't use it, the user gets a uid-suffixed namespace instead. If several running sessions share the target name, the lock uses the one socket this user owns.fm-wake-drain.sh,fm-teardown.sh,fm-send.sh,fm-peek.shandfm-crew-state.sh:--helpexits 0 and prints an example.next:line on stdout, then exit 2.wakes: 0.fm-session-start.shandfm-afk-return.shfilter that line out, so their existing output stays the same.🤖 Generated with Claude Code
Risk Assessment
✅ Low: Each change is small and has a regression. The round-1 fixes are in place: the lint memory fallback is fully reverted, the owner is now resolved inside perl so subshells on bash 3.2 work, and teardown refuses
-*flags with the error on stdout. Every caller of the drain output that parses it ignores or filters the newwakes: 0line.Testing
I ran fm-wake-drain, fm-send, fm-peek, fm-teardown and fm-crew-state against a throwaway lab home, then deleted it. Every AXI behaviour matched the intent, and the two fixes from the earlier review hold: single-dash teardown refusals, and the timeout owner inside a subshell with BASHPID unset. I also checked live that the remote inherit set leaves out worker-sandbox. The regression tests I could run here pass, including the CI-greening tests (gotmp, remote-delta-read, sbx broker/run) and the new per-user herdr lock test. These were fixture and test runs, not live runs, so those scenarios are marked untested. A pre-existing herdr descendant failure stops the full herdr test file early on this host (it fails the same way on the base commit), so I ran the lock tests on their own. fm-spawn-dispatch-profile passes once the host's own DISABLE_AUTOUPDATER variable is removed. Three things could not run here: the macOS stock-bash CI step, the Pi calm test (Pi missing) and the full teardown and lint test files (tasks-axi and actionlint missing). The output is all text, so there are no screenshots.
Evidence: AXI CLI transcript (help, refusals, empty state) against the lab home
Source: AXI CLI transcript (help, refusals, empty state) against the lab home
Evidence: fm_exec_timed subshell run with BASHPID unset, plus the remote inherit item list
Source: fm_exec_timed subshell run with BASHPID unset, plus the remote inherit item list
Evidence: herdr presentation-lock tests including two same-named sessions
Source: herdr presentation-lock tests including two same-named sessions
Evidence: Targeted regression results
Source: Targeted regression results
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-config-inherit-lib.sh:97- Leavingworker-sandboxout offm_config_inherit_itemsstops new transfers. A remote secondmate home that already gotconfig/worker-sandboxfrom earlier inheritance (it was in FM_INHERITABLE_CONFIG at the base commit) keeps that copy, though. The item is no longer in the remote set, so neitherfm-remote-inherit-push.sh:46nor the receiverfm-remote-inherit.sh:41ever mirrors its absence or removes it. If that stale file sayssbx, the remote home keeps refusing spawns, which is the failure this change is meant to prevent. The new regression (tests/fm-shared-captain-inheritance.test.sh:190) only covers a fresh home. Fixing this means adding a one-time cleanup or migration of the existing remote copy, which extends the change's scope. That remedy needs the user's approval.tests/fm-backend-herdr.test.sh:690- On this host, tests/fm-backend-herdr.test.sh stops at 'a registered agent with a live agent-named descendant must stay live/alive' (got 'unknown unreadable refused'), so the tests after it never run. The base commit 722c961 fails the same way, so this change did not cause it. The new per-user lock test passes when run on its own.tests/fm-spawn-dispatch-profile.test.sh- tests/fm-spawn-dispatch-profile.test.sh fails here only because the host exports DISABLE_AUTOUPDATER=1, which ends up in the expected launch line; with that variable removed it passes. This is the test environment, not the change.Lab home viabin/fm-lab-home.sh create $LAB, then each script run with FM_HOME=$LAB (fleet override variables removed):--help,--bogus,-x/-f, invalid idbad/id, an unexpected argument after the task id, an emptybin/fm-wake-drain.shrun twice, andfm-crew-state.shwith no argumentsbash -c 'unset BASHPID; . bin/fm-timeout-lib.sh; ( fm_exec_timed 10 1 sh -c "sleep 3; echo ..." ); ( fm_exec_timed 1 1 sh -c "sleep 5" )'bash -c '. bin/fm-config-inherit-lib.sh; fm_config_inherit_items'bash tests/fm-timeout-lib.test.shbash tests/fm-shared-captain-inheritance.test.shfm-backend-herdr presentation-lock tests run on their own (test_presentation_session_lock_* including the new per-user test)bash tests/fm-wake-drain-open-decisions.test.shbash tests/fm-send-resolve-key.test.shbash tests/fm-peek-remote.test.shbash tests/fm-crew-state.test.shbash tests/fm-gotmp.test.shbash tests/fm-remote-delta-read.test.shbash tests/fm-sbx-verify-broker.test.shbash tests/fm-sbx-run.test.shenv -u DISABLE_AUTOUPDATER bash tests/fm-spawn-dispatch-profile.test.shbash tests/fm-teardown.test.sh(stopped at line 643: tasks-axi missing)bash tests/fm-calm-pi-extension.test.sh(Pi package missing)git diff 722c9612 8c083c9 -- bin/fm-lint.sh docs/fm-test-portable-shards.mdis empty and bin/fm-lint.sh contains nomemory-fallback✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.