Repository navigation
Split AI-credit guard tests into four focused suites - #11837
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The refactor leaves pricing-source provenance pointing to a deleted test file, so the active metadata reference must be updated to a valid durable evidence source.
1 open issue
What changed in this PR
This PR refactors the monolithic AI-credit guard test suite into four focused suites while preserving production behavior and updating publication, maintenance, workflow, and documentation references.
Changes:
- Split tariff accounting, steering notices, promotions, and pricing fallback tests into separate suites.
- Added independent per-suite state and environment cleanup.
- Updated selectors, regression assertions, workflow commands, documentation, and the affected workflow lock.
| File | Description |
|---|---|
| scripts/model-information/publication.test.ts | Updates publication test selectors to use the four focused AI-credit guard suites. |
| scripts/model-information/maintenance-command.test.ts | Updates maintenance command expectations for the focused guard test suites. |
| scripts/model-information/maintenance-command.cjs | Runs the four focused API-proxy guard suites during maintenance validation. |
| scripts/ci/model-api-mapping-updater-workflow.test.ts | Updates workflow regression assertions for the new test selectors. |
| docs/model-catalogue-publication.md | Documents the focused test command used during model catalogue publication. |
| docs/adr/0004-model-information-management.md | Updates ADR validation commands to reference the focused suites. |
| containers/api-proxy/guards/ai-credits-tariff.test.js | Contains tariff accounting and budget-enforcement tests. |
| containers/api-proxy/guards/ai-credits-promotions.test.js | Contains time-bound AI-credit promotion tests. |
| containers/api-proxy/guards/ai-credits-pricing-fallback.test.js | Contains model resolution, fallback, warning, and priceability tests. |
| containers/api-proxy/guards/ai-credits-notices.test.js | Contains steering-warning and low-credit notice tests. |
| containers/api-proxy/guards/ai-credits-guard.test.js | Removes the superseded monolithic AI-credit guard test suite. |
| .github/workflows/publish-model-catalogue.yml | Runs the focused guard suites during catalogue publication validation. |
| .github/workflows/model-api-mapping-updater.md | Updates the scheduled maintenance workflow test command. |
| .github/workflows/model-api-mapping-updater.lock.yml | Updates the compiled workflow lock with the revised validation command. |
Review effort: Lite (adaptive)
| @@ -0,0 +1,699 @@ | |||
| const { | |||
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Updated the pricing provenance to cite the existing tariff suite. Commit: |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 172cc8e |
|
@copilot merge main and resolve conflicts, then fix the failing build verification and root unit test ci checks |
…redits-guard-tests # Conflicts: # .github/workflows/model-api-mapping-updater.lock.yml Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged |

The 1,800-line AI-credit guard suite mixes tariff accounting, steering notices, promotions, and pricing resolution. Separate these concerns without changing production behavior.