Repository navigation
Build(deps-dev): Bump eslint from 9.24.0 to 9.33.0 - #109
Closed
dependabot[bot] wants to merge 1 commit into
Closed
dependabot[bot] wants to merge 1 commit into
dependabot[bot] wants to merge 1 commit into
Conversation
Bumps [eslint](https://github.com/eslint/eslint) from 9.24.0 to 9.33.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v9.24.0...v9.33.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 9.33.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Contributor
Author
|
Superseded by #110. |
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
…gs for handle-store commands (task #107, slice B) Exposes the InferenceHandleStore (slice A) as kernel commands under the canonical `ai/*` namespace: ai/inference/open → mints HandleRef tied to a provider ai/inference/generate → routes through the session's adapter ai/inference/close → releases the session ai/inference/inspect → observability snapshot Per Joel (2026-05-31): "Yeah the inference command doesn't do this. It's smart subsystems and daemons. Commands are dumb and short." And the strongest version yet: "So the commands absolutely cannot negotiate this." This module is intentionally the DUMB command layer. It parses the envelope, validates, calls the store, returns the result. NO scheduling, NO batching, NO LoRA paging, NO quantization decisions, NO base-model-sharing logic — that all lives in the future smart subsystems + daemons that sit BEHIND this command surface. ### Wiring InferenceHandleModule owns a local DashMap<provider_id, Arc<dyn AIProviderAdapter>> populated at wiring time via `register_adapter(provider_id, adapter)`. Deliberately decoupled from AdapterRegistry (which uses Box<dyn> + `&mut self` lifecycle methods); rather than refactor the registry's ownership model in this slice, the handle module is self-contained. A later refactor (#109 or after) consolidates if needed. ### Wire shape — canonical envelope pattern - `OpenParams { provider, model?, system_prompt?, active_adapters?, persona_id? }` - Handles ride on the envelope's top-level `handle` field, NOT in params (per substrate convention; matches data/query-next, etc.) - `GenerateParams { request: TextGenerationRequest }` + envelope handle - `CloseParams {}` / `InspectParams {}` carry no params; the envelope handle is the input - Responses flatten — `success` + result fields at the top level, envelope handle returned on open via `with_handle_ref` ### ts-rs bindings auto-generated `src/shared/generated/ai_inference/{Open,Generate,Close,Inspect}{Params,Result}.ts` — consumers `import type { OpenParams } from '@shared/generated/ai_inference/OpenParams'` and call `Commands.execute('ai/inference/open', params)`. No hand-written duplicate types across the Rust ↔ TS boundary. ### Tests (16, all green) - config reports canonical module name + `ai/inference/` prefix - open via command surface returns HandleRef with canonical owner + type_tag at the envelope's top-level handle field - open with unregistered provider returns typed "not registered" error listing what's available - generate via command surface routes to the adapter, response carries the heuristic-adapter's `[heuristic:...]` echo - generate without envelope handle returns loud error (no silent default-to-nil) - close via command surface releases; subsequent generate fails with handle-not-found - inspect via command surface returns the SessionInspection snapshot (provider, has_system_prompt, generation_count) - unknown command returns loud error naming the known commands - full open → generate × 2 → inspect → close round trip - 7 ts-rs export_bindings tests (auto-generated, one per type) ### Doctrine - [[commands-are-kernel-level-and-compose]] — pure command-envelope routing; no internal logic; composable with any other module - [[inference-is-an-adapter-always-in-the-loop]] — handle commands are THE canonical inference shape; one-shot `inference/llm/request` remains the legacy path until #106 namespace consolidation - [[inference-scarcity-economics]] §"commands are dumb" — this is the dumb command layer; smart bits land later as separate components without changing this surface - [[host-the-seemingly-impossible]] — by keeping commands stable + narrow, the daemons behind them can grow as smart as needed to meet the M5-multi-modal-multi-lane target
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
…l docs
Joel (2026-05-31): "Then we want to architect the unknowns on
paper now; what you said being load bearing in memory. Design
what we need and document what isn't."
Four new docs lock the working session's substrate doctrine into
the repo so future readers (Claude, contributors, AIs reviewing
adversarially) inherit it without needing the auto-memory:
1. **docs/architecture/AI-COMMAND-NAMESPACE.md** (~275 lines)
The `ai/*` tree — LLMs, vision, audio, embeddings, classical
ML, planning algorithms, game/agent AI, low-level kernels — all
under one namespace. Three universal primitives: adapter
polymorphism (OpenCV-style), handle pattern (establish once,
reuse many), capture+replay (observability-is-half). The
architectural rule: commands are dumb, daemons are smart.
Multimodal CNN crutches are first-class peers, NOT utilities —
how non-multimodal LLMs get sensory parity.
2. **docs/architecture/INFERENCE-SCHEDULING-AND-SCARCITY.md** (~435 lines)
The DAEMON layer behind `ai/inference/*`. The adaptive-
resolution analogy (video player drops 4K → 1080p under
congestion; inference daemon drops FP16 → INT8 → INT4 under
memory pressure — same model, no quality tier-down). Component
designs: tiered SlotPool, RequestQueue, BatchAssembler
(continuous batching, vLLM-style), LoRAPager, BaseModelSharing,
PressureMonitor, AdaptiveQuantizer, SpeculativeWarmer,
RouteSelector (local vs grid). Cross-grid M5→5090 case as a
peer adapter. Captures the prior-attempt failure modes the
substrate MUST NOT repeat: hot-path LoRA swap, global FIFO,
naive shared-model concurrency, underestimated swap latency,
policy negotiation on the command surface.
3. **docs/architecture/OBSERVABILITY-AS-SUBSTRATE.md** (~253 lines)
The "half the architecture is debug" doctrine. The CaptureSink
pattern as universal shape (trait + Noop/JSONL/InMemory + Recording
decorator). The three canonical introspection questions:
counterfactual ("would I respond the same way?"), fault
isolation ("which layer is broken?"), relevance ("contextually
relevant?"). The non-negotiable Noop-default-zero-overhead rule.
Introspection reachable as a command, not just files on disk.
4. **docs/planning/AI-LANE-OPEN-QUESTIONS.md** (~417 lines)
Explicit punch list of 20 design decisions we KNOW we need but
haven't made yet, organized by lane: inference daemon (#109),
cross-grid inference (#108), namespace consolidation (#106),
observability, hardware/memory hierarchy, multi-modal
pipelines, prior-attempt forensics. Each entry: question, why
it matters, what's blocked, candidate approaches, decision
gate. Highest-priority: Q20 (recover prior-attempt failure
logs — don't repeat what was "rather shitty"), Q1 (persona
priority class signaling), Q11 (namespace migration path).
Plus CLAUDE.md's canonical-substrate-docs intro now lists the
three new architecture docs + the open-questions doc, so the
next reader picking up this work finds them in the right order.
Implementation status note: the inference COMMAND layer (open /
generate / close / inspect) ships today via #107A + #107B. The
SMART daemon layer (slot pools, continuous batching, multi-LoRA
serving, adaptive quantization, cross-grid offload) is designed
here but unbuilt — task #109 and #108. The docs are deliberately
honest about what's known and what's open; nothing in
INFERENCE-SCHEDULING-AND-SCARCITY.md or AI-LANE-OPEN-QUESTIONS.md
overstates current implementation.
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
…n after prior-art survey Joel (2026-05-31): "Let's look at prior art on genomic paging, model loading. I think we weren't clever enough with our lanes. The goal should be to ideally cover the needs of the persona, while being realistic. On this machine it might be 3 low end, maybe cpu, without a grid inference provider which we plan to use. But this isn't an option for some. We should at least attempt something reasonable, a model with creative capacity." After surveying the existing tree: **Prior art already shipped (and previously underweighted in INFERENCE-SCHEDULING-AND-SCARCITY.md):** - `cognition/throughput_lease.rs::ThroughputLease` — the slot/lane primitive with Graceful / Hard / Pinned revocation - `cognition/throughput_lease.rs::ThroughputLeaseRegistry` - `cognition/adaptive_throughput.rs::AdaptiveThroughputRequest` + `AdaptiveThroughputPlan` — the admission planner keyed by `target_silicon` - `inference/footprint_registry/mod.rs::FootprintRegistry` — per-resource memory accounting + cheapest-eviction search + lease-aware composition (`acquire_lease`) - `genome/working_set.rs` + `genome/tier.rs` — 5-tier hierarchy (Fast / Warm / Bench / Cold / Frozen) with canonical per-tier eviction policies (LruWithinTurn / LruAcrossTurns / LfuPlusRecency / DemandAlignedWithRefinedPreference / AppendOnlyGcOnSleep). UMA-aware. - `paging/broker.rs::PressureBroker` + `PressureTier` (Normal/Warning/High/Critical) - `inference/recipe_budget.rs::TaskKind` — 10 task classes already enumerated (Chat, VoiceChat, VideoChat, CodingSmall, CodingLarge, GameNpcIdle, GameNpcEngaged, SentinelEasy, SentinelHard, AcademyStudent) with seed KV budgets and per-silicon cost models. **The "we weren't clever enough" insight:** prior attempts treated lanes as separate model loads. The actually-clever framing is the opposite — a lane is `(persona, TaskKind, ThroughputLease)` over the SHARED base model. Continuous batching multiplexes lanes through the same model forward pass. KV cache budgets per lane come from the existing TaskKind table. Three premises: 1. ONE base model on the host (substrate picks best-fit, creative capacity, not stupid) 2. N lanes, each (persona, TaskKind) — multiplexed via continuous batching 3. Existing primitives compose into the InferenceCoordinator — no reinvention Realistic baseline target (Joel's "3 low-end CPU" case): - 1 base model: Gemma-2-2B Q4_K_M or Qwen-2.5-3B Q4_K_M (~2 GB) - 3 lanes: typical 1× VoiceChat (8K) + 1× Chat (8K) + 1× GameNpcIdle (4K) - Total KV: ~1 GB FP16 (~650 MB INT8) - Throughput: ~10-18 tok/s aggregate through continuous batch on CPU - No grid required; works standalone Higher-end (M5 UMA) keeps the same shape, scales up the model. Grid (#108) adds remote-lane fallback — same architecture, peer hosting some of the lanes. **The new doc covers:** - Full prior-art inventory (component → existing file mapping) - Lane type definition (persona / task / lease) - Coordinator scaffold (composing existing primitives) - 5-step MVP build plan (Lane type → Coordinator → wire-through → LlamaCpp batched decode → pressure-driven eviction) - Realistic baseline target table (CPU-only / 8 GB / 16 GB / M5) - Acceptance criteria - 5 new open questions specific to the realistic lane build (Q21 llama.cpp batched-decode finish reasons, Q22 model-pick policy, Q23 KV precision switch, Q24 TaskKind mid-session change, Q25 idle-lane demotion policy) - Explicit non-goals (no per-persona model loads, no quality-tiered selection, no hot-path LoRA swap, no global FIFO, no client-side scheduling awareness) **Side updates:** - CLAUDE.md canonical-docs section: the realistic-lane doc lands as the "read this FIRST for scheduler work" pointer; SCHEDULING-AND- SCARCITY remains the aspirational ceiling. - AI-LANE-OPEN-QUESTIONS.md: 5 new questions Q21–Q25 land under a "Realistic lane build" section adjacent to the existing scheduling questions. - Task #109 rescoped: from "build scheduler from scratch" to "compose existing primitives into InferenceCoordinator" with the realistic- lane doc as the build plan. This unblocks #109 with a far more tractable scope. The aspirational ceiling stays — it's where the substrate is going — but the floor is buildable in a focused MVP cut.
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
Per the build plan in [`docs/architecture/INFERENCE-LANES-REALISTIC.md`](../../docs/architecture/INFERENCE-LANES-REALISTIC.md). A Lane is `(persona, TaskKind, ThroughputLease)` over the SHARED base model on this host. Multiple lanes share the loaded model bytes; only KV cache + persona-scoped state differs per lane. The substrate's "ONE model, N lanes" cleverness — the prior-attempt failure was conceiving lanes as separate model loads. Lanes are recipe-budgeted KV slots, not weight copies. ### What this step ships - `Lane` struct binding persona × TaskKind × ThroughputLease × handle - `LaneClass` enum (Realtime / Interactive / Background / Sentinel) - Class → revocation policy mapping (Realtime→Pinned, Interactive→Graceful, Background+Sentinel→Hard) — the substrate's pressure-response contract - `LaneClass::default_for_task(TaskKind)` so the coordinator can derive class from task by default; persona context can override - Accessors: seed_kv_tokens / max_kv_tokens (from recipe_budget), is_pinned, is_expired, is_reclaimable ### Composition (no reinvention) Lane glues existing primitives without touching their internals: - `cognition::throughput_lease::ThroughputLease` — the slot primitive + revocation policy - `inference::recipe_budget::TaskKind` — seed + max KV budgets - `genome::working_set::PersonaId` — substrate identity type - HandleRef binding — surfaces the coordinator's DashMap<handle_id, Lane> lookup ### Tests (15, all green) - LaneClass → revocation policy mappings (Realtime/Interactive/ Background/Sentinel) - LaneClass::default_for_task for every TaskKind variant (Voice/Video→Realtime, Chat/NPC-Engaged→Interactive, Coding/Idle/Academy→Background, Sentinel-Easy/Hard→Sentinel) - Lane field accessors (persona, task, handle_id, class, lease_id) - seed_kv_tokens + max_kv_tokens match recipe_budget table - Realtime lanes report is_pinned=true - Non-realtime lanes report is_pinned=false - Lease expiry → is_expired transitions correctly - Realtime + active → not reclaimable; expired override flips it - Background + active → reclaimable immediately ### What's next (step 2) `InferenceCoordinator` (`coordinator.rs`) composes Lane with the existing AdaptiveThroughputPlanner + FootprintRegistry + PressureBroker into the actual admission + lifecycle path. The coordinator owns a DashMap<handle_id, Lane>. The handle module will route through it. The 5-step build plan tracker: - [x] Step 1: Lane type + binding (this commit) - [ ] Step 2: InferenceCoordinator scaffold - [ ] Step 3: Wire InferenceHandleModule through the coordinator - [ ] Step 4: Continuous batching in LlamaCppAdapter - [ ] Step 5: Pressure-driven lane eviction
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
…mposition (task #109, step 2) Per the build plan in [`docs/architecture/INFERENCE-LANES-REALISTIC.md`](../../docs/architecture/INFERENCE-LANES-REALISTIC.md). The coordinator is the smart-subsystem layer behind the dumb `ai/inference/*` commands. It owns LANE LIFECYCLE — admission, lease + memory accounting, handle binding — by COMPOSING existing substrate primitives without reinventing them: - `plan_adaptive_throughput` from `cognition::adaptive_throughput` makes admission decisions keyed by `target_silicon` + per-lane budget - `FootprintRegistry::acquire_lease` / `release_lease` mirrors the ThroughputLease into byte accounting in one call (so lease expiry / pressure eviction sees the bytes too) - `InferenceHandleStore::open` / `close` (already shipped #107A) owns the actual adapter session under the bound HandleRef - `Lane` (step 1) binds (persona, task, lease, handle) so the coordinator's DashMap<handle_id, Lane> answers "what's this handle's persona / class / KV budget?" ### Key surface - `CoordinatorConfig` — declares the substrate's per-silicon lane budgets (`Vec<ThroughputLaneBudget>`), per-token KV bytes for footprint accounting, and lease duration. Includes `realistic_floor_default()` shaped for the lanes-realistic doc's baseline target (4 concurrent lanes UnifiedMemory, ~80K cost units = 3× chat + 1× spare). - `OpenLaneRequest` — persona + task + adapter + standard session options + class_override + now_ms (caller supplies clock for determinism + replay). - `open_lane(req)` → `Result<HandleRef, CoordinatorError>` runs 4 ordered steps: admission planning, lease + footprint acquire, handle store open, lane binding. Failure at any step leaves the coordinator consistent (no partial-state leaks). - `close_lane(handle)` — idempotent release. Returns `Ok(true)` if the lane was present, `Ok(false)` if already gone. - `inspect(handle)` → `Option<LaneInspection>` — observability snapshot per [[observability-is-half-the-architecture]]; provider, task, class, KV budgets, bytes accounted, lease timings, pin status. - `lane_for_handle` / `lane_count` / `is_empty` — telemetry. ### How admission stays honest The coordinator synthesizes an "occupancy job" representing all existing leases at this `target_silicon`, then injects it into the admission request alongside the new job. This lets the pure `plan_adaptive_throughput` planner see the FULL load when deciding whether to admit — without modifying the planner. ### Typed errors (no string parsing) - `AdmissionDenied { reason: NoBudget | ResourcePressure | Stale, task, persona }` - `LeaseAcquireFailed(msg)` — the underlying ThroughputLeaseError wrapped - `HandleNotFound { handle_id }` ### Tests (10, all green) - open_lane admits first persona, returns valid HandleRef - lane is bound to handle, carries persona + task + class - close_lane releases footprint + lease + handle store entry, decrements count; double-close is idempotent - admission denies when max_concurrency exceeded → typed ResourcePressure - admission denies when single-job cost_units exceeds max_cost_units (one CodingLarge of 128K against 20K cap → typed deny) - admission denies when no budget for the requested silicon → typed NoBudget - **the realistic-floor smoke test**: 3 personas × 3 distinct TaskKinds (Chat/VoiceChat/GameNpcIdle) sharing ONE heuristic adapter; verifies class derivation (Interactive/Realtime/ Background), KV budgets from recipe table (8K/8K/4K), and pin status (VoiceChat pinned, others not). This is the substrate's defining boast at the realistic floor — multi-persona on one adapter, each persona getting its task- shaped lane. - inspect returns full snapshot for known handle - inspect returns None for unknown handle - class_override lets daemons promote a Chat lane to Realtime when persona context implies (e.g. voice-engaged) ### Step 2 deliberately does NOT include - ServiceModule wiring (Step 3 — the InferenceHandleModule becomes a thin facade over the coordinator) - Continuous batching path in LlamaCpp (Step 4 — the only genuinely new model-serving code) - Pressure-driven eviction sweep (Step 5 — walks reclaimable lanes in revocation-policy order) - Capture sink emission (lands with Step 3 wiring; trait shapes are ready to add when the module routes through here) Each remaining step is its own commit. The library piece (Lane + Coordinator) composes cleanly without the module wiring, so this slice is independently testable + reviewable.
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
…half-the-substrate doctrine (task #109, step 3a) The prior commit (7379698) shipped the InferenceCoordinator without observability hooks — a doctrine violation per [[OBSERVABILITY-AS-SUBSTRATE.md]] line 245: "If a slice ships a module without observability hooks, that slice is incomplete." This commit closes the gap before Step 3b wires the module through the coordinator. Now the coordinator emits structured capture events at every load-bearing decision; sentinels / mechanics / adversarial reviewers can subscribe. ### What ships - `LaneCaptureEvent` enum with three variants: - `LaneOpened` — admission passed, lease acquired, handle minted. Carries persona, task, class, handle_id, lease_id, cost_units, bytes_accounted, target_silicon. - `LaneAdmissionDenied` — admission planner refused. Carries persona, task, reason (NoBudget / ResourcePressure / Stale), cost_units_requested, target_silicon. - `LaneClosed` — lane released. Carries persona, task, handle_id, lease_id, was_present (false on double-close so observers can distinguish). - `LaneCaptureSink` trait — `record(&self, event)` so the coordinator's hot path stays lock-free (impls manage their own interior mutability). - `NoopLaneCaptureSink` — production default, zero cost. - `InMemoryLaneCaptureSink { capacity }` — bounded ring for tests + mechanic-shop introspection. `drain()` returns + clears, `snapshot()` clones, `len()` / `is_empty()` for size queries. Drops oldest when at capacity (proven by test). - `InferenceCoordinator::with_capture_sink(sink)` constructor — swap from the default Noop to an active sink. ### Doctrine alignment - The Noop default reduces the coordinator's hot path to a single virtual call that the compiler can inline through the empty `record()` impl — zero allocation, zero state. The production build pays nothing for observability it didn't ask for. - The sink decides what to do with the event; the caller never branches on "is observability on?" (per the doctrine line "Never branch in the caller on 'is observability enabled?' — let the sink decide"). - Capture events carry the FULL decision rationale (cost units, bytes, target silicon, reason) so a future replay / mechanic-shop tool can answer "why was this admission denied?" without re-running the planner. ### Tests (5 new, 15 total, all green) - capture_sink_records_lane_opened_event_on_successful_open - capture_sink_records_admission_denied_with_reason (third concurrent open → LaneAdmissionDenied with ResourcePressure) - capture_sink_records_lane_closed_with_was_present_flag (real close → was_present=true; double-close → was_present=false) - noop_sink_drops_events_without_panic_or_alloc - in_memory_sink_capacity_drops_oldest (capacity=2; 3rd event evicts the 1st) ### Next (step 3b) Wire `InferenceHandleModule` through `InferenceCoordinator`: - Module holds optional `Arc<InferenceCoordinator>` - `OpenParams` gains `task: Option<TaskKind>` - `open` / `close` route through coordinator when present - `InspectResult` carries optional lane fields when coordinator-managed - ts-rs bindings export TaskKind + LaneClass
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
… (task #109, step 3b) The dumb-command layer now composes with the smart coordinator behind it, per the build plan in [`docs/architecture/INFERENCE-LANES-REALISTIC.md`](../../docs/architecture/INFERENCE-LANES-REALISTIC.md). ### What ships **Module surface**: - `InferenceHandleModule::with_coordinator(Arc<InferenceCoordinator>)` — new constructor for coordinator-wired mode. Existing `new()` keeps the back-compat direct-store path for tests + incremental rollout. - `OpenParams` gains `task: Option<TaskKind>` (defaults to Chat when omitted) + `class_override: Option<LaneClass>`. Daemons can promote a Chat lane to Realtime when persona context implies (voice engaged, mention detected, etc.). - `InspectResult` gains 7 optional lane fields (task, class, seed_kv_tokens, max_kv_tokens, bytes_accounted, lease_expires_at_ms, is_pinned). Coordinator-mode populates; back-compat mode leaves None. **Routing**: - `open` → coordinator.open_lane() when wired; falls back to store.open when not. Admission errors map to typed module errors preserving reason + persona + task. - `close` → coordinator.close_lane() when wired (which releases lease + footprint + handle in one); store.close fallback. - `inspect` → still returns the session snapshot from the handle store, AND augments with the coordinator's LaneInspection when wired. Both views in one wire response. - `generate` stays direct through the handle store. Step 4 wires batched-decode through the coordinator. ### ts-rs surface - `TaskKind` and `LaneClass` now derive `TS` and export to `shared/generated/inference/{TaskKind,LaneClass}.ts`. The `OpenParams` + `InspectResult` ts-rs bindings auto-regenerated to include the new fields. ### Tests (6 new, 22 total, all green) - open_through_coordinator_creates_lane_and_returns_handle — verifies VoiceChat → Realtime → Pinned with correct KV budget - open_through_coordinator_defaults_task_to_chat_when_omitted — Chat is the default; class derives Interactive - open_through_coordinator_admission_failure_surfaces_typed_error — 4 lanes admit (max_concurrency=4); 5th errors with "admission denied" + "ResourcePressure" - close_through_coordinator_releases_lane — close removes both the lane AND the underlying handle store entry; subsequent inspect fails - class_override_promotes_chat_to_realtime_through_coordinator — daemon-style class override works through the wire - inspect_in_non_coordinator_mode_leaves_lane_fields_none — back compat: existing tests still pass; lane fields stay None ### Doctrine alignment - [[commands-are-kernel-level-and-compose]] — the command surface stayed stable. `OpenParams` grew two optional fields, no rename, no removed fields. Callers using the existing shape work unchanged. - [[inference-is-an-adapter-always-in-the-loop]] — the heuristic adapter (registered in tests + production) round-trips through the coordinator → admission → lease → footprint → store path. - [[observability-is-half-the-architecture]] — the wired path's inspect carries lane state alongside session state; nothing about the lane is hidden from callers who ask. - [[inference-scarcity-economics]] §"commands are dumb, daemons smart" — the module IS dumb: parse envelope, route, materialize. The coordinator IS smart: admission, lease, footprint, eviction (Step 5). The split is now real in code. ### What's next - Step 4: continuous batching path in LlamaCppAdapter — requires llama.cpp batched-decode API audit per Q21. - Step 5: PressureBroker-driven lane eviction walk. - Wiring the coordinator into production AIProviderModule initialization (so the real continuum-core-server uses lanes, not just tests).
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
…rvive, Hard yields first (task #109, step 5) The substrate's contract for what pressure does to inference lanes, realized. Closes the realistic-lane build's primary scope for #109. Joel (2026-05-31), the load-bearing prior-attempt warning that shapes this work: "We wrote about this and attempted the same thing with adapters before. It was rather shitty. Key is low latency." The prior failure mode was hot-path adapter eviction on active realtime conversations. This commit makes that impossible by construction. ### Algorithm `evict_under_pressure(target_bytes, now_ms)` walks candidate lanes in priority order: 1. **Expired leases** (any class — including Realtime), oldest first by `lease.acquired_at_ms`. An expired pinned lease is FREE bytes for the substrate; the pin contract was per-turn, not eternal. 2. **`Hard` revocation policy** (Background, Sentinel) — pressure tier 1. Reflective + adversarial work yields first. 3. **`Graceful` revocation policy** (Interactive) — pressure tier 2. Chat / NPC-engaged work yields second. 4. **`Pinned` revocation policy** (Realtime) — **NEVER** evicted by pressure-class targeting. Only step 1 can take them, when their lease has expired. Within each tier, oldest `acquired_at_ms` goes first (rough LRU proxy; richer last-used metrics arrive when the handle store's `last_used_ms` flows through in a future step). Walk stops when bytes_freed >= target OR all evictable lanes exhausted. Returns `EvictionResult` with the per-lane breakdown + `bytes_short = target - bytes_freed` (zero = target met; positive = ran out of non-pinned). ### Public API ```rust pub fn evict_under_pressure(&self, target_bytes: u64, now_ms: u64) -> EvictionResult; pub struct EvictionResult { pub evicted: Vec<EvictedLane>, pub bytes_freed: u64, pub bytes_short: u64, } pub struct EvictedLane { pub handle_id: Uuid, pub persona: PersonaId, pub task: TaskKind, pub class: LaneClass, pub bytes_freed: u64, pub reason: EvictionReason, } pub enum EvictionReason { LeaseExpired, // tier 1 — any class PressureHard, // tier 2 — Background, Sentinel PressureGraceful, // tier 3 — Interactive } ``` ### Observability — per-lane capture event New variant `LaneCaptureEvent::LaneEvicted` carries captured_at_ms, persona, task, class, handle_id, lease_id, bytes_freed, reason. Mechanic-shop observers + sentinels can audit "why was Paige's chat lane evicted at 14:32?" — the answer lives in the trace. ### Critical invariant test `evict_under_pressure_does_not_touch_pinned_realtime_lane`: 1 Realtime + 1 Background, 100 MB of pressure. Only the Background yields. The Realtime lane survives intact. This is the substrate's defining promise to active voice / video chat personas, locked under test. ### Tests (10 new, 25 total, all green) - evict_under_pressure_does_not_touch_pinned_realtime_lane — THE critical invariant: Pinned + active = never evicted - evict_under_pressure_prefers_hard_then_graceful — tier ordering - evict_under_pressure_picks_oldest_within_same_tier — within-tier LRU by acquired_at_ms - evict_under_pressure_collects_expired_first_even_pinned — an expired Realtime lease IS evicted (under LeaseExpired reason), but not under pressure-class targeting - evict_under_pressure_stops_when_target_met — walk halts at target bytes; doesn't over-evict - evict_under_pressure_reports_bytes_short_when_all_pinned — honest about shortfall when no evictable lanes; lane_count unchanged - evict_under_pressure_emits_lane_evicted_capture_with_reason — capture sink fires with correct reason classification - evict_under_pressure_with_zero_target_evicts_nothing — sanity - evict_under_pressure_on_empty_coordinator_is_noop — sanity - evict_realistic_floor_scenario_three_personas_one_must_yield — the realistic-floor story under load: 3 personas (Realtime / Interactive / Background), pressure says free 4K bytes. The Background lane yields; Realtime + Interactive stay warm. The substrate's multi-persona-on-commodity-hardware boast under load. ### Build plan tracker - [x] Step 1: Lane type + binding (1173d88) - [x] Step 2: InferenceCoordinator (7379698) - [x] Step 3a: LaneCaptureSink observability (4fcd99d) - [x] Step 3b: InferenceHandleModule routes through coordinator (b7b3ae6) - [x] Step 5: pressure-driven eviction walk (this commit) - [ ] Step 4: continuous batching in LlamaCppAdapter (the only genuinely new model-serving code; needs Q21 llama.cpp batched-decode API audit) ### What remains for #109 - Step 4: llama.cpp batched serving wiring (the heavy lift). - Wiring the coordinator into production AIProviderModule init (so the real continuum-core-server uses lanes by default, not just tests). - PressureBroker integration so an external pressure signal triggers `evict_under_pressure` automatically. The substrate's defining boast — 16 personas on commodity hardware, real-time latency, no quality tier-down — now has its admission, observability, and pressure-response paths shipped + tested. The remaining work is making it real on llama.cpp.
joelteply
added a commit
that referenced
this pull request
Jun 2, 2026
…sized continuous batching (task #109, step 4) Lifts the previously-hard-coded `n_seq_max = 1` out of the adapter's load() into a caller-controlled knob via the canonical builder pattern. This unblocks the coordinator's lane-multiplexing contract: one base-model load serves N concurrent persona lanes through the in-backend continuous-batching scheduler. ### Background — the prior art was already there The audit for Step 4 (Q21 in [`docs/planning/AI-LANE-OPEN-QUESTIONS.md`](../../docs/planning/AI-LANE-OPEN-QUESTIONS.md)) revealed the heavy lift was already done. The `inference/backends/llamacpp_scheduler.rs` file ships a full continuous-batching scheduler: - `Scheduler::enqueue(req)` accepts `GenerationRequest`s with a `persona_id` + an mpsc TokenEvent stream. - A dedicated OS thread (`driver_loop`) runs one `llama_decode` per loop iteration, advancing every active sequence in parallel within that single decode via `llama_batch` with multiple `seq_id` values. - `ActiveSeq` tracks prefill_pos, gen_pos, sampler, stop sequences, persona_id, output_so_far per slot. - `BatchRole::{PrefillFinal, Generating}` lets the driver sample the right logit index for the right seq. - The adapter's `generate_for_persona` (pure-text path) routes through it; that's the comment "scheduler-managed continuous batching" at llamacpp_adapter.rs:723. The ONLY blocker was the adapter hard-coding `n_seq_max: 1` in LlamaCppConfig, forced historically by qwen3.5's recurrent / Gated-Delta-Net Metal graph aborting at multi-seq batches. This commit lifts that knob to the adapter caller so the substrate's coordinator can size the shared scheduler for multi-lane serving on architectures that DO multiplex cleanly (standard Llama, Qwen-2.5, Gemma-2). ### What this ships - `LlamaCppAdapter::with_n_seq_max(n: u32)` — builder method. Clamps zero to one (zero would be a config error — the scheduler can't serve any seq). - `LlamaCppAdapter::n_seq_max() -> Option<u32>` — accessor for coordinator wiring + introspection. - `n_seq_max_override: Option<u32>` field; `load()` reads it, defaulting to 1 when unset (back-compat + qwen3.5 safety). - Documentation on the builder explaining: (a) the coordinator contract (n_seq_max ≥ lane_budgets.max_concurrency), (b) the qwen3.5 / recurrent-architecture caveat, (c) the future model-arch probe (task #110) that will auto-detect safety. ### Tests (4, all green) - n_seq_max_defaults_to_none_for_single_seq_backcompat — historical behavior preserved when caller doesn't set it. - n_seq_max_override_round_trips_through_builder — builder sets + accessor reads. - n_seq_max_zero_clamps_to_one — graceful handling of invalid config; no panic deep in llama.cpp. - n_seq_max_builder_composes_with_other_overrides — chains cleanly with with_context_length + with_kv_quant_policy so coordinator wiring sets all three in one pipeline. ### What's deliberately deferred (task #110) Production registration in `AIProviderModule` still constructs LlamaCppAdapter with the default (None = 1). Auto-sizing n_seq_max from the coordinator config requires a model-architecture probe (read GGUF metadata, return safe-for-N verdict) so qwen3.5 stays single-seq while Llama/Qwen-2.5/Gemma-2 multiplex. Until #110 lands, multi-lane serving on a real GGUF needs explicit `.with_n_seq_max(N)` at the wiring site plus caller verification of model family. ### Build plan tracker - [x] Step 1: Lane type + binding (1173d88) - [x] Step 2: InferenceCoordinator (7379698) - [x] Step 3a: LaneCaptureSink observability (4fcd99d) - [x] Step 3b: InferenceHandleModule routes through coordinator (b7b3ae6) - [x] Step 5: pressure-driven eviction walk (817017b) - [x] Step 4: LlamaCppAdapter n_seq_max builder (this commit) Realistic-lane MVP is now feature-complete in code. Outstanding work: production wiring (#110 architecture probe + AIProviderModule default to coordinator config), PressureBroker subscription so host pressure auto-triggers evict_under_pressure, and the integration test against a real GGUF when #110 lands.
Bumps eslint from 9.24.0 to 9.33.0.
Release notes
Sourced from eslint's releases.
... (truncated)
Changelog
Sourced from eslint's changelog.
... (truncated)
Commits
a90d7c49.33.09534b55Build: changelog update for 9.33.04258046chore: update dependency@eslint/jsto v9.33.0 (#19998)ad28371chore: package.json update for@eslint/jsrelease06a22f1test: resolve flakiness in --mcp flag test (#19993)732433cfix: allow any type formeta.docs.recommendedin custom rules (#19995)34f0723docs: playground button for TypeScript code example (#19671)dc942a4docs: Update README5a4b6f7docs: Update no-multi-assign.md (#19979)247e156docs: add missing let declarations inno-plusplus(#19980)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)