Repository navigation
fix(store): deterministic operator-audit lease; package budgets as measurement plus margin (#971) - #975
Merged
Conversation
…mand; budgets as measurement plus margin (#971) The test deleted the store_servers lease while the serving store's heartbeat kept renewing it, so a beat between the DELETE and the operator fence re-inserted the lease and refused deleteOwnerless. Closing the store stops the heartbeat and removes its lease deterministically. Package budgets are now each package's measurement plus a fixed margin (core 24 KiB packed, 2% unpacked and entries; add-ons the larger of 10% and 6/24 KiB, plus two entries), with one policy comment replacing the per-PR history, so routine growth no longer edits the same lines in every PR. Co-Authored-By: Claude Opus 5.5 <[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.
Fixes #971
Flaky store test
packages/store/test/operator-audit.test.tsranDELETE FROM store_serverswhile the serving store was still open. Its heartbeat (joinHostLease, every 5 s) upserts its own lease, so a beat landing between the DELETE anddeleteOwnerless's fence re-inserted the lease and the command was refused. The test now callsstore.close(), which stops the heartbeat and deletes the lease, before the final command.*_serverslease under a running server (the other matches insert synthetic expired/peer rows).close()removes a process's own lease, and it clears the heartbeat first. A beat re-inserting a lease that a peer purged after it expired (e.g. a suspended process) is intended: the process is still serving.Package budget policy
Every PR used to bump the core budget by a few KiB and append a history comment, so concurrent PRs conflicted on the same lines.
scripts/package-audit.tsnow carries one policy comment: each limit is a Node 26 measurement (afternpm run build,npm pack --dry-run --json --ignore-scripts) plus a fixed margin:The margins absorb CI's Node 24 (~800 bytes larger packed). When intended growth reaches a limit, re-measure every package and reset the whole table by the policy instead of raising one by the overshoot. The per-PR history comments are gone; the commit history keeps them. Entries limits were tightened to measurement + margin (e.g. mcp 31 -> 14, store-schema 12 -> 9).
docs/DEVELOPMENT-PIPELINE.mddescribes the policy.npm run verifyandnpm run test:packagepass locally (Node 26).🤖 Generated with Claude Code