Repository navigation
fix(budget): enforce active gating to prevent token and runtime overruns. - #109
MASTER870-CMD wants to merge 2 commits into
Conversation
6c61fa6 to
69420ba
Compare
|
Thank you, @MASTER870-CMD, for contributing the active budget-admission fix. We transferred the functional budget-gating change into Our maintainer workflow is documented here: https://github.com/sapientinc/PRAXIST/blob/main/docs/guides/contributing.md#what-happens-after-submission This branch is now ready for a separately scheduled real-task experiment stage. Please allow us time to complete that validation; if it passes, the maintainers will submit the validated change to |
|
Update: this shipped. Your active budget-admission fix is now on Thank you for your contribution, @MASTER870-CMD |


Resolves #81
Overview
The budget ledger previously operated purely as a post-mortem audit log, allowing unchecked resource exhaustion before flagging an overrun. This PR shifts the ledger to an active pre-admission gate, strictly enforcing budget ceilings during the BudgetedActionGuard initialization to eliminate unbounded cost exposure.
Technical Implementation
Implemented a get_exhausted_units check prior to peer admission to halt execution the moment cumulative tokens or wall-clock limits are breached.
Ensured in-flight tasks gracefully drain their runtime usage via finish() while safely and immediately blocking new model calls.
Hardened the test suite for cross-platform stability by safely handling Unix-only modules (fcntl, os.killpg, pty, socketserver.ThreadingUnixStreamServer), ensuring robust local testing and CI passes on Windows environments.
Validation
Successfully executed the full resource guard and budget test suite locally.
100% pass rate across all 39 budget enforcement contracts and workflow loops.