Repository navigation
Conversation
|
Speaking as Kun's firstmate: thanks @Moshik21. Welcome back with the placement layer. Which PR should stay open, this one or #6984? I compared the diffs.
Waiting on you: confirm which PR to keep, then rebase in stack order after #6983 lands. Nothing else is needed from you right now. |
|
#7595 replaces #6984. Pipeline custody for the old branch could not be recovered safely; the replacement also includes the privacy scrub. Keep the replacement open; the old PR is being closed as superseded. With #6973 merged, the remaining landing order is #6983, then #7595. The required rebases are still in progress. |
|
Speaking as Kun's firstmate: thanks for confirming, @Moshik21. This PR replaces #6984, which you've closed, so there's nothing left to sort out on duplicates. We'll land #6983 and then this one. This branch still sits on #6983's old head |
da3fac8 to
0a75739
Compare
|
Speaking as Kun's firstmate: thanks @Moshik21 for the rebase. #6983 landed ( What I checked (head Contract-class (my own read): still opt-in. CI: the failing serial shards ran on the old ubuntu-26.04 image. They're the same failures main itself has, and none are in |
Intent
A firstmate with several homes (main plus secondmates, local or remote) has no help deciding which home should take a new lane. Each home already publishes its own capacity facts (open lanes, pressure, disk) through
fm-capacity.sh, but the choice among homes is still made by eye, with nothing that weighs a home's pressure, headroom or project clone against the task.bin/fm-place.shreads those published facts and advises a home. It is opt-in (config/lane-placement.jsonwith"mode": "advise"), only advises, and never spawns, routes or sends. A home the operator names always wins.This PR was rebased onto current main now that the capacity-facts change (#6983) has landed, so the diff covers only this placement layer.
What Changed
bin/fm-place.sh, an opt-in advisory script that ranks candidate homes for a new lane from each home's publishedstate/lane-capacity.jsonfacts. It is enabled byconfig/lane-placement.jsonwith"mode": "advise", and off otherwise (FM_PLACE=off, absent config, or"mode": "off"). It never spawns, routes, or moves anything. It also hasoutcomeandreviewsubcommands and appends to a private decision log,state/lane-placement.jsonl.tests/fm-place.test.shand registered it inbin/fm-test-run.sh(family list, timing table, and thebin/fm-place.shchanged-path mapping).docs/configuration.md("Lane placement") anddocs/scripts.md, and added the exampledocs/examples/lane-placement.jsonwith itsoperator-exampleentry indocs/documentation-audiences.json. Updated the routing guidance inAGENTS.mdand the home layout in theoperational-home-layoutskill to coverconfig/lane-placement.jsonand the decision log.Risk Assessment
✅ Low: The change is opt-in, advisory-only lane placement scoped to PR B. The approved wording-only fallback correction is now present in the header, the status table and the emitted note, and it matches docs/configuration.md. The answer logic is untouched.
Testing
The existing fm-place test file passes. I also ran the real script against a throwaway home whose capacity facts came from the real
fm-capacity.sh --publish. Where a scenario needed an unpressured or stale home, I edited those facts withjqand the script itself was unchanged. Full, clear, fallback, stale fitting home, captain, error, off, usage errors, outcome and review all behaved as documented, and the fallback note uses the approved wording. The log was 0600 and was the only file the script touched. This change has no UI, so no screenshots were taken.Evidence: Full: real host load refuses every home
Source: Full: real host load refuses every home
Evidence: Clear: best fitting home is chosen
Source: Clear: best fitting home is chosen
Evidence: Fallback to main when no fitting home is eligible
Source: Fallback to main when no fitting home is eligible
Evidence: Stale fitting home with eligible main: wording check
Source: Stale fitting home with eligible main: wording check
Evidence: Captain, already-running task, off, usage errors, JSON
Source: Captain, already-running task, off, usage errors, JSON
Evidence: Outcome and review
Source: Outcome and review
Evidence: Files touched in the lab home
Source: Files touched in the lab home
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 4 issues found → auto-fixed ✅
AGENTS.md- merge conflict rebasing onto origin/mainbin/fm-capacity.sh- merge conflict rebasing onto origin/maindocs/configuration.md- merge conflict rebasing onto origin/maintests/fm-capacity.test.sh- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-place.sh:15- The approved wording-only correction from review round 2 (commit 3eb32498, 'Align fm-place fallback wording with documented rule') is missing from this replay. Only bbe49d5 and c2a6eac are above the base, and 3eb32498 is not an ancestor of HEAD. The round-3 instruction said to preserve that correction in the final tree. The old wording is still in three places, and it contradicts docs/configuration.md:808 ('fallback homes are considered only when no fitting home is eligible or unranked'). (1) bin/fm-place.sh:15 header says the fallback is used 'when every fitting home is blocked'. (2) bin/fm-place.sh:46 says 'the best fallback when every fitting home is blocked'. (3) bin/fm-place.sh:614 emits the note 'every fitting home is blocked (...)'. Because of (3), a fitting home whose facts are unreachable, stale, or missing is reported as 'blocked' even though it was never judged blocked. Matching test: tests/fm-place.test.sh:188 asserts the old note text and must change with it. Restore the 3eb32498 text: 'no fitting home is eligible or unranked (...)', plus the header note that unreachable, stale, or missing facts count as not eligible. This is wording only, with no change to the answer logic.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-place.test.sh(all 7 groups ok)Live lab: disposable FM_HOME with two local secondmate homes, each publishing real facts throughbin/fm-capacity.sh --publishbin/fm-place.sh --task ... --fitting ... --fallback mainfor the full, clear, fallback and unknown-fitting cases--captain, an already-running task,FM_PLACE=off, and three usage errors (unknown home, unknown flag, missing--task)--jsonoutput,fm-place.sh outcome(firstmate and captain),fm-place.sh reviewA file-touch check on the lab home; the lab was removed afterwards✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.