Repository navigation
Conversation
Add bin/fm-capacity.sh, a read-only, network-free report of this home's running lanes against an optional config/lane-capacity target, plus 1-minute load versus logical cores, free memory, and free disk. The first output line is machine-readable (free_lanes=N reason=...), followed by a human summary. Probes degrade to unknown when unavailable on a platform. Document config/lane-capacity in docs/configuration.md and point the backlog re-evaluation rule in AGENTS.md at the new report.
…imits Extend bin/fm-capacity.sh with --json, --publish, and --admit, optional config/lane-capacity lines (min-avail-gb, min-disk-gb, pressure-file, reserve-flag, captain-idle, quota-provider, max-load1), lookout.beat pressure reading with probe fallback, and an opt-in watcher publish of state/lane-capacity.json.
…ublished-text redaction
bin/fm-place.sh reads each candidate home's state/lane-capacity.json (local, or through fm-on.sh and fm-remote-file.sh for a remote home), filters and scores the fitting homes, prints one TOON answer with every home's reasons, and appends one line to state/lane-placement.jsonl. It never spawns, routes, or moves anything. Modes are off and advise, opted in by config/lane-placement.json; outcome records firstmate's choice and review summarizes the advice period. Facts failing fail open; a malformed config exits 2.
Owner
|
Speaking as Kun's firstmate: thanks @Moshik21. This PR's body says its goal is to update #6984. #6984 itself was force-pushed at 21:35 UTC (head Contract-class: opt-in (same diff as #6984). CI: same as #6984; serial 2 was cancelled at the 30-minute ceiling (#7255). |
Contributor
Author
|
Opened in error by our tooling; superseded by #6984, which carries the update. |
Owner
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
Our own open upstream pull request #6984 (feat(bin): advise lane placement from published lane facts, branch fm/router-p1-pr-b) currently shows mergeable=false (conflicts) against upstream main. Get it rebased and passing its checks again. Upstream consent for updating this exact PR branch is recorded for this task. The PR adds bin/fm-place.sh, an advisory lane-placement command that reads published lane capacity facts, and is stacked on the open PRs #6983 and #6973, whose commits it carries and must keep unchanged.
What Changed
bin/fm-capacity.sh, which reports open lanes against the optionalconfig/lane-capacitytarget plus host headroom.--jsonprints thefm-lane-capacity.v1document and--publishwrites it tostate/lane-capacity.json.bin/fm-watch.shnow publishes that file detached, only whenconfig/lane-capacityexists and the file is at least 30s old.bin/fm-place.sh, an advisory lane-placement command. It reads each candidate home's published lane facts (local, secondmate, or remote), ranks eligible homes, and treats missing, stale, or unreachable facts as unknown. It hasoutcomeandreviewsubcommands for the decision log. It is opt-in throughconfig/lane-placement.jsonand never spawns or routes anything.docs/configuration.md,docs/scripts.md,docs/examples/lane-placement.json,AGENTS.md, the operational-home-layout skill,docs/documentation-audiences.json). Addedtests/fm-capacity.test.shandtests/fm-place.test.shand registered them inbin/fm-test-run.sh.Risk Assessment
✅ Low: The rebase kept every carried commit's changed lines identical to the pre-rebase versions and applied the recorded bin/fm-test-run.sh resolution (fm-place 22000 before the polytoken entries). The shell sources and helper functions the new scripts depend on still exist on the new base, and all touched scripts pass
bash -n.Testing
The fm-place test file passes. Live runs of bin/fm-place.sh against disposable lab homes (with real facts from bin/fm-capacity.sh --publish) showed the expected statuses and guards; the lab homes were deleted afterwards. Two checks failed on this host and are explained in the findings: the host-dependent ioreg case in fm-capacity, and the --check-coverage guard, which fails only inside this gate worktree and passes on clean copies of the same commit. The live runs never produced a ranked "clear" pick: host load was about 120, which made main ineligible, and the second lab home's facts were rejected as foreign. The ranking and scoring paths are covered by the passing fm-place test file only. I could not verify that the carried #6973/#6983 commits are unchanged against upstream, because no remote refs are available in the worktree. The runner diff against upstream main shows only the PR's own additions.
git diff 9d76aa8 HEAD -- bin/fm-test-run.shadds fm-place.test.sh and fm-capacity.test.sh entries, andbin/fm-test-run.sh --list --alllists fm-place, polytoken-harness and polytoken-signals-live-…Evidence: fm-place live run transcript (lab home, valid config)
Source: fm-place live run transcript (lab home, valid config)
Evidence: fm-place live run: direct-PR, missing-facts and foreign-facts cases
Source: fm-place live run: direct-PR, missing-facts and foreign-facts cases
Evidence: fm-place live run: invalid config rejected
Source: fm-place live run: invalid config rejected
Evidence: fm-place test log
Source: fm-place test log
Evidence: fm-capacity test log (fails on macOS ioreg case)
Source: fm-capacity test log (fails on macOS ioreg case)
Evidence: fm-capacity test log with /usr/sbin off PATH (passes)
Source: fm-capacity test log with /usr/sbin off PATH (passes)
Evidence: check-coverage failure output in the gate worktree
Source: check-coverage failure output in the gate worktree
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
bin/fm-test-run.sh- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Review** - passed
✅ No issues found.
bin/fm-test-run.sh --check-coveragefails here with 'portable serial shards share scripts'. It failed on all 5 runs in this gate worktree, including underenv -i. The same commit passes in 5 other copies, and the base commit 9d76aa8 passes 4/4 in clean copies. The copies were git archives, a no-.git copy, a copy with the .git pointer file, a linked worktree, a copy under a.no-mistakes/worktrees/...path, and a 160-character path. In-process enumeration inside the guard was inconsistent: twoportable_serial_assignmentscalls in one process disagreed (227 lines with tests/fm-x-mode.test.sh vs 226 without). Standalone--listis stable at 226. I could not find the cause, so I am treating it as specific to this worktree and bash 3.2, not a defect in the rebased content. The guard needs to be confirmed in remote CI.tests/fm-capacity.test.sh:471-tests/fm-capacity.test.shcase 'unreadable presence and quota must read unknown' fails on this macOS host (got idle|unknown) because the real /usr/sbin/ioreg is on PATH after the test removes its fake ioreg. The test belongs to the carried feat(bin): add fm-capacity.sh to report open lanes and host headroom #6973 commits, which must stay unchanged. With /usr/sbin removed from PATH the whole file passes. Linux CI is unaffected.git diff 9d76aa8 HEAD -- bin/fm-test-run.shadds fm-place.test.sh and fm-capacity.test.sh entries, andbin/fm-test-run.sh --list --alllists fm-place, polytoken-harness and polytoken-signals-live-…bash tests/fm-place.test.sh(exit 0, all tests passed)bash tests/fm-capacity.test.sh(fails 1 host-dependent case on macOS; passes with /usr/sbin removed from PATH)git diff 9d76aa8 HEAD -- bin/fm-test-run.shto confirm the sorted list: tests/fm-place.test.sh 22000, then upstream's polytoken-harness 21090 and polytoken-signals-live-e2e 103, then tests/fm-pr-check-security.test.shbin/fm-test-run.sh --list --all | grep -E 'fm-place|polytoken'(all three scripts are scheduled)bin/fm-test-run.sh --check-coveragein the gate worktree (failed 5/5) and in clean copies of HEAD (passed 5/5), plus the base commit in clean copies (passed 4/4)Livebin/fm-place.shruns against disposable lab homes (made with bin/fm-lab-home.sh, facts frombin/fm-capacity.sh --publish): invalid config rejected with exit 2, FM_PLACE=off, captain override, unknown home rejected, missing secondmate facts reported as unknown,outcomeandreview --json, decision log mode 0600✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.