Repository navigation
fix: phase 9/10 usage ledger, review instrumentation, cost tests, dependency conflicts (#393, #428, #430, #445) - #509
Merged
Ayinkx merged 4 commits intoOct 17, 2026
Conversation
main was failing to collect tests: the shared alert-state fixture imported a missing app.services.alerts module unconditionally, tests/test_alerts.py had a syntax error and no module-level skip allowance, app/services/email.py violated the lint rules, and tests/test_notifications.py imported an unmerged budget_alerts service. Guard the optional fixture, repair the test syntax, fix the email docstring/imports, and add the small per-period budget alert evaluator the merged notification tests expect.
…yinkxLab#430) Add nullable request_id, latency_ms and status columns to the usage ledger (with a reversible migration) and populate them from review instrumentation. AI reviews now record exactly one ledger row per run with project/workspace scope, token counts, provider/model, estimated-token confidence and outcome. Provider usage/latency is captured through the provider contract while test doubles that only implement complete() still work.
Cover exact-vs-wildcard precedence, provider/model/global wildcard fallbacks, unknown models, token-count clamping and the exact cost arithmetic with offline unit tests. The price table helpers accept an optional table so these branches are testable without mutating the shipped defaults.
…Lab#393) Walk the whole plugin graph before failing, collect PEP 440 constraints per dependency and report a conflict with both dependency paths when no single version can satisfy them. Direct and transitive conflicts (plugin and Python package dependencies) now refuse enable with a clear message, while version mismatches remain PluginDependencyVersionError.
|
@jiggy-techy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Implements the four assigned Phase 9/10 issues on a branch cut from upstream
main:request_id,latency_msandstatusto the usage ledger (model + reversible migration).The branch also repairs CI breakage already present on
main(see "Baseline fixes" below) soruff,blackand the fullpytestsuite are green.Changes
Usage ledger correlation fields (#428)
request_id(64 chars, indexed),latency_ms(non-negative integer) andstatus(lowercased, indexed) toUsageRecordandto_dict().f9e8d7c6b5a4(down_revision = c4d5e6f7a8b9) with matching upgrade/downgrade.record_usage()validates/truncates the new fields; existing rows and callers remain valid because everything is optional.AI review instrumentation (#430)
provider.chat), while test doubles that only exposecomplete()keep working via a documented estimate fallback._save_result()appends exactly onesource="review"ledger row per run (success and failure), carryingworkspace_id/project_id, provider/model,tokens_estimated,request_id,latency_msandstatus.status="error"row.Cost service tests (#445)
*wildcards with deterministic precedence: exact →(provider, "*")→("*", model)→("*", "*").estimate_cost_usd()clamps each token count toMAX_TOKEN_COUNTwhile still rejecting negative counts.Plugin dependency conflicts (#393)
PluginDependencyConflictErroris raised when no version can satisfy all constraints, naming every conflicting requirement and path. Direct and transitive conflicts (plugin and Python-package dependencies) are covered, plus a registry-level test proving the plugin stays disabled.Baseline fixes (pre-existing on
main)tests/test_alerts.pysyntax error and made its missing-module skip module-level safe.app/services/email.py.app/services/budget_alerts.pyevaluator that the already-merged notification tests import.Verification
Targeted runs also cover the changed areas:
Issue links
Closes #393
Closes #428
Closes #430
Closes #445