Dashboard › opencode-lore › Session 0WSxfhGSVTyc
0WSxfhGSVTycYrZfLRead-only focused code audit in /home/byk/Code/opencode-lore-embedding-runtime. Do not edit files or mutate VCS. Inspect current working-copy changes for cgroup memory headroom and embedding pool admission only: packages/core/src/cgroup-memory.ts, embedding/local.ts, embedding/pool.ts, embedding-cap.ts and relevant tests. Identify concrete correctness defects, unnecessary complexity, missing edge-case tests, and whether logic preserves: primary worker always exists; cgroup limit is not mistaken for remaining free; unknown constrained headroom fails closed only for expansion; healthy siblings serve while failed slot has retry debt; all unproven workers plus next worker are charged; observed per-worker resident budget should be represented safely; no NaN/infinity. Cite exact file:line and return concise PASS/CONCERN/MUST-FIX findings. Do not run full test suite, network, or any service. You may run focused read-only test commands if needed. This is preliminary review, not final immutable-candidate review.
<path>/home/byk/Code/opencode-lore-embedding-runtime</path> <type>directory</type> <entries> .craft.yml .git .github/ .gitignore .jj/ .lore.md .oxfmtrc.json .oxlintrc.json AGENTS.md CHANGELOG.md codecov.yml LICENSE node_modules/ package.json packages/ patches/ pnpm-lock.yaml pnpm-workspace.yaml quality/ README.md scripts/ stryker.config.mjs supabase/ tsconfig.base.json tsconfig.json vitest.config.ts vitest.evals.config.ts vitest.mutation.config.ts (28 entries) </entries>
<path>/home/byk/Code/opencode-lore-embedding-runtime/AGENTS.md</path> <type>file</type> <content> 1: <!-- This section is maintained by the coding agent via lore (https://github.com/BYK/loreai) --> 2: ## Long-term Knowledge 3: 4: For long-term knowledge entries managed by [lore](https://github.com/BYK/loreai) (gotchas, patterns, decisions, architecture), see [`.lore.md`](.lore.md) in the project root. 5: <!-- End lore-managed section --> 6: 7: ## Review 8: 9: See [`quality/REVIEW.md`](quality/REVIEW.md) for the review heuristics and workflow — regression-test discipline, adversarial-order state setup, fan-out registry coverage, recurring bug-class batteries, and the two-reviewer rule. Every non-trivial PR requires an adversarial correctness review before merge. 10: 11: # Project Overview 12: 13: Lore is a **three-tier memory architecture** for AI coding agents. ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/quality/REVIEW.md</path> <type>file</type> <content> 1: # Review Heuristics — Lore 2: 3: This document codifies the review bar for pull requests. It exists because 4: adversarial review has repeatedly caught correctness bugs that a green test 5: suite missed — skip/early-return branches, lifecycle sequences, and fan-out 6: registry gaps. Institutionalizing these patterns so they compound. 7: 8: The review workflow (§6) is referenced from AGENTS.md. 9: 10: --- 11: 12: ## 1. Regression-test discipline 13: 14: Every adversarial-review finding that surfaces a defect **must** land a 15: deterministic regression test in the same PR. The test: 16: - fails on the base branch (proving it reproduces the bug), 17: - passes on the fix (proving the fix works), 18: - drives the *real* precondition, not an artificially-constructed state (e.g. ...
<skill_content name="jj-guide"> # Skill: jj-guide # jj Guide for AI Agents Jujutsu (jj) is a Git-compatible VCS with mutable commits, automatic snapshotting, no staging area, and first-class conflicts. This skill teaches you how to use it safely from a non-interactive agent environment. If `.jj/` exists in the repo root, this is a jj repo. **Use `jj` commands, not `git`.** In a colocated repo (`.jj/` *and* `.git/`), git tools can read the state, but mutations should go through `jj` so the operation log stays consistent. ## Critical Rules - **NEVER** use interactive flags (`-i`, `--interactive`). TUI prompts hang in agent environments. This applies to `jj split -i`, `jj squash -i`, `jj commit -i`, `jj resolve`, `jj diffedit`, etc. - **ALWAYS** pass `-m "msg"` when describing/committing. Without `-m`, an editor opens and hangs. - **VERIFY** mutations with `jj st` and `jj log` after `squash`, `abandon`, `rebase`, `restore`, `commit`. ...
/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/cgroup-memory.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-status.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/vector-pool.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/temporal-embedding-queue.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/shutdown-vector-pool.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-shutdown.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-self-heal.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-pool.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-pool-memory.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-optional-stack.test.ts /home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embe...
/home/byk/Code/opencode-lore-embedding-runtime/packages/core/src/embedding/local.ts
Working copy changes: A packages/core/src/cgroup-memory.ts M packages/core/src/embedding/local.ts M packages/core/src/embedding/pool.ts M packages/core/src/embedding-cap.ts M packages/core/src/embedding-worker-types.ts M packages/core/src/embedding-worker.ts M packages/core/src/embedding.ts M packages/core/src/ort-native.ts A packages/core/test/cgroup-memory.test.ts M packages/core/test/embedding-cap.test.ts M packages/core/test/embedding-pool-memory.test.ts M packages/core/test/embedding-pool.test.ts M packages/core/test/embedding-wasm-fallback.test.ts M packages/core/test/embedding-worker-stdio.test.ts M packages/core/test/embedding-worker-types.test.ts M packages/core/test/ort-native.test.ts M packages/gateway/script/bundle.ts M packages/gateway/script/ort-platform-package.ts M packages/gateway/test/bundle-exports.test.ts M packages/gateway/test/ort-platform-package.test.ts Working copy (@) : tmzmtlss 8888d203 fix/embedding-runtime-admission | fix(core): correct embedding runtime ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/src/cgroup-memory.ts</path>
<type>file</type>
<content>
1: import { readFileSync } from "node:fs";
2: import { posix } from "node:path";
3:
4: interface CgroupMembership {
5: version: 1 | 2;
6: path: string;
7: }
8:
9: interface CgroupMemoryFiles {
10: version: 1 | 2;
11: directory: string;
12: mountPoint: string;
13: root: string;
14: }
15:
16: type ReadTextFile = (path: string) => string;
17:
18: function readTextFile(path: string): string {
19: return readFileSync(path, "utf8");
20: }
21:
22: function decodeProcPath(value: string): string | null {
23: const decoded = value.replace(/\\([0-7]{3})/g, (_match, octal: string) =>
24: String.fromCharCode(Number.parseInt(octal, 8)),
25: );
26: if (!decoded.startsWith("/") || decoded.includes("\0")) return null;
27: if (decoded.split("/").includes("..")) return null;
28: return posix.normalize(decoded);
29: }
30:
31: function ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/src/embedding/local.ts</path>
<type>file</type>
<content>
1: /** Local ONNX embedding worker lifecycle. */
2:
3: import { freemem } from "node:os";
4: import { readLinuxCgroupMemoryHeadroomBytes } from "../cgroup-memory";
5: import { db } from "../db";
6: import * as log from "../log";
7: import { vendorModelInfo } from "../embedding-vendor";
8: import { nativeIntraOpThreads } from "../ort-native";
9: import {
10: MIN_EMBED_TOKENS,
11: MODEL_MAX_TOKENS,
12: backoffEmbedCap,
13: clampFreeToContainerLimit,
14: memoryModelEmbedCap,
15: reconcileEmbedCap,
16: reprobeEmbedCap,
17: resolveMemoryHeadroom,
18: shouldReprobeEmbedCap,
19: type PersistedEmbedCap,
20: } from "../embedding-cap";
21: import {
22: EMBED_OOM_EXIT_CODE,
23: isMissingLocalStackError,
24: isWasmFatalError,
25: type EmbedRequest,
26: type WorkerInbound,
27: type WorkerOutbound,
28: type WorkerInitData,
29: } from ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/src/embedding/local.ts</path>
<type>file</type>
<content>
601: this.worker = testWorkerFactory(
602: workerInitData,
603: workerEntrypoint,
604: workerOptions,
605: );
606: } else {
607: this.worker = new Worker(workerEntrypoint, workerOptions);
608: }
609:
610: // Attach flowing readers before any request is posted. The streams remain
611: // owned and drained for the worker's whole lifetime, including init/OOM
612: // diagnostics emitted before the first response or during shutdown.
613: drainEmbeddingWorkerOutput(this.worker);
614:
615: // Don't let the worker prevent process exit.
616: this.worker.unref();
617:
618: // Capture the worker THIS init spawned. Every event handler below is bound
619: // to `spawned` and early-returns if `this.worker !== spawned` — a stale
620: // worker's late ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/src/embedding/pool.ts</path>
<type>file</type>
<content>
1: /** Host-owned queue and pool for local embedding workers. */
2:
3: import { createHash } from "node:crypto";
4: import { freemem } from "node:os";
5: import { config } from "../config";
6: import * as log from "../log";
7: import {
8: DEFAULT_MAX_EMBED_POOL,
9: EMBED_POOL_ABS_MAX,
10: PER_WORKER_MEM_BUDGET_BYTES,
11: clampFreeToContainerLimit,
12: } from "../embedding-cap";
13: import {
14: EmbeddingQueueCapacityError,
15: EmbeddingRequestAbortedError,
16: EmbeddingWorkerWatchdogError,
17: type EmbeddingProvider,
18: LocalProviderUnavailableError,
19: WORKER_SHUTDOWN_TIMEOUT_MS,
20: isRecallEmbed,
21: } from "./contract";
22: import {
23: LocalProvider,
24: availableMemoryHeadroom,
25: clearLocalProviderLatch,
26: constrainedMemoryLimit,
27: localEmbeddingState,
28: } from "./local";
29: import { OwnedRetirements } from ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/src/embedding/pool.ts</path>
<type>file</type>
<content>
601: };
602: armWatchdog("init", embedInitWatchdogMs);
603:
604: try {
605: // Deliberately omit every caller's AbortSignal. The operation owns the
606: // worker slot until native inference settles; callers only own waiters.
607: const vectors = await Promise.race([
608: slot.provider.embed(
609: operation.texts,
610: operation.inputType,
611: undefined,
612: () => armWatchdog("execution", embedExecutionWatchdogMs),
613: ),
614: watchdog,
615: ]);
616: this.recordSlotSuccess(slot);
617: const retainResult =
618: operation.retainResult === true && operation.waiters.size === 0;
619: operation.state = "completed";
620: operation.completedAt = Date.now();
621: operation.vectors = retainResult
622: ? ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/src/embedding-cap.ts</path> <type>file</type> <content> 1: /** 2: * Adaptive token-cap math for local ONNX embedding inference. 3: * 4: * Local inference OOMs on long inputs: the O(L²) attention tensor for a long 5: * sequence blows the WASM heap, and because WASM linear memory never shrinks, 6: * an in-process retry cannot recover. We instead cap the input sequence length 7: * up-front and adapt that cap to the host — start from a memory-aware estimate, 8: * and on each OOM lower the cap ×0.7 and respawn the worker on a fresh heap. 9: * 10: * This module holds the pure, dependency-free math so it can be unit-tested in 11: * isolation. The stateful pieces (persistence, worker lifecycle, telemetry) 12: * live in embedding.ts. 13: */ 14: 15: /** Floor token cap. ...
diff --git a/packages/core/src/cgroup-memory.ts b/packages/core/src/cgroup-memory.ts
new file mode 100644
index 0000000000..57d6fa9940
--- /dev/null
+++ b/packages/core/src/cgroup-memory.ts
@@ -0,0 +1,205 @@
+import { readFileSync } from "node:fs";
+import { posix } from "node:path";
+
+interface CgroupMembership {
+ version: 1 | 2;
+ path: string;
+}
+
+interface CgroupMemoryFiles {
+ version: 1 | 2;
+ directory: string;
+ mountPoint: string;
+ root: string;
+}
+
+type ReadTextFile = (path: string) => string;
+
+function readTextFile(path: string): string {
+ return readFileSync(path, "utf8");
+}
+
+function decodeProcPath(value: string): string | null {
+ const decoded = value.replace(/\\([0-7]{3})/g, (_match, octal: string) =>
+ String.fromCharCode(Number.parseInt(octal, 8)),
+ );
+ if (!decoded.startsWith("/") || decoded.includes("\0")) return null;
+ if (decoded.split("/").includes("..")) return null;
+ return posix.normalize(decoded);
+}
+
+function ...
Found 100 matches (more matches available)
/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/cgroup-memory.test.ts:
Line 25: "0::/worker.slice\n",
Line 30: directory: "/run/cgroup mount/worker.slice",
Line 58: "3:memory:/legacy/worker",
Line 67: directory: "/run/memory/worker",
Line 226: it("fails closed when a constrained mount root is unreadable", () => {
Line 275: it("reads v1 headroom and treats its oversized unlimited sentinel as max", () => {
/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-pool-memory.test.ts:
Line 3: import type { Worker } from "node:worker_threads";
Line 22: import { EMBED_OOM_EXIT_CODE } from "../src/embedding-worker-types";
Line 25: // (Onur's report): the pool grew to N workers, each independently sized its
Line 29: // These tests pin the two guards: (1) each worker sizes from free / ceiling, and
Line 37: /** Minimal stand-in for a node:worker_threads ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-pool.test.ts</path>
<type>file</type>
<content>
1: import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2: import { EventEmitter } from "node:events";
3: import type { Worker } from "node:worker_threads";
4: import {
5: embed,
6: embedInTokenBatches,
7: EmbeddingQueueCapacityError,
8: EmbeddingRequestAbortedError,
9: EmbeddingWorkerWatchdogError,
10: ensureEmbeddingReady,
11: isAvailable,
12: LocalProviderUnavailableError,
13: recallEmbedsInFlight,
14: resetProvider,
15: shutdownProvider,
16: _configuredEmbedPoolSize,
17: _getLocalInitRetryAtForTest,
18: _resetLocalProviderProbe,
19: _resetProviderShutdownTrackingForTest,
20: _restoreProvider,
21: _saveAndClearProvider,
22: _setConstrainedMemoryForTest,
23: _setAvailableMemoryForTest,
24: _setEmbedPoolSizeForTest,
25: _setEmbeddingWorkerWatchdogsForTest,
26: ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-pool.test.ts</path>
<type>file</type>
<content>
640: expect(fakes[0].gotShutdown).toBe(false);
641: });
642:
643: it("already-aborted input creates no worker", async () => {
644: _setEmbedPoolSizeForTest(1);
645: const fakes = installFakeWorkers();
646: const abort = new AbortController();
647: abort.abort();
648:
649: await expect(
650: embed(["cancelled"], "document", abort.signal),
651: ).rejects.toBeInstanceOf(EmbeddingRequestAbortedError);
652: await flush();
653: expect(fakes).toHaveLength(0);
654: });
655:
656: it("retires and replaces a worker whose initialization watchdog expires", async () => {
657: _setEmbedPoolSizeForTest(1);
658: _setEmbeddingWorkerWatchdogsForTest(10, 60_000);
659: const fakes = installFakeWorkers();
660:
661: await expect(embed(["stuck init"], "document")).rejects.toMatchObject({
662: name: ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-pool.test.ts</path>
<type>file</type>
<content>
1200: await flush();
1201: fakes[0].completeNext();
1202: await Promise.all([afterExhaustion, queuedAfterExhaustion]);
1203: });
1204:
1205: it("does not let a stale recovery probe clear a newer sibling failure", async () => {
1206: _setEmbedPoolSizeForTest(2);
1207: _setPoolFreememForTest(64 * GB);
1208: _setLocalInitCooldownMsForTest(60_000);
1209: const fakes = installFakeWorkers();
1210:
1211: const warm = embed(["warm"], "document");
1212: await flush();
1213: fakes[0].completeAll();
1214: await warm;
1215:
1216: // Build two failures while the healthy slot continues serving.
1217: for (let attempt = 1; attempt <= 2; attempt++) {
1218: const healthy = embed([`healthy-${attempt}`], "document");
1219: if (attempt > 1) _setLocalInitRetryAtForTest(Date.now() - 1);
1220: const ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-cap.test.ts</path>
<type>file</type>
<content>
1: import { describe, it, expect } from "vitest";
2: import {
3: BACKFILL_MIN_AUTO_DUTY,
4: BACKFILL_THROTTLE_MAX_SLEEP_MS,
5: DEFAULT_MAX_EMBED_POOL,
6: EMBED_POOL_ABS_MAX,
7: EMBED_WORKER_RESIDENT_RESERVE_BYTES,
8: MIN_EMBED_TOKENS,
9: MODEL_MAX_TOKENS,
10: PER_WORKER_MEM_BUDGET_BYTES,
11: EMBED_TOKEN_CEILING,
12: backfillThrottleSleepMs,
13: backoffEmbedCap,
14: clampEmbedCap,
15: clampFreeToContainerLimit,
16: desiredEmbedPoolSize,
17: memoryModelEmbedCap,
18: reconcileEmbedCap,
19: reprobeEmbedCap,
20: resolveBackfillCpuDuty,
21: resolveMemoryHeadroom,
22: shouldReprobeEmbedCap,
23: } from "../src/embedding-cap";
24:
25: const GB = 1024 * 1024 * 1024;
26: const MB = 1024 * 1024;
27:
28: describe("clampFreeToContainerLimit", () => {
29: it("is a no-op when unconstrained (constrained <= 0)", () => {
30: // ...
Found 25 matches
/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-pool.test.ts:
Line 1547: // desiredEmbedPoolSize) would mask it via the worker count. Guards the
/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-cap.test.ts:
Line 16: desiredEmbedPoolSize,
Line 115: expect(desiredEmbedPoolSize(3 * GB - 1)).toBe(1);
Line 116: expect(desiredEmbedPoolSize(3 * GB)).toBe(2);
Line 123: expect(desiredEmbedPoolSize(clamped)).toBe(1);
Line 125: expect(desiredEmbedPoolSize(7 * GB)).toBe(DEFAULT_MAX_EMBED_POOL);
Line 144: expect(desiredEmbedPoolSize(clamped)).toBe(
Line 145: desiredEmbedPoolSize(hostFree),
Line 392: describe("desiredEmbedPoolSize", () => {
Line 395: expect(desiredEmbedPoolSize(0)).toBe(1);
Line 396: expect(desiredEmbedPoolSize(PER_WORKER_MEM_BUDGET_BYTES)).toBe(1);
Line 398: expect(desiredEmbedPoolSize(2 * PER_WORKER_MEM_BUDGET_BYTES - ...
<path>/home/byk/Code/opencode-lore-embedding-runtime/packages/core/test/embedding-pool-memory.test.ts</path>
<type>file</type>
<content>
1: import { afterEach, beforeEach, describe, expect, it } from "vitest";
2: import { EventEmitter } from "node:events";
3: import type { Worker } from "node:worker_threads";
4: import {
5: embed,
6: _persistEmbedCap,
7: _resetLocalProviderProbe,
8: _restoreProvider,
9: _saveAndClearProvider,
10: _setConstrainedMemoryForTest,
11: _setContainerFreeForTest,
12: _setAvailableMemoryForTest,
13: _setEmbedPoolSizeForTest,
14: _setPoolFreememForTest,
15: _setTestWorkerFactory,
16: } from "../src/embedding";
17: import {
18: MIN_EMBED_TOKENS,
19: backoffEmbedCap,
20: memoryModelEmbedCap,
21: } from "../src/embedding-cap";
22: import { EMBED_OOM_EXIT_CODE } from "../src/embedding-worker-types";
23:
24: // Regression suite for the embedding-pool OOM that SIGKILLed the whole gateway
25: // (Onur's report): the pool grew to N workers, ...
RUN v4.1.8 /home/byk/Code/opencode-lore-embedding-runtime
Test Files 4 passed (4)
Tests 137 passed (137)
Start at 00:02:35
Duration 4.03s (transform 2.47s, setup 1.99s, import 1.83s, tests 4.09s, environment 1ms)
Working copy changes: A packages/core/src/cgroup-memory.ts M packages/core/src/embedding/local.ts M packages/core/src/embedding/pool.ts M packages/core/src/embedding-cap.ts M packages/core/src/embedding-worker-types.ts M packages/core/src/embedding-worker.ts M packages/core/src/embedding.ts M packages/core/src/ort-native.ts A packages/core/test/cgroup-memory.test.ts M packages/core/test/embedding-cap.test.ts M packages/core/test/embedding-pool-memory.test.ts M packages/core/test/embedding-pool.test.ts M packages/core/test/embedding-wasm-fallback.test.ts M packages/core/test/embedding-worker-stdio.test.ts M packages/core/test/embedding-worker-types.test.ts M packages/core/test/ort-native.test.ts M packages/gateway/script/bundle.ts M packages/gateway/script/ort-platform-package.ts M packages/gateway/test/bundle-exports.test.ts M packages/gateway/test/ort-platform-package.test.ts Working copy (@) : tmzmtlss 8888d203 fix/embedding-runtime-admission | fix(core): correct embedding runtime ...
Unknown or zero cgroup headroom permanently pins the primary worker to 256 tokens. clampFreeToContainerLimit() returns 0 when constrained headroom is unknown (embedding-cap.ts:165-173). LocalProvider then stores that value in both its initial cap and capFreememAtLearn (embedding/local.ts:130-136, 160-170, 472-480). Upward probing rejects a zero baseline (embedding-cap.ts:327-333), so later memory recovery never restores capacity. This violates “unknown headroom fails closed only for expansion.” The test at embedding-pool-memory.test.ts:149-162 codifies the initial floor but never tests recovery.
The cgroup resolver can omit tighter visible ancestors. When several direct mounts match, it deliberately selects the deepest mount root (cgroup-memory.ts:115-117) and stops walking at that mountpoint (cgroup-memory.ts:194-200). A shallower visible mount may expose a parent whose remaining headroom is lower because of sibling usage. Selecting the deeper mount can therefore overstate headroom and admit another worker. Add a test with nested direct mounts where the shallower parent is tighter. Namespaced roots also need an explicit fail-closed policy because their host ancestors are hidden (cgroup-memory.ts:119-121).
Retired, unproven workers lose their reservation before they exit. retireSlot() removes the slot immediately while its worker remains owned and resident (embedding/pool.ts:318-329). Growth reserves memory only for active unhealthy slots (embedding/pool.ts:265-268). With a ceiling above two, a timed-out initializer or inference can still grow while a replacement starts. The ceiling-two test at embedding-pool.test.ts:689-725 hides this because worker count alone blocks replacement. Charge every unsettled unproven worker plus the candidate.
The memory clamp can return NaN or infinity. hostFree is never validated before Math.min() (embedding-cap.ts:160-174). ...
Date: Sep 16, 2026 * 🔴 (23:54) User stated `packages/core/test/embedding-pool.test.ts` “never touches” the per-worker OOM/self-heal lifecycle; that lifecycle is covered separately in `embedding-oom-recovery.test.ts`. * 🟡 (23:54) `packages/core/test/embedding-pool.test.ts` is a 1,650-line Vitest suite for `EmbeddingPool` cross-worker dispatch issue `#999`, covering least-busy routing, lazy and m…
Date: Sep 16, 2026 * 🔴 (23:53) User stated constrained memory must never be admitted from a stale cgroup directory or a cached discovery miss. * 🔴 (23:53) User stated sibling cgroup usage must never be subtracted from the wrong scope. * 🔴 (23:53) User stated a host logger or sink must never interrupt stream consumption. * 🔴 (23:53) User stated embedding-pool growth must never multiply memory …
Date: Sep 16, 2026 * 🔴 (23:53) User stated the adaptive embedding cap must never exceed the Nomic v1.5 maximum sequence length. * 🔴 (23:53) User stated each embedding OOM lowers the cap by a factor of 0.7 and respawns the worker with a fresh heap. * 🔴 (23:53) User stated that when free memory never improves, upward embedding-cap re-probing must never occur. * 🔴 (23:53) User stated a persisted…
Date: Sep 16, 2026 * 🔴 (23:52) User stated stale events from a retired embedding worker, including during a WASM fallback respawn, must never clobber the fresh worker state. * 🔴 (23:52) User stated embedding-worker recovery must never loop unbounded or create an event storm; the relevant recovery path is FTS-only. * 🔴 (23:52) User stated upward embedding-cap re-probing must account for memory …
Date: Sep 16, 2026 * 🔴 (23:51) User stated Jujutsu (`jj`) operations never fail on merge conflict; `rebase` / `new` / `squash` record conflicts in the resulting commit, after which `jj st` must be run and conflicted files resolved manually rather than with interactive `jj resolve`. * 🔴 (23:51) User stated that when `.jj/` exists at the repository root, mutations must use `jj`, not `git`; in a c…
Date: Sep 16, 2026 * 🔴 [requested-read-only-review] (23:45) User requested a read-only focused code audit in `/home/byk/Code/opencode-lore-embedding-runtime`; instructed not to edit files or mutate VCS. * 🟡 (23:45) Audit scope is current working-copy changes for cgroup memory headroom and embedding-pool admission in `packages/core/src/cgroup-memory.ts`, `embedding/local.ts`, `embedding/pool.ts`…