Skip to content

feat: add Codex capacity observations#79

Merged
galligan merged 1 commit into
mainfrom
dis-35-add-codex-account-and-capacity-probes
Jul 11, 2026
Merged

feat: add Codex capacity observations#79
galligan merged 1 commit into
mainfrom
dis-35-add-codex-account-and-capacity-probes

Conversation

@galligan

@galligan galligan commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Context

Codex 0.144 exposes account identity, multi-bucket capacity, reset-credit inventory, and historical token usage through stable App Server reads. Dispatch needs a redacted provider-neutral observation before it can expose a trustworthy usage surface or make future routing decisions.

Closes DIS-35.

What changed

  • add typed account/read, account/rateLimits/read, and account/usage/read client methods
  • model signed-in/signed-out accounts, multi-window and multi-limit snapshots, spend controls, reset credits, summaries, and daily buckets
  • add a normalized provider-level stream for threadless account/rateLimits/updated notifications
  • persist schema-v17 provider capacity observations keyed by provider, host scope, and config scope, replacing the current row instead of growing duplicates
  • mask account labels and fingerprint account/reset-credit identity; raw email, auth fields, balance strings, raw responses, and mutation handles are not persisted
  • retain precise account, capacity, usage, and per-window observation timestamps
  • merge sparse rate-limit pushes by limit/window identity without erasing unmentioned weekly or individual windows
  • make ready, partial, signed-out, disabled, unsupported, and unavailable states explicit
  • add generated schema guards, synthetic fixtures, migrations, SQL compatibility coverage, research notes, and ADR-0023 storage guidance

Verification

  • just check: 497 passed, 14 live tests deselected; Ruff, format, strict mypy, wheel/sdist build, and package contents passed
  • real local 0.144 App Server smoke called all three reads without a model turn and printed only the redacted Dispatch observation
  • fixtures cover current, partial, signed-in, signed-out, multi-bucket, reset-credit, and daily usage shapes
  • targeted local review round 2: 5/5 clean, zero open P0/P1/P2

Risk and rollout

This slice adds storage and typed probe behavior but no new public command. The dependent DIS-39 slice derives dispatch usage and grouped MCP reads from this substrate. Reset credits remain read-only; no redemption path is added.

@linear-code

linear-code Bot commented Jul 11, 2026

Copy link
Copy Markdown

DIS-35

galligan commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@galligan galligan marked this pull request as ready for review July 11, 2026 10:58

galligan commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 11, 10:58 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 11, 10:58 AM UTC: @galligan merged this pull request with Graphite.

@galligan galligan merged commit 12da706 into main Jul 11, 2026
5 checks passed

@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: 9b6009b294

ℹ️ 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 src/outfitter/dispatch/core/capacity.py
Comment thread src/outfitter/dispatch/core/capacity.py
galligan added a commit that referenced this pull request Jul 11, 2026
## Context

The final cumulative review of the App Server 0.144 adoption stack found five cross-milestone correctness gaps that milestone-local reviews had missed, plus stale hosted review threads and closeout evidence drift. This PR repairs those gaps and keeps the adoption goal active until hosted reconciliation and clean-main proof are complete.

## What changed

- Reconciles topology lifecycle from active and archived App Server pages separately, including cached transitions in both directions.
- Deduplicates capacity windows by provider-limit/window identity and conservatively maps id-less pushes to a named or sole existing limit.
- Makes explicit `sync --full` bypass unchanged/incremental shortcuts and rescan from byte zero.
- Resolves `permissions` cwd in the CLI caller while retaining the generic authored CLI derivation path.
- Moves `new` permission-profile conflicts onto `NewInput`, preserving the shared validation taxonomy across control socket, CLI, and MCP.
- Records the formal amendment that replaces one brittle/costly combined scenario with the checked-in milestone scenario and isolated integration matrix.
- Corrects the release audit: this goal performed no release or publish action, while independent PR #81 merged the 0.8.2 version bump during the execution window.

## Verification

- `just check`: 613 passed / 17 opt-in tests deselected, Ruff, formatting, strict mypy, wheel/sdist, and package-content validation.
- Focused repair/public-surface suite: 215 passed.
- Migration/concurrency suite: 21 passed.
- Post-repair isolated App Server proof: account/capacity, permission profiles, and persisted fork/topology all passed.
- Full-stack code re-review: 5/5 clean, no open P0/P1/P2.
- Full-stack surface re-review: every code/evidence finding fixed; only hosted thread reconciliation remains after this PR is submitted.

## Hosted review reconciliation

This PR fixes the six still-current review threads on merged PRs #78, #79, #82, and #83. Each thread will receive a reply linking this repair, then be resolved before this PR leaves draft.

## Scope

No release or package publish is included. No secrets, remote configuration, or unrelated tracker state are changed.
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.

1 participant