Repository navigation
perf(update): in steady state the inventory walks only the Count's branches - #290
Merged
Merged
Conversation
…anches * a stored write receipt proves every branch the Count wrote shared the prefix, so the refs walk asks refs(query:) for it and keeps only the names that start with it; a cold cache or a changed prefix walks every branch, and that run is a full write whose cleanup lists every branch itself * the one behaviour change: a branch a person copied to a name outside the prefix is invisible to the warm walk and is cleaned up by the next full write instead of the next run Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 669f572 | Commit Preview URL Branch Preview URL |
Nov 13 2026, 01:57 AM |
…osed A branch renamed outside prs.branch keeps its open pull request on GitHub, so the refs walk narrowed to the prefix cannot see it; the receipts still name it. Guard the walk two ways: a repository-scoped receipts-prefix marker names the prefix the most recent save used, so a prs.branch flip away and back walks every branch once before narrowing again, and a receipted branch absent from a narrow walk — with no plan rewriting it — takes the full write path, whose REST pull listing and cleanup branch list see it exactly as an unfiltered run would. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Merged
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.
Consult 7, PR 4b (behaviour change accepted by the user). After #284 the inventory's remaining cost on a large repository is its branch pages, one per hundred branches on every run. Every branch the Count creates shares the configured
prs.branchprefix, and a stored write receipt proves the Count has written there before.verified-write-receiptsentry for this repository and prefix, the inventory asksrefs(refPrefix: "refs/heads/", query: $prefix). GitHub'squeryis a case-insensitive substring match (checked live), so the client keeps only names that start with the prefix; undecodable nodes still count against completeness. The filter travels on every continuation page.queryis sent and every branch is walked as before. That run is a full write, and cleanup lists every branch itself.Behaviour change, the only one:
restore_inventorymarks a run partial when it sees an owned branch no plan wants, including one outside the prefix whose commit carries the Count's trailers. Such a branch exists in steady state only when a person copies one of the Count's branches to another name. Today the next run deletes the copy; now the next full write does. Documented inguide/pull-requests.mdandinternals/cache.md.Proof (
crates/update/tests/inventory_prefix.rs):many_foreign_branches_decide_alike: 150 in-prefix and 203 foreign branches, including an infix hit (vendor/patchula/thing) and a case hit (Patchula/case) that GitHub'squeryreturns, paged. The full walk reads 353 names and the prefix walk exactly the 150.RestoreOutcome, dashboardControls, tooling evidence and visible pull requests are identical.a_copy_of_a_counts_branch_is_obsolete_only_to_the_full_walkpins the one intended difference.a_plan_settles_alike_under_either_walk.FakeGitHub::refs_connectionmodelsrefPrefix(must end/),query(case-insensitive substring),firstandafter, and panics on anything else.fixtures/update/inventory.jsonrequests carry the new query text; variables are unchanged and norefQuerymeans no filter.Live (read-only; the warm case seeds an empty receipt into a local in-memory cache, nothing is written to these repositories):