Include directory account_id in observation_scope (SBS-1079) - #407
Draft
tsouth89 wants to merge 1 commit into
Draft
Include directory account_id in observation_scope (SBS-1079)#407tsouth89 wants to merge 1 commit into
tsouth89 wants to merge 1 commit into
Conversation
Capacity-event and enforcement baselines keyed only on provider|source|email|org, so Codex personal and Team seats that share a login email collapsed. usage_history, thresholds, and predictive pace already isolate on snapshot.account_id (SBS-1079). Co-authored-by: Tyler <tyler@southboundsoftware.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ceiling | f5c57ac | Commit Preview URL Branch Preview URL |
Aug 23 2026, 10:27 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
observation_scope(shared by capacity-event observation and enforcement tracking) hashed onlyprovider|source|email|org. Codex directory seats that share a login email — personal + Team — therefore shared one baseline. A drop on the Team seat looked like a confirmed surprise reset of the personal seat, and a missing core window on one seat was flaggedunavailableon the other.Directory
snapshot.account_idis now part of that hash, matching isolation already in place forusage_history, threshold toasts, and post-SBS-1057 predictive pace.Related issue
Fixes SBS-1079 (incomplete SBS-1057).
Affected areas
Validation
Hosted CI is the main frontend and Rust gate (Windows for Rust jobs).
account_idfield (same hashcodex:f9a966f77f51ccff, falseSurpriseReset85%→10%, falseunavailableon Weekly) and pass with itcargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml— 620 passedcargo test --manifest-path rust/Cargo.toml— passedcargo fmt --all --check— passednode --test worker.test.mjs, version-sync check,pnpm test,pnpm build— passedpowershell.exe ... scripts\local-check.ps1— Windows-only; not run here (covered by hosted Rust jobs)UI / tray proof
Notes for reviewers
The new tests are the regression: two Codex seats with the same email, org, and source but different directory
account_ids. Without this change they collide.Ambient seats (
account_idempty) still hash with an empty fifth field, so persisted baselines for those seats re-key once after upgrade (first live read is a fresh baseline, same as a new scope). Directory seats that were colliding get distinct keys immediately.Do not merge.
Note
Include directory
account_idinobservation_scopescoping keyaccount_idas a fifth field to the raw string used for hashing inobservation_scope, changing the format fromprovider_id|source_label|email|organizationtoprovider_id|source_label|email|organization|account_id.account_idin the tracking scope.account_idis empty. Checkobservation_scopein capacity_events.rs.Macroscope summarized f5c57ac.