Dashboard › opencode-lore › Distillation
Distillation
ID: 3920306f-43e7-47e1-be98-78aaff9a70bd
Generation: 0
Tokens: 1165
R_compression: 16.672
C_norm: 0.005
Archived: No
Created: 2026-09-16 23:58:24
Source IDs:
["lore_tm_v1_m-VckDOv-qjjCPSShyVl5RScgJh1ISIg6uQ0P4rYcy4","lore_tm_v1_sShOdHNOuYZMlb61j23JJjXnpyCeiIVKc2zzzPksM9s","lore_tm_v1_L-sBX37xluEbIHxilVX9BqNH3B_bS5G4KESTgq_V0hY","lore_tm_v1_ZWI8J325Ag3mhkk_EBBosuqJoedqh0WjEu8BdQYQ51A"]
Observations
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, embedding-cap.ts, and relevant tests.
- π‘ (23:45) User asked the audit to identify concrete correctness defects, unnecessary complexity, and missing edge-case tests, with concise per-finding
PASS / CONCERN / MUST-FIX verdicts and exact file:line citations.
- π‘ (23:45) User asked whether the logic preserves these invariants: the primary worker always exists; a cgroup limit is not mistaken for remaining free memory; unknown constrained headroom fails closed only for expansion; healthy sibling workers continue serving while a failed slot has retry debt; all unproven workers plus the next worker are charged; observed per-worker resident budget is represented safely; and no
NaN or infinity occurs.
- π΄ (23:45) User prohibited running the full test suite, network access, or any service during this audit; focused read-only test commands are allowed if needed.
- π΄ (23:45) User stated this is a preliminary review, not the final immutable-candidate review.
- π΄ (23:47) User stated tests must use a temporary SQLite database via
packages/core/test/setup.ts β never the production DB.
- π΄ (23:47) User stated the project runtime is Node.js
>= 22.5, uses TypeScript with pnpm workspaces, and stores its SQLite WAL/FTS5 database at ~/.local/share/lore/lore.db.
- π΄ (23:47) User stated releases use Sentry Craft through GitHub Actions and directed: Never manually bump versions or edit CHANGELOG. Craft handles both automatically.
- π‘ (23:47) Documented release commands are
gh workflow run release.yml -f version=auto for conventional-commit-derived semver or gh workflow run release.yml -f version=0.23.0 for an explicit version.
- π‘ (23:47) Documented release workflow order: 1.
scripts/bump-version.sh updates all package.json versions; 2. changelog is generated from conventional commits; 3. a release/X.Y.Z branch is created and pushed; 4. CI runs tests and builds npm tarballs, standalone binaries, and delta patches; 5. Craft opens a publish issue; 6. labeling it accepted triggers npm publishing via OIDC and a GitHub Release with binaries and patches.
- π΄ (23:49) User stated adversarial-review defects must receive deterministic regression tests in the same PR that fail on the base branch, pass on the fix, and establish the real precondition rather than an artificial state.
- π΄ (23:49) User stated tests of guards must fail when the guard is removed; otherwise they do not test the guard.
- π΄ (23:49) User stated adversarial setup should include state present before the handling operation, delete-then-recreate across lifecycle boundaries, and modify-while-off sequences.
- π΄ (23:49) User stated skip/early-return branches are the highest-risk surface and each skip branch needs a test that causes it to skip something incorrectly and proves that it does not.
- π΄ (23:49) User stated the TDD rule: Never trust the fix without seeing it fail. Every bug fix should begin with a regression test confirmed failing on the base branch and then passing on the fix.
- π΄ (23:49) User stated frozen shared arrays are preferred for memoized results shared across callers so accidental mutation throws a
TypeError in strict mode rather than silently corrupting the cache.
- π΄ (23:49) User stated
db().query monkeypatches are shadowed by the tracing Proxy; SQL-counting tests should use log.registerSink({ withDbSpan }) because assigning db().query = ... is silently ignored.
- π΄ (23:49) User stated non-trivial changes require two separate review passes: 1. adversarial/correctness review covering breaking states, enumerated cases, apply-then-revert mutants, property-test stability Γ10, hash-equivalence proofs, frozen-array mutation safety, and stale-cache analysis; 2. security/pentest review covering injection, credential leaks, protocol attacks, and privilege escalation.
- π΄ (23:49) User stated adversarial review is mandatory before merge for non-trivial changes, while security review depends on risk profile.
- π‘ (23:49) General final-review policy requires
pnpm test, pnpm run typecheck, pnpm run lint, and pnpm run format:check, checking exit codes; property tests must be run Γ10, the working tree must end unmodified and hash-verified, and reports must provide per-point PASS / FAIL / CONCERN / MUST-FIX verdicts with file:line evidence plus an overall MERGE / DO-NOT-MERGE verdict. This sessionβs preliminary audit separately prohibits the full test suite.