Skip to content

Establish Muse Code quota acquisition and truthful native provider states #522

Closed

Description

@HemSoft

Description

Franz's October 26 request includes iOS. The ProviderID registry and live refresh registry do not include Muse Code. Its widget publisher and watch coordinator consume iPhone results.

Vendor-advertised contract: the official changelog describes non-inference muse usage in 1.4.13, MSP usage/read and usage/changed for last-seen five-hour/weekly windows, and run.usage with per-model tokens separately from allowance. These capabilities do not prove a current account reading.

Observed by the authorized fleet owner on Home at 05:34 EDT, October 26: pinned Muse Code 1.4.13-R6996.1; one usage --help, then one usage --json with login/auto-update disabled and environment META_API_KEY excluded. Exit 0; allowlisted payload {"schemaVersion":1,"allowance":null}. The observed schema also has reason:string and hint:string; their free-form values were omitted and raw output was not retained. This proves the command ran, not zero usage, entitlement, subscription billing or inference. Tier, billing type, pool/model scope, used/remaining units/values and reset times remain unknown. Native stored credential context can differ from an exported PAYG key. No login, auth-file read, credential transfer, config change or inference occurred; no repeat probe is authorized by this issue.

Sources: Meta subscriptions, Wonder Full availability, authentication precedence, and CLI changelog. A desktop CLI read is not proof of a supported phone authorization-to-quota flow. No such iOS acquisition contract has been verified. Repository setup rules require guided phone setup and forbid token/cookie/JSON import as routine setup. Establish that contract first and record any exact external registration/API availability block; do not promise live quota before it exists. Coordinate source semantics with https://github.com/hemsoft-dev/chief/issues/22.

This is issue intake only. Fleet CLI/provider installation, settings, authorization and inference verification belong to the existing fleet worker. No host setup, secret extraction, private endpoint discovery, purchases or implementation dispatch is authorized by this issue. Preserve existing priorities and protected work. Preserve P0 release work and PR #521. This issue does not schedule or reprioritize implementation.

Desktop source-contract peers: hemsoft-dev/codexbar#273, hemsoft-dev/codexbar-mac#199 and hemsoft-dev/hs-pi-dashboard#70. Their CLI support does not resolve the phone acquisition gate.

Why

Users need the real subscription allowance. Desktop session totals or a PAYG key would give a misleading phone experience.

Goal

Provide a compliant native Muse Code connection where supported, with verified quota semantics and explicit unavailable states wherever acquisition remains unsupported.

Acceptance Criteria

  • Accept schema version 1 with nullable allowance. allowance:null with exit 0 is unavailable quota, distinct from genuine numeric zero. Handle reason/hint as untrusted diagnostics with safe allowlisting/redaction, never raw identity-bearing text. Preserve unknown billing/tier/scope/unit/reset fields and handle unsupported schema versions safely.
  • Use the subscription name Muse Code. Preserve returned tier, billing mode, observation time, units and pool/model scope. Show Wonder Full only where the source identifies it; a catalog model listing alone proves neither inference nor entitlement. Keep OpenCode Muse Spark and PAYG Meta API pools separate.
  • Preserve supported short-window and weekly used/remaining values and reset timestamps, including independent model-specific windows if returned. Verify fraction versus percentage and used versus remaining direction from the pinned contract. Never derive absolute caps from plan multipliers, token totals or the published prompt range; monthly renewal is not a quota reset.
  • Missing, stale, malformed or unsupported readings, expired authorization, wrong billing mode, insufficient entitlement, rate limits and transport failures remain distinguishable and unavailable. Missing data never becomes zero, unlimited, a healthy state or spare capacity. Keep valid neighboring windows and last-good timestamps without claiming freshness.
  • Keep consumed tokens and model/session activity separate from remaining paid-subscription quota. Any projection, alert or SUS requires the corresponding verified quota, duration, scope and reset; otherwise show unavailable and exclude that score. Never sum the same subscription across machines or models.
  • Document an executable, supported iPhone authorization-to-allowance path with account binding and a sanitized production-parser fixture before claiming live support. Handle cancellation, expiration, reconnection and late responses after account switches. Protect credentials in Keychain. Do not require desktop credential export/import, a CLI on iPhone, a PAYG key or undocumented endpoints.
  • If the phone acquisition contract remains unavailable, expose that exact capability limit, keep the live quota work explicitly blocked and complete independently testable native state/schema work without fabricating data. This is distinct from Franz's later live account comparison.
  • Integrate verified results into account settings, dashboard, history, metric choices, alerts, widget snapshots and iPhone-to-watch/complication publication. Existing saved configurations, old snapshots and other providers remain compatible; widget/watch consumers receive no provider secrets or new provider networking.

Definition of Done

  • Add sanitized contract fixtures for measured usage, genuine zero, exhausted allowance, reset rollover, partial/missing fields, malformed units/values, stale cache, PAYG, denied entitlement, expired auth, timeout and rate limiting. Prove token/activity-only data cannot become quota.
  • Document the pinned CLI/schema version, field mapping, source freshness and scope, acquisition limits and known unsupported states. Include backward-compatibility coverage for old persisted data and existing providers.
  • Complete the repository's applicable quality gates and current-head review. Do not claim live account compatibility from fixtures.
  • Cover phone result-to-widget/watch round trips and existing CodexBar Pro access/account rules. Update the changelog and acquisition/unsupported-state documentation. Keep the automatic CI cost ceiling intact.

Validation

  • On authorized Apple infrastructure, use the native build/unit, pinned lint and SwiftPM smoke commands in AGENTS.md. Run relevant watch tests if its contract changes; keep costly new checks local or manually dispatched. Do not run the full release UI gate for routine PRs.
  • With sanitized fixtures, inspect the full provider-to-dashboard/widget/watch flow for valid, partial, unsupported acquisition, expired auth, exhausted and stale readings. Assert unknown values cannot trigger healthy quota alerts or SUS.
  • Franz owns later real-account phone sign-in and comparison; record it as pending without making it a prerequisite for delivering independently validated app work. App registration/acquisition design remains engineering work.
  • In the eventual PR, embed current-head screenshots uploaded as GitHub attachments with CLI --attach, proving measured, partial, exhausted, unavailable/auth-error and stale states. Include a short recording for setup/refresh interaction when practical, or state the concrete reason it is omitted. No runtime UI was started for this issue-only research; the provider is absent and protected owners remain active.

Activity

  1. HemSoft commented on Oct 27, 2026

    @HemSoft
    CollaboratorAuthor

    Phone-side source research (2026-10-26 20:05 ET)

    Result: no supported iPhone authorization-to-allowance path exists today. Live Muse Code quota on iPhone stays blocked. This PR covers the native schema/state work and an explicit "not available on iPhone" state, and acquires no data.

    Public first-party sources checked:

    Question Finding Source
    Can a third-party app use the subscription credential? No. "This credential is for use with Muse Code only." Subscriptions "work only through the Muse Code CLI while signed in with your Meta Model API account." Other keys are pay-as-you-go. Subscriptions
    Is there an OAuth, device-code or client-registration flow for apps? Not documented. Muse Code itself supports browser sign-in into the CLI, a pasted key, META_API_KEY and muse auth set. Precedence: env key, then stored key, then browser session. Authentication
    Is there an HTTP usage or allowance endpoint? No. The API reference covers Responses, Chat completions, Messages, Files, Images, Voice and Models only. The web Usage dashboard shows PAYG token consumption, not the subscription allowance. API reference, Billing
    What reads the allowance? Only the CLI and its local host: muse usage / muse exec --json run.usage (1.4.11, 1.4.13), and MSP usage/read / usage/changed on muse serve (1.4.0). MSP is a local session protocol between an app and a spawned muse host, not a network API. Changelog

    Why the Grok precedent (GROK-CONSUMER-CONTRACT.md) does not carry over: xAI publishes OIDC discovery with a device-code grant and a public CLI client, and its billing read is a bearer-token HTTP call. Meta documents neither a phone-usable grant nor a usage endpoint. It also restricts the subscription credential to Muse Code. Lifting the CLI's private sign-in or scraping the web dashboard would mean undocumented endpoints and cookie/credential handling, which this issue and AGENTS.md forbid. No private endpoint was probed.

    Exact missing items that would unblock live quota:

    1. A Meta-supported authorization a third-party iOS app can complete on the phone (OAuth/OIDC authorization code or device code with a registrable client) whose grant covers reading the Muse Code subscription allowance.
    2. A documented network endpoint that returns the allowance for that grant (the muse usage --json schema 1 shape, or equivalent).

    Neither the desktop CLI nor a self-hosted feed resolves this for App Store users.

    What the iOS change will do now (design under review, details in the PR):

    • Adds Muse Code to the provider registry, but it can't be added as an account. Add Account lists it under "Not available on iPhone" with the reason above. No account, refresh, network call, credential, widget or watch entry is created.
    • Adds a native schema-1 parser that follows the shipped producer contract (hs-pi-dashboard#71, field map) and codexbar#274. allowance:null is unavailable, not zero. reason/hint are never surfaced. Windows are validated independently. Token totals never become quota. There is no SUS and no price.
    • Adds distinct unavailable states, including the acquisition limit, with sanitized fixtures and tests. A fixture-only mapping covers dashboard, widget and watch, so a future supported source has a tested path.

    Council: none consulted · missing: GPT 6.1 Sol (Codex weekly pause, 20% used, 188% projected, usage.py 20:00 ET), Muse Wonder Full 1.0 (muse-code Weekly pause, 35% used, 245% projected) · Council unavailable. An independent Claude Opus 5.5 design critique (not a seat) is running as a P0 safeguard.

    Franz's live phone sign-in and quota comparison remain pending and are not possible until the items above exist.

  2. HemSoft commented on Oct 27, 2026

    @HemSoft
    CollaboratorAuthor

    Delivered (2026-10-26 23:49 ET)

    Merged in #525 as fc55494, from reviewed head 6c4f7f7.

    • Outcome: no supported iPhone authorization-to-allowance path exists, so live Muse Code quota stays blocked. The exact missing items are in the research comment and MUSE-CODE.md.
    • Users see: Add Account says Muse Code isn't available on iPhone, and why. Muse Code can't be added, refreshed, scored or hold an account slot.
    • Ready for a future source: a native schema-1 reader with distinct unavailable states and sanitized fixtures, plus widget, watch and history round trips.
    • Validation:
      • SwiftLint: 0 violations.
      • Full CodexBarIOSTests: 1,182/1,182.
      • SwiftPM smoke harness: passed.
      • Coverage: the Muse reader and its fixture are at 100% function coverage.
      • Screenshots: six current-head simulator screenshots are in the PR.
      • Automatic CI: unchanged.
    • Reviews:
      • Codex's review of bd7fda5 hung for more than an hour after the re-request.
      • An independent Claude audit-pr review found one Medium item: fixture function risk. It was fixed in 6c4f7f7.
      • Codex's review of 6c4f7f7 was clean ("Didn't find any major issues").
    • Pending: Franz's live phone sign-in and quota comparison. It isn't possible until Meta ships a supported source. The release gates (iOS/watch tests, function risk, full UI validation) run before the next submission as usual.

    Council: none consulted · missing: GPT 6.1 Sol (Codex weekly pause), Muse Wonder Full 1.0 (muse-code Weekly pause, 245% projected) · Council unavailable. An independent Opus 5.5 design critique was used instead (not a seat): adopted 9, declined 1 (out-of-order observation guard; there's no source yet, so it's recorded as a future requirement).

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions