Skip to content

refactor: rename @opencode-ai/shared to @opencode-ai/core (#24309)#265

Merged
Astro-Han merged 1 commit into
devfrom
claude/upstream-sync-209-pr1-rename
Apr 27, 2026
Merged

refactor: rename @opencode-ai/shared to @opencode-ai/core (#24309)#265
Astro-Han merged 1 commit into
devfrom
claude/upstream-sync-209-pr1-rename

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Mechanical rename of the workspace package @opencode-ai/shared to @opencode-ai/core. packages/shared moves to packages/core; all consumer imports update from @opencode-ai/shared/* to @opencode-ai/core/*. No file content changes beyond the rename.

PawWork-local consumers updated: packages/util, packages/ui, packages/opencode, packages/desktop-electron runtime-import-guard test.

Why

First half of upstream's "shared → core" refactor (PR #24309). This PR is intentionally scoped to the rename only so the diff stays mechanical and reviewable. The follow-up commits that move modules (Global, log, flag, cross-spawn, npm) into core land in PR2 of #209.

This is part of the weekly upstream sync per project_upstream_strategy.md.

Related Issue

#209

How To Verify

bun install
bun run --cwd packages/core typecheck
bun run --cwd packages/opencode typecheck
bun run --cwd packages/util typecheck
bun run --cwd packages/ui typecheck
bun run --cwd packages/desktop-electron typecheck

All five packages typecheck clean locally on this branch.

Checklist

  • I linked the related issue ([Feature] Track selective upstream backports from opencode v1.14.17-v1.14.22 #209)
  • This PR has type, scope, and priority labels (upstream / harness / P3)
  • I listed the relevant verification steps
  • No visible UI changes — N/A
  • No desktop/packaging/updater impact — N/A (workspace rename only)
  • I considered docs/dependencies — bun.lock regenerated; no new deps
  • Targeting dev, Conventional Commits English title

Summary by CodeRabbit

  • Chores
    • Renamed and reorganized an internal utilities package and updated imports/dependencies across the codebase to reference the new namespace. No functional or user-facing behavior changed; this improves internal consistency and module resolution.

@Astro-Han Astro-Han added P3 Low priority upstream Tracked upstream or vendor behavior harness Model harness, prompts, tool descriptions, and session mechanics labels Apr 27, 2026
@coderabbitai

coderabbitai Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cd4f80f4-28f7-46c8-b09e-53637730db98

📥 Commits

Reviewing files that changed from the base of the PR and between 0c6252d and 002807a.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (56)
  • packages/core/package.json
  • packages/core/src/filesystem.ts
  • packages/core/src/global.ts
  • packages/core/src/runtime.ts
  • packages/core/src/types.d.ts
  • packages/core/src/util/array.ts
  • packages/core/src/util/binary.ts
  • packages/core/src/util/effect-flock.ts
  • packages/core/src/util/encode.ts
  • packages/core/src/util/error.ts
  • packages/core/src/util/flock.ts
  • packages/core/src/util/fn.ts
  • packages/core/src/util/glob.ts
  • packages/core/src/util/hash.ts
  • packages/core/src/util/identifier.ts
  • packages/core/src/util/iife.ts
  • packages/core/src/util/lazy.ts
  • packages/core/src/util/module.ts
  • packages/core/src/util/path.ts
  • packages/core/src/util/retry.ts
  • packages/core/src/util/slug.ts
  • packages/core/sst-env.d.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/global.test.ts
  • packages/core/test/lib/effect.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/util/identifier.test.ts
  • packages/core/tsconfig.json
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/opencode/package.json
  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/config/command.ts
  • packages/opencode/src/config/config.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/session/export.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/storage/db.ts
  • packages/ui/package.json
  • packages/ui/src/components/file.tsx
  • packages/ui/src/components/line-comment.tsx
  • packages/ui/src/components/markdown.tsx
  • packages/ui/src/components/message-part.tsx
  • packages/ui/src/components/session-review.tsx
  • packages/ui/src/components/session-turn.tsx
  • packages/ui/src/components/tool-info.ts
  • packages/util/package.json
  • packages/util/test/compat-surface.test.ts
  • packages/util/test/compat.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: unit-windows-desktop
  • GitHub Check: unit-windows-opencode-config-project
  • GitHub Check: unit-windows-app
  • GitHub Check: unit-desktop
  • GitHub Check: typecheck
  • GitHub Check: unit-windows-opencode-session
  • GitHub Check: unit-windows-opencode-server-tools
  • GitHub Check: unit-opencode
  • GitHub Check: smoke-macos-arm64
  • GitHub Check: e2e-artifacts
  • GitHub Check: analyze-js-ts
🧰 Additional context used
📓 Path-based instructions (1)
packages/opencode/**/*.ts

📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)

packages/opencode/**/*.ts: Use Effect.gen(function* () { ... }) for Effect composition
Use Effect.fn("Domain.method") for named/traced effects and Effect.fnUntraced for internal helpers; these accept pipeable operators as extra arguments to avoid unnecessary outer .pipe() wrappers
Use Effect.callback for callback-based APIs
Prefer DateTime.nowAsDate over new Date(yield* Clock.currentTimeMillis) when you need a Date in Effect code
Use Schema.Class for multi-field data in Effect schemas
Use branded schemas (Schema.brand) for single-value types in Effect
Use Schema.TaggedErrorClass for typed errors in Effect schemas
Use Schema.Defect instead of unknown for defect-like causes in Effect code
In Effect.gen / Effect.fn, prefer yield* new MyError(...) over yield* Effect.fail(new MyError(...)) for direct early-failure branches
Use makeRuntime from src/effect/run-service.ts for all services; it returns { runPromise, runFork, runCallback } backed by a shared memoMap that deduplicates layers
Use InstanceState from src/effect/instance-state.ts for per-directory or per-project state that needs per-instance cleanup; do work directly in the InstanceState.make closure where ScopedCache handles run-once semantics
Use Effect.addFinalizer or Effect.acquireRelease inside the InstanceState.make closure for cleanup (subscriptions, process teardown, etc.)
Use Effect.forkScoped inside the InstanceState.make closure for background stream consumers — the fiber is interrupted when the instance is disposed
Prefer FileSystem.FileSystem instead of raw fs/promises for effectful file I/O in Effect services
Prefer ChildProcessSpawner.ChildProcessSpawner with ChildProcess.make(...) instead of custom process wrappers in Effect services
Prefer HttpClient.HttpClient instead of raw fetch in Effect services
Prefer Path.Path, Config, Clock, and DateTime services when those concerns are already inside Effect code
For backgroun...

Files:

  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/config/command.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/config.ts
🧠 Learnings (48)
📓 Common learnings
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/ui/src/theme/context.tsx:11-16
Timestamp: 2026-04-22T09:32:58.310Z
Learning: In Astro-Han/pawwork (`packages/ui/src/theme/context.tsx` and related files), the renaming of localStorage theme keys from `opencode-*` to `pawwork-*` (THEME_ID, COLOR_SCHEME, THEME_CSS_LIGHT, THEME_CSS_DARK) is intentional and should NOT include a migration path from the old keys. Migrating would re-couple PawWork and OpenCode browser storage namespaces, which the PR is explicitly designed to avoid. A reset to the PawWork default theme on upgrade is acceptable by design.
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 224
File: packages/app/src/i18n/zh.ts:0-0
Timestamp: 2026-04-24T17:08:46.780Z
Learning: In Astro-Han/pawwork PR `#224`, the first-occurrence `PawWork 爪印` branding rule originally specified in issue `#196` was superseded by an updated Chinese-branding spec. On all zh UI surfaces in `packages/app/src/i18n/zh.ts` (e.g., `dialog.model.unpaid.freeModels.title`, `session.new.subtitle`, `sidebar.gettingStarted.line1`), the correct and intentional target is fully localized `爪印` branding — no `PawWork` prefix. Do NOT flag these strings as missing the first-occurrence `PawWork 爪印` rule in future reviews.
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `FileSystem.FileSystem` instead of raw `fs/promises` for effectful file I/O in Effect services
📚 Learning: 2026-04-27T11:18:47.596Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 271
File: packages/opencode/test/agent/agent.test.ts:440-447
Timestamp: 2026-04-27T11:18:47.596Z
Learning: In `packages/opencode/test/agent/agent.test.ts` (Astro-Han/pawwork), all agent-permission tests intentionally use the manual `tmpdir()` + `Instance.provide(...)` pattern. Do not flag individual tests in this file for conversion to `provideTmpdirInstance(...)` or `provideInstance(...)`; a full harness migration would be a separate PR if the pattern ever needs to change.

Applied to files:

  • packages/opencode/src/config/agent.ts
  • packages/core/test/util/flock.test.ts
  • packages/util/test/compat.test.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `Path.Path`, `Config`, `Clock`, and `DateTime` services when those concerns are already inside Effect code

Applied to files:

  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/config/command.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/global/index.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/ui/src/components/session-review.tsx
  • packages/ui/src/components/message-part.tsx
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/config.ts
  • packages/ui/src/components/line-comment.tsx
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `FileSystem.FileSystem` instead of raw `fs/promises` for effectful file I/O in Effect services

Applied to files:

  • packages/opencode/src/config/agent.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/config/command.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/opencode/src/config/plugin.ts
  • packages/ui/src/components/session-turn.tsx
  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/global/index.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/ui/src/components/file.tsx
  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/ui/src/components/session-review.tsx
  • packages/ui/src/components/message-part.tsx
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
  • packages/ui/src/components/line-comment.tsx
  • packages/util/test/compat.test.ts
📚 Learning: 2026-04-21T16:57:20.257Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 102
File: packages/opencode/src/config/command.ts:23-29
Timestamp: 2026-04-21T16:57:20.257Z
Learning: In packages/opencode/src/config/ config modules, treat both `Schema.Struct` and `Schema.Class` as valid schema patterns and do not require converting `Schema.Struct` to `Schema.Class`. If `Schema.Struct` is used in a config schema (e.g., in files like `command.ts`, `formatter.ts`, `provider.ts`, `permission.ts`, `lsp.ts`, `config.ts`, `keybinds.ts`), accept it as intentional; the selection should be based on upstream alignment and the local schema context, not on a rule that one form must replace the other.

Applied to files:

  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/config/command.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-27T08:58:00.665Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 264
File: packages/opencode/src/session/prompt.ts:531-538
Timestamp: 2026-04-27T08:58:00.665Z
Learning: When using Effect (e.g., `yield*` with `Effect`-style generator yielding), only use `yield* new SomeErrorClass(...)` if `SomeErrorClass` extends `Schema.TaggedErrorClass` (i.e., it implements Effect’s Yieldable interface). For plain `Error` subclasses (like `BlockedLoopError` / `LoopStopError`) or inline `new Error(...)` values, they are not yieldable and must be wrapped as `yield* Effect.fail(new PlainError(...))`. Do not recommend changing `yield* Effect.fail(new SomePlainError(...))` to `yield* new SomePlainError(...)` unless the error class extends `Schema.TaggedErrorClass`.

Applied to files:

  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/config/command.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-23T08:51:04.230Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 186
File: packages/opencode/test/plugin/workspace-adaptor.test.ts:139-144
Timestamp: 2026-04-23T08:51:04.230Z
Learning: In Astro-Han/pawwork (`packages/opencode/src/util/filesystem.ts`), the `Filesystem` utility does NOT expose a `remove` or `unlink` helper. The established repository pattern for auth.json teardown in tests (e.g. `provider.test.ts`, `amazon-bedrock.test.ts`, `workspace-adaptor.test.ts`) is to combine `Filesystem.write` with `node:fs/promises unlink`. Do not flag this mixed usage as inconsistent — it is the correct and intentional pattern.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/ui/src/components/file.tsx
  • packages/ui/src/components/tool-info.ts
  • packages/core/test/util/flock.test.ts
  • packages/ui/src/components/session-review.tsx
  • packages/ui/src/components/message-part.tsx
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
  • packages/ui/src/components/line-comment.tsx
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Import test utilities from `../fixtures` instead of `playwright/test`

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/opencode/src/config/plugin.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Prefer Effect-aware helpers from `fixture/fixture.ts` over building manual runtimes in tests: use `tmpdirScoped()` for scoped temp directories, `provideInstance(dir)(effect)` for low-level binding without directory creation, `provideTmpdirInstance(...)` for single temp instance binding, or `provideTmpdirServer(...)` for tests that also need the test LLM server.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/config/command.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/opencode/src/config/plugin.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Use the `tmpdir` function from `fixture/fixture.ts` to create temporary directories for tests with automatic cleanup. Use `await using` syntax to ensure automatic cleanup when the variable goes out of scope.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/util/flock.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
📚 Learning: 2026-04-25T12:52:37.850Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 234
File: packages/opencode/src/session/export.ts:24-31
Timestamp: 2026-04-25T12:52:37.850Z
Learning: In `packages/opencode/src/session/export.ts`, the `hashFile` async helper intentionally uses raw `node:fs/promises` (`fs.readFile`) rather than `FileSystem.FileSystem`. It is a small, self-contained helper called inside `Effect.promise(...)` with broad failure tolerance (try/catch returning `undefined`). Using `FileSystem.FileSystem` here would add unnecessary layers without payoff. The `FileSystem.FileSystem` preference applies to Effect-service-style operations, not thin async boundary helpers like `hashFile`.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/opencode/src/config/plugin.ts
  • packages/ui/src/components/session-turn.tsx
  • packages/core/test/util/effect-flock.test.ts
  • packages/ui/src/components/file.tsx
  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/ui/src/components/session-review.tsx
  • packages/ui/src/components/message-part.tsx
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
  • packages/util/test/compat.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Use `testEffect(...)` from `test/lib/effect.ts` for tests that exercise Effect services or Effect-based workflows.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-22T09:32:54.556Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/opencode/test/provider/provider.test.ts:64-85
Timestamp: 2026-04-22T09:32:54.556Z
Learning: In `packages/opencode/test/provider/provider.test.ts`, the file intentionally uses AppRuntime-based async helpers (`run`, `list`, `getProvider`, etc.) rather than `testEffect(...)` for all tests. Converting individual tests to `testEffect` while leaving the rest on the async pattern would create internal inconsistency. A full harness migration of this file is the right approach if the pattern needs to change, but that should be a separate PR.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/global/index.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/core/test/util/flock.test.ts
  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/config.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Use `it.effect(...)` when the test should run with `TestClock` and `TestConsole`. Use `it.live(...)` when the test depends on real time, filesystem mtimes, child processes, git, locks, or other live OS behavior.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-22T08:49:47.800Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/desktop-electron/src/main/index-sidecar-source.test.ts:3-11
Timestamp: 2026-04-22T08:49:47.800Z
Learning: In `packages/desktop-electron/src/main/index-sidecar-source.test.ts` (Astro-Han/pawwork), the test intentionally uses `expect(source).toContain` / `expect(source).not.toContain` string matching against the raw `index.ts` source text as a lightweight sidecar contract guard. The maintainer has explicitly chosen not to introduce an AST parser (e.g., `babel/parser` or acorn) for this purpose. Do not flag these string-based assertions as fragile or suggest converting them to AST-based matching.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Avoid custom `ManagedRuntime`, `attach(...)`, or ad hoc `run(...)` wrappers in Effect tests when `testEffect(...)` already provides the runtime.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/global/index.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/managed.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Define `const it = testEffect(...)` near the top of the test file and keep the test body inside `Effect.gen(function* () { ... })`. Yield services directly with `yield* MyService.Service` or `yield* MyTool`.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-27T11:19:24.963Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 271
File: packages/opencode/test/tool/websearch-auth.test.ts:0-0
Timestamp: 2026-04-27T11:19:24.963Z
Learning: In `packages/opencode/test/tool/websearch-auth.test.ts` (Astro-Han/pawwork), the tests intentionally use a small local `runWith` runner with raw `bun:test` and `Effect.runPromise` rather than the `testEffect` harness. Each test case injects a custom in-memory `Auth.Service` layer; switching to `testEffect` would be style-only churn without changing risk coverage. Do not flag these tests as needing harness migration.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-27T11:18:47.298Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 271
File: packages/opencode/test/tool/websearch.test.ts:21-78
Timestamp: 2026-04-27T11:18:47.298Z
Learning: In `packages/opencode/test/tool/websearch.test.ts`, the tests intentionally use manual `Effect.runPromise` with explicit `Effect.provide(...)` chains (including `Layer.succeed(Auth.Service, ...)`, `Layer.succeed(HttpClient.HttpClient, http)`, `WebSearchAuth.layer`, `Truncate.defaultLayer`, and `Agent.defaultLayer`) rather than the `testEffect(...)` harness. This is by design: the fake Auth and HTTP recovery-metadata layers must be explicitly injected and kept visible/scoped at the test site. Do NOT suggest migrating these tests to `testEffect` or removing the manual layer provides.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-27T11:18:47.332Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 271
File: packages/opencode/test/tool/mcp-exa.test.ts:1-186
Timestamp: 2026-04-27T11:18:47.332Z
Learning: In `packages/opencode/test/tool/mcp-exa.test.ts` (Astro-Han/pawwork), the tests intentionally use raw `bun:test` async cases with `Effect.runPromise(...)` and per-case `HttpClient.make(...)` fakes rather than the `testEffect(...)` harness. The maintainer has explicitly decided not to migrate, because the HttpClient fake wiring is itself the behavior under test and switching to `testEffect` would be style churn without changing risk coverage. Do not flag these tests as needing harness migration.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `makeRuntime` from `src/effect/run-service.ts` for all services; it returns `{ runPromise, runFork, runCallback }` backed by a shared `memoMap` that deduplicates layers

Applied to files:

  • packages/opencode/src/session/session.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/config.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-25T12:52:49.735Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 234
File: packages/opencode/src/share/session.ts:27-27
Timestamp: 2026-04-25T12:52:49.735Z
Learning: In `packages/opencode/src/share/session.ts`, the local `ensureEnabled` closure is intentionally duplicated from `ShareRuntime.ensureEnabled` in `runtime.ts`. Using the shared `ShareRuntime.ensureEnabled` effect directly would leak `CloudShareGate` back into the `R` (requirement) type of `share`, `unshare`, and `create`, because the shared effect re-yields the service rather than capturing an already-resolved gate reference. The current pattern resolves `gate` once at the top of the outer `Effect.gen` and then closes over it in a local `ensureEnabled`, keeping the inner effects' requirement types clean. A comment in the file points to `runtime.ts` to make the intentional duplication discoverable. The real fix would be refactoring `ensureEnabled` to accept a gate parameter, but that change is larger than the DRY benefit warrants. Do not flag this duplication as a maintenance issue.

Applied to files:

  • packages/opencode/src/session/session.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/managed.ts
  • packages/util/test/compat.test.ts
📚 Learning: 2026-04-27T10:32:59.274Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 264
File: packages/opencode/src/session/diagnostics.ts:245-252
Timestamp: 2026-04-27T10:32:59.274Z
Learning: In pawwork’s session diagnostics/loop error handling (e.g., packages/opencode/src/session/diagnostics.ts), keep `loopLastError` stored as raw/unscrubbed error text in loop metadata. The intended trust boundary for sensitive-data scrubbing is the renderer: `LoopRenderer.render` must apply `scrubErrorText` before any user/model-facing output. Do not recommend scrubbing `loopLastError` at the `observeToolError` call site, because failed tool parts already store raw errors in `state.error` (pre-existing leak) and scrubbing only `loopLastError` would be lossy without closing the gap. If export-side hardening is required, implement a single sanitizer pass in the export layer over both `state.error` and the loop/metadata fields, rather than sanitizing only `loopLastError` earlier in the storage path.

Applied to files:

  • packages/opencode/src/session/session.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/session/export.ts
📚 Learning: 2026-04-27T10:33:08.974Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 264
File: packages/opencode/src/session/prompt.ts:108-169
Timestamp: 2026-04-27T10:33:08.974Z
Learning: For Astro-Han/pawwork session processing code under packages/opencode/src/session/ (e.g., prompt.ts and processor.ts), this specific loop-gate TOCTOU/race between buildLoopContext() and recordSyntheticBlock/recordSyntheticStop is intentionally handled via idempotence guards (re-check sigKey presence and hasStopped inside the record helpers). Do not treat the absence of a per-parent Effect.Mutex as a blocking review issue for this known edge case; the residual window should only create extra synthetic parts and must not change the "turn ends" contract. Respect the existing code comment documenting the trade-off, and only escalate to a full-mutex approach if the race is observed in practice.

Applied to files:

  • packages/opencode/src/session/session.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/session/export.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Schema.TaggedErrorClass` for typed errors in Effect schemas

Applied to files:

  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Schema.Defect` instead of `unknown` for defect-like causes in Effect code

Applied to files:

  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use branded schemas (`Schema.brand`) for single-value types in Effect

Applied to files:

  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Schema.Class` for multi-field data in Effect schemas

Applied to files:

  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Prefer the `project` fixture for tests that need a dedicated project with LLM mocking

Applied to files:

  • packages/core/test/fixture/flock-worker.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `ChildProcessSpawner.ChildProcessSpawner` with `ChildProcess.make(...)` instead of custom process wrappers in Effect services

Applied to files:

  • packages/opencode/src/config/plugin.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `InstanceState` from `src/effect/instance-state.ts` for per-directory or per-project state that needs per-instance cleanup; do work directly in the `InstanceState.make` closure where `ScopedCache` handles run-once semantics

Applied to files:

  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/global/index.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Effect.cached` when multiple concurrent callers should share a single in-flight computation rather than storing `Fiber | undefined` or `Promise | undefined` manually

Applied to files:

  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : For background loops or scheduled tasks, use `Effect.repeat` or `Effect.schedule` with `Effect.forkScoped` in the layer definition

Applied to files:

  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/core/test/fixture/effect-flock-worker.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Effect.gen(function* () { ... })` for Effect composition

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
📚 Learning: 2026-04-22T09:32:58.310Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/ui/src/theme/context.tsx:11-16
Timestamp: 2026-04-22T09:32:58.310Z
Learning: In Astro-Han/pawwork (`packages/ui/src/theme/context.tsx` and related files), the renaming of localStorage theme keys from `opencode-*` to `pawwork-*` (THEME_ID, COLOR_SCHEME, THEME_CSS_LIGHT, THEME_CSS_DARK) is intentional and should NOT include a migration path from the old keys. Migrating would re-couple PawWork and OpenCode browser storage namespaces, which the PR is explicitly designed to avoid. A reset to the PawWork default theme on upgrade is acceptable by design.

Applied to files:

  • packages/ui/src/components/session-review.tsx
  • packages/opencode/src/config/paths.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/drizzle.config.ts : Configure Drizzle Kit migrations with schema path `./src/**/*.sql.ts` and output path `./migration`

Applied to files:

  • packages/opencode/src/config/paths.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `HttpClient.HttpClient` instead of raw `fetch` in Effect services

Applied to files:

  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Effect.forkScoped` inside the `InstanceState.make` closure for background stream consumers — the fiber is interrupted when the instance is disposed

Applied to files:

  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/packages/app/src/testing/**/*.ts : Test-only hooks must be inert unless explicitly enabled and should not add normal-runtime listeners, reactive subscriptions, or per-update allocations

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-24T17:12:26.774Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 224
File: packages/desktop-electron/electron-builder.config.ts:14-18
Timestamp: 2026-04-24T17:12:26.774Z
Learning: In Astro-Han/pawwork, the `localizedMacDisplayNameByChannel` map in `packages/desktop-electron/electron-builder.config.ts` is intentionally kept separate from `localizedAppDisplayName` in `packages/desktop-electron/src/main/app-display-name.ts`. The former is a build-time packaging helper; the latter is a runtime UI helper that localizes the current app name by locale. Coupling them would introduce a build-time dependency on runtime main logic. Do not suggest deduplicating or sharing this mapping — the explicit local table is covered by focused regression tests in `electron-builder-app-update.test.ts`.

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Test files should be named with the pattern `feature-name.spec.ts`

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : When validating routing, assert against canonical or resolved workspace slugs using shared helpers from `../actions` to account for Windows canonicalization

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use SCREAMING_SNAKE_CASE for constants in tests

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use lowercase, descriptive test names (e.g., 'sidebar can be toggled')

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use camelCase for variable names in tests

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use locator assertions like `toBeVisible()`, `toHaveCount(0)`, and `toHaveAttribute(...)` for normal UI state verification

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Test one feature per test file

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Prefer fluent helpers and drivers when they make intent obvious and reduce locator-heavy noise in tests

Applied to files:

  • packages/util/test/compat.test.ts
🔇 Additional comments (33)
packages/core/package.json (1)

4-4: Manifest rename is correct.

The package name now matches the new @opencode-ai/core namespace expected by updated workspace consumers.

packages/ui/package.json (1)

48-48: UI dependency migration is consistent.

Switching to @opencode-ai/core while keeping workspace:* is correct for this refactor.

packages/opencode/package.json (1)

116-116: Opencode workspace dependency update looks good.

The dependency now correctly points to @opencode-ai/core in line with the new import source.

packages/util/package.json (1)

14-14: Util manifest change is correct.

@opencode-ai/core is the right workspace dependency after the shared→core rename.

packages/core/test/fixture/flock-worker.ts (1)

2-2: Flock import migration is clean.

The fixture now references the renamed core package without changing lock behavior.

packages/ui/src/components/line-comment.tsx (1)

2-2: Path util import update is correct.

getDirectory and getFilename now resolve from @opencode-ai/core as expected for the rename.

packages/ui/src/components/session-turn.tsx (1)

11-12: Session turn utility imports are correctly migrated.

Both Binary and path helpers now point to @opencode-ai/core with no functional drift in usage.

packages/ui/src/components/tool-info.ts (1)

2-2: Tool info import rename is correct.

getFilename now correctly comes from @opencode-ai/core/util/path for this namespace migration.

packages/ui/src/components/file.tsx (1)

1-1: LGTM!

Import correctly updated from @opencode-ai/shared/util/encode to @opencode-ai/core/util/encode. The sampledChecksum usage in DiffViewer's cacheKey computation (lines 1062-1064) remains unchanged.

packages/core/test/fixture/effect-flock-worker.ts (1)

4-6: LGTM!

Imports correctly updated to @opencode-ai/core/* namespace. The Global.Service, EffectFlock.layer, and AppFileSystem.defaultLayer usage in the test layer composition (lines 23-36) remains unchanged.

packages/core/test/filesystem/filesystem.test.ts (1)

4-4: LGTM!

Import correctly updated to @opencode-ai/core/filesystem. The AppFileSystem.layer and AppFileSystem.Service usage in the test remains unchanged.

packages/opencode/src/config/command.ts (1)

6-6: LGTM!

Import correctly updated to @opencode-ai/core/util/glob. The Glob.scan(...) usage (lines 42-47) remains unchanged.

packages/opencode/src/config/agent.ts (1)

9-9: LGTM!

Import correctly updated to @opencode-ai/core/util/glob. The Glob.scan(...) usage in both load() and loadMode() functions remains unchanged.

packages/core/test/util/flock.test.ts (1)

6-7: LGTM!

Imports correctly updated to @opencode-ai/core/* namespace. The Flock.acquire, Flock.withLock, and Hash.fast usage throughout the tests remains unchanged.

packages/opencode/src/config/config.ts (3)

22-22: LGTM!

Import correctly updated to @opencode-ai/core/filesystem. The AppFileSystem.Service usage in the Effect layer (line 401) and AppFileSystem.defaultLayer in layer composition (line 874) remain unchanged.


26-26: LGTM!

Import correctly updated to @opencode-ai/core/util/effect-flock. The EffectFlock.defaultLayer usage in layer composition (line 873) remains unchanged.


50-50: LGTM!

Import correctly updated to @opencode-ai/core/runtime. The Runtime.isPawWork() utility calls throughout the file remain unchanged.

packages/opencode/src/config/plugin.ts (1)

1-1: LGTM!

Import correctly updated to @opencode-ai/core/util/glob. The Glob.scan(...) usage in the load() function (lines 33-38) remains unchanged.

packages/opencode/src/config/managed.ts (1)

7-7: Import migration is correctly scoped.

This runtime import rename is consistent with the workspace package move and keeps existing behavior intact.

packages/opencode/src/storage/db.ts (1)

17-17: Namespace update looks correct.

Runtime is referenced the same way after the import move, so this segment is safe.

packages/opencode/src/global/index.ts (1)

6-6: Good mechanical rename.

The Runtime import repoint is consistent and does not change path resolution logic.

packages/opencode/src/share/runtime.ts (1)

2-2: Runtime import migration is clean.

This keeps the existing gate semantics while aligning with the new core package namespace.

packages/ui/src/components/message-part.tsx (1)

47-48: UI utility imports are correctly repointed.

Path and checksum helpers are migrated consistently with no logic changes in call sites.

packages/core/test/util/effect-flock.test.ts (1)

8-11: Test import updates are consistent and safe.

The renamed core module paths preserve the same test behavior and structure.

packages/ui/src/components/markdown.tsx (1)

5-5: Checksum import migration looks good.

This is a straight namespace update with no change to markdown cache-key logic.

packages/ui/src/components/session-review.tsx (1)

14-15: Session review utility imports are correctly updated.

The rename is consistent with the rest of the PR and keeps component behavior unchanged.

packages/opencode/src/config/paths.ts (1)

12-13: Core namespace import migration is correct and behavior-preserving.

AppFileSystem and Runtime were cleanly repointed to @opencode-ai/core/* with unchanged usage semantics.

packages/util/test/compat.test.ts (1)

3-5: Compatibility test update is consistent and clear.

The test now correctly validates util/core parity after the package rename, and naming aligns with the new source package.

Also applies to: 7-13

packages/desktop-electron/scripts/runtime-import-guard.test.ts (1)

19-19: Runtime guard tests were correctly migrated to @opencode-ai/core/runtime.

The updated fixtures and expected values stay aligned with the guard implementation and preserve test intent.

Also applies to: 32-32, 43-43, 151-151, 155-155

packages/util/test/compat-surface.test.ts (1)

3-21: Compat-surface migration to core is complete and consistent.

The test still validates the same contracts, now against @opencode-ai/core as intended.

Also applies to: 24-27, 31-37, 39-39, 44-47, 50-51, 53-53, 56-57, 59-59, 61-61

packages/opencode/src/session/session.ts (1)

28-28: Session runtime import rename is correct.

Runtime was repointed to core with no behavior change at call sites.

packages/opencode/src/session/export.ts (1)

9-9: Export runtime import migration is clean.

The Runtime namespace update to core is consistent and preserves getRuntimeNamespace() behavior.

packages/opencode/src/session/instruction.ts (1)

12-12: Instruction runtime import update is correct.

Runtime was migrated to core with unchanged usage and no behavioral drift.


📝 Walkthrough

Walkthrough

Monorepo-wide package namespace migration: imports and package.json entries changed from @opencode-ai/shared to @opencode-ai/core across core, opencode, ui, util, desktop-electron, and related tests.

Changes

Cohort / File(s) Summary
Core package manifest
packages/core/package.json
Renamed package name from @opencode-ai/shared@opencode-ai/core.
Core tests & fixtures
packages/core/test/filesystem/filesystem.test.ts, packages/core/test/fixture/effect-flock-worker.ts, packages/core/test/fixture/flock-worker.ts, packages/core/test/util/effect-flock.test.ts, packages/core/test/util/flock.test.ts
Updated import specifiers in test files to reference @opencode-ai/core/* instead of @opencode-ai/shared/*.
Desktop Electron runtime guard
packages/desktop-electron/scripts/runtime-import-guard.test.ts
Updated test input/fixtures and expectations to use @opencode-ai/core/runtime in place of @opencode-ai/shared/runtime.
Package dependency updates
packages/opencode/package.json, packages/ui/package.json, packages/util/package.json
Replaced @opencode-ai/shared workspace dependency entries with @opencode-ai/core (workspace:*).
Opencode config & core modules
packages/opencode/src/config/..., packages/opencode/src/global/index.ts, packages/opencode/src/config/config.ts, packages/opencode/src/config/managed.ts, packages/opencode/src/config/paths.ts
Switched imports for utilities/services (e.g., AppFileSystem, EffectFlock, Glob, Runtime) from @opencode-ai/shared/* to @opencode-ai/core/*.
Opencode session & storage
packages/opencode/src/session/..., packages/opencode/src/share/runtime.ts, packages/opencode/src/storage/db.ts
Switched Runtime import sources to @opencode-ai/core/runtime; call sites unchanged.
UI components — encoding/path utilities
packages/ui/src/components/file.tsx, packages/ui/src/components/markdown.tsx, packages/ui/src/components/line-comment.tsx, packages/ui/src/components/message-part.tsx, packages/ui/src/components/session-review.tsx, packages/ui/src/components/session-turn.tsx, packages/ui/src/components/tool-info.ts
Repointed checksum/sampledChecksum and getDirectory/getFilename imports from @opencode-ai/shared/util/* to @opencode-ai/core/util/*.
Util package tests
packages/util/test/compat-surface.test.ts, packages/util/test/compat.test.ts
Updated tests to import utility surfaces from @opencode-ai/core/util/* instead of @opencode-ai/shared/util/*, plus identifier renames in tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

dependencies

Poem

🐰 From shared to core I skip and sing,
New import trails on every spring,
A tidy hop through files and tests,
Each path aligned, no messy nests,
Hooray — the namespace found its ring! 🥕✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/upstream-sync-209-pr1-rename

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request renames the @opencode-ai/shared package to @opencode-ai/core across the monorepo. The changes include updating the package name in package.json, adjusting the lockfile, and updating all internal import references. Feedback suggests updating variable and import aliases in test files (e.g., changing sharedFindLast to coreFindLast) to maintain naming consistency with the new package name.

Comment thread packages/util/test/compat-surface.test.ts Outdated
Comment thread packages/util/test/compat-surface.test.ts Outdated
Comment thread packages/util/test/compat.test.ts Outdated
Comment thread packages/util/test/compat.test.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/util/test/compat.test.ts`:
- Around line 3-5: Rename the imports that alias core package exports to use
"core" instead of "shared": change sharedBase64Encode → coreBase64Encode,
sharedChecksum → coreChecksum, and sharedGetFilename → coreGetFilename (leave
utilGetFilename as-is) and update all test usages to reference coreBase64Encode,
coreChecksum, and coreGetFilename so the intent is clear that these imports come
from `@opencode-ai/core`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dd771ab4-2cdb-497b-917b-e8cef89030dd

📥 Commits

Reviewing files that changed from the base of the PR and between 99f98ff and 0c6252d.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (56)
  • packages/core/package.json
  • packages/core/src/filesystem.ts
  • packages/core/src/global.ts
  • packages/core/src/runtime.ts
  • packages/core/src/types.d.ts
  • packages/core/src/util/array.ts
  • packages/core/src/util/binary.ts
  • packages/core/src/util/effect-flock.ts
  • packages/core/src/util/encode.ts
  • packages/core/src/util/error.ts
  • packages/core/src/util/flock.ts
  • packages/core/src/util/fn.ts
  • packages/core/src/util/glob.ts
  • packages/core/src/util/hash.ts
  • packages/core/src/util/identifier.ts
  • packages/core/src/util/iife.ts
  • packages/core/src/util/lazy.ts
  • packages/core/src/util/module.ts
  • packages/core/src/util/path.ts
  • packages/core/src/util/retry.ts
  • packages/core/src/util/slug.ts
  • packages/core/sst-env.d.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/global.test.ts
  • packages/core/test/lib/effect.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/util/identifier.test.ts
  • packages/core/tsconfig.json
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/opencode/package.json
  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/config/command.ts
  • packages/opencode/src/config/config.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/session/export.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/storage/db.ts
  • packages/ui/package.json
  • packages/ui/src/components/file.tsx
  • packages/ui/src/components/line-comment.tsx
  • packages/ui/src/components/markdown.tsx
  • packages/ui/src/components/message-part.tsx
  • packages/ui/src/components/session-review.tsx
  • packages/ui/src/components/session-turn.tsx
  • packages/ui/src/components/tool-info.ts
  • packages/util/package.json
  • packages/util/test/compat-surface.test.ts
  • packages/util/test/compat.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: smoke-macos-arm64
  • GitHub Check: unit-windows-desktop
  • GitHub Check: unit-windows-opencode-session
  • GitHub Check: unit-windows-opencode-server-tools
  • GitHub Check: unit-windows-opencode-config-project
  • GitHub Check: unit-app
  • GitHub Check: unit-windows-app
  • GitHub Check: typecheck
  • GitHub Check: unit-desktop
  • GitHub Check: unit-opencode
  • GitHub Check: e2e-artifacts
  • GitHub Check: analyze-js-ts
🧰 Additional context used
📓 Path-based instructions (1)
packages/opencode/**/*.ts

📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)

packages/opencode/**/*.ts: Use Effect.gen(function* () { ... }) for Effect composition
Use Effect.fn("Domain.method") for named/traced effects and Effect.fnUntraced for internal helpers; these accept pipeable operators as extra arguments to avoid unnecessary outer .pipe() wrappers
Use Effect.callback for callback-based APIs
Prefer DateTime.nowAsDate over new Date(yield* Clock.currentTimeMillis) when you need a Date in Effect code
Use Schema.Class for multi-field data in Effect schemas
Use branded schemas (Schema.brand) for single-value types in Effect
Use Schema.TaggedErrorClass for typed errors in Effect schemas
Use Schema.Defect instead of unknown for defect-like causes in Effect code
In Effect.gen / Effect.fn, prefer yield* new MyError(...) over yield* Effect.fail(new MyError(...)) for direct early-failure branches
Use makeRuntime from src/effect/run-service.ts for all services; it returns { runPromise, runFork, runCallback } backed by a shared memoMap that deduplicates layers
Use InstanceState from src/effect/instance-state.ts for per-directory or per-project state that needs per-instance cleanup; do work directly in the InstanceState.make closure where ScopedCache handles run-once semantics
Use Effect.addFinalizer or Effect.acquireRelease inside the InstanceState.make closure for cleanup (subscriptions, process teardown, etc.)
Use Effect.forkScoped inside the InstanceState.make closure for background stream consumers — the fiber is interrupted when the instance is disposed
Prefer FileSystem.FileSystem instead of raw fs/promises for effectful file I/O in Effect services
Prefer ChildProcessSpawner.ChildProcessSpawner with ChildProcess.make(...) instead of custom process wrappers in Effect services
Prefer HttpClient.HttpClient instead of raw fetch in Effect services
Prefer Path.Path, Config, Clock, and DateTime services when those concerns are already inside Effect code
For backgroun...

Files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
  • packages/opencode/src/config/command.ts
🧠 Learnings (42)
📓 Common learnings
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/ui/src/theme/context.tsx:11-16
Timestamp: 2026-04-22T09:32:58.310Z
Learning: In Astro-Han/pawwork (`packages/ui/src/theme/context.tsx` and related files), the renaming of localStorage theme keys from `opencode-*` to `pawwork-*` (THEME_ID, COLOR_SCHEME, THEME_CSS_LIGHT, THEME_CSS_DARK) is intentional and should NOT include a migration path from the old keys. Migrating would re-couple PawWork and OpenCode browser storage namespaces, which the PR is explicitly designed to avoid. A reset to the PawWork default theme on upgrade is acceptable by design.
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 224
File: packages/app/src/i18n/zh.ts:0-0
Timestamp: 2026-04-24T17:08:44.294Z
Learning: In Astro-Han/pawwork PR `#224`, the first-occurrence `PawWork 爪印` branding rule originally specified in issue `#196` was superseded by an updated Chinese-branding spec. On all zh UI surfaces in `packages/app/src/i18n/zh.ts` (e.g., `dialog.model.unpaid.freeModels.title`, `session.new.subtitle`, `sidebar.gettingStarted.line1`), the correct and intentional target is fully localized `爪印` branding — no `PawWork` prefix. Do NOT flag these strings as missing the first-occurrence `PawWork 爪印` rule in future reviews.
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 211
File: packages/opencode/src/provider/models.ts:113-179
Timestamp: 2026-04-24T06:50:02.712Z
Learning: In Astro-Han/pawwork (`packages/opencode/src/provider/models.ts`), `PublishModel` and `PublishProvider` intentionally duplicate fields from `Model` and `Provider` with looser optionality. The split is a deliberate behavior boundary: `PublishModel`/`PublishProvider` (with `.passthrough()`) are used for lenient publish-time validation of incoming catalogs, while `Model`/`Provider` are used for strict runtime normalization. Do not flag this duplication as a maintenance burden or suggest extracting a shared base schema — the explicit separation is intentional and tied to the models-refresh reliability path introduced in PR `#211`.
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `makeRuntime` from `src/effect/run-service.ts` for all services; it returns `{ runPromise, runFork, runCallback }` backed by a shared `memoMap` that deduplicates layers

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/global/index.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/share/runtime.ts
  • packages/opencode/src/config/paths.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-25T12:52:47.074Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 234
File: packages/opencode/src/share/session.ts:27-27
Timestamp: 2026-04-25T12:52:47.074Z
Learning: In `packages/opencode/src/share/session.ts`, the local `ensureEnabled` closure is intentionally duplicated from `ShareRuntime.ensureEnabled` in `runtime.ts`. Using the shared `ShareRuntime.ensureEnabled` effect directly would leak `CloudShareGate` back into the `R` (requirement) type of `share`, `unshare`, and `create`, because the shared effect re-yields the service rather than capturing an already-resolved gate reference. The current pattern resolves `gate` once at the top of the outer `Effect.gen` and then closes over it in a local `ensureEnabled`, keeping the inner effects' requirement types clean. A comment in the file points to `runtime.ts` to make the intentional duplication discoverable. The real fix would be refactoring `ensureEnabled` to accept a gate parameter, but that change is larger than the DRY benefit warrants. Do not flag this duplication as a maintenance issue.

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/session/instruction.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/session/session.ts
  • packages/opencode/src/share/runtime.ts
📚 Learning: 2026-04-25T12:52:35.671Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 234
File: packages/opencode/src/session/export.ts:24-31
Timestamp: 2026-04-25T12:52:35.671Z
Learning: In `packages/opencode/src/session/export.ts`, the `hashFile` async helper intentionally uses raw `node:fs/promises` (`fs.readFile`) rather than `FileSystem.FileSystem`. It is a small, self-contained helper called inside `Effect.promise(...)` with broad failure tolerance (try/catch returning `undefined`). Using `FileSystem.FileSystem` here would add unnecessary layers without payoff. The `FileSystem.FileSystem` preference applies to Effect-service-style operations, not thin async boundary helpers like `hashFile`.

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/plugin.ts
  • packages/ui/src/components/file.tsx
  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/session/session.ts
  • packages/core/test/util/flock.test.ts
  • packages/ui/src/components/session-review.tsx
  • packages/ui/src/components/session-turn.tsx
  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/config/paths.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/ui/src/components/message-part.tsx
  • packages/util/test/compat.test.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `FileSystem.FileSystem` instead of raw `fs/promises` for effectful file I/O in Effect services

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/plugin.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/ui/src/components/session-review.tsx
  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/share/runtime.ts
  • packages/ui/src/components/session-turn.tsx
  • packages/core/test/util/effect-flock.test.ts
  • packages/ui/src/components/line-comment.tsx
  • packages/opencode/src/config/paths.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/ui/src/components/message-part.tsx
  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `Path.Path`, `Config`, `Clock`, and `DateTime` services when those concerns are already inside Effect code

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/global/index.ts
  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/share/runtime.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/ui/src/components/line-comment.tsx
  • packages/opencode/src/config/paths.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/ui/src/components/message-part.tsx
  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Avoid custom `ManagedRuntime`, `attach(...)`, or ad hoc `run(...)` wrappers in Effect tests when `testEffect(...)` already provides the runtime.

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/global/index.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/util/test/compat.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Use `testEffect(...)` from `test/lib/effect.ts` for tests that exercise Effect services or Effect-based workflows.

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/util/test/compat.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-22T09:32:54.556Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/opencode/test/provider/provider.test.ts:64-85
Timestamp: 2026-04-22T09:32:54.556Z
Learning: In `packages/opencode/test/provider/provider.test.ts`, the file intentionally uses AppRuntime-based async helpers (`run`, `list`, `getProvider`, etc.) rather than `testEffect(...)` for all tests. Converting individual tests to `testEffect` while leaving the rest on the async pattern would create internal inconsistency. A full harness migration of this file is the right approach if the pattern needs to change, but that should be a separate PR.

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/managed.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/util/test/compat.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Prefer Effect-aware helpers from `fixture/fixture.ts` over building manual runtimes in tests: use `tmpdirScoped()` for scoped temp directories, `provideInstance(dir)(effect)` for low-level binding without directory creation, `provideTmpdirInstance(...)` for single temp instance binding, or `provideTmpdirServer(...)` for tests that also need the test LLM server.

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/opencode/src/config/plugin.ts
  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/config/paths.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/util/test/compat.test.ts
  • packages/opencode/src/config/command.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Effect.gen(function* () { ... })` for Effect composition

Applied to files:

  • packages/opencode/src/session/export.ts
  • packages/core/test/fixture/effect-flock-worker.ts
📚 Learning: 2026-04-21T16:57:20.257Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 102
File: packages/opencode/src/config/command.ts:23-29
Timestamp: 2026-04-21T16:57:20.257Z
Learning: In packages/opencode/src/config/ config modules, treat both `Schema.Struct` and `Schema.Class` as valid schema patterns and do not require converting `Schema.Struct` to `Schema.Class`. If `Schema.Struct` is used in a config schema (e.g., in files like `command.ts`, `formatter.ts`, `provider.ts`, `permission.ts`, `lsp.ts`, `config.ts`, `keybinds.ts`), accept it as intentional; the selection should be based on upstream alignment and the local schema context, not on a rule that one form must replace the other.

Applied to files:

  • packages/opencode/src/config/managed.ts
  • packages/opencode/src/config/plugin.ts
  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Import test utilities from `../fixtures` instead of `playwright/test`

Applied to files:

  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/util/test/compat.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Use the `tmpdir` function from `fixture/fixture.ts` to create temporary directories for tests with automatic cleanup. Use `await using` syntax to ensure automatic cleanup when the variable goes out of scope.

Applied to files:

  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/config/paths.ts
  • packages/util/test/compat.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Prefer the `project` fixture for tests that need a dedicated project with LLM mocking

Applied to files:

  • packages/core/test/fixture/flock-worker.ts
📚 Learning: 2026-04-23T08:51:04.230Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 186
File: packages/opencode/test/plugin/workspace-adaptor.test.ts:139-144
Timestamp: 2026-04-23T08:51:04.230Z
Learning: In Astro-Han/pawwork (`packages/opencode/src/util/filesystem.ts`), the `Filesystem` utility does NOT expose a `remove` or `unlink` helper. The established repository pattern for auth.json teardown in tests (e.g. `provider.test.ts`, `amazon-bedrock.test.ts`, `workspace-adaptor.test.ts`) is to combine `Filesystem.write` with `node:fs/promises unlink`. Do not flag this mixed usage as inconsistent — it is the correct and intentional pattern.

Applied to files:

  • packages/core/test/fixture/flock-worker.ts
  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/ui/src/components/session-review.tsx
  • packages/ui/src/components/line-comment.tsx
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
  • packages/ui/src/components/message-part.tsx
  • packages/util/test/compat.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `InstanceState` from `src/effect/instance-state.ts` for per-directory or per-project state that needs per-instance cleanup; do work directly in the `InstanceState.make` closure where `ScopedCache` handles run-once semantics

Applied to files:

  • packages/opencode/src/global/index.ts
  • packages/opencode/src/storage/db.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-22T08:49:47.800Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/desktop-electron/src/main/index-sidecar-source.test.ts:3-11
Timestamp: 2026-04-22T08:49:47.800Z
Learning: In `packages/desktop-electron/src/main/index-sidecar-source.test.ts` (Astro-Han/pawwork), the test intentionally uses `expect(source).toContain` / `expect(source).not.toContain` string matching against the raw `index.ts` source text as a lightweight sidecar contract guard. The maintainer has explicitly chosen not to introduce an AST parser (e.g., `babel/parser` or acorn) for this purpose. Do not flag these string-based assertions as fragile or suggest converting them to AST-based matching.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/util/test/compat.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Use the `config` option in `tmpdir` to write an `opencode.json` config file during test setup by passing a partial Config.Info object.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Define `const it = testEffect(...)` near the top of the test file and keep the test body inside `Effect.gen(function* () { ... })`. Yield services directly with `yield* MyService.Service` or `yield* MyTool`.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
  • packages/util/test/compat.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:31.032Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.032Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Use `it.effect(...)` when the test should run with `TestClock` and `TestConsole`. Use `it.live(...)` when the test depends on real time, filesystem mtimes, child processes, git, locks, or other live OS behavior.

Applied to files:

  • packages/core/test/filesystem/filesystem.test.ts
  • packages/core/test/util/flock.test.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
  • packages/util/test/compat-surface.test.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `ChildProcessSpawner.ChildProcessSpawner` with `ChildProcess.make(...)` instead of custom process wrappers in Effect services

Applied to files:

  • packages/core/test/util/flock.test.ts
  • packages/opencode/src/share/runtime.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-22T09:32:58.310Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/ui/src/theme/context.tsx:11-16
Timestamp: 2026-04-22T09:32:58.310Z
Learning: In Astro-Han/pawwork (`packages/ui/src/theme/context.tsx` and related files), the renaming of localStorage theme keys from `opencode-*` to `pawwork-*` (THEME_ID, COLOR_SCHEME, THEME_CSS_LIGHT, THEME_CSS_DARK) is intentional and should NOT include a migration path from the old keys. Migrating would re-couple PawWork and OpenCode browser storage namespaces, which the PR is explicitly designed to avoid. A reset to the PawWork default theme on upgrade is acceptable by design.

Applied to files:

  • packages/ui/src/components/session-review.tsx
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/src/**/*.sql.ts : Drizzle schema should live in `src/**/*.sql.ts`

Applied to files:

  • packages/opencode/src/storage/db.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Effect.cached` when multiple concurrent callers should share a single in-flight computation rather than storing `Fiber | undefined` or `Promise | undefined` manually

Applied to files:

  • packages/opencode/src/share/runtime.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/opencode/src/config/paths.ts
  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : For background loops or scheduled tasks, use `Effect.repeat` or `Effect.schedule` with `Effect.forkScoped` in the layer definition

Applied to files:

  • packages/opencode/src/share/runtime.ts
  • packages/core/test/util/effect-flock.test.ts
  • packages/core/test/fixture/effect-flock-worker.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/drizzle.config.ts : Configure Drizzle Kit migrations with schema path `./src/**/*.sql.ts` and output path `./migration`

Applied to files:

  • packages/opencode/src/config/paths.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Effect.forkScoped` inside the `InstanceState.make` closure for background stream consumers — the fiber is interrupted when the instance is disposed

Applied to files:

  • packages/core/test/fixture/effect-flock-worker.ts
  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Prefer `HttpClient.HttpClient` instead of raw `fetch` in Effect services

Applied to files:

  • packages/opencode/src/config/config.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : When validating routing, assert against canonical or resolved workspace slugs using shared helpers from `../actions` to account for Windows canonicalization

Applied to files:

  • packages/util/test/compat.test.ts
  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Schema.TaggedErrorClass` for typed errors in Effect schemas

Applied to files:

  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use `Schema.Defect` instead of `unknown` for defect-like causes in Effect code

Applied to files:

  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:21.288Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:21.288Z
Learning: Applies to packages/opencode/**/*.ts : Use branded schemas (`Schema.brand`) for single-value types in Effect

Applied to files:

  • packages/opencode/src/config/command.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/packages/app/src/testing/**/*.ts : Test-only hooks must be inert unless explicitly enabled and should not add normal-runtime listeners, reactive subscriptions, or per-update allocations

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Test files should be named with the pattern `feature-name.spec.ts`

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use SCREAMING_SNAKE_CASE for constants in tests

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use lowercase, descriptive test names (e.g., 'sidebar can be toggled')

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use camelCase for variable names in tests

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-24T17:12:23.931Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 224
File: packages/desktop-electron/electron-builder.config.ts:14-18
Timestamp: 2026-04-24T17:12:23.931Z
Learning: In Astro-Han/pawwork, the `localizedMacDisplayNameByChannel` map in `packages/desktop-electron/electron-builder.config.ts` is intentionally kept separate from `localizedAppDisplayName` in `packages/desktop-electron/src/main/app-display-name.ts`. The former is a build-time packaging helper; the latter is a runtime UI helper that localizes the current app name by locale. Coupling them would introduce a build-time dependency on runtime main logic. Do not suggest deduplicating or sharing this mapping — the explicit local table is covered by focused regression tests in `electron-builder-app-update.test.ts`.

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use locator assertions like `toBeVisible()`, `toHaveCount(0)`, and `toHaveAttribute(...)` for normal UI state verification

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Test one feature per test file

Applied to files:

  • packages/desktop-electron/scripts/runtime-import-guard.test.ts
📚 Learning: 2026-04-20T14:36:04.113Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.113Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Prefer fluent helpers and drivers when they make intent obvious and reduce locator-heavy noise in tests

Applied to files:

  • packages/util/test/compat-surface.test.ts
🔇 Additional comments (30)
packages/util/package.json (1)

14-14: Dependency rename is correctly applied.

Line 14 cleanly switches the workspace dependency to @opencode-ai/core with no unintended manifest changes.

packages/opencode/package.json (1)

116-116: opencode manifest update is consistent with the rename.

Line 116 correctly points to @opencode-ai/core as a workspace dependency.

packages/ui/package.json (1)

48-48: UI dependency migration looks correct.

Line 48 updates the workspace package name without introducing unrelated manifest churn.

packages/core/package.json (1)

4-4: Core package identity rename is correctly set.

Line 4 updates the package name to @opencode-ai/core, matching the new namespace expected by dependents.

packages/ui/src/components/tool-info.ts (1)

2-2: Import migration is safe and consistent.

Line 2 updates getFilename to the new @opencode-ai/core path with no downstream logic changes in this file.

packages/ui/src/components/file.tsx (1)

1-1: Checksum utility import update is correctly scoped.

Line 1 performs the expected namespace switch to @opencode-ai/core while preserving existing cache-key logic.

packages/ui/src/components/session-review.tsx (1)

14-15: Session review utility imports are correctly migrated.

Lines 14-15 switch to @opencode-ai/core with unchanged call sites, which keeps behavior stable.

packages/ui/src/components/line-comment.tsx (1)

2-2: Line-comment path helper migration is clean.

Line 2 correctly repoints path helpers to @opencode-ai/core with no functional changes needed elsewhere in the component.

packages/core/test/fixture/flock-worker.ts (1)

2-2: LGTM – Clean namespace migration.

The import update from @opencode-ai/shared/util/flock to @opencode-ai/core/util/flock is correct and consistent with the PR's mechanical package rename objective.

packages/core/test/filesystem/filesystem.test.ts (1)

4-4: LGTM – Correct filesystem import migration.

The AppFileSystem import now correctly references @opencode-ai/core/filesystem, aligning with the package rename.

packages/core/test/util/flock.test.ts (1)

6-7: LGTM – Flock and Hash imports migrated correctly.

Both utility imports now reference the @opencode-ai/core namespace as intended.

packages/ui/src/components/session-turn.tsx (1)

11-12: LGTM – UI utility imports migrated correctly.

The Binary and path utilities now correctly reference @opencode-ai/core/util/*. The provided code snippet confirms byte-for-byte equivalence of the Binary implementation.

packages/core/test/fixture/effect-flock-worker.ts (1)

4-6: LGTM – Effect-based dependencies migrated correctly.

All three service imports (AppFileSystem, EffectFlock, Global) now reference @opencode-ai/core as intended. The provided code snippets confirm layer compatibility.

packages/opencode/src/share/runtime.ts (1)

2-2: LGTM – Runtime import migrated correctly.

The Runtime import now correctly references @opencode-ai/core/runtime, with existing usage unchanged.

packages/opencode/src/session/session.ts (1)

28-28: LGTM – Runtime import migrated correctly.

The Runtime import now correctly references @opencode-ai/core/runtime, with existing usage (e.g., line 269) unchanged.

packages/opencode/src/session/instruction.ts (1)

12-12: LGTM – Runtime import migrated correctly.

The Runtime import now correctly references @opencode-ai/core/runtime, with all existing usage (lines 32, 38, 52, 120, 332) unchanged.

packages/opencode/src/storage/db.ts (1)

17-17: Runtime import migration looks correct.

Line 17 correctly repoints to @opencode-ai/core/runtime, and existing Runtime.appName() usage remains compatible.

packages/opencode/src/session/export.ts (1)

9-9: Import rename is safe and consistent.

Line 9 updates the runtime source to @opencode-ai/core/runtime without changing behavior in getRuntimeNamespace().

packages/opencode/src/global/index.ts (1)

6-6: Global runtime import migration is correct.

Line 6 now points to @opencode-ai/core/runtime, and Runtime.appName() path initialization remains valid.

packages/ui/src/components/markdown.tsx (1)

5-5: Checksum import migration looks good.

Line 5 correctly switches to @opencode-ai/core/util/encode and keeps the markdown cache-key flow unchanged.

packages/opencode/src/config/config.ts (1)

22-22: Core namespace migration is consistent across config dependencies.

Lines 22, 26, and 50 correctly repoint AppFileSystem, EffectFlock, and Runtime to @opencode-ai/core/* with no behavioral drift.

Also applies to: 26-26, 50-50

packages/opencode/src/config/managed.ts (1)

7-7: Managed runtime import update is correct.

Line 7 cleanly migrates to @opencode-ai/core/runtime, and existing runtime checks remain compatible.

packages/opencode/src/config/paths.ts (1)

12-12: Config path import migration is solid.

Lines 12-13 correctly switch filesystem/runtime dependencies to @opencode-ai/core/* with unchanged behavior.

Also applies to: 13-13

packages/ui/src/components/message-part.tsx (1)

47-48: Import migration is correct and consistent.

Line 47 and Line 48 correctly switch utility imports to @opencode-ai/core while preserving existing identifiers/usages.

packages/core/test/util/effect-flock.test.ts (1)

8-11: Core test imports were migrated cleanly.

Line 8 to Line 11 correctly update all tested modules to @opencode-ai/core/* without altering the test behavior.

packages/util/test/compat-surface.test.ts (1)

3-3: Compat-surface import updates are coherent.

The renamed imports correctly target @opencode-ai/core/util/* while keeping the compatibility assertions intact.

Also applies to: 5-5, 7-7, 9-10, 13-13, 15-15, 17-17, 19-19, 21-21

packages/desktop-electron/scripts/runtime-import-guard.test.ts (1)

19-19: Runtime-guard expectations were updated consistently.

The fixture strings and assertions now align on @opencode-ai/core/runtime, including package-name resolution and built-file scanning checks.

Also applies to: 32-32, 43-43, 151-151, 155-155

packages/opencode/src/config/agent.ts (1)

9-9: Glob namespace migration is correct.

Line 9 correctly repoints to @opencode-ai/core/util/glob and remains compatible with existing Glob.scan(...) usage.

packages/opencode/src/config/plugin.ts (1)

1-1: Plugin config import update looks good.

Line 1 correctly migrates Glob to @opencode-ai/core/util/glob with no behavioral change.

packages/opencode/src/config/command.ts (1)

6-6: Command config import migration is correct.

Line 6 cleanly updates Glob to @opencode-ai/core/util/glob and keeps the existing load flow intact.

Comment thread packages/util/test/compat.test.ts Outdated
Pure mechanical rename of the workspace package. packages/shared is
moved to packages/core; all consumers update imports from
@opencode-ai/shared/* to @opencode-ai/core/*. No file content changes
beyond the package rename.

PawWork-local consumers (packages/util, packages/ui, packages/opencode,
packages/desktop-electron runtime-import-guard test) updated.

This is the first half of upstream's "shared → core" refactor; the
follow-up commits that move modules (Global, log, flag, cross-spawn,
npm) into core land in a separate PR (#209 PR2).

Refs: #209
@Astro-Han Astro-Han force-pushed the claude/upstream-sync-209-pr1-rename branch from 0c6252d to 002807a Compare April 27, 2026 15:09
@Astro-Han

Copy link
Copy Markdown
Owner Author

Renamed all shared*/Shared* aliases to core*/Core* in packages/util/test/compat.test.ts and packages/util/test/compat-surface.test.ts (imports + local variables + test descriptions + NamedError names) so the test intent matches the new package name. Folded into the rename commit via git commit --fixup + git rebase --autosquash per repo convention; force-pushed.

@Astro-Han Astro-Han merged commit aed4559 into dev Apr 27, 2026
25 checks passed
@Astro-Han Astro-Han deleted the claude/upstream-sync-209-pr1-rename branch April 28, 2026 09:06
@coderabbitai coderabbitai Bot mentioned this pull request May 2, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

harness Model harness, prompts, tool descriptions, and session mechanics P3 Low priority upstream Tracked upstream or vendor behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant