From 3e1159488317b7b4b6fab87935eb0a26b8091fbb Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 26 May 2026 00:50:07 +0900 Subject: [PATCH] chore(repo): untrack .omo/evidence and .omo/notepads per .gitignore These directories are AI-agent workspace artifacts intended to be local-only per .gitignore rules: .omo/* !.omo/rules/ !.omo/rules/** They were accidentally tracked across several refactor commits. Files remain on disk; only the index entries are removed. Future writes are now properly ignored. Closes #4441 --- .../pr2-baseline-default.sha256 | 1 - .../pr2-baseline-gemini.sha256 | 1 - .../prompts-as-skills/pr2-baseline-gpt.sha256 | 1 - .../pr2-baseline-planner.sha256 | 1 - .omo/evidence/task-1-baseline.txt | 6 - .omo/evidence/task-2-no-coupling.txt | 6 - .omo/evidence/task-2-package-exists.txt | 6 - .omo/evidence/task-2-reexports.txt | 6 - .omo/evidence/task-2-tests.txt | 6 - .omo/evidence/task-3-di-interface.txt | 6 - .omo/evidence/task-3-no-coupling.txt | 6 - .omo/evidence/task-3-tests.txt | 6 - .omo/evidence/task-5-no-coupling.txt | 6 - .omo/evidence/task-5-tests.txt | 6 - .omo/evidence/task-9-loc-check.txt | 6 - .omo/evidence/task-9-no-coupling.txt | 6 - .omo/evidence/task-9-tests.txt | 6 - .../package-layering-refactor/decisions.md | 19 --- .../package-layering-refactor/learnings.md | 116 ------------------ 19 files changed, 217 deletions(-) delete mode 100644 .omo/evidence/prompts-as-skills/pr2-baseline-default.sha256 delete mode 100644 .omo/evidence/prompts-as-skills/pr2-baseline-gemini.sha256 delete mode 100644 .omo/evidence/prompts-as-skills/pr2-baseline-gpt.sha256 delete mode 100644 .omo/evidence/prompts-as-skills/pr2-baseline-planner.sha256 delete mode 100644 .omo/evidence/task-1-baseline.txt delete mode 100644 .omo/evidence/task-2-no-coupling.txt delete mode 100644 .omo/evidence/task-2-package-exists.txt delete mode 100644 .omo/evidence/task-2-reexports.txt delete mode 100644 .omo/evidence/task-2-tests.txt delete mode 100644 .omo/evidence/task-3-di-interface.txt delete mode 100644 .omo/evidence/task-3-no-coupling.txt delete mode 100644 .omo/evidence/task-3-tests.txt delete mode 100644 .omo/evidence/task-5-no-coupling.txt delete mode 100644 .omo/evidence/task-5-tests.txt delete mode 100644 .omo/evidence/task-9-loc-check.txt delete mode 100644 .omo/evidence/task-9-no-coupling.txt delete mode 100644 .omo/evidence/task-9-tests.txt delete mode 100644 .omo/notepads/package-layering-refactor/decisions.md delete mode 100644 .omo/notepads/package-layering-refactor/learnings.md diff --git a/.omo/evidence/prompts-as-skills/pr2-baseline-default.sha256 b/.omo/evidence/prompts-as-skills/pr2-baseline-default.sha256 deleted file mode 100644 index e25199317..000000000 --- a/.omo/evidence/prompts-as-skills/pr2-baseline-default.sha256 +++ /dev/null @@ -1 +0,0 @@ -78aa43e2e2b7db307827d9ddda30a4c6a24aa35a9255efe1ee39a4476d71acca diff --git a/.omo/evidence/prompts-as-skills/pr2-baseline-gemini.sha256 b/.omo/evidence/prompts-as-skills/pr2-baseline-gemini.sha256 deleted file mode 100644 index 7520ee3dc..000000000 --- a/.omo/evidence/prompts-as-skills/pr2-baseline-gemini.sha256 +++ /dev/null @@ -1 +0,0 @@ -5c5766549e868e7a1c87252e742e491b7015138948c6e26fb704346bb55d5d7c diff --git a/.omo/evidence/prompts-as-skills/pr2-baseline-gpt.sha256 b/.omo/evidence/prompts-as-skills/pr2-baseline-gpt.sha256 deleted file mode 100644 index 9cef46da9..000000000 --- a/.omo/evidence/prompts-as-skills/pr2-baseline-gpt.sha256 +++ /dev/null @@ -1 +0,0 @@ -8f31f0053256914e94605944b28e123c584a0ad093e0d44d5ad66da009a632ae diff --git a/.omo/evidence/prompts-as-skills/pr2-baseline-planner.sha256 b/.omo/evidence/prompts-as-skills/pr2-baseline-planner.sha256 deleted file mode 100644 index 8aba42abc..000000000 --- a/.omo/evidence/prompts-as-skills/pr2-baseline-planner.sha256 +++ /dev/null @@ -1 +0,0 @@ -8897b3a11b61c12a02bfba13a76c80742bc4e5356cfc30e2f0c38464aa587bf3 diff --git a/.omo/evidence/task-1-baseline.txt b/.omo/evidence/task-1-baseline.txt deleted file mode 100644 index 3d1a7f7e0..000000000 --- a/.omo/evidence/task-1-baseline.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Baseline captured for package layering refactor — tests, build, and typecheck status before any changes. -Date: 2026-05-21T02:09:46Z -Method: bun test && bun run build && bun run typecheck -Result: Baseline established — 7312 pass / 1 skip / 2 fail / 7315 total; 2 pre-existing failures in skill-content.test.ts; build and typecheck exit 0. diff --git a/.omo/evidence/task-2-no-coupling.txt b/.omo/evidence/task-2-no-coupling.txt deleted file mode 100644 index 37d2aa97f..000000000 --- a/.omo/evidence/task-2-no-coupling.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that packages/utils has no coupling back into src/ or other OMO-specific internals. -Date: 2026-05-21T02:09:46Z -Method: grep -rE "@opencode-ai|from ['\"]opencode/|Bun\.|from ['\"]bun:" --exclude='*.test.ts' --exclude='*.audit.test.ts' packages/utils/src/ -Result: No violations — 0 matches. Package is clean with no upward coupling. diff --git a/.omo/evidence/task-2-package-exists.txt b/.omo/evidence/task-2-package-exists.txt deleted file mode 100644 index 8dd063275..000000000 --- a/.omo/evidence/task-2-package-exists.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that the extracted @oh-my-opencode/utils package exists with correct structure after Task 2. -Date: 2026-05-21T02:09:46Z -Method: ls -la packages/utils/ && cat packages/utils/package.json -Result: Package exists with src/, package.json, tsconfig.json, node_modules. 12 files moved (write-file-atomically.ts deferred). diff --git a/.omo/evidence/task-2-reexports.txt b/.omo/evidence/task-2-reexports.txt deleted file mode 100644 index 6ace9ac22..000000000 --- a/.omo/evidence/task-2-reexports.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that all shared utility reexports from src/shared/* now correctly proxy to @oh-my-opencode/utils. -Date: 2026-05-21T02:09:46Z -Method: grep -r "from \"@oh-my-opencode/utils\"" src/shared/ src/features/boulder-state/ -Result: All 12 reexport sites verified — deep-merge, snake-case, record-type-guard, extract-semver, frontmatter, file-utils, contains-path, port-utils, tool-name, replace-tool-args, jsonc-parser, format-duration. diff --git a/.omo/evidence/task-2-tests.txt b/.omo/evidence/task-2-tests.txt deleted file mode 100644 index c416db1a0..000000000 --- a/.omo/evidence/task-2-tests.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that test suite still passes after Task 2 utils extraction — no regressions introduced. -Date: 2026-05-21T02:09:46Z -Method: bun test -Result: No regressions — 7312 pass / 1 skip / 2 fail / 7315 total (matches baseline). The 2 failures are pre-existing in skill-content.test.ts. diff --git a/.omo/evidence/task-3-di-interface.txt b/.omo/evidence/task-3-di-interface.txt deleted file mode 100644 index 6a1f3ce8f..000000000 --- a/.omo/evidence/task-3-di-interface.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that the ProviderCache DI interface is properly defined in model-core and wired into OMO adapters. -Date: 2026-05-21T02:09:46Z -Method: grep -r "ProviderCache\|readConnectedProvidersCache\|findProviderModelMetadata" packages/model-core/src/ src/shared/ -Result: Interface defined in packages/model-core/src/provider-cache.ts. Injection points verified in model-resolution-pipeline.ts and model-error-classifier.ts. OMO adapters in src/shared/ correctly pass connectedProvidersCache into model-core. diff --git a/.omo/evidence/task-3-no-coupling.txt b/.omo/evidence/task-3-no-coupling.txt deleted file mode 100644 index dc8f09c30..000000000 --- a/.omo/evidence/task-3-no-coupling.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that packages/model-core has no coupling back into src/ or OMO-specific internals. -Date: 2026-05-21T02:09:46Z -Method: grep -rE "@opencode-ai|from ['\"]opencode/|Bun\.|from ['\"]bun:" --exclude='*.test.ts' --exclude='*.audit.test.ts' packages/model-core/src/ -Result: No violations — 0 matches. Package is clean with no upward coupling. diff --git a/.omo/evidence/task-3-tests.txt b/.omo/evidence/task-3-tests.txt deleted file mode 100644 index a746b6baa..000000000 --- a/.omo/evidence/task-3-tests.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that test suite still passes after Task 3 model-core extraction — no regressions introduced. -Date: 2026-05-21T02:09:46Z -Method: bun test -Result: No regressions — 7312 pass / 1 skip / 2 fail / 7315 total (matches baseline). The 2 failures are pre-existing in skill-content.test.ts. diff --git a/.omo/evidence/task-5-no-coupling.txt b/.omo/evidence/task-5-no-coupling.txt deleted file mode 100644 index bf2a8300f..000000000 --- a/.omo/evidence/task-5-no-coupling.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that packages/agents-md-core has no coupling back into src/ or OMO-specific internals. -Date: 2026-05-21T02:09:46Z -Method: grep -rE "@opencode-ai|from ['\"]opencode/|Bun\.|from ['\"]bun:" --exclude='*.test.ts' --exclude='*.audit.test.ts' packages/agents-md-core/src/ -Result: No violations — 0 matches. Package is clean with no upward coupling. diff --git a/.omo/evidence/task-5-tests.txt b/.omo/evidence/task-5-tests.txt deleted file mode 100644 index 31428145e..000000000 --- a/.omo/evidence/task-5-tests.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that test suite still passes after Task 5 agents-md-core extraction — no regressions introduced. -Date: 2026-05-21T02:09:46Z -Method: bun test -Result: No regressions — 7312 pass / 1 skip / 2 fail / 7315 total (matches baseline). The 2 failures are pre-existing in skill-content.test.ts. diff --git a/.omo/evidence/task-9-loc-check.txt b/.omo/evidence/task-9-loc-check.txt deleted file mode 100644 index c40e1737b..000000000 --- a/.omo/evidence/task-9-loc-check.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that all source files in packages/boulder-state stay under the 250 pure LOC soft limit. -Date: 2026-05-21T02:09:46Z -Method: wc -l packages/boulder-state/src/**/*.ts -Result: All files under 250 LOC. Largest: write-state.ts (169), task.ts (147), read-state.ts (141). All others under 100 LOC. diff --git a/.omo/evidence/task-9-no-coupling.txt b/.omo/evidence/task-9-no-coupling.txt deleted file mode 100644 index 574f46743..000000000 --- a/.omo/evidence/task-9-no-coupling.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that packages/boulder-state has no coupling back into src/ or OMO-specific internals. -Date: 2026-05-21T02:09:46Z -Method: grep -rE "@opencode-ai|from ['\"]opencode/|Bun\.|from ['\"]bun:" --exclude='*.test.ts' --exclude='*.audit.test.ts' packages/boulder-state/src/ -Result: No violations — 0 matches. Package is clean with no upward coupling. diff --git a/.omo/evidence/task-9-tests.txt b/.omo/evidence/task-9-tests.txt deleted file mode 100644 index dedb77ad9..000000000 --- a/.omo/evidence/task-9-tests.txt +++ /dev/null @@ -1,6 +0,0 @@ -PASS - -Description: Verify that test suite still passes after Task 9 boulder-state extraction — no regressions introduced. -Date: 2026-05-21T02:09:46Z -Method: bun test -Result: No regressions — 7312 pass / 1 skip / 2 fail / 7315 total (matches baseline). The 2 failures are pre-existing in skill-content.test.ts. diff --git a/.omo/notepads/package-layering-refactor/decisions.md b/.omo/notepads/package-layering-refactor/decisions.md deleted file mode 100644 index 846dc7ef0..000000000 --- a/.omo/notepads/package-layering-refactor/decisions.md +++ /dev/null @@ -1,19 +0,0 @@ -## [2026-05-20T15:12:12Z] Task 2 scope reduction -Dropped `write-file-atomically.ts` from utils extraction. -Reason: depends on omo-specific `tolerant-fsync` chain (classify-path-environment, fsync-skip-tracker, logger). -Decision deferred to a future task. -Net effect: utils package ships 12 files instead of 13. - -## [2026-05-20T15:12:12Z] Task 2 jsonc-parser decoupling -Choice: Option A -Reason: Small call-site surface; keeps full jsonc-parser API together in the new package and avoids split ownership. -Call sites changed: src/plugin-config.ts, src/cli/config-manager/config-context.ts, src/cli/doctor/checks/config.ts, src/cli/doctor/checks/model-resolution-config.ts, src/cli/doctor/checks/team-mode.ts, src/cli/doctor/checks/tools-lsp.ts, src/shared/project-discovery-dirs.ts, packages/utils/src/jsonc-parser.test.ts, packages/utils/src/jsonc-parser.memoization.test.ts - -## [2026-05-21T02:05:00Z] Task 9 (worktree) -storage.ts split plan (from 977 LOC monolith): -- `storage/shared.ts`: constants, timestamp/parsing helpers, mirror<->work projection, state normalization. -- `storage/read.ts`: path resolution, file read/parse, plan discovery/progress parsing, read-only selectors. -- `storage/write.ts`: persist/clear, create state/work IDs, active work selection, work lifecycle updates. -- `storage/session.ts`: session-id tracking append logic (global + per-work). -- `storage/task.ts`: task-session CRUD and timer transitions. -- `storage/index.ts`: public API barrel with explicit named exports (no wildcard export). diff --git a/.omo/notepads/package-layering-refactor/learnings.md b/.omo/notepads/package-layering-refactor/learnings.md deleted file mode 100644 index 411ed8149..000000000 --- a/.omo/notepads/package-layering-refactor/learnings.md +++ /dev/null @@ -1,116 +0,0 @@ - -## [2026-05-20T15:04:52Z] Task 1 baseline -- Total tests: 7315 -- Pass: 7312, Fail: 2, Skip: 1 -- Build exit code: 0 (dist/ size: 13M, 1456 files) -- Typecheck exit code: 0 -- Packages: 15 package.json files under packages/, 3 private (ast-grep-mcp, rules-core, web) -- Anomalies observed: 2 pre-existing test failures in `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. - -## [2026-05-20T15:12:12Z] Task 2 pre-flight -- `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). - -## [2026-05-21T00:00:00Z] Task 7 (worktree) -- Pre-flight import audit (`packages/ast-grep-mcp/src/*.ts`) shows only `mcp.ts`, `runner.ts`, and `cli-binary-path-resolution.ts` touch adapter/runtime-specific concerns. -- Candidate extracted files are pure from MCP perspective: - - `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: - - Core should own `buildSgArgs()` + `runSg()` orchestration and error mapping. - - OMO-specific binary resolution stays adapter-side (`getAstGrepPath` in `cli-binary-path-resolution.ts`). - - OMO-specific process spawn stays adapter-side (`bun-spawn-shim.ts`), injected via core deps (`spawnProcess`). - -## [2026-05-21T00:00:00Z] Task 8 (worktree) -- Created `packages/comment-checker-core/` with `package.json`, `tsconfig.json`, `index.d.ts`, and `src/` barrel. -- Moved pure apply-patch parser + metadata parsing into `packages/comment-checker-core/src/apply-patch-edits.ts`. -- Moved shared comment-checker types into `packages/comment-checker-core/src/types.ts`. -- Added injectable pure runner in `packages/comment-checker-core/src/runner.ts`: - - `resolveCommentCheckerBinary()` - - `runCommentChecker()` with injected `spawn`, `existsSync`, and timer functions. -- Kept OMO-specific adapter pieces in place (`hook.ts`, `pending-calls.ts`, `initialization-gate.ts`, `downloader.ts`). -- Added per-file shims at original locations: - - `src/hooks/comment-checker/apply-patch-edits.ts` - - `src/hooks/comment-checker/types.ts` -- Updated `src/hooks/comment-checker/cli.ts` to keep Bun spawn glue locally while delegating pure runner + resolver to core package. -- Updated `src/hooks/comment-checker/hook.ts` to import `extractApplyPatchEdits` from `@oh-my-opencode/comment-checker-core`. -- Updated root workspace wiring (`package.json` workspaces, devDependency, typecheck:packages) and ran `bun install`. -- Verification: - - `bun run typecheck` exit 0 - - `bun test` 7312/1/2/7315 (baseline-matching drift) - - `bun run build` exit 0 - -## [2026-05-21T00:00:00Z] Task 3 retry (worktree) -- Extracted model resolution pipeline surface into `packages/model-core/` with moved sources/tests and package scaffold (`package.json`, `tsconfig.json`, barrel `src/index.ts`). -- Added ProviderCache DI seam in model-core: - - `model-resolution-pipeline.ts` accepts `providerCache`. - - `model-error-classifier.ts` exposes cache-injected provider selector. -- Kept OMO runtime cache implementation in `src/shared/connected-providers-cache.ts` and wired injections through shared shims. -- Recreated per-file `src/shared` shims with explicit symbol re-exports (no `export *` in shims). -- Moved `src/shared/model-capabilities/` subtree into model-core and kept shared adapter entry via `src/shared/model-capabilities/index.ts` wrapper. -- Verification pass: `bun run typecheck`=0, `bun test`=7312/1/2/7315 baseline, `bun run build`=0. - -## [2026-05-20T18:37:22Z] W2-QA gate -- Verdict: REJECT. T6 `lsp-core` deferral accepted and not considered. -- Evidence written under `.omo/evidence/w2-qa-*.txt` for all 10 requested checks. -- Blocking failures: - - Test delta drifted from baseline: `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`. - - Dependency DAG violation: `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. -- Passing blocking checks: package symlinks/LSP references, OpenCode coupling sweep, build exit 0, and `dist/` remained 13M. -- Informational coverage concerns: `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. - -## [2026-05-21] BOULDER COMPLETE - -All 40 plan checkboxes resolved (40 [x], 0 [ ], 1 [~] deferred for T6 lsp-core). - -**Final commits on dev (since baseline 6609d90b3):** -- Wave 1: utils package extraction + W1-QA APPROVE -- Wave 2: model-core, rules-engine, agents-md-core, ast-grep-core, comment-checker-core, boulder-state extractions + W2-QA APPROVE (T6 deferred) -- Wave 3: meta-audits + opencode-coupling grep gate + AGENTS.md/ROADMAP docs + W3-QA APPROVE -- Final Wave round 1: F2 + F3 APPROVE; F1 + F4 REJECT -- Round 2 fixes: FIX-1 (model-core DI eliminated 4 back-imports), FIX-2 (14 evidence sentinels), FIX-3 (T4 doc edit split) -- Final Wave round 2: F1 + F4 surface 2 new issues -- Round 3 fixes: FIX-5 (audit allowlist for runtime.Bun.* dual-runtime pattern), FIX-6 (delete 855KB dead generated JSON) -- Final state: all 4 reviewers APPROVE - -**Test baseline preserved exactly: 7314 pass / 1 skip / 2 fail / 7317 total** -- 2 fails are pre-existing skill-content ambiguous short-name tests (untouched by refactor) -- 1 documented flake: tmux runner test under heavy parallel I/O (passes 9/9 in isolation) - -**Architecture delivered:** -- 7 Core packages in packages/ (utils, model-core, rules-engine, agents-md-core, ast-grep-core, comment-checker-core, boulder-state) -- Per-file re-export shims at original src/ locations (never `export *`) -- opencode-coupling-audit.test.ts enforces zero Bun.* or src/ coupling in package production code (test files exempt) -- ProviderCache, ConnectedProvidersAdapter, SpawnFn DI interfaces for harness independence -- API designed for future pi/codex adoption - -**Deferred future tracks:** -- T6 lsp-core extraction (submodule strategy) -- Pi adapter layer (senpi + extensions) -- Codex adapter layer -- rules-engine full Engine DI (originally planned in T4, scoped to rename only) -- 3 orphan re-export shims for cleanup (apply-patch-edits.ts, model-capability-aliases.ts, model-capability-guardrails.ts) -- Tmux runner test flake (documented) - -**Key learnings:** -- Subagents running bash inherit the parent's cwd, NOT the worktree path — must use `workdir` parameter explicitly. FIX-6 subagent deleted from main repo by accident before catching this. -- Coupling audit regex `\bBun\.` is too broad; negative lookbehind `(?