Dashboard › opencode › Distillation
9fa1fa72-0f09-434f-a349-83e3306c5fb1["lore_tm_v1_eWJF-bbsBVrNQTEI_LQutVcCdvwP_LwoXqvdSIqPHxw","lore_tm_v1_ls2xcZ3dyHNHpBgxPtRbDCPKmcfTUAKH4JziHbmrIuQ","lore_tm_v1_0m6_vRpvbq1ioJX9RiqKcrhDWhP9hxlEmuTsh1XE5Uw","lore_tm_v1_RRul30z9Xk2BdfvW9WLktlTKNV_9RI8NjwRAVz4wF4Y","lore_tm_v1_7xNSXn1x1XgoXJ0fJYzAOBp1A3my4eqmmwhxX6XjpXY"]
Date: Sep 16, 2026
packages/core/test/session-runner-tool-events.test.ts lines 136 and 140; packages/core/test/session-runner.test.ts lines 837, 852, 1737, 3000, 3064, and 3124. Notable checks include session.next.tool.failed.1, decoding with Schema.decodeUnknownSync(SessionEvent.Tool.Success.data), matching SessionEvent.Tool.Success.type, publishing SessionEvent.Step.Started, and the test "publishes the original overflow when recovery summarization fails".packages/core/src/event.ts:369; packages/core/src/project.ts:49; packages/core/src/session.ts:178,450; packages/core/src/session/input.ts:483,558,566,582; packages/core/src/session/context-epoch.ts:79; packages/core/src/session/compaction.ts:206,243; packages/core/src/session/recovery.ts:154; packages/core/src/session/runner/llm.ts:148,283,385,468; and packages/core/src/session/runner/publish-llm-event.ts:63,66,103,234,243.packages/core/src/event.ts:369-395, publishEvent<D extends Definition>(definition, event, commit?) rejects a commit hook on a non-durable definition by dying with InvalidDurableEventError, type: event.type, and exact message Local commit hooks require a durable event.publishEvent(...) calls commitDurableEvent(definition, event as Payload, undefined, commit); when committed, it augments the event with durable.aggregateID, durable.seq, and durable.version, then calls notify(event, true). Otherwise it calls notify(event, false).packages/core/src/event.ts:398-416, isolated event observers run through Effect.suspend(() => observer(event)); non-interruption failures are logged as "Event listener failed" with eventID, eventType, and cause. notify(event, isolateListeners) invokes all listeners, publishes to the event-type-specific PubSub when present, and then publishes to pubsub.all.packages/core/src/event.ts:419-438, publish(...) resolves location from options?.location or Location.Service, creates an ID with options?.id ?? ID.create(), preserves optional metadata, and forwards options?.commit to publishEvent(...).packages/core/src/event.ts:441-478, replay(event, options?) accepts { publish?, ownerID?, strictOwner? }, resolves the durable definition with Durable.get(event.type), and rejects unknown/non-durable types with exact message Unknown durable event type ${event.type}.replay(...) decodes serialized data using Schema.decodeUnknownSync(definition.data)(event.data) and calls commitDurableEvent(...) with seq, aggregateID, ownerID, and strictOwner. If committed and options?.publish is true, it notifies listeners with the reconstructed durable metadata and listener isolation enabled.packages/core/src/event.ts:480-511, replayAll(events, options?) returns undefined for an empty list, requires every event to share the first eventβs aggregateID, and otherwise dies with exact message Replay events must belong to the same aggregate.replayAll(...) requires contiguous sequence numbers beginning at events[0]?.seq ?? 0; a mismatch dies with exact message Replay sequence mismatch at index ${index}: expected ${seq}, got ${event.seq}. It replays events in order and returns the source aggregate ID.packages/core/src/event.ts:514-532, remove(aggregateID) transactionally deletes the aggregate from EventSequenceTable and EventTable; claim(aggregateID, ownerID) updates EventSequenceTable.owner_id.packages/core/src/event.ts:534-563, subscribe(definition) streams the definition-specific PubSub, streamAll() streams pubsub.all, and readAfter(aggregateID, after) optionally invokes beforeAggregateRead, then selects events whose sequence is greater than after, orders them ascending, and maps rows through decodeSerializedEvent(...).packages/core/src/event.ts:565-583, subscribeDurable(aggregateID) creates a sliding PubSub<void> of capacity 1, registers it in pubsub.durable, and removes/shuts it down on release; empty aggregate wake sets are deleted.packages/core/src/event.ts:243-249, durable commit processing reads the aggregateβs current seq and owner_id from EventSequenceTable; absent aggregates use latest = -1.packages/core/src/event.ts:250-260, event data is encoded with Schema.encodeUnknownSync(definition.data). When input.strictOwner is true and the stored owner differs from input.ownerID, commit dies with exact message Replay owner mismatch for aggregate ${aggregateID}: expected ${row.ownerID}, got ${input.ownerID ?? "none"}.input.seq <= latest only if the stored event has the same id, versioned type, and deeply equal encoded data. If the replay provides ownerID and the aggregate currently has no owner, the existing aggregate is assigned that owner. Any mismatch dies with exact message Replay diverged at aggregate ${aggregateID} sequence ${input.seq}.row.ownerID !== input.ownerID).input?.seq ?? latest + 1; replay must append exactly at latest + 1, otherwise commit dies with exact message Sequence mismatch for aggregate ${aggregateID}: expected ${latest + 1}, got ${seq}.EventTable; reuse dies with exact message Event ${event.id} already exists at aggregate ${stored.aggregateID} sequence ${stored.seq}.commit(seq) hook before upserting EventSequenceTable and inserting the event into EventTable, all inside an immediate, uninterruptible database transaction.EventSequenceTable upsert stores aggregate_id, seq, and owner_id; an existing owner is only initialized from input.ownerID when currently null. EventTable stores id, aggregate_id, seq, the versionedType(definition.type, durable.version), and encoded event data.pubsub.durable.get(committed.aggregateID) receive undefined, with results discarded.