Repository navigation
fix(external-grants): bound and fairly schedule grant attachment work (#5019 PR3-C follow-up) - #6306
Draft
schickling-assistant wants to merge 4 commits into
Conversation
Contributor
Author
|
Smalltalk authority engineer (
Posted on behalf of @schickling
|
This branch has not been deployed
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.
Stacked on #5993 (base: its branch). Depends on #5993. Part of #867 / #5019 PR3-C. This PR must land before external-grant issuance is enabled (condition recorded in #5993).
Problem
In #5993,
attach_claimattaches a newly authenticated assistant-grant base or transition to every authenticated opposite record of the same subject, origin and actor, inside one maintenance unit. An admitted member can replicate many valid signed bases and transitions for one subject. One unit then expands into a bases-by-transitions cross product while the writer is held. The 64-unit / 100 ms slice budget cannot interrupt that loop. (Security review of #5993; the loop exists since5f0ada37.)Goal (FPL decision)
A durable, resumable attachment task, charged per candidate pair against the slice budget, with the subject fenced until the task completes. No per-subject history cap.
Decisions
subject_pendingcovers attachment tasks and conflict witnesses. A restrictive partial attachment keeps the previous effective row as a witness until the subject has no tasks.Verification
Duration::ZEROone-unit termination; cursor and witness survive a file reopen; invalid candidates are charged; late opposite arrival; trim during a task; fence lift for a completed subject next to an unrelated continuous backlog; ineligible-witness prefix is bounded; every non-empty queue is served within one round; attachment and proof-recheck owners finish while lower-ID and between-ID arrivals continue.smallclaims --lib assistant_grant_authorityrun is queued on a shared host (disk admission). Results will be posted here. Hosted CI runs only after this PR's base becomesmain.22b947e4. They found three problems in earlier commits, and later commits fixed them: global witness cleanup starvation (719dd9d2), uncharged ineligible-witness probes and reservations that starved other queues (4d26734b), and hash-ordered owner starvation (22b947e4). The implementer and the two reviewers are GPT family. The Claude-family review follows in a comment.Complexity
The change adds a task table, a witness table, an owner registry and one scheduler. Without them, the slice budget cannot bound attachment work, and the queues cannot serve owners fairly. About 640 of the 1217 changed lines are tests.
Concerns
Friction & bottlenecks
The local verification of #5993 and of this PR waited hours for shared build capacity. Some runs stopped on host memory or disk floors.
References
Depends on #5993. See #867, #5019.
Posted on behalf of @schickling
agent_identitysessionagent_personaagent_supervisoragent_toolagent_tool_versionagent_runtimeagent_modelworktree