Skip to content

Placement framework v1.1: the machine dimension — registry placement reader + rules M1–M5 (#2179) - #12815

Merged
dezren39 merged 2 commits into
mainfrom
felix/2179-placement-v11
Nov 23, 2026
Merged

dezren39 merged 2 commits into
mainfrom
felix/2179-placement-v11

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Placement framework v1.1 — the machine dimension (#2179)

The slice the onboarding standard (§5/§6) and the task-placement framework (§6) both named once the registry shape existed: placement gains its third step. Option (§2 of the framework), pool/route (§3), now machine. The registry artifact (PR #12717) and the watchdog (PR #12758, now running every 15 min from Felix's seat) are the inputs; this PR is the reader + the rule.

What lands

scripts/fleet-machine-placement.py — derives the placement view of every registry record, for schedulers to consume:

  • M1, declared-state gate (standard §2/§4): only active records may receive work — declared/joining haven't passed §2 steps 5–6, draining takes no new work, retired is terminal. Evaluated before health.
  • M2, health gate (§1.5/§4): the health view is the watchdog module's placement_view, imported, not reimplemented — the §1.5 rule has exactly one home. Fresh health reads as its earned status; last_seen older than two cadences (30 min) or absent reads as left.
  • M3/M4, tiers: active+healthy = tier 1; active+degraded = tier 2, with the failed checks named in the view.
  • M5, capability requirements (§1.4): --require NAME keeps only machines declaring that capability — declarations, never probes.
  • The registry is validated (§3 validator) before any view is derived; an invalid registry is refused, never read leniently. Strict Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 argument contract (one positional + declared flags; anything else is a usage error, exit 2). Session facts ride beside the declared cap — activity is not concurrency, so the cap is reported, not gated on.

Framework doc §8 + placement-policy.yaml v1.1 — the rules above written into the task-placement framework (the doc §6 deferred them to exactly this), the policy transcription amended in the same pass per its header rule, and the placement record gains machine / machine_view fields.

Two v1.1 decisions, flagged for review (recorded in §8)

  1. Degraded is eligible, at tier 2. A degraded axis is a fresh, earned, named failure — not silence — and a one-node pool that stopped on any failed axis would stop fleet-wide; the 2026-11-22 disk episode ran the other way (work continued on degraded amd-6 until the purge). Tier 2 keeps the preference honest.
  2. Unknown is not eligible. Eligibility follows earned states only (§1.5: healthy is earned whole). This deliberately differs from burn rule B4 (stale quota reads never idle a pool) — the standard makes machine silence/unearned health a stop, and v1.1 follows the standard for machines.

Evidence

  • Fail-before (pristine main + this suite): FileNotFoundError: scripts/fleet-machine-placement.py — the module does not exist on main; the suite cannot load.
  • Pass-after: placement suite 21/21; sibling suites untouched and green — watchdog 13/13, validator 18/18 (31/31 together, re-run on the merged tree: all 52 pass).
  • Live readback against the registry on origin/main (watchdog commit 6da9528e0, health written 2026-11-23T03:10:29Z — reachable ok with server HTTP 200, disk ok at 548 GB free / 16.2% after the purge, load_headroom failed at 31.06 load15 = 1.94/core, sessions 50 listed / 31 active, cap 12):
$ python3 scripts/fleet-machine-placement.py <registry@main>            # read at 03:11Z, last_seen 43s old
amd-6: tier 2 (state=active, view=degraded, health=degraded, last_seen=2026-11-23T03:10:29Z) caps=queue_worker,opencode_sessions,builds sessions listed=50 active=31 cap=12 — degraded — failed checks: load_headroom
placeable: amd-6

$ python3 scripts/fleet-machine-placement.py <registry@main> --now 2026-11-23T03:41:29Z   # last_seen + 31 min
amd-6: ineligible (state=active, view=left, ...) — health stale or never seen — treated as left the pool (§1.5)
placeable: (none)

So from live data: the pool's one node is placeable at tier 2 right now (degraded on load under the 4–8-lane scale-up), and the staleness demotion bites exactly at the §1.5 boundary.

Boundaries kept

No machine's declared state is changed by this PR (amd-6 was already active from its S1 record; nothing is recorded active here — the Osseo pass, #1095/#1097/#1099/#1101, is hands-gated and hasn't happened). The watchdog script and the registry's health block are untouched — the reader imports placement_view and only reads the registry. No scheduler consumes the reader yet; wiring the first consumer is the follow-on, and the tiers only bite when a second node passes §2.

Refs #2179 (the v1.1 remainder), #2024 (framework review round).


See it in action
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

felix added 2 commits November 23, 2026 03:11
…staleness demotion (#2179)

scripts/fleet-machine-placement.py derives the placement view of every
registry record: declared-state gate (§2/§4), the watchdog's
placement_view health rule imported not reimplemented (§1.5: stale or
never-seen reads as left), eligibility tiers (healthy 1, degraded 2),
and declared-capability requirements (§1.4). Validates the registry
first; strict #3352 argument contract. 21 tests, oracle = onboarding
standard §1.4/§1.5/§2/§4 + framework §8.
§8 of the task-placement framework: placement gains its third step
(option, pool/route, machine) on the #2179 registry shape — rules
M1-M5, the placement record's machine/machine_view fields, and the two
v1.1 decisions recorded for the review round (degraded eligible at
tier 2; unknown not eligible). placement-policy.yaml transcribed in
the same pass per its header rule (version 1.1, machines section).
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 03:12
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e7349d8a-6165-492f-9845-093b8e85c257
Commits

Reviewing files that changed from the base of the PR and between 6da9528 and 32d0933.

Files selected for processing: 4

  • doc/2026-11-03T15-10-56Z_design_task-placement-framework-v1/2026-11-03T15-10-56Z_design_task-placement-framework-v1.md
  • doc/2026-11-03T15-10-56Z_design_task-placement-framework-v1/placement-policy.yaml
  • scripts/fleet-machine-placement.py
  • scripts/test_fleet_machine_placement.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 09d665f into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the felix/2179-placement-v11 branch November 23, 2026 03:13
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