GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fleet(placement): read the monthly guard inputs from quota-current.json (#2732) by dezren39 · Pull Request #13451 · developing-today/code Conversation
|
|
Warning Review limit reachedYou'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 21 minutes. View limit details
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f1b96f811
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if e.State != "ok" { | ||
| continue | ||
| } | ||
| okEntries++ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reject entries retained after a failed gatherer tick
When a gatherer tick fails, markRetained in pm-stack/aggregator/src/quota-gather-map.ts preserves the previous entry's state: "ok" and adds retainedFromFailedTick. This reader ignores that marker, so a retained monthly reading within the 60-minute age bound is accepted as live data even though the latest read failed. The existing TypeScript reader explicitly classifies these entries as stale in entryState. Decode and exclude retained entries before selecting the newest usable read so the new seating path cannot silently proceed on failed-tick data.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 2674ffddf5e (lane aae shepherd): ReadQuotaCurrent decodes retainedFromFailedTick and excludes retained entries from selection, mirroring entryState in quota-current.ts — retained is stale by definition (#1268). Pinned by TestReadQuotaCurrentRetainedEntries: a sole retained read is a stale error, and a retained entry never shadows an older genuine ok read.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| answers.PoolMonthlyPct = &pct | ||
| answers.PoolReadAt = &readAt | ||
| answers.PoolID = *poolID |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Clear the B4 fallback flag after obtaining a live read
If the answers file contains pool_read_unobtainable: true from a previous fallback, supplying the new live-read flags replaces the timestamp and monthly percentage but leaves that flag set. buildRecord in evaluate.go returns immediately for PoolReadUnobtainable, before checking any monthly guard, so even a successful live reading of 98.4% emits a placement record instead of refusing. Clear answers.PoolReadUnobtainable when the authoritative read succeeds; B4 reliance no longer applies once a fresh read has been obtained.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 2674ffddf5e (lane aae shepherd): applyLiveRead in cmd/placement-record/main.go now clears PoolReadUnobtainable when the live read succeeds, so buildRecord reaches the monthly guard on the fresh read. Pinned by TestApplyLiveReadClearsB4Fallback and verified end-to-end with the real policy: B4 answers + live 98.4% now refuses with the audited monthly-guard line (exit 1); B4 answers + live 50.0% emits a record with no B4 reliance.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if *policyPath == "" || *answersPath == "" || (*quotaCurrentPath == "") != (*poolID == "") { | ||
| fmt.Fprintln(os.Stderr, "usage: placement-record --policy <placement-policy.yaml> --answers <answers.json> [--quota-current <quota-current.json> --pool <serviceId>]") | ||
| os.Exit(2) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reject explicitly empty live-quota options
When a dispatcher supplies --quota-current "$QUOTA_PATH" --pool "$POOL_ID" with both variables empty, this check passes because it cannot distinguish explicitly empty options from omitted ones. The subsequent live-read branch is skipped, allowing a successful record based on hand-supplied answers despite the caller requesting live quota enforcement. Track option presence and reject empty supplied values before reading files. The operator argument contract linked from AGENTS.md explicitly requires that a “present-but-valueless option is a usage error, never the default” (doc/agents/operator-script-argument-contract.md, lines 15–16).
AGENTS.md reference: AGENTS.md:L43-L48
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 2674ffddf5e (lane aae shepherd): option presence is tracked via flag.Visit, and liveReadSelection rejects a supplied-but-empty --quota-current or --pool as a usage error (exit 2) — a present-but-valueless option is never the default, per the operator argument contract. Pinned by TestLiveReadSelection (7-case matrix) and an end-to-end run of the empty pair.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…iring (#2732) Shepherd fix on PR #13451 (lane aae), addressing the unresolved Codex review findings — all fail-open holes in the monthly guard's live path: - P1: a successful live read now clears a stale pool_read_unobtainable B4 fallback in the answers file (applyLiveRead). buildRecord returns on a B4 reliance before the guard runs, so a 98.4% live read was seating unguarded. - P1: explicitly empty --quota-current/--pool values are a usage error (liveReadSelection tracks option presence), per the operator argument contract: a present-but-valueless option is never the default. A dispatcher expanding unset variables no longer degrades silently to hand-supplied answers. - P2: ReadQuotaCurrent excludes entries the gatherer retained after a failed tick (retainedFromFailedTick), mirroring entryState in quota-current.ts (#1268): retained is stale by definition. Tests: TestReadQuotaCurrentRetainedEntries (a sole retained read is a stale error; a retained entry never shadows an older genuine ok read), TestLiveReadSelection (7-case pair matrix), TestApplyLiveReadClearsB4Fallback. Verified end-to-end with the real policy of record: B4 answers + live 98.4% refuses with the audited monthly-guard line; the empty pair exits 2; a retained-only read exits 1 as stale; B4 answers + live 50.0% emits a record with no B4 reliance.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.