Skip to content

impl(quota-plane): stage-3 S3 — shadow placement: forecast-informed ordering logged beside live ordering #12697

Closed

Description

@dezren39

Stage-3 epic #12694, slice S3. Design record: doc/2026-11-22T22-35-00Z_design_quota-plane-stage-3/ (issue #1177; hub copy files/stage-3-design-2026-11-22.md in the usage-billing-hub goal files).

Gate: work starts after Drew's review of the Stage-3 design doc (per #1177's method).

Scope: Compute the placement/rotation ordering the forecast implies (burn-by-expiry adjusted by projected exhaustion: a pool projected to wall before its reset is demoted before it reaches the caution zone) and log it beside the live ordering in the admission/claimant path, with a per-decision diff record. No live effect: the live ordering is untouched. Mirrors the quota-admission-shadow pattern already in the stack.

Acceptance criteria

Activity

  1. developing-today commented on Nov 22, 2026

    @developing-today
    Contributor
  2. added
    kind/featureNew feature or capability request
    priority/normalOrdinary priority (the default)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 22, 2026
  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Picked up by felix — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while felix posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Progress from felix: still working

  5. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Progress from felix: still working

  6. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: implementation landed (PR open for Felix's review)
    by: agent felix (kind muse, Muse sandbox seat)
    at: 2026-11-22

    PR #12748 — Stage-3 S3 shadow placement, per design D3. NOT a close: acceptance criterion 1 (≥1 week of shadow diff records, summarized on #12694) is calendar time that starts at the first laptop tick running the merged code; this issue stays open for it, like S1's live-acceptance week.

    What landed:

    • src/quota-shadow-placement.ts — pure per-tick projection emitting the diff record: live ordering (burn-by-expiry from measured data only; tiers open → unknown → caution ≥85% → walled, soonest reset first; unknown is not closed), shadow ordering (one adjustment: an open pool projected to wall before its reset is demoted into the caution tier, before the caution zone), and per pool the measured inputs, every forecast window row with its honesty state + consumed/excluded verdict, both ranks, and movement reasons. Decision point = the gatherer tick, with the current/forecast products' generatedAt stamps — S7 has everything it needs to score shadow-vs-live.
    • gather-quota.ts publishes it after the forecast block (after every live output): quota-shadow-placement.json (latest) + quota-shadow-placement-history.jsonl (one line per tick), fail-soft; a failed forecast still yields a record with shadow == live. No live path reads the record.

    S2's findings bind consumption, as specified: the bare opencode-go monthly forecast is never consumed (mixing artifact; exclusion logged on the record) while per-workspace monthly rows are; insufficient-history rows are logged, never consumed; a stale forecast reading degrades to no forecast. The forecast can never promote a measured demotion, remove a pool, or close anything.

    Evidence (sandbox): fail-before module-not-found on pristine main; 14/14 new tests incl. the no-live-effect battery (live ordering identical across null/empty/all-wall/honesty-only/stale forecast variants); neighbours 82/82; full aggregator suite 3,225 pass / 4 fail, the 4 identical on pristine main (verified in a scratch worktree); tsc + biome clean. No new dependencies.

    Remains: the accumulation week (starts on the same laptop aggregator redeploy #12718 and S1's live acceptance wait on), then the summary on #12694 and close. S4 (#12698) reads this record's evidence; S5–S7 untouched.

  7. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Released by felix (outcome: free). S3 shadow placement implemented: PR #12748 open for Felix's review (pure quota-shadow-placement.ts projection + gather-quota per-tick publication of quota-shadow-placement.json/.jsonl history). 14/14 new tests, neighbours 82/82, full suite 3225/4 with the 4 identical on pristine main; tsc+biome clean; no new deps. Issue stays open for the >=1-week shadow accumulation, which starts at the laptop aggregator redeploy (same gate as #12718/S1 live acceptance); summary then posts on #12694.

  8. added and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 23, 2026
  9. added a commit that references this issue on Nov 23, 2026
  10. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: implementation merged; acceptance clock pending
    by: agent felix (kind muse, Muse sandbox seat)
    at: 2026-11-22

    Merged: PR #12748 (shadow placement). Felix re-ran the suite at review: 14/14, 63 expects. The shadow record (quota-shadow-placement.json + per-tick history jsonl) is written after every live output, fail-soft; the no-live-effect property is structural (live ordering computed from quota-current alone) and pinned by test across forecast variants. S2's bindings are in code: the bare opencode-go monthly forecast is never consumed (exclusion logged), insufficient-history rows are logged not consumed, stale-window forecasts degrade to none.

    #12697 stays open for acceptance criterion 1: ≥1 week of shadow diff records from the laptop running the merged code — the same aggregator redeploy that #12718 and S1's live acceptance wait on. The shadow week starts at the first such tick; S4 (#12698) reads this record's evidence and stays gated until the week exists.

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/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)queue/queuedHas a queued queue taskstatus:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions