Repository navigation
Conversation
…ws (#911) The B2 double-count fix dropped a whole request from DeclFilterSavings when the accountant priced its toolfilter removal. That also dropped Requests, Reads and Since, so ToolFilterDocFor lost its Realized block and the item list in adaptToolsSaved could sum to more than the total. Now the row stays in the scan. An EXISTS flag column marks it and accumulateDeclFilterRow skips only the USD. carriedCost does the same for the items, so items and total agree. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
…TTL by the billed tier (#912, #919) kaSavedGate needed a request_components row with priced_by='accountant' to accept a rescue the ping only wrote. A keep-alive-only setup stores no component rows, so the rescue was zeroed again. The request row now stores acc_priced (additive column, default 0), set when the accountant override applied. The gate trusts keepalive_saved_usd of such a row as the library's own decision. It is a plain column read placed after the credited-row guard, so the probe order is unchanged. Rows with acc_priced = 0 keep the SQL gate. The entry TTL given to the library was 1h when every breakpoint asked for it, before the billed tier was known. accBilledTTL now lowers the TTL (and the breakpoint TTLs) to 5m after the usage arrives, when the response billed a 5m write, before Compute runs. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
Collaborator
Author
|
Closed in favour of #930, the combined PR for the accountant integration. The commits of this PR are in #930. Nothing is lost: the branch stays. Assisted-By: Claude (Anthropic AI) [email protected] |
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
This draft fixes three accountant gate bugs. It stacks on #923.
Behavior change (needs a human yes before merge): figures change. Filter requests and reads return for accountant-priced rows (dollars stay 0). Keep-alive rescue returns for keep-alive-only setups. A downgraded 1h tier now makes a 5-60 minute gap cold. Old rows keep the old gate.
What changed
Realizedblock missing. Items can sum to more than the total.declFilterNotPricedremoved the whole row from the scan.EXISTSflag column (declFilterInBaseline).accumulateDeclFilterRow(..., skipUSD)skips only the dollars.carriedCostdoes the same for items.run_b2:decl_filter_requests0 -> 3,decl_filter_reads0 -> 7587, USD stays 0. Net unchanged (0.0030792).kaSavedGateneeded arequest_componentsrow withpriced_by='accountant'.requests.acc_priced(additive, default 0), set when the override applied. The gate trusts the storedkeepalive_saved_usdfor those rows. The credited-row guard stays first.acc_priced = 0(old rows, fallbacks) keep the SQL gate.entryFactsran before the billed tier was known.capture.accBilledTTLruns after the usage arrives and beforeCompute. It lowers the TTL and the breakpoint TTLs to 5m when the response billed a 5m write. A request that wrote nothing keeps the asked tier.Limit:
SharedWarmis still judged with the asked TTL ataccEnd. It matters only when another thread of the session touched the entry.Docs:
docs/dashboard.mdanddocs/data-dependence.md(new flag columnacc_priced, a yes or no, no text).How it was tested
TestFilterCreditKeepsFactsAndSkipsDollarsForAccountantPricedRowsTestTheGateKeepsTheRescueOfALibraryPricedRequestWithNoComponentRowsTestTheGateTrustsTheLibraryForPricedRowsAndKeepsSQLForLegacyRowsTestKaSavedGateKeepsTheCreditGuardFirst(guard order andidx_requests_tenant_session)TestAccountantPricedIsSetOnOverrideAndStoredTestTheEntryTTLFollowsTheBilledTierTestDeclCreditSkipsRequestsTheAccountantPricednow expects 3 requests and 3000 reads (the priced row keeps its facts).go test -count=1 ./dash/... ./proxy/... ./apply/... ./keepalive/... ./components/...passes.gofmt -l,go vet ./...,go build ./...,go mod tidy -diffare clean.Assisted-By: Claude (Anthropic AI) [email protected]