.omo/notepads/package-layering-refactor/learnings.md
src/features/opencode-skill-loader/skill-content.test.ts — ambiguous short name resolution returns 2 resolved skills instead of 1 when "debugging" + "playwright" are queried together. This is a REAL baseline failure; do not fix as part of this refactor plan unless explicitly directed.src/shared/deep-merge.ts: pure, zero imports.src/shared/snake-case.ts: imports ./deep-merge only (moved together) — pure after extraction.src/shared/record-type-guard.ts: pure, zero imports.src/shared/extract-semver.ts: pure, zero imports.src/shared/frontmatter.ts: imports js-yaml only.src/shared/file-utils.ts: imports fs only.src/shared/contains-path.ts: imports fs and path only.src/shared/port-utils.ts: imports node:net only.src/shared/tool-name.ts: pure, zero imports.src/shared/replace-tool-args.ts: pure, zero imports.src/features/boulder-state/format-duration.ts: pure, zero imports.src/shared/jsonc-parser.ts: coupled to plugin basenames; decoupled via parameterized detectPluginConfigFile(dir, options).src/shared/write-file-atomically.ts: depends on omo-specific ./tolerant-fsync; extraction deferred by scope decision (kept in-place).packages/ast-grep-mcp/src/*.ts) shows only mcp.ts, runner.ts, and cli-binary-path-resolution.ts touch adapter/runtime-specific concerns.types.ts: type-only, currently coupled only by CliLanguage source (CLI_LANGUAGES).language-support.ts: CLI language enum + numeric defaults; no MCP/Bun coupling.pattern-hints.ts: pure heuristics; no runtime coupling (intended identical behavior for pi/codex parity).result-formatter.ts: pure string formatter over SgResult.sg-compact-json-output.ts: pure JSON parsing/truncation logic; depends only on constants/types.runner.ts split requirement confirmed:
buildSgArgs() + runSg() orchestration and error mapping.getAstGrepPath in cli-binary-path-resolution.ts).bun-spawn-shim.ts), injected via core deps (spawnProcess).packages/comment-checker-core/ with package.json, tsconfig.json, index.d.ts, and src/ barrel.packages/comment-checker-core/src/apply-patch-edits.ts.packages/comment-checker-core/src/types.ts.packages/comment-checker-core/src/runner.ts:
resolveCommentCheckerBinary()runCommentChecker() with injected spawn, existsSync, and timer functions.hook.ts, pending-calls.ts, initialization-gate.ts, downloader.ts).src/hooks/comment-checker/apply-patch-edits.tssrc/hooks/comment-checker/types.tssrc/hooks/comment-checker/cli.ts to keep Bun spawn glue locally while delegating pure runner + resolver to core package.src/hooks/comment-checker/hook.ts to import extractApplyPatchEdits from @oh-my-opencode/comment-checker-core.package.json workspaces, devDependency, typecheck:packages) and ran bun install.bun run typecheck exit 0bun test 7312/1/2/7315 (baseline-matching drift)bun run build exit 0packages/model-core/ with moved sources/tests and package scaffold (package.json, tsconfig.json, barrel src/index.ts).model-resolution-pipeline.ts accepts providerCache.model-error-classifier.ts exposes cache-injected provider selector.src/shared/connected-providers-cache.ts and wired injections through shared shims.src/shared shims with explicit symbol re-exports (no export * in shims).src/shared/model-capabilities/ subtree into model-core and kept shared adapter entry via src/shared/model-capabilities/index.ts wrapper.bun run typecheck=0, bun test=7312/1/2/7315 baseline, bun run build=0.lsp-core deferral accepted and not considered..omo/evidence/w2-qa-*.txt for all 10 requested checks.bun test produced 7311 pass / 1 skip / 3 fail / 1 error / 7315 tests; extra failure is src/shared/tmux/runner.test.ts:202 after timeout at src/shared/tmux/runner.test.ts:199./tmp/w2-qa-equiv.ts could not resolve @oh-my-opencode/utils from /private/tmp/w2-qa-equiv.ts:1.packages/agents-md-core/package.json:19 depends on @oh-my-opencode/rules-engine, a cross-Wave-2 internal dependency beyond utils.packages/rules-core/ still exists, although only node_modules/ remains inside.dist/ remained 13M.ast-grep-core, comment-checker-core, boulder-state, and agents-md-core have zero co-located package tests; boulder-state has no critical-path test files.All 40 plan checkboxes resolved (40 [x], 0 [ ], 1 [~] deferred for T6 lsp-core).
Final commits on dev (since baseline 6609d90b3):
Test baseline preserved exactly: 7314 pass / 1 skip / 2 fail / 7317 total
Architecture delivered:
export *)Deferred future tracks:
Key learnings:
workdir parameter explicitly. FIX-6 subagent deleted from main repo by accident before catching this.\bBun\. is too broad; negative lookbehind (?<!runtime\.)\bBun\. correctly distinguishes legitimate dual-runtime shim from production violations.*.test.ts to avoid false positives.