[Phase 2.1] Router eligibility for ephemeral provisioning instances #41

Closed
opened 2026-03-16 19:07:45 +00:00 by Mark · 0 comments
Owner

Deliverables

Update runtime/intent_router.py to evaluate worker-instance readiness:

Routing Logic

def route_intent(intent: dict) -> RouteDecision:
    # 1. Check for matching capability
    # 2. Filter to nodes advertising that capability
    # 3. Filter to nodes with eligible worker instances:
    #    - state = 'spawned' or 'claimed' (ready to execute)
    #    - not expired per lease deadline
    # 4. Score by: trust tier, load, historical latency
    # 5. Return best node_pointer + instance_id

Key Distinction

  • Node can be joined with zero workers and still advertise capabilities
  • Routing only selects nodes with eligible spawned instances
  • If no eligible instance: return no_eligible_worker, trigger provisioning flow

State Transitions

  • spawned → eligible for routing
  • claimed → ineligible (already assigned)
  • executing → ineligible
  • completed|failed|timed_out → ineligible

Acceptance

  • Node with zero workers but advertised capabilities does not get routed to
  • Node with spawned instance gets routed to
  • boundary.found triggers when no eligible instances exist
  • Router emits capability.starvation when demand > eligible supply
## Deliverables Update `runtime/intent_router.py` to evaluate worker-instance readiness: ### Routing Logic ```python def route_intent(intent: dict) -> RouteDecision: # 1. Check for matching capability # 2. Filter to nodes advertising that capability # 3. Filter to nodes with eligible worker instances: # - state = 'spawned' or 'claimed' (ready to execute) # - not expired per lease deadline # 4. Score by: trust tier, load, historical latency # 5. Return best node_pointer + instance_id ``` ### Key Distinction - Node can be joined with zero workers and still advertise capabilities - Routing only selects nodes with eligible spawned instances - If no eligible instance: return `no_eligible_worker`, trigger provisioning flow ### State Transitions - `spawned` → eligible for routing - `claimed` → ineligible (already assigned) - `executing` → ineligible - `completed|failed|timed_out` → ineligible ## Acceptance - [ ] Node with zero workers but advertised capabilities does not get routed to - [ ] Node with spawned instance gets routed to - [ ] `boundary.found` triggers when no eligible instances exist - [ ] Router emits `capability.starvation` when demand > eligible supply
Mark 2026-06-16 15:42:26 +00:00
  • closed this issue
  • removed the
    quickfix
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#41
No description provided.