Skip to content

A grant moves only when her need outgrows it or the pool needs it back, never on a regime flip - #5751

Merged
joelteply merged 1 commit into
canaryfrom
fable/grants-stick
Nov 4, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fable/grants-stick

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Serves the minds by stopping the rebind churn that cost all four residents their prompt cache about once a minute. This is Joel's step 1 for the dynamic architecture: a grant follows need and doesn't loop.

The defect

On the M5 (d47c5c2, 00:49-01:04Z), persona.rehome fired 22 times in 15 minutes. The grants flipped between two regimes as one mind's need moved: 'every target fits' (everyone gets her target) and 'needs only' (everyone gets her need). Every flip rebound all four residents.

The rule

The test a_regime_flip_never_rebinds_a_mind_whose_grant_still_fits:

  • grants every target;
  • then grows one need past what the targets leave;
  • asserts the others keep their grants exactly, the grower gets her need, the total is within the pool, and the same demand again moves nothing.

Measured

  • M5 serving-down window (01:10Z): window_grant + window_sim 12 passed; clippy clean.
  • After deploy: persona.rehome per hour against each mind's delib.turn.demand over one hour. A rebind should appear only where a need crosses its grant. Owner: Fable, at deploy.

Superseded by card a156ee65 (per-request admission by exact cells, fork #92), which deletes grants and rebinds outright.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…k, never on a regime flip

On the M5 (d47c5c2, 00:49-01:04Z) persona.rehome fired 22 times in 15 minutes: grants flipped between
'every target fits' (each granted her target) and 'needs only' as one mind's need moved, and every flip
rebound all four residents and cost their prompt cache. A mind holding at least her need now keeps
exactly what she holds; only a mind whose need is above her holding (or a newcomer) is resized, to her
target when every amount fits, else to her need. Holder floors and pressure reclaim from #5745 are
unchanged, so what is bound stays within the pool.

Test a_regime_flip_never_rebinds_a_mind_whose_grant_still_fits: targets granted, then one need grows
past what the targets leave; the three others keep their grants exactly, the grower gets her need, the
bound total stays within the pool, and the same demand again moves nothing.

M5 serving-down window 01:10Z: window_grant + window_sim 12 passed, clippy clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at 0c37023 (Cormac; author session 01LoTjvf…, not mine). Merge on green.

Verified: what is bound stays ≤ pool, and a settled mind is not rebound on a regime flip.

  • The only change is in the aim branch, which still returns only when total(&aim) <= pool. The want, reclaimed and floors branches are unchanged from A grant is never below a mind's need, and a held grant survives drift #5745, which I traced branch by branch.
  • Hand trace of the test: mind 4's aim = target 60,000 (her need 49,000 > holds 45,000, so she is not settled). The aim total is 211,000 > 200,000, so it falls to want = max(need, holds) = 47 + 53 + 51 + 49 = 200,000 ≤ pool. Minds 1-3 keep exactly what they hold; 4 gets her need.

Recorded, not blocking: a settled mind no longer grows back to her target when room returns. aim = holds once holds >= need, so only a rising need moves her. A mind that fell to her need under pressure stays there after the pool frees. That's a one-way ratchet ("control both ways"), and acceptable as the interim, because card a156ee65 (admission by exact cells) deletes per-mind grants. Noted on that card so it isn't lost.

@joelteply
joelteply merged commit 0b28543 into canary Nov 4, 2026
32 checks passed
@joelteply
joelteply deleted the fable/grants-stick branch November 4, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant