feat(scroll): P6.4 agent observer + cold-region LRU - #67
Merged
Merged
Conversation
…eth, non-finite selectNext, unified graceMs, #66 pin
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.
what
P6.4: the PURE observer + cold-region LRU for the native attention-anchored agent — SELECTION only (which cold region to reorganize next). No I/O, no server, no edit, no driver. P6.5 wire the driver over
HeadlessPeer+ auth; P6.6 provenance + milestone e2e → P6 CLOSE.how
src/agent/coldScheduler.ts— pure LRU.selectNext(state, cold): never-worked first, then least-recently-worked, tie-break by document order; seeded fromcold[0]so a non-empty cold NEVER return null (even under non-finite timestamps).markWorked(state, id, now, present): record + prune absent ids (bounded map over a long session). monotonic-nowprecondition documented.src/agent/observer.ts—observe({ order, remotes, prevTracked, lru, now, awarenessKnown, pinned?, config? }): fold grace (trackCameras), derive the cold set (coldBlocks— the SAME predicate the authority enforce), select (selectNext). Fail closed: awareness unknown → cold empty → null target. Return{ targetId, cold, tracked }(tracked a ReadonlyMap the driver thread into the next tick). The agent-side BELT to the authority's commit-time SUSPENDERS (P6.3: commit-time spatial ProposalGuard — enforce the guard at the room authority #62).src/agent/spatialGuard.ts— exportresolveGraceMs(single grace source so the observer'strackCamerasfold andguardedBlocksread ONE formula, never diverge).test
coldScheduler.test.ts(9),observer.test.ts(6 + 1 skip),observer.pbt.test.ts. The safety PBT recompute the guarded set INDEPENDENTLY from raw inputs (non-laundering, mirror the authority'sliveCameras, NEVER from observe's owntracked), so a resolution or config/pinned-forwarding bug surface as a mismatch instead of holding by algebra. Teeth mutation-verified (mutate → vitest → revert): fold cameras→[],config→undefined,pinned→undefinedall go RED. Full suite 240 pass / 3 skip; tsc 0. Adjudicator PASS-WITH-CARRYFORWARD (re-ran the mutations itself).carry-forward → P6.5 (#66)
The agent fold cameras via the laundered
RemoteCamera.anchor(→order[0]for a vanished block), so a reader whose block was hard-deleted with no redirect is UNDER-guarded agent-side (the authority's non-launderingliveCamerashandle it right). LATENT: unwired (no driver), authority reject the doomed proposal at commit. Pinned by a skipped observer test (fail-closed on a laundered camera) that FAIL if un-skipped. #66 also carriesObserverStatebundling (F-06) +awarenessKnownproducer (F-07). #63 (P6.3) server pins stay gating.Closes #65
🤖 Generated with Claude Code
https://claude.ai/code/session_01X7WHDHurYHVibsjwvevzFr