Skip to content

[AIGTWY-4880] Add a reversible budget fixture for CUJ5 - #914

Closed
andy-xu-db wants to merge 1 commit into
andy-xu-db/stack/andy/aigtwy-4880-account-authfrom
andy-xu-db/stack/andy/aigtwy-4880-budget-fixture
Closed

andy-xu-db wants to merge 1 commit into
andy-xu-db/stack/andy/aigtwy-4880-account-authfrom
andy-xu-db/stack/andy/aigtwy-4880-budget-fixture

Conversation

@andy-xu-db

@andy-xu-db andy-xu-db commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR


Summary

Add the reversible account-budget fixture for CUJ5 (AIGTWY-4880). It uses existing positive spend and temporarily changes the per-user hard-block limit to exercise the 50% and 80% smart-default tiers.

Changes

  • Read one immutable BudgetTarget from the metadata supplied to pytest and reject a mismatched workspace before requests.
  • Validate the published policy, budget scope, and absence of principal overrides before writing.
  • Calculate thresholds with Decimal, preserve the complete budget configuration, and verify account and recommendation API readback.
  • Restore the original threshold on success or failure, including an update whose response may have been lost.
  • Use the account token minted by the runner from the shared CUJ service-principal credentials.

Configuration

PR #911 owns the concrete workspace, account, budget, and model values in .github/workflows/integration.yml. PR #913 forwards them without duplicating those values in the runner or fixture.

Verification

The complete stack passed 119 focused tests. Live CUJ5 verified account-budget mutation and restoration. The update body retains required alert/action IDs, omits response-only fields, and normalizes the legacy BLOCK_USAGE.target returned by GET but rejected by PUT. The principal needs workspace model access, pre-provisioned positive spend, and account budget read/update permission. Setup never generates spend.

@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from 8ccf72d to 9b36a1e Compare September 30, 2026 20:16
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch 2 times, most recently from 8ab0906 to bae3286 Compare September 30, 2026 20:26
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from 9b36a1e to 2c2c025 Compare September 30, 2026 20:26
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from bae3286 to 79a23dd Compare September 30, 2026 20:39
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from 2c2c025 to e61d623 Compare September 30, 2026 20:39
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from 79a23dd to 7b6553e Compare September 30, 2026 20:49
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from e61d623 to 4fc5d70 Compare September 30, 2026 20:49
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from 7b6553e to ef0dfb4 Compare October 1, 2026 14:38
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch 2 times, most recently from 3a4a526 to 66aa7fe Compare October 1, 2026 15:05
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from ef0dfb4 to 3830958 Compare October 1, 2026 15:05
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from 66aa7fe to d66abea Compare October 1, 2026 15:09
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from 3830958 to b2c5c7c Compare October 1, 2026 15:09
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from d66abea to 6d207a5 Compare October 1, 2026 16:24
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch 2 times, most recently from 5f28dfc to 131af08 Compare October 1, 2026 16:29
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from 6d207a5 to 307e450 Compare October 1, 2026 16:29
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from 131af08 to 5a8abeb Compare October 1, 2026 16:37
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch 2 times, most recently from 518b57f to eff75a9 Compare October 1, 2026 17:17
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from 5a8abeb to 9e8519f Compare October 1, 2026 17:17
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from eff75a9 to 53d70a5 Compare October 1, 2026 18:51
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from 9e8519f to 3ffdb7f Compare October 1, 2026 18:51
@andy-xu-db andy-xu-db changed the title [AIGTWY-4880] Add a reversible live budget fixture [AIGTWY-4880] Add a reversible budget fixture for CUJ5 Oct 1, 2026
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from 53d70a5 to e33b205 Compare October 1, 2026 18:56
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from 3ffdb7f to c7ccaa6 Compare October 1, 2026 18:56
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from c7ccaa6 to 141eff0 Compare October 1, 2026 19:43
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from e33b205 to 1d0dbfb Compare October 1, 2026 19:43
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch 12 times, most recently from fa66168 to b07e258 Compare October 1, 2026 20:57
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch 2 times, most recently from 62f9dfc to c6e5363 Compare October 2, 2026 13:36
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch 2 times, most recently from 6eaabe9 to cf56ee8 Compare October 2, 2026 14:26
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch 2 times, most recently from 058db96 to bb6457e Compare October 2, 2026 15:42
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch 2 times, most recently from 56fa5f9 to c848559 Compare October 2, 2026 16:49
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from bb6457e to 75792ec Compare October 2, 2026 16:49
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-account-auth branch from 75792ec to f258ae5 Compare October 2, 2026 17:03
@andy-xu-db
andy-xu-db force-pushed the andy-xu-db/stack/andy/aigtwy-4880-budget-fixture branch from c848559 to 6c4f77a Compare October 2, 2026 17:03
@andy-xu-db

Copy link
Copy Markdown
Collaborator Author

Consolidated into #911, which now contains the complete CUJ5 integration test change as one commit against main.

@andy-xu-db andy-xu-db closed this Oct 2, 2026
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