Skip to content

fleet(pools): refuse pool-drawn seatings at >=97% monthly, >1pp/h pace, or steward hard-stop (#2732) - #12895

Open
dezren39 wants to merge 1 commit into
mainfrom
lane-code-i/2732-monthly-pace-guard
Open

dezren39 wants to merge 1 commit into
mainfrom
lane-code-i/2732-monthly-pace-guard

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Slice 1 of #2732 (feature-slice): one acceptance criterion — a seating attempt against a ≥97%-monthly pool is refused and logged.

What changed (pkgs/fleet/placement, the shared seating helper the triage pointed at):

  • Answers gains pool_id / pool_monthly_pct / pool_pace_pph / pool_hard_stop (steward hard-stop in machine-readable form, proposal step 2).
  • Evaluate refuses pool-drawn seatings on a fresh read at ≥97% monthly, >1pp/h trailing pace, or hard-stop; the refusal names pool + % + guard source for the dispatcher log (proposal step 3).
  • Unknown state never refuses: B4 reliance, absent monthly data, and non-pool options proceed; E1 exceptions bypass with their own record as the log.
  • Prerequisite repair: policy version decodes the v1.1 string form ("1.1") as well as the v1.0 int — every existing placement test was failing at HEAD after Machine pool: onboard additional machines as fleet job nodes and redesign placement around a pool #2179.

Evidence:

  • New TestMonthlyPaceGuard (8 subtests) fails before, passes after; full package suite green: go test ./... ok.
  • CLI demo: 97.5% read → monthly-guard refusal exit 1 with pool/%/source; 82% read → placement record exit 0.

Not in this slice: wiring into the live queue client / OpenChamber dispatcher, the weekly audit sample (still gated on #2024 review per the PoC README).

Refs #2732 — slice 1 of an effort/l; live wiring remains.

…e, or steward hard-stop (#2732)

Slice 1 of #2732: the placement evaluator — the shared seating helper the
triage suggested for the dispatcher and lane-shift paths — now enforces
the monthly pace guard at seating time. A pool-drawn placement on a fresh
quota read is refused (exit non-zero, pool + % + guard source on stderr)
when pool_monthly_pct >= 97, pool_pace_pph > 1, or pool_hard_stop is set.
Unknown state never refuses (B4 reliance, absent monthly data, non-pool
options proceed); E1 exceptions bypass with their own record as the log.

Prerequisite repair in the same package: policy version now decodes the
v1.1 string form ("1.1") as well as the v1.0 int — all existing
placement tests were failing at HEAD after the #2179 amendment.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 04:44
@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 47 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: 1ad062bf-5a0c-45b8-b882-0faf90eaf51b
Commits

Reviewing files that changed from the base of the PR and between bc47aa7 and 84f3cf9.

Files selected for processing: 4

  • pkgs/fleet/placement/README.md
  • pkgs/fleet/placement/evaluate.go
  • pkgs/fleet/placement/monthly_guard_test.go
  • pkgs/fleet/placement/policy.go
  • 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T04:46:38.389507Z 84f3cf9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84f3cf9074

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +213 to +214
if reason := monthlyGuardRefusal(a); reason != "" {
return Record{}, fmt.Errorf("monthly-guard refusal: option %q on pool %q refused (%s)", optionID, guardPoolID(p, a, optionID), reason)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exempt recorded E1 exceptions from the monthly guard

For an E1 exception choosing a pool-drawn option with a fresh read at ≥97%, pace >1pp/h, or a hard-stop, exceptionRecord still calls buildRecord, so this unconditional check rejects the exception instead of emitting its record. This contradicts the newly documented E1 bypass in placement/README.md and prevents dispatchers from using the advertised recorded override. Skip the monthly guard when ruleID == "exception", while preserving the existing quota-read checks.

Useful? React with 👍 / 👎.

@dezren39
dezren39 removed the request for review from a team November 23, 2026 05:55

This branch has not been deployed

No deployments
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