mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
* refactor(session): make ModelLane the provider boundary (#979) ## Summary This closes the model-lane ownership gap left by #832: `ChatSession` no longer stores raw provider/client handles. `ResolvedModelBinding` now carries the provider, client, model, capabilities, registry generation, and backend-auth configuration as one coherent snapshot. - Atomically rebind existing sessions after model-registry changes while pinning each in-flight send, fallback, judge, output guard, task agent, title, compaction, perception, and voice operation to its initiating principal and binding. - Fence UI publication, canonical trajectory folds, durable writes, streams, retries, child scopes, and judge work by generation. Stop can hand off to a successor without accepting late state; cancelled tools retain typed effect receipts, and concurrent approval batches resolve by exact cycle or call. - Make create, fork, open, close, and delete race-safe with hidden `creating` reservations, incarnation-aware state tails, and an ACL-rechecked transaction that clones checkpoint-bounded history, configuration, project/persona state, and attachment references. - Extend REST/OpenAPI and Python/TypeScript SDK contracts for create/fork inputs, routed-create metadata, live-workstream probes, targeted approvals, and structured cancellation results. - Update architecture, storage, authentication, judge, channel, console, API, and SDK documentation, including regenerated architecture diagrams and OpenAPI artifacts. ## Validation - SQLite suite: 11,188 passed, 9 skipped, 10 deselected - PostgreSQL suite: 11,195 passed, 2 skipped, 10 deselected - Live backend: 3 passed - SSE recovery: 6 passed; browser recovery harness passed all scenarios - Ruff: clean; 595 files correctly formatted - mypy: 243 source files clean - TypeScript: typecheck/build and 35 tests passed - OpenAPI artifacts fresh; all 14 changed diagrams reproduce byte-for-byte - `git diff --check` and Git LFS integrity clean Closes #979. * fix(deps): update nanoid for GHSA-2v37-7h3g-55p8 Refresh the transitive lock entry admitted by PostCSS so the TypeScript security gate no longer resolves the vulnerable custom-generator implementation. Validation: - npm ci - npm audit --audit-level=moderate: 0 vulnerabilities - TypeScript typecheck and build - TypeScript tests: 35 passed * fix(test): assert canonical model registry URLs Replace prefix checks with exact canonical base URL assertions so the tests do not model incomplete URL validation. Validation: tests/test_model_registry.py (185 passed); Ruff check/format; mypy.
This commit is contained in:
@@ -8,6 +8,7 @@ from types import SimpleNamespace
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from turnstone.core.model_turn import resolve_capabilities
|
||||
from turnstone.core.rerank import (
|
||||
CohereJinaRerankClient,
|
||||
RerankHit,
|
||||
@@ -592,7 +593,6 @@ class TestModelCapabilitiesRerankFields:
|
||||
import dataclasses
|
||||
|
||||
from turnstone.core.providers._protocol import ModelCapabilities
|
||||
from turnstone.core.session import ChatSession
|
||||
|
||||
base = ModelCapabilities()
|
||||
provider = SimpleNamespace(get_capabilities=lambda model: base)
|
||||
@@ -605,8 +605,7 @@ class TestModelCapabilitiesRerankFields:
|
||||
}
|
||||
)
|
||||
registry = SimpleNamespace(get_config=lambda alias: cfg)
|
||||
stub = SimpleNamespace(_registry=registry)
|
||||
caps = ChatSession._resolve_capabilities(stub, provider, "m", "rr")
|
||||
caps = resolve_capabilities(provider, "m", "rr", registry)
|
||||
assert isinstance(caps, ModelCapabilities)
|
||||
assert caps.rerank_threshold == 0.5
|
||||
assert caps.rerank_scale == "logit (sigmoid-normalised)"
|
||||
|
||||
Reference in New Issue
Block a user