Skip to content

fix(quota-plane): canonicalise fee_period vocabulary in reconcile.py diff (#13375) - #13395

Merged
dezren39 merged 1 commit into
mainfrom
lane-zs-13375
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-zs-13375

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

reconcile.py's diff compared fee_period as a raw string across legs whose vocabularies differ by construction:

  • plan-store leg: the store's Effect schema (Period in the opencode fork's model-plan.ts) admits only monthly / yearly / once, and ModelPlan.writeStore validates against it — a store row can never carry month / year.
  • tracker leg: the fenced plan-facts block uses month / year (schema approved 2026-11-16).

Since the store was seeded, every reconciliation reported 9 fee_period findings (winner: plan-store) that were pure vocabulary noise. The fixture masked it: its hand-written store fixture used month, a value the real store schema rejects.

Fix

Canonicalise fee_period to the tracker vocabulary for comparison only, inside diff (PERIOD_ALIASES: monthly→month, yearly→year). Neither source's vocabulary changes — the comparison is the only place the two meet, and within this repo fee_period has no other consumer. Findings keep each leg's raw values, so a genuine period finding still shows what each source actually says and names the winner truthfully. once has no tracker equivalent and passes through unchanged, so a one-off fee still mismatches any recurring tracker period.

Tests

test_reconcile.py:

  • Base store fixture now carries the schema-valid monthly against tracker month → no-drift (this is the vocabulary case; previously masked).
  • New planted genuine mismatch: store monthly vs tracker year → exactly one fee_period finding, winner plan-store, raw values {"plan-store": "monthly", "tracker": "year"} reported.
  • New agreement case: store yearly vs tracker year → no-drift.

Verification

  • Remote dispatch (fleet queue session fp_cd30072ca532094c8a3f60d74e59b6b7, run 45203801763): python3 pm-stack/provider-usage/test_reconcile.py at ref lane-zs-13375 — succeeded.
  • Laptop run of the same fixture suite in the worktree: all tests pass.
  • Live-input reconciliation with the fixed tool (laptop plan store ~/.local/share/opencode/plans.json, the registry's plan-facts block, the current snapshot): no-drift, legs plan-store 9 / tracker 9 / measured 0, zero findings — the 9 vocabulary findings are gone and no other store↔tracker drift remains. (The measured leg is empty — the snapshot freshness gap already recorded on the parent issue; it carries no values to disagree with.)

For #13375. The parent reconciliation issue stays open on its remaining slices; nothing here closes it.


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

…diff (#13375)

The plan-store leg's schema admits monthly/yearly/once while the
tracker's approved plan-facts schema uses month/year, so the raw-string
comparison reported 9 permanent fee_period findings that were pure
vocabulary noise. Canonicalise fee_period to the tracker vocabulary for
comparison only; findings keep each leg's raw value and winner.

Fixture tests: the store fixture now carries the schema-valid "monthly"
(the old "month" value is one the real store schema rejects and masked
the bug), plus a planted genuine period mismatch (monthly vs year,
caught with raw values reported) and a yearly/year agreement case.
@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 51 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: d62ce728-82c3-45d5-a50f-2249f1b1bf0d
Commits

Reviewing files that changed from the base of the PR and between ba37500 and 0784f18.

Files selected for processing: 2

  • pm-stack/provider-usage/reconcile.py
  • pm-stack/provider-usage/test_reconcile.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 22ec90b into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-zs-13375 branch November 23, 2026 15:24
@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-23T15:26:01.842167Z 0784f18 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant