Skip to content

slots observer: #371 follow-ups (marker line back, slots-off double count, comment, cleanup test) #381

Closed

Description

@scuttletoby

Follow-ups from the lens on #371 (#371 (comment), SAFE, no blocker/major).

  1. Put back the // Fork: marker line in apps/server/src/process/agentScope.ts (above ownScope:). It was dropped from slots observe: one count per agent, stored held slots, seams list, tests (#353) #371 because main's seam check reads the allow list from main, so the PR's own new entry could not allow it. The entry (which already lists the marker) is on main once slots observe: one count per agent, stored held slots, seams list, tests (#353) #371 merges, so a one-line PR now passes.
  2. Minor, SlotObserver.ts:201-205: with slots off, decide returns early (SlotGate.ts:373) and never uses the held slot up, so it stays in the wait store; the next decision by another thread counts the held slot AND the holder's new start (one agent counted twice, until the slot ends, default 120 s). Observe data only (the same kind as slots observe mode: double count when slots are off, stored held slots, seams list, tests (#332 follow-ups) #353 item 1); no decision changes. Fix: leave out held slots of threads that already have a start counted by the rule, or count no held slots while slots are off. A test: slots off must read pieces: 1 like slots on.
  3. Minor, comment at SlotObserver.ts:65-68: the wait store is read when the observation runs, not at the decision; a queued observation can miss a slot a later decision used up (one agent too few, a few seconds). Reword the comment (or read at decision time).
  4. Nit: no test covers the cleanup of the rule's start list (SlotObserver.ts:256-258); mutation M10 survived. Add one.

Part of the dynamic slots follow-ups (#353).

🤖 Generated with Claude Code

Activity

  1. scuttletoby commented on Nov 17, 2026

    @scuttletoby
    OwnerAuthor

    Status after #394 (merged): items 2-4 done. Still open here:

    • Item 1 (marker line): blocked. Main's .github/fork-seams.json entry for apps/server/src/process/agentScope.ts no longer lists the // Fork: marker (dropped in f57196f before slots observe: one count per agent, stored held slots, seams list, tests (#353) #371 merged), so main's seam check refuses the line. Needs a one-line seams entry change first, then the marker.
    • New minor from the slots observer: #371 follow-ups (slots-off double count, comment, cleanup test) #394 lens (slots observer: #371 follow-ups (slots-off double count, comment, cleanup test) #394 (comment)), apps/server/src/slots/SlotObserver.ts:214-224: with slots off, one agent can still be counted twice in two orders, because a hold is only marked used if a later observation still sees the holder's start in memory: (a) the holder's own store read is slow or fails, then its dispatch ends with no child (next decision reads 1, slots on reads 0); (b) the holder's observation is skipped (queue full) and its child shows a run before the next decision (reads 2, should be 1). At most one extra agent per hold until the hold ends; observe-only, no decision changes. Fix: note the caller's thread at decision time (before the skip check) and let the next good store read mark its holds; test both orders red first.
    • Nit (SlotObserver.ts:217): no test pins marking from starts still in memory rather than only counted ones (mutation M9 survives); add the "child run shows before the next store read" order as a row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions