# 0.2.0-beta.1

> 新增常驻资源租约、显式 Session 准入、两阶段可变分块、SessionGroup 选路与动态内存压力调节。

---

LLMS 索引： [llms.txt](/tasklane-web/llms.txt)

---

本版本引入了完整的动态资源调度与状态型多副本能力，涵盖常驻资源租约（`ResourceLease`）、显式 `Session` 准入、`SessionGroup` 缓存足迹路由、两阶段可变大小分块、交互资源预留（`interactiveReserve`）以及内存压力与自适应扩缩容。

## 主要变化摘要

- **常驻资源与显式会话准入**：新增 `resources.acquire({ kind: 'resident', bytes })` 可调大小租约，以及支持 `wait / immediate` 模式的 `scope.acquireSession()` 与空闲可回收会话（`reclaimable: true`）。
- **多副本 `SessionGroup` 与缓存遥测**：支持通过 `CacheResourceLease.report()` 上报读取器内部块缓存快照与命中率，并在 `SessionGroup` 中按真实缓存足迹（Footprint）智能选路。
- **两阶段可变大小分块**：新增 `createSizedResultSource` 与 `iterateSizedResults`，先描述块大小上界、再按实际需求预留输出额度并读取数据。
- **交互预留与定向阻塞唤醒**：支持为 `interactive` 工作预留专用 Worker、活跃槽位、准备窗口、结果租约与字节预算；调度器对阻塞队列建立资源索引，实现定向唤醒。
- **内存压力与可选自适应控制**：支持 `resizePool`、`setMemoryPressure`、`trim` 以及池级 `adaptive` 控制器，所有缓存缩容均基于 Host ACK 确认后归还额度。

## 原始记录

以下内容完整保留 [tasklane CHANGELOG](https://github.com/mapseekai/tasklane/blob/b40ba606552c4b798ebb803528548151186b364b/CHANGELOG.md) 中此版本的英文原文，供核对完整技术变更：

- Scoped resident ResourceLease budgets, bounded handle counts and atomic resize.
- Explicit Session admission with immediate/wait modes, cancellation and capacity diagnostics.
- Opt-in idle Session reclamation with graceful disposal and physical capacity retention on failure.
- Multi-key locality hints with bounded, scope-isolated successful-work history.
- Resizable Worker cache resources and large TypedArray resident accounting.
- Two-phase sized result streaming with pre-encoding output admission.
- Explicit transferOwnedBuffers alias, public types and emap migration guidance.
- Joint Worker/resident Session admission, pressure-driven replica reclaim and resize wakeups.
- Failed Worker termination no longer blocks reclamation of healthy idle Workers.
- Zero-copy binary cache view snapshots and cumulative per-pool/global cache counters.
- Sized output metadata is encoded once, with announced and task bounds rechecked before sending.
- Session admission retains ownership through reentrant factory cancellation and synchronous startup failures.
- Session groups route among caller-opened replicas using bounded replacement reader footprints.
- Optional interactive Worker, active/preparing, result-lease and byte reservations.
- Resource-indexed blocked queues with targeted wakeups and eligibility counters.
- Explicit pool resize, pressure/trim and reader trim callbacks with acknowledgement-based accounting.
- Opt-in adaptive Worker/cache targets within hard bounds, with idle hysteresis and pressure suspension.
- Reader cache counters/snapshots and per-pool reclamation attempts, failures and reasons.
- Protocol v6 adds cache control and resource telemetry; update the main package and Worker bundle together.
- Recheck idle replica eligibility after asynchronous cleanup to protect newly admitted work.
- Defer adaptive cache changes on busy Workers and reconcile at idle without blocking other pools.
- Deterministic multi-pool sampling, repeated pressure transitions and three-browser sustained lifecycle coverage.

## 相关文档

- [当前 API 参考](/docs/reference/)
- [资源调度与内存压力](/docs/guides/resource-scheduling/)
- [文档依据与版本](/docs/reference/provenance/)
