Repository navigation
feat: replay budget, bash counted by effect, replay in stats (0.0.75) - #95
Merged
Merged
Conversation
This was referenced Nov 15, 2026
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
teeinto a workspace file, and an inline interpreter script that writes a workspace path are writes: counted, advised, and denied instrictpast the budget. a failed Bash write keeps its charge, because a command can write and then exit non zero. the guard saw none of them, and 834 of 1066 main loop edit turns went through Bash against 232 through Edit and Write. the read classifier acceptsecho,cut,sort,uniq,diff, newlines,||, moregitandghread subcommands, and agit -Cprefix; oneechoseparator between two reads used to reset the streak.replayaudit event with its kind (read, write, verify, settle, dispatch, other), and/fusion:statsreports the main loop replay of dispatching sessions per accepted package with its split by kind, after the verification evidence lines. replay events carry no repository, so only sessions with a worker record in the report's scope count, and only packages accepted since the first counted event. the coercion ledger counts a sprawl in replayed tokens for events that carry them and keeps the write count rule for older events.lib/guard/replay.mjs(pricing and budget math),lib/guard/bash-effect.mjs(the two classifiers),lib/guard/turn.mjs(one turn record per hook call);write-events.mjsandread-streak.mjsswitch their thresholds to tokens.rules-manifest.jsonis generated output.history-gc-stamp.jsonand a lock into the data directory after the job record turns done, and the linux runner lost that race withENOTEMPTYhere twice and once onmain.breaking changes
FUSION_INLINE_WRITE_BUDGETis gone.FUSION_INLINE_REPLAY_BUDGET_TOKENSsets the budget in both postures.stricta session with a small context writes for more turns before the denial and one with a large context for fewer; the tail allowance and the zero dispatch relief are unchanged.test plan
already verified
npm test-> 2141 tests, 2136 pass, 3 skipped, 2 fail under full suite load (Codex monitor keeps A announced when B vanishes after the snapshot,background timeout marks the record error and result reports the failure, neither in a touched file);node --test tests/codex-jobs-monitor.test.mjs tests/task-lifecycle.test.mjsthen passed 90 of 90 three times in a row. 1967 passed before the changeclaude plugin validatepasses for codex, grok, cursor, devin, fusion, and the marketplace rootnode plugins/fusion/scripts/generate-rules-manifest.mjs-> 60 template versionssed -n 1,5p README.md; echo ---; grep -n fusion package.jsonas a read turn, then raised the same turn to write for a python heredoc that appends toREADME.mdand logged the write with its pathnode plugins/fusion/scripts/fusion-stats.mjs --allover those events printed the replay headline andreplay by kind: write 100% (1 turn)(run before the headline gainedin dispatching sessions)#- [x] an adversarial review of the branch returned 17 findings with probes. 15 are fixed here with a failing test each: Bash write forms the classifier missed (newline boundaries,
NAME=valueprefixes,>& file, several in place operands, dotfile and extensionless targets), read commands with an output option (sort -o,git diff --output,gh api -f), quoted operators read as redirects, a failed sibling write erasing a shared turn charge, a held lock leaving a write priced on the previous turn, two known message ids merged inside 1500 ms, and the stats scope and coverage of the per package figure. rerunning the reviewer's 21 command probe returns the expected class for every line. one is the documented limit below (MCP and skill turns are not priced), and one was already true onmainand is fixed with it (a passing verification now clears the advisory dedupe)reviewer should verify
/fusion:smokepasses, and a session past 500,000 tokens of context gets the read advisory within four consecutive read only turns/fusion:statsshows the two main loop replay lines once a session has run on the new buildnotes
Locus follows the packagegains two sentences saying locus also follows the price of the seat; nothing is removed.A read only stretch longer than a few turnsbecomes the stretch that would replay the budget, with the two worked figures, which is stricter at a large context and looser at a small one by design. the runtime guard paragraph names the replay budget in place of the two counts and adds the Bash effect sentence;the write budget is a hard floorbecomesthe replay budget is a hard floor for writes. no invariant inCONTRIBUTING.mdchanges.git apply,mv, andcpare left out on purpose because they are how a peer's work is merged back.