Dashboard › opencode › Distillation
20b85891-6af9-4040-b14f-4876aaea61ff["lore_tm_v1_SNEv_-Lcam3YEx8AquNcZIuNCDlaww_zIjX_hvaO0hA","lore_tm_v1_zE7i_CWgZ860WH2NYEi-Wp1eyRPiRznHvMFEXELDcKA","lore_tm_v1_vTIGSjwZ-qG1gnM_Jtfblyw4Pe1AoWX2j32N4jNyotM","lore_tm_v1_MrvUiWY6kThaJzsIbO1VN1Ed_D62CaMMcSlJvRKPx84","lore_tm_v1_rMwqfKksewJRuFZe0-SpFt9pZmy4xREGfpBIHWc322A","lore_tm_v1_nfhoXE6nqKV-4eokDNscrZ8cS9zoUGY3KD5M2LXnw0o","lore_tm_v1_8NCOa-g3kUj2ql171dUHbY1PEujnCxXHKu2aZZ3qi5M","lore_tm_v1_XAX1CGGatCZosTxEHBxKyaTJBPR32Wmcs9jnuvKpV1U","lore_tm_v1_SOVAW5njRzD2KdE5HyYpuZK4-aCkYNL36pZDxOHLGJo","lore_tm_v1_OOz0eK7rbE6rdGP7-yjNX4ITdO-VwnTG_MSX6rTcBfo","lore_tm_v1_Rchws_OY0l3LyWV7keY4dUDtd_4Gzf81WMFi_hB2_zU","lore_tm_v1_JLnJhKcT_wWSMLnL_dDuyUtveqjZeAeSptHQYriJVgc"]
Date: Sep 9, 2026
/home/byk/Code/opencode-lore/quality/REVIEW.md codifies Loreβs pull-request review bar because adversarial review has repeatedly found correctness bugs missed by green test suites, especially skip/early-return branches, lifecycle sequences, and fan-out registry gaps.SYNCED_TABLES β sync-registry-contract.test.ts, covering registered table shape, pull-only/no-capture invariants, composite-primary-key correctness, sync columns, ID columns, and versioned flags; MIGRATIONS β db.test.ts with one toBe(MIGRATIONS.length) schema-version assertion plus migration-specific tests; AGENTS β agents.test.ts, requiring every agent to have name, displayName, binary, and detect(), with binary as a constant placeholder string.packages/core/test/sync-registry-contract.test.ts; per-operation sync invariants in packages/core/src/sync-data.ts through assertSyncInvariants; and sequence properties in packages/gateway/test/sync.property.test.ts.assertSyncInvariants covers no pull-only outbox entries, at most 1 profile, and every state row referencing a registered table.packages/gateway/test/sync.property.test.ts covers standing invariants after every operation, prune-floor non-wedging, eventual convergence, no ping-pong, and currentTier correctness.#856, #861, #866, and #868 establish skip/early-return branches as the highest-risk surface; guards involving NOT EXISTS, latest <> 'upsert', and content matching masked real data-loss bugs, so every skip branch needs a test that makes it skip something it should not.#833 property-test battery found 4 real sync-engine bugs missed by example tests; all depended on sequences crossing enable/disable/push/pull boundaries.syncedColumns PRAGMA cache, should be frozen so accidental mutation throws TypeError in strict mode rather than silently corrupting the cache.db().query monkeypatches are silently shadowed by the tracing Proxy; use log.registerSink({ withDbSpan }), as empirically verified in #874.pnpm test, pnpm run typecheck, pnpm run lint, and pnpm run format:check; they must inspect exit codes because a blank output tail can hide lint or formatting failures.file:line evidence, and give an overall MERGE / DO-NOT-MERGE decision; unstructured βLGTMβ is insufficient./home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/source.ts:152 logs the warning "configured plugin path must be a directory" with { target: operation.target }./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts, configured local plugins βalways arrive here as directoriesβ; the local-file branch at lines 94β97 remains for legacy auto-discovery of standalone server sources.PluginModule.make in /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts creates an unbounded PubSub<void>, tracks watched paths in Set<string>, subscribes through Watcher.Service, waits on a Deferred<void> readiness signal, and forks update processing into the enclosing scope with { startImmediately: true }.watchTarget(file) recursively walks to the nearest existing ancestor when a plugin dependency is missing, returning a watcher input with type: "directory" or "file" based on stat(file).PluginModule.make acquires createPluginSources((file) => runPromise(watch(file))) and releases it through sources.dispose().PluginModule.load treats an absolute operation.target as local; non-local targets use npm.resolve(operation.target) when options?.install === false, otherwise npm.add(operation.target).PluginModule.load resolves local file entrypoints directly to { server: pathToFileURL(operation.target).href } only for the legacy standalone-file case; otherwise it calls Host.resolve(installed ?? { directory: operation.target }).options?.install === false, PluginModule.load returns { pending: true as const }; otherwise a missing server entrypoint raises PluginModule.LoadError with Plugin entrypoint not found: ${operation.target}.id and either an effect or setup function; decode failures become PluginModule.LoadError with message "Plugin must export a default definition with an id and an effect or setup function."PluginPromise.fromPromise(value); native effect-style definitions are used directly./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts keeps compiled RPC endpoint metadata in const compiledEndpoints = new WeakMap<object, CompiledEndpoint>(); each CompiledEndpoint has a readonly decoder array, an encoder, and a noContent flag.makeStreams in /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts gives each async iterator its own scope, tracks iterator cleanup callbacks in subscriptions, closes all subscriptions when the plugin unloads, supports optional AbortSignal, and removes each abort listener during close()./home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.ts, createPluginSources(watch) stores source attempts in Map<string, Source>, cleanup callbacks in Array<() => void>, and in-progress watcher setup in Set<Promise<void>>.createPluginSources().read(entrypoint) waits for all watcher setup, then reuses the prior loaded attempt only when every tracked fileβs current digest equals its stored digest.{ digest, directory }, starts watch(file), removes the pending promise when settled, and deliberately consumes watcher-setup rejection because setup can be interrupted while module evaluation remains pending.createPluginSources().read() dynamically imports #plugin-source, calls prepareSource(entrypoint, track), records an optional prepared.dispose, and caches prepared.load() before evaluation so unchanged failing modules do not repeat import-time side effects on every filesystem notification.Hash.sha256; files hash readFileSync(file), directories hash JSON.stringify(readdirSync(file).sort()), and inaccessible or missing paths use the literal digest "missing".localSource(spec, directory) recognizes file://, ./, ../, and absolute paths, resolving relative filesystem paths against directory; package-like specifiers return undefined./home/byk/Code/opencode-lore/packages/core/src/log.ts treats debug as enabled only when LORE_DEBUG === "1" or case-insensitively equals "true"; LORE_DEBUG=0 and LORE_DEBUG=false must not enable stderr status output.traceDbQuery<T>(sql, fn) delegates to sink.withDbSpan(sql, fn) when available and otherwise calls fn() directly.silenceStderr() because any stdout/stderr byte from an in-process gateway corrupts the TUI; this applies to all logger levels, including error, even with LORE_DEBUG=1, while persistent file and registered LogSink output remain active.globalThis key "__loreStderrSilenced" rather than a module-local variable so separately bundled copies of @loreai/core in the same main thread observe the same state.silenceStderr(silenced = true) is process-global and idempotent; isStderrSilenced() reports the current state. Standalone Lore CLI processes do not call it and retain stderr visibility./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin.ts, active plugin slots preserve activation-order alignment, including failed setup slots, so prefix diffing remains index-aligned and an unchanged failed revision is not retried.Semaphore.makeUnsafe(1) as the activation lock, Latch.make(true) for readiness, and a tokenized pending set; the latch closes while any readiness hold exists and reopens when the last token is released.Plugin.activate, raising Error("Duplicate plugin ID: ...")."failed to restore plugin; deactivating".Activation with "Plugin disabled after ${failure.state}.transform failed. Check server logs for details." and a reference of the form err_${crypto.randomUUID().slice(0, 8)}, then enqueue a PendingFailure containing the plugin, scope, failure, refresh operation, reference, and readiness-hold release.Effect.ensuring via Scope.close(item.scope, Exit.void) and Effect.forkScoped({ startImmediately: true }), so cleanup is still scheduled if an inventory observer fails and does not block under the lock or hold."failed to clean up disabled plugin" with "plugin.id", ref, and cause; non-interruption reporting failures log "failed to report disabled plugin"; item.release always runs in a final Effect.ensuring.closed = true, clears pending readiness tokens, opens the readiness latch, clears active slots, and runs State.shutdown(Scope.close(scope, exit))./home/byk/Code/opencode-v2-pilot/packages/plugin/src/source.bun.ts uses a monotonically incremented generation initialized with Date.now() and returns { version: String(++generation), load: () => Host.load(entrypoint) }.node_modules, deletes require.cache[file] even for absent keys to invalidate rejected evaluations, tracks each visited file, and scans only files matching /\.[cm]?[jt]sx?$/.Bun.Transpiler with loader selection tsx, jsx, ts, or js and target "bun"; scan failures produce an empty dependency list while the native runtime loader remains responsible for compilation, package resolution, import attributes, and error reporting.createRequire(file).resolve(requested) for require-call imports and Bun.resolveSync(requested, path.dirname(file)) otherwise; unresolved local dependencies cause track(path.dirname(requested), true) so creation on a later save can trigger recovery.