Skip to content

design(core): one quota signal, three consumers — shared QuotaSnapshot and weight-layer contract for #566/#567/#568 #587

Open
2 of 2 issues completed

Description

@dezren39

Decision needed (one line): Adopt the shared-contract design — one derived QuotaSnapshot signal, gates filter candidates before weighting, the burn-rate controller writes only through the existing tuner Adjustment channel — or keep #566/#567/#568 as three independent features with separate quota reads and config?

Summary

Three features filed the same day — #566 (quota-aware session placement), #567 (time-based weighting), #568 (native quota intelligence / burn-rate controller) — each presuppose a quota signal and a shared weight model that none of them defines, and each sketches a different config surface to do it. This design is the missing contract: (1) a QuotaSnapshot value derived from data the fork already owns (ModelPlan windows + windowReport() usage), with one staleness rule where unknown/stale is never treated as headroom; (2) a layering rule — gates (#566) filter candidates before weighting, weights rank survivors through the existing weightOf layers, the controller (#568) writes only expiring Adjustments like the tuner already does, and credential failover (#6) stays orthogonal inside an attempt; (3) per-layer weight attribution in the decision log so "why is this model ranked here?" is answerable for all three.

This extends — does not duplicate — the existing thread: #566, #567, #568, #6 stay as the implementation vehicles for phases 3–5. It also closes a roadmap gap: ROADMAP.md → "Routing, cost and plans" lists #6–#10 but has no row for #566/#567/#568. Full design doc: files/designs/opencode-quota-signal-routing.md in the keep-the-four-repos-healthy goal workspace (registered in files/potential-projects.md).

Current state (evidence)

Proposal (point of view)

Phased breakdown

  1. Phase 1 — QuotaSnapshot derivation + staleness contract. Pure module over ModelPlan + windowReport() data; unknown/stale rules; unit tests (missing limit, missing windowHours, stale observation, threshold boundaries). No selection behaviour change. (Filed as a sub-issue of this design issue and enqueued.)
  2. Phase 2 — Per-layer weight attribution in the decision log. Traced weight computation; traced weights must equal weightOf weights; surfaced via existing route-review tooling. No behaviour change. (Filed as a sub-issue of this design issue and enqueued.)
  3. Phase 3 — Quota gates on the snapshot. The existing Quota-aware session placement: filter by quota % and session type (root vs subsession) #566, re-scoped onto this contract once the decision lands. (Not re-filed — Quota-aware session placement: filter by quota % and session type (root vs subsession) #566 is the vehicle.)
  4. Phase 4 — Controller as adjustment producer. The existing Native quota intelligence: burn-rate estimation and dynamic reprioritization to consume quota before reset #568; its telemetry acceptance is narrowed by Phase 1. (Not re-filed.)
  5. Phase 5 — Time-based model/provider weighting: peak/off-peak profiles and temporary priority windows #567 close-out. Verify WeightRule windows/boosts against Time-based model/provider weighting: peak/off-peak profiles and temporary priority windows #567's acceptance; inspection surface on Phase 2's attribution; retire its separate config sketch. (Not re-filed.)

Open questions (in the design doc, deliberately not filed as issues)

Non-goals

Related

Acceptance criteria

Activity

  1. added
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    priority/highImportant and time-sensitive
    app/corePackage: core (pkgs/ or apps/ in this repo)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    meta/epicEpic / cross-repo tracker
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
  3. dezren39 commented on Oct 27, 2026

    @dezren39
    Author

    🤖 Agent note · filed

  4. dezren39 commented on Oct 29, 2026

    @dezren39
    Author

    DREW DECISION (2026-10-29, main chat): ADOPT the shared QuotaSnapshot contract — one quota read shape consumed by the placement features (#566, #567, #568), not three private reads. Drew's note: this is what should have been done to begin with. #566 is unblocked by this ruling.

  5. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    and removed
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    on Oct 29, 2026
  6. developing-today commented on Nov 3, 2026

    @developing-today

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7041 (triage, queued, priority 50) in repo-health-opencode-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

  7. dezren39 commented on Nov 4, 2026

    @dezren39
    Author

    Triage (task 7041): design state confirmed — DECIDED, not awaiting a ruling. Drew ruled on this issue on 2026-10-29: ADOPT the shared QuotaSnapshot contract ("one quota read shape consumed by #566, #567, #568, not three private reads"), explicitly unblocking #566.

    Routing from here:

    This epic stays open as the tracker for the contract; it closes when the phase vehicles land, not on the decision alone.

  8. added and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  9. dezren39 commented on Nov 4, 2026

    @dezren39
    Author

    Decision of record: ADOPT — recorded late. Drew ruled ADOPT on this design on 2026-10-29 (adopt the shared QuotaSnapshot contract and weight layer for #566/#567/#568, Phase 3 scope as designed). The ruling was never transcribed onto the issue, so #566 sat user/escalated and its queue task 7038 sat blocked waiting on a decision that had already been made. That blockage is cleared now: #566's escalation labels are removed and task 7038 is requeued. This issue stays open as the epic tracker for the three consumers.

  10. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

    Partial verification — staying open (2026-11-07 done-task-only audit, tracking: developing-today/code#7016).

    Queue task(s) [7041] were marked done, and some work did land:

    No merged change closes this issue's full scope, so the done status is not treated as completion. Remainder re-queued as triage task 11490.

  11. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

    🤖 Agent note · triaged

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/corePackage: core (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-inskind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/epicEpic / cross-repo trackerpriority/highImportant and time-sensitivesource/design-architectFiled by the repo design architect jobstatus/in-progressActively being workedtask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions