Skip to content

feat: add Muse Code allowance to Rust dashboard and widgets (#273) - #274

Merged
HemSoft merged 8 commits into
mainfrom
t3/muse-code-provider-ui
Oct 27, 2026
Merged

HemSoft merged 8 commits into
mainfrom
t3/muse-code-provider-ui

Conversation

@HemSoft

@HemSoft HemSoft commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds opt-in Muse Code subscription allowance across the Rust provider registry, settings, refresh, dashboard, account history, alerts and widget feed. Reads schema-1 muse usage --json through the contained runner with child-only environment/cwd/output limits. Preserves source observation and fetch times, independent valid siblings and last-good history. Null stays unavailable; token activity never becomes quota. Muse has no SUS or price.

The contract follows the shipped Pi implementation at 588be884. MUSE_CODE.md records the field map, acquisition/freshness policy, consumer inventory and limits. Free-form reasons cannot safely distinguish expired auth, entitlement denial, PAYG or rate limiting; those diagnoses remain unsupported.

The cached-alert review finding is addressed by a validated per-metric evaluation context. Alert condition, severity, outlook and ordering use the same source assessment after actual-now freshness/reset checks. Relative exhaustion countdowns advance from that anchor to wall time once and clamp at zero. At-reset percentages, Early-before-reset gaps and observed quota stay unchanged. Reset countdowns use actual wall time.

Metrics collection also retains bounded failure evidence before cleanup while preserving the original exception and strict merge. The 098eba8 hosted failure rejected a raw profile after successful suites and produced no comparison. Its cause remains unknown. Profiles are never repaired, filtered, discarded or retried by the collector.

Closes #273.

Acceptance Criteria

  • Pinned used-percent schema/units, independent window validation, safe diagnostics and honest unknown scope/billing handling.
  • Provider/settings/refresh/account/table/focus/history/alerts integration with stable account and metric keys.
  • Bounded noninteractive acquisition, five-minute/reset cache and bounded failure backoff across adapter reconstruction.
  • Production adapter → account persistence → widget file → actual widget reader synthetic round trips and legacy compatibility.
  • Source-clock alert consistency, real-time countdowns, stale/expired suppression and valid sibling preservation.
  • Real exact-head GPUI evidence below, with fresh explicit isolated settings.

Definition of Done

  • Measured provenance plus synthetic zero/exhausted/partial/malformed/reset/stale/null/unsupported/failure/activity coverage.
  • Contract, unsupported diagnoses and serialization consumer inventory documented.
  • Local product gates and actual rendered evidence completed for source committed at 72a1ee631f7a1e8be4cdee79f77ed8adab68374d.
  • Current-head Codex review clean, zero unresolved threads, all seven CI jobs and all three Package jobs passed at 72a1ee631f7a1e8be4cdee79f77ed8adab68374d.

Validation

Head 72a1ee631f7a1e8be4cdee79f77ed8adab68374d; base 7bb492fd3622727eee81b1e31f7256a15e71c3dd. Bound branch t3/muse-code-provider-ui; worktree clean at capture.

  • cargo fmt --all --check: passed.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed.
  • cargo test --workspace --locked: passed, 1,032 tests plus the standalone contained-command fixture; 5 existing ignored tests unchanged.
  • cargo clippy -p codexbar-app --all-targets --features capture --locked -- -D warnings: passed.
  • npm run lint:md and git diff --check: passed. The existing dependency future-compatibility notice for block v0.1.6 remains unchanged.
  • Deterministic RED/GREEN: at old a169450, a fresh five-minute cached source triggers the alert while its detail incorrectly reports Normal. At 6a2415f, actual GPUI shows the related relative countdown mismatch. Current tests verify severity/observed/is_projected/outlook/summary, warning-only ranking, notification deduplication, old-key recovery, stale/expired guards, valid Weekly siblings, zero-crossing clamp and legacy delta 0. The production adapter cache preserves original observation and fetch times. Real table, card/takeaway, bar accessibility/hover and actual widget-reader paths agree.
  • The unchanged pinned AST adapter reports zero paired-function CC increases against the retained base. Alert detail/account-alert complexity remains 8/14. The current-head Linux metrics gate passed with no failures: production lines improved from 87.689269% to 88.025586%, and branches from 79.102783% to 79.767064%. Base and candidate were measured on the same Linux/x86_64 host with unchanged tools, scopes, exclusions and thresholds. The verified metrics artifact SHA-256 is e86a5c87c1386a15880e215649d832a5bb4c59ec47de2d4eebc24f17f25f80f8.
  • The failure-retention Python files, workflow, measurement operations/inputs, scopes, exclusions and thresholds are unchanged by these alert fixes. Their 13 contract tests and real uncovered-regression rejection remain retained from a169450; no script rerun was needed for unchanged tooling.
  • Native Windows desktop screenshots remain explicitly deferred. The actual shared widget consumer is tested synthetically and shown through the real macOS GPUI preview. No live vendor/account compatibility is claimed.
  • A recording is omitted because this is static quota/alert wording through existing navigation, with no new interaction or animation. Fixed-clock before/after renders and deterministic elapsed-time tests cover the time semantics.

Repeatable exact-head capture, starting with a fresh directory:

CODEXBAR_SETTINGS_DIR=/tmp/codexbar-273-head-72a1ee6/settings \
CODEXBAR_CAPTURE_DIR=/tmp/codexbar-273-head-72a1ee6 \
CODEXBAR_CAPTURE_MUSE=1 \
cargo run --locked --features capture -p codexbar-app -- --demo

All new after images are actual macOS GPUI renders from 72a1ee631f7a1e8be4cdee79f77ed8adab68374d, light theme, 2880 × 1922, synthetic data and no live provider polling. The two before images identify their own source commits. Earlier captures without explicit settings isolation are not used or uploaded.

Before, exact base: no Muse provider in the sanitized demo table.

Base before, 7bb492f: Muse provider absent

Before the relative-countdown follow-up, exact 6a2415f: the alert severity is already corrected, but the table/takeaway say 1h 58m to exhaustion while reset is in 1h 55m and the gap is 2m early.

Before countdown correction, 6a2415f cached alert

After, exact current head: source 60.5% is displayed rounded to 60%; the original at-reset 101% projection and 2m Early gap remain. Every relative exhaustion countdown is now 1h 53m, while reset stays 1h 55m. Valid Weekly keeps its independent alert.

Current cached alert table and detail

Current cached alert actual widget-reader preview

Current-head allowance and freshness states

Measured 15% short / 5% weekly, source observation retained; no Muse SUS or price.

Current measured table and detail

Current measured actual widget-reader preview

Invalid short sibling stays n/a; valid Weekly stays 5%.

Current partial table and detail

Current partial actual widget-reader preview

Exhausted quota caps bars at 100% while preserving raw forecast usage; uncovered eligible widget quotas are red.

Current exhausted table and detail

Current exhausted actual widget-reader preview

Null allowance is unavailable/n/a, with no zero, unlimited or spare-capacity claim.

Current null table and detail

Current null actual widget-reader preview

Failed refresh retains original sample clocks and explicit stale/last-known status.

Current timeout table and detail

Current timeout actual widget-reader preview

Source older than 420 seconds keeps its timestamps and suppresses current forecasts; widgets are neutral.

Current stale table and detail

Current stale actual widget-reader preview

Current-head reset rollover and settings

Before reset, short quota remains current.

Current reset-before table and detail

Current reset-before actual widget-reader preview

After reset, still inside source freshness, short quota is n/a and cannot forecast or alert; valid Weekly remains current.

Current reset-after table and detail

Current reset-after actual widget-reader preview

Opt-in settings explain the existing CLI-only session contract.

Current Muse settings

Prior 098eba8 render evidence retained, 18 image links

These prior images and their verified byte hashes remain preserved. They are earlier evidence, not exact current-product renders.

@HemSoft
HemSoft marked this pull request as ready for review October 26, 2026 21:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T23:25:51.220824Z 72a1ee6 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4084236c67

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/codexbar-store/src/history.rs Resolved
@HemSoft

HemSoft commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 25f8c213cd

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@HemSoft

HemSoft commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 098eba86cc

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@HemSoft

HemSoft commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a169450430

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/codexbar-core/src/alerts.rs Resolved
@HemSoft

HemSoft commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 6a2415fc89

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@HemSoft

HemSoft commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 72a1ee631f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Muse Code subscription metrics to the Rust app and widget feed

1 participant