Dashboard › opencode › Distillation
3c8cfcb6-dff5-4e36-9fe6-3be8151ac65b["lore_tm_v1_hR_Xg7nRyI32p0IhHNuwjH_ZX8q79BXoPkD6CeyxfJ0","lore_tm_v1_09X4aeRnxSm6jPqwEy7j7Dz-3yZJOyQlve41tStiR8Y","lore_tm_v1_FN4GnJ-cZVo2Oahhx1Vxh9CVblNqiD8UFo_UfGxCtzI","lore_tm_v1_0uRz9rC2XnJFJW3dXQ_4nI4EfVPzd0G7WAVleA4RMag","lore_tm_v1_b689LIy9Ri11AOY7l9r9MafpCPvvpIf5_IIRJaey0lo","lore_tm_v1__uLVpH7n2Oi62Lt4P0bJUNMH9gsr0HyDMkx6gpsJlW8","lore_tm_v1_MOnEHyVM3CvBeQy4gewL_p6sbOEre8j1SMk7h7SCQc8"]
Date: Sep 15, 2026
packages/schema/src/session-event.ts:232 documents that stream fragments are live-only and Text.Ended is the replayable full-value boundary; Text.Delta begins at line 233 and carries assistantMessageID, textID, and delta.packages/core/test/lib/effect.ts defines Body<A, E, R> as an Effect.Effect<A, E, R> or a function returning one; body() wraps it in Effect.suspend.packages/core/test/lib/effect.ts:11-20 defines run(): it applies Effect.scoped, provides a layer, captures Effect.exit, logs every Cause.prettyErrors(exit.cause) through Effect.logError, and returns the exit via Effect.runPromise.packages/core/test/lib/effect.ts:22-41 defines make(testLayer, liveLayer), returning { effect, live }; both test variants support ordinary, .only, and .skip forms and accept number | TestOptions.packages/core/test/lib/effect.ts:44-53 defines testEnv = Layer.mergeAll(TestConsole.layer, TestClock.layer()), liveEnv = TestConsole.layer, exports it = make(testEnv, liveEnv), and exports testEffect(layer) using Layer.provideMerge(layer, testEnv) and Layer.provideMerge(layer, liveEnv).packages/core/test/session-projector.test.ts contains 37 matches related to recovery/ownership/expiry: repeated SessionRecovery.recover() calls occur at lines 212-213, 258, 305, 344-345, 390-391, 484, 536, and 842; fixtures use owners "dead", "live", "successor", "stale-owner", "successor-owner", and "owner", with expiries including 0, 60_000, and Date.now() + 60_000.packages/core/test/session-projector.test.ts:470 directly inserts malformed execution row ('malformed', sessionID, 'dead', 'invalid', 0, 0) into session_execution.packages/core/test/session-projector.test.ts:673 advances ownership with .set({ id: "successor-advance", owner_id: "successor-owner", expires_at: 60_000 }); lines 744 and 782 query SessionExecutionTable.expires_at as expiresAt.packages/core/test/session-prompt.test.ts:121-140 tests that session.interrupt(sessionID) delegates process-local interruption through SessionExecution, leaves session messages empty, and also works for unrecorded SessionV2.ID.make("ses_missing").packages/core/test/session-prompt.test.ts:143-162 tests durable admission before transcript promotion: prompting "Fix the failing tests" with resume: false returns the message while session.messages({ sessionID }) remains empty, and the admitted record has the same ID/session/prompt with delivery: "steer".packages/core/test/session-prompt.test.ts:165-183 tests MIME resolution before admission: file { uri: "data:image/png;base64,aGVsbG8=", name: "image.png" } becomes { uri: "data:image/png;base64,aGVsbG8=", name: "image.png", mime: "image/png" }, and the admitted prompt stores those resolved files.packages/core/test/session-prompt.test.ts:186-213 tests durable event streaming after an aggregate sequence: two prompts, "First" and "Second", are promoted via SessionInput.promoteSteers(db, events, sessionID, Number.MAX_SAFE_INTEGER); streamed [durable.seq, type] values are ordered as [0, "session.next.prompt.admitted"], [1, "session.next.prompt.admitted"], [2, "session.next.prompted"], [3, "session.next.prompted"]; querying after sequence 0 starts at sequence 1.packages/core/test/session-prompt.test.ts:216-229 begins the test "resumes through a recorded message without appending another prompt" using an admitted "Fix the failing tests" message, then clearing executionCalls and wakeCalls before session.resume(sessionID).packages/core/src/database/migration.ts defines Migration as { id: string; up: (tx: Transaction) => Effect.Effect<void, unknown> } and serializes apply() calls with const lock = Semaphore.makeUnsafe(1).packages/core/src/database/migration.ts:18-40 migration initialization logic: inspect non-SQLite internal tables; if a "session" table exists, call applyOnly(db, migrations); if any other tables exist without "session", die with "Database is not empty and has no session table"; for an empty database, run schema.up(tx), create migration (id TEXT PRIMARY KEY, time_completed INTEGER NOT NULL), and record every generated migration ID with Date.now() in one transaction.packages/core/src/database/migration.ts:43-50 defines applyOnly(db, input): create the migration journal if absent and load completed migration IDs into a Set.packages/core/src/database/migration.ts:51-94 handles legacy Drizzle journals only when the new journal is empty. If __drizzle_migrations has a name column, it copies non-null names with INSERT OR IGNORE; otherwise it converts created_at to prefix strftime('%Y%m%d%H%M%S', created_at / 1000, 'unixepoch'), matches input IDs beginning with ${entry.prefix}_, and records each match.packages/core/src/database/migration.ts:77-83: if no input migration ID matches a timestamp-derived prefix, migration dies with new Error(\Legacy migration timestamp ${entry.created_at} does not match any known migration`)`.packages/core/src/database/migration.ts:96-106 skips migration IDs already in the completed set; each pending migration.up(tx) and insertion of its (id, Date.now()) journal row occur atomically in a transaction.packages/core/test/session-runner.test.ts:3106 contains "interrupts runner continuation when permission approval is declined"; its declined tool is described as "Fail because the user declined approval" and executes Effect.die(new PermissionV2.DeclinedError()), with prompt "Call declined" and tool call ID "call-declined".packages/core/test/session-runner.test.ts validation cases include question rejection via questions.reject(pending[0]!.id) at line 3233, "rejects duplicate streamed text starts" at line 3769, and "rejects malformed streamed tool input ordering" at line 3813.