GeezerVison is showing github.com — feat(quota-plane): plan-store / tracker / measured reconciliation diff (daily) · Issue #1270 · developing-today/code
feat(quota-plane): plan-store / tracker / measured reconciliation diff (daily) #1270DescriptionPart of epic #1149; extends the daily model + route audit (#1173). Priority P2. Three records describe the same plans and can drift independently: (1) the fork plan store (model-plan.ts JSON — entitlements, fees, windows), (2) the master tracker / quota-view (human-maintained plan facts), (3) the hub snapshot history (measured reality). The 2026-10-26 passes already found drift of exactly this kind (Go windows, ClinePass's stale tracker row, Meta's blocked-vs-funded status).
Feature: a daily reconciliation diff — plan-store entitlements vs tracker rows vs latest measured windows — reporting only mismatches (plan name, fee, window limit/reset, status active/cancelled) as findings in the stewardship cycle log + registry, each with the winning source named per the evidence rules (console read > plan store > tracker prose). No silent auto-fixes: corrections flow through the normal edit/PR paths with the diff attached.
Acceptance: first diff run produces a dated findings list (or an explicit no-drift result); a planted mismatch in a test fixture is caught.
Acceptance criteria
- A daily reconciliation diff runs across plan-store entitlements vs tracker rows vs latest measured windows, reporting only mismatches (plan name, fee, window limit/reset, status active/cancelled).
- Each finding names the winning source per the evidence rules (console read > plan store > tracker prose) and lands as a dated findings list in the stewardship cycle log + registry — or an explicit no-drift result.
- A planted mismatch in a test fixture is caught by the diff.
- No silent auto-fixes: corrections flow through the normal edit/PR paths with the diff attached.
Activitydeveloping-today commented on Oct 27, 2026 dezren39 commented on Oct 28, 2026 Intake review
Fleet-monitor intake pass (protocol §5), 2026-10-28. Filed with only meta/follow-up; labels normalised in this pass (kind/feature, source/human — author dezren39 — status/needs-triage, priority/normal per the body's P2, effort/m).
Still live: no merged or open PR references this issue (checked 2026-10-28T01:47Z); nothing has implemented it yet.
Related: part of epic #1149; extends the daily model + route audit #1173. Siblings #1268 (parallel provider fetching) and #1269 (credential lifecycle) feed the same measured-reality record this diff compares against.
Notes / risks: the body's one-line Acceptance was expanded into criteria without changing its meaning. The evidence-rule ordering (console > plan store > tracker prose) is the load-bearing decision — a diff that reports mismatches without naming the winner recreates the manual drift hunt it replaces. No silent auto-fixes is an explicit design constraint, kept as a criterion.
Suggested approach: fixture-first — build the three-source comparison against a planted-mismatch fixture, then wire the daily run into the stewardship cycle log. dezren39 commented on Nov 1, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane C
- Session / ID: queue task 2529
- Found via: queue claim
- Task: Triage feat(quota-plane): plan-store / tracker / measured reconciliation diff (daily) #1270 against current main: verify whether a plan-store / tracker / measured reconciliation diff exists, then route as a scoped follow-up packet or close with evidence.
- Expectation: effort s; done = agent-note triage verdict posted, follow-up packet enqueued if confirmed, labels synced.
- Links: queue task 2529
dezren39 commented on Nov 23, 2026
Agent note · reconciliation — the 2026-11-16 "done" record does not survive fresh verification (Lane EB, 2026-11-22)
Picked up via epic #1149 (its only open sub-issue). Fresh verification this pass, first-hand:
What still holds
- Tool exists:
~/hatch/tools/provider-usage/reconcile.py on the laptop (three-leg diff: plan store / tracker fenced plan-facts / measured snapshot; reports only mismatches; names the winning source; never edits a source).
- Fixture tests pass today:
python3 test_reconcile.py → exit 0, "all reconcile fixture tests pass", including the planted-mismatch case (criterion 3 ✓) and the missing-store failure case per the 2026-11-16 ruling.
- No silent auto-fixes: holds by construction (criterion 4 ✓).
What does not hold
- The fenced plan-facts block the 2026-11-16 run seeded, and its "RECONCILIATION FINDINGS — 2026-11-16" section, are absent from every surviving registry copy — checked this pass: sandbox goal copy, laptop
hatch-personal copy, laptop hatch copy (0 matches for both plan-facts and RECONCILIATION in each). The dated findings list (criterion 2's artifact) does not currently exist, so the diff cannot run against the real tracker today.
- The live plan store (
~/.local/share/opencode/plans.json) is present but still holds 0 plan rows — the seeding correction the first run prescribed never flowed, so the 8 presence findings would recur verbatim.
- No daily cadence is wired: no cron/stewardship definition references
reconcile.py or provider-usage (searched the goal cron copies + ~/workspace/cron.d + system-cron.d). Criterion 1's "daily" is unmet; the 2026-11-16 note's "ready to be called from the stewardship cycle" was never actioned.
Remaining slices, in order
- Re-seed the fenced plan-facts block in the canonical registry (transcribe from the registry's own POOL MAP facts, as the 2026-11-16 run did) and record a fresh dated findings run.
- Seed the plan store's plan rows through the normal edit path — the correction already prescribed by the first run's diff.
- Wire the daily call into the stewardship cycle (its named home) so the diff runs daily instead of once.
#1270 stays open. Nothing here waits on Drew — the two input-contract rulings of 2026-11-16 stand and are implemented in the tool. dezren39 commented on Nov 23, 2026
Lane HC claim — #1270 slices 1+2 (via epic #1149 pickup, 2026-11-23)
Picked up #1149 from fleet agent next; fresh premise check confirms Lane EB's 04:16Z reconciliation: the epic's only open sub-issue is this one, unclaimed since EB's triage note. Taking slices 1+2 in EB's named order:
- Re-seed the fenced plan-facts block in the canonical registry from its own POOL MAP facts; record a fresh dated findings run.
- Seed the plan store's plan rows through the normal edit path.
Slice 3 (wire the daily call into the live stewardship-cycle cron) is a primary-seat scheduling change — left named, not taken by this lane. dezren39 commented on Nov 23, 2026
Lane HC — #1270 slice 1 LANDED: plan-facts tracker re-seeded + fresh findings run recorded (2026-11-23)
What landed (dezren39/hatch-personal commit d960a3919, pushed to main; +121 lines, insertions only, in provider-quota-registry.md):
- The fenced ```plan-facts block exists again in the canonical (laptop hatch-personal) registry copy: 9 rows — claude-max $100/mo, meta-high-usage $15/mo, openai-drewrypope $100/mo, openai-popesdrew $0 (free Student), opencode-go $10/mo (720h window, $60 list cap, calendar reset), command-code-go $1/mo, clinepass $79.92/yr, open-design-go $84/yr, mistral-education $57.50/yr (720h, $15 API budget, calendar reset). Transcribed from Drew's authoritative 2026-11-07 plan dictation + the registry's own pool facts; any field without an established fact is null — no limit or reset rule was guessed. The Muse assistant subscription is deliberately not a row (per the POOL MAP it is not a pool); Antigravity has no row yet — its plan identity/fee is not established in the dictation.
- RECONCILIATION FINDINGS — 2026-11-23 recorded directly under the block (criterion 2's dated artifact exists again): legs plan-store 0 / tracker 9 / measured 0; 9 findings, all
presence — every plan present only in the tracker; no field-level mismatches (no other leg carries values yet).
Verification (first-hand, laptop): python3 test_reconcile.py → "all reconcile fixture tests pass" (incl. planted-mismatch). Real run: reconcile.py --store ~/.local/share/opencode/plans.json --tracker <registry> --measured <snapshot> → exit 0, legs {plan-store: 0, tracker: 9, measured: 0}, the 9 presence findings above.
New finding recorded in the registry: the measured leg is empty because the surviving provider-usage-snapshot.json is dated 2026-11-03 and carries no per-provider plan records — a gatherer/keeper freshness gap; the diff cannot see measured reality until the snapshot flows again.
Remaining slices (in EB's order):
2. Seed the plan store's rows from the tracker rows — still outstanding. This lane did NOT hand-edit plans.json: it is a live fleet store (15 model tier assignments) and its normal edit path / consumer semantics were not verified in this pass; the findings above are the diff the correction should attach, per the tool's design ("corrections flow through normal edit/PR paths with the diff attached").
3. Wire the daily call into the stewardship cycle — a live-cron change; primary-seat scheduling, not taken by this lane.
#1270 stays open on slices 2+3. Nothing here waits on Drew. dezren39 commented on Nov 23, 2026
Claim — Lane KD (archer, sandbox fix lane), 2026-11-23 ~01:20 CST. Taking #1270 slice 2 in Lane EB's named order (Lane HC landed slice 1, comment 7093237096, and left slice 2 explicitly outstanding): seed the plan store's plan rows from the 9 tracker rows through the normal edit path — first verifying what that path is and the store's consumer semantics, per HC's recorded reason for not hand-editing plans.json. Then re-run reconcile.py against the same three legs and record the fresh findings here. Slice 3 (daily stewardship-cycle wiring) is a primary-seat scheduling change — not taken by this lane. If no sanctioned edit path exists, I will record that finding and stop rather than hand-edit a live fleet store. dezren39 commented on Nov 23, 2026
Flag hold — Lane KD (archer), 2026-11-23 ~01:24 CST. #1270 slice 2 is premise-verified, fully prepared, and NOT executed past this point.
Premise verdict: TRUE and unclaimed. Lane HC landed slice 1 (comment 7093237096) and left slice 2 explicitly outstanding. Verified first-hand this pass (read-only):
- The plan store
~/.local/share/opencode/plans.json is present, valid, and holds plans: [] with 15 model tier entries and 0 pools — exactly the state HC recorded.
- The tracker leg is live: the fenced plan-facts block in the canonical registry (laptop hatch-personal
provider-quota-registry.md) carries the 9 rows HC seeded.
- The normal edit path is identified and its semantics verified in source (opencode fork, origin/main
7403b84a0d): the plan_info tool's upsert action calls ModelPlan.upsertPlan(store, patch, now) then ModelPlan.writeStore(...) (packages/core/src/tool/plugin/plan-info.ts:136). writeStore validates the whole store against the Plan schema and replaces the file atomically (temp + rename, mode preserved); readStore throws on a malformed file, so a post-write re-read is a real verification. This is the path HC could not verify in its pass; no hand-edit of the JSON is needed or proposed.
Flag hold: the fork worktree I created for the run (~/wt-lane-kd-1270, branch lane-kd-1270, off origin/main) and its dependency install returned under a platform execution-risk notice. Per the standing rule from the prior holds, I stopped: nothing will be run, imported, built, or tested inside that checkout, and the store has NOT been written. Drew's standing clone approval does not clear a per-item flag — this needs Drew's plain-words go-ahead for this specific slice.
Prepared seed, ready to execute verbatim on approval — one upsert per tracker row through the path above, fields transcribed from the tracker row only (fee currency USD per Drew's 2026-11-07 dictation; verifiedAt = the run date, verifiedFrom = the tracker block and its dictation source):
claude-max (provider claude, label "Claude Max", coverage subscription): fee 100/month; quota window 168h, no limit/reset.
meta-high-usage (provider meta, "Meta High Usage", subscription): fee 15/month; window 168h.
openai-drewrypope (provider openai, "OpenAI drewrypope", subscription): fee 100/month; window 168h.
openai-popesdrew (provider openai, "OpenAI popesdrew", coverage free — free Student per the dictation): fee 0/month; window 168h.
opencode-go (provider opencode-go, "OpenCode Go", subscription): fee 10/month; window 720h, limit 60 (unit usd — the $60 list cap), reset calendar.
command-code-go (provider command-code, "Command Code GO", subscription): fee 1/month; window 720h.
clinepass (provider clinepass, "ClinePass", subscription): fee 79.92/year; no quota window.
open-design-go (provider open-design, "Open Design Go", subscription): fee 84/year; window 168h.
mistral-education (provider mistral, "Mistral Education", subscription): fee 57.50/year; window 720h, limit 15 (unit usd — the $15 API budget), reset calendar.
- All status
active (the tracker value). Window names from the window length (168h = weekly, 720h = monthly); limit-less windows carry unit other — the tracker names no unit and none is invented.
- Safety shape: back up
plans.json beside itself first; the seed script re-reads the store immediately before writing (single read-modify-write via upsertPlan ×9 + one writeStore), then re-reads and asserts plans = 9, models still 15, pools still 0; then reconcile.py is re-run on the same three legs HC used and the fresh findings are recorded here. Expected result if the transcription is right: legs plan-store 9 / tracker 9 / measured 0, and the 9 presence findings clear (the measured leg stays empty — the 2026-11-03 snapshot freshness gap HC recorded is a separate remainder, not part of this slice).
Blocker: Drew's item-specific approval only. Slice 3 (daily stewardship-cycle wiring) remains a primary-seat scheduling change, untouched by this lane either way. dezren39 commented on Nov 23, 2026
Takeover claim — Lane YP (archer), 2026-11-23. Taking #1270 slice 2 under Drew's batch approval of the former flag holds (2026-11-23 07:35 CST, which covers this item).
Lane KD's claim (comment 7094202190) and flag-hold record (comment 7094341501) are orphaned — KD stopped on the platform flag and the lane has been silent since; no other active lane claim covers this slice (full thread re-read this pass, 50/50 comments, count-confirmed). I adopt KD's prepared scope exactly as recorded in 7094341501: seed the plan store's 9 plan rows from the tracker rows through the verified normal edit path (plan_info upsert → ModelPlan.upsertPlan + ModelPlan.writeStore), with the recorded safety shape (backup beside the store, re-read before write, post-write assertions plans=9 / models=15 / pools=0), then re-run reconcile.py on the same three legs Lane HC used and record the fresh findings here.
Slice 3 (daily stewardship-cycle wiring) is a primary-seat scheduling change — not taken by this lane. #1270 stays open after slice 2. dezren39 commented on Nov 23, 2026
Lane YP — #1270 slice 2 LANDED: plan store seeded through the normal edit path; fresh findings recorded (2026-11-23)
Executed Lane KD's prepared scope (comment 7094341501) verbatim under Drew's 2026-11-23 batch approval, adopted via my takeover claim (comment 7103937514). KD's flagged worktree no longer exists on the laptop and its branch was never created — nothing had been run in it and the store was untouched, exactly as KD recorded. I worked from a fresh worktree off current fork main (e8a2cd966b); the dependency install and every step ran without the platform flag this time.
What was done
- Pre-write state verified first-hand:
~/.local/share/opencode/plans.json held plans 0 / models 17 / pools 0. (KD recorded 15 model entries at ~01:24 CST; the live store gained 2 tier entries through normal use in between — the seed's invariant is that the models/pools counts are unchanged by the write, and that is what was asserted.)
- Backup taken beside the store first:
plans.json.bak-2026-11-23-1270-slice2 (mode 600, byte count identical to the pre-seed file).
- Seed ran through the verified sanctioned path — one script performing a single read-modify-write:
ModelPlan.readStore → ModelPlan.upsertPlan ×9 (one per tracker row, fields transcribed from the tracker rows only) → one ModelPlan.writeStore, importing the module from the fresh main worktree so the write went through full schema validation and the atomic temp+rename replace. Post-write re-read through readStore (which throws on a malformed store) asserts: plans = 9, models = 17 (unchanged), pools = 0 (unchanged). Store file mode still 600.
- The 9 rows: claude-max, meta-high-usage, openai-drewrypope, openai-popesdrew (coverage
free, fee 0 — free Student per the dictation), opencode-go (720h window, limit 60 USD, calendar reset), command-code-go, clinepass (no quota window), open-design-go, mistral-education (720h, limit 15 USD, calendar reset). All status active; verifiedAt = the run timestamp; verifiedFrom names the tracker block and its dictation source. One mapping the schema forces: the tracker writes fee periods as month/year, the store schema (Period) admits only monthly/yearly/once, so the rows carry the schema's words for the same facts.
Fresh findings (same three legs Lane HC used; test_reconcile.py passes, incl. the planted-mismatch case)
- Legs: plan-store 9 / tracker 9 / measured 0.
- The 9
presence findings from HC's run are gone: every tracker plan now has a store row, and fee amount, window, limit, reset and status agree on all 9.
- 9 findings remain, all
fee_period, winner plan-store: the vocabulary gap named above — reconcile.py compares the raw strings, so the store's monthly/yearly reads as drift against the tracker's month/year on every run. This is a tool vocabulary defect, not data drift; the correction path (normalise the period vocabulary in reconcile.py, with fixture coverage for the schema's words) is filed as fix(quota-plane): reconcile.py fee_period vocabulary mismatch reports permanent drift #13375. Nothing was auto-edited.
- The dated findings are also recorded in the registry (RECONCILIATION FINDINGS — 2026-11-23 (post-seed run) section; hatch-personal commit
43dd53a17, pushed to main).
- Measured leg still empty — the 2026-11-03 snapshot freshness gap HC recorded is unchanged and remains a separate remainder.
What remains on #1270
- Slice 3: wire the daily call into the stewardship cycle — a primary-seat scheduling change, not taken by this lane (named here so the issue's remaining scope is explicit).
- The fix(quota-plane): reconcile.py fee_period vocabulary mismatch reports permanent drift #13375 vocabulary normalisation, once landed, should take the daily diff to a no-drift result on the store↔tracker legs.
- The measured-leg freshness gap (snapshot dated 2026-11-03) still needs the gatherer/keeper flow restored before the diff can see measured reality.
#1270 stays open on slice 3. There is no PR for this slice by design: the correction's normal path for a live data store is the plan_info upsert itself, and the only repo-side change (the registry findings section) landed as the hatch-personal commit above, mirroring Lane HC's slice 1. dezren39 commented on Nov 23, 2026 Lane ZS — store↔tracker drift note from the #13375 landing.
#13375 (fee_period vocabulary mismatch in reconcile.py) is fixed and closed: PR #13395 merged (22ec90b9c29d). The diff now canonicalises fee_period to the tracker vocabulary for comparison only; findings keep raw per-leg values.
Post-fix live-input reconciliation (laptop plan store ~/.local/share/opencode/plans.json, this registry's plan-facts block, current snapshot): no-drift overall — legs plan-store 9 / tracker 9 / measured 0, zero findings. The 9 vocabulary findings from the post-seed run are gone, and no other store↔tracker field drift remains.
Remaining known gap is unchanged and already recorded here: the measured leg is empty because the surviving snapshot carries no per-provider plan records (gatherer/keeper freshness), so the diff still cannot see measured reality. This issue stays open on its remaining slices. dezren39 commented on Nov 24, 2026 Second-pass verify (lane code-h, task 21742), fresh state 2026-11-24:
Verdict: substantially delivered; remainder is an owner scheduling decision — no packet routed.
dezren39 commented on Nov 26, 2026
Triage (queue task 24955, lane 11, 2026-11-26): the 2026-11-24 verdict stands, and nothing has changed since.
- Slices 1 and 2: landed. Tracker rows and plan-store rows were seeded.
- The no-drift result: holds. After fix(quota-plane): canonicalise fee_period vocabulary in reconcile.py diff (#13375) #13395, a live-input run found zero findings.
- The daily schedule: still open. Wiring the daily call into the live stewardship-cycle cron is a scheduling change on the primary seat, which is an owner call.
- The measured leg: still empty. The snapshot carries no per-provider plan records, so the diff can't see measured reality until gatherer/keeper freshness is fixed.
No worker packet is routed, because neither remainder has an executor a lane can act on.
Generated by Claude Code dezren39 commented on Nov 27, 2026
Triage — xaltha lane, queue task 25452 (coverage-reconciliation re-import), 2026-11-26
Revalidated #1270 first-hand this pass; the 2026-11-24 pass-2 verdict (task 21742) and the 2026-11-26 triage (task 24955) stand unchanged:
Remaining — neither has a lane executor:
- Slice 3: wire the daily
reconcile.py call into the live stewardship-cycle cron — a primary-seat scheduling change / owner decision, repeatedly named-not-taken by prior lanes.
- Measured-leg freshness gap: the surviving snapshot carries no per-provider plan records (dated 2026-11-03), so the diff cannot see measured reality until the gatherer/keeper flow is restored.
Disposition: triaged per task 25452 acceptance — issue stays OPEN on slice 3 + the measured-leg gap above. No code change, worktree, or PR this run; routing a worker packet for slice 3 would manufacture queue work with no executor.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|