3.9 KiB
worldtree-sdk cutover — SLICE-3 complete (2026-07-19)
Slice-3 of the #20 consumer-layer cutover: persona + authored-history +
first-message migrated onto the ratatoskr.wt adapter, and the last
hand-rolled sessions.py paths retired. Two commits: ca9a339 (feat) +
fc256bb (heid-bug-hunt fixups), tags v0.21.11 / v0.21.12. Suite 469 green.
What moved / what was deleted
wt.set_persona_state— passes 3 PAD axes; SDK owns the{"pad": {…}}wire (#317) viaPadState. No route-specific error row →SessionApiFaileddefault. Finiteness enforced at the adapter precondition (chokepoint) AND the CLI.wt.write_authored_history— SDKwrite_history; v1 fixesauthor="assistant"(dropped the unusedauthor/effects/claimed_original_atparams — no caller used them, and a 3-key literal type-checks against the SDK's privateAuthoredHistoryInputwithout importing a non-public symbol). 404 →AuthoredHistoryUnavailable(hide-existence; the ROUTE is the discriminator, never the body); else the default.first_message.seed_preset_first_message— now takes aWorldtreeClient, routes throughwt.write_authored_history; best-effort invariants (INV-001..004) unchanged. Tests rewritten to drive a fakeWorldtreeClient(the wire is the SDK's to prove via its parity corpus, not first_message's).- CLI
--set-persona-pad/--seed-first-message+ the_amainand web create-path first-message seeds rewired onto the adapter. - DELETED from
sessions.py:create_session+SessionInfo,set_persona_state,write_authored_history,get_session_messages,_bifrost_error_from. (The exceptions +BifrostBinding+AgentInfo+ slice-4/5/6 functions stay.)
Live-smoke (INV-CUT-5, personal :8081 b128)
--seed-first-message → 201 (seq=0, phase=seeded) → read-back verbatim;
--set-persona-pad 0.4,0.1,-0.2 → 204; --new create-path preset seed observed
routing through the adapter. All three route families proven end-to-end.
Both heid gates cleared
- heid-code-review (panel, cutover contract): ZERO code-vs-contract drift, all
three arms. Regin's 3 secondary items all self-graded
accept(non-slice-3 routes / web-not-unit-tested / slice-2 stream test) — correctly declined. - heid-bug-hunt (panel): earned its keep — caught a real regression I shipped
in
ca9a339: when the two CLI probes moved off raw httpx onto the adapter, transport failures changed class — the SDK normalizes ANY pre-response transport failure toworldtree_sdk.ConnectFailed(request.py:196), aWorldtreeError(notApiError), so it escaped the adapter unmapped AND the probes' httpx-onlyexcepttuples → uncaught traceback instead of[network_error]exit 21._amain(slice-2) already handled it; the probes lagged. Fix: addConnectFailedto both probe tuples (live-verified at a refused host → exit 21). Second finding (3/3): finite-PAD enforced only at the CLI, not the adapter chokepoint → fix: adapter precondition assert. Declined (correctly): deletedsessions.pyexports (intended no-shim cutover, zero un-migrated importers),session["session_id"]index (accept-known-risk, matches--new), Regin's "web hangs forever" (refuted by Heid from source — the seed iswait_for-bounded).
Foot-gun banked
The SDK wraps ALL transport failures into ConnectFailed(status=0) (not raw
httpx). Every ratatoskr caller that goes through the adapter must except ConnectFailed on its network path — the httpx-only catches are now dead. This bit
the slice-3 probes; watch for it in slice-4+ call-site rewires.
Next
Slice-4 (agents/Tier-3 — list/get/define/patch/delete/persona_state) which FOLDS
the pending model→role cutover (project-tier3-agents-model-to-role-pending).
See 2026-07-19-worldtree-sdk-cutover-slice-1-2-complete for the slice-1+2 arc.