Skip to content

effectify Project service#18808

Open
kitlangton wants to merge 11 commits intodevfrom
kit/effectify-project
Open

effectify Project service#18808
kitlangton wants to merge 11 commits intodevfrom
kit/effectify-project

Conversation

@kitlangton
Copy link
Contributor

Summary

  • Migrate Project service to Effect service pattern (Service/Interface/Layer)
  • Use ChildProcessSpawner + ChildProcess.make for all git operations
  • Use FileSystem for cached ID read/write, sandbox existence, icon discovery
  • Use Path for all path resolution
  • db() helper wraps Database.use for clean Effect.sync DB access
  • fromDirectory fully effectful — git detection, ID caching, upsert, session migration
  • Replace fn() wrapper on update with UpdateInput schema
  • 25 tests passing

Test plan

  • 25 tests pass (existing 19 + 6 new)
  • fromDirectory: git repos, worktrees, commits, no-git
  • discover: favicon detection
  • update: name, icon, commands, multi-field, not-found error, GlobalBus events
  • list, get, setInitialized, addSandbox, removeSandbox
  • Typecheck clean

@kitlangton kitlangton marked this pull request as ready for review March 24, 2026 02:12
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
- Add 6 tests for list, get, setInitialized, addSandbox, removeSandbox
- Replace fn() wrapper on update with plain async function + UpdateInput schema
- Update route validator to use Project.UpdateInput
- Check off Project in migration checklist
…sync for DB

- gitRun helper for initGit (ChildProcessSpawner pattern)
- FileSystem for discover (readFile) and sandboxes (exists)
- Effect.sync wrapper for all Database.use calls
- emitUpdated helper for GlobalBus events
- fromDirectory stays as Effect.promise (complex, convert incrementally)
- defaultLayer provides Node platform implementations
- Convert all git calls to ChildProcessSpawner-based git helper
- Use FileSystem for cached ID read/write and sandbox existence checks
- Use Path for all path resolution (no more raw path module)
- Use db() for all Database operations (select, upsert, session migration)
- Parallel sandbox existence checks via Effect.forEach + concurrency
- Remove iife, existsSync dependencies
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
@kitlangton kitlangton force-pushed the kit/effectify-project branch from 5092adb to 50beb01 Compare March 24, 2026 14:50
- Replace Filesystem/Glob/existsSync with AppFileSystem.Service
- Replace NodeChildProcessSpawner with CrossSpawnSpawner
- Promise-based API delegates to runPromise (fromDirectory, discover,
  update, initGit, sandboxes, addSandbox, removeSandbox)
- list/get/setInitialized stay sync (callers depend on it)
- Extract fakeVcs const, use fsys.isDir for sandbox filtering
- Preserve stdin:"ignore" on git spawns, which("git") in initGit
- Use Effect.forkIn(scope) for fire-and-forget discover
- Update tests: remove mock.module for util/git, use Bun.file
commonDir and topLevel failures must return early with fakeVcs,
matching old .catch(() => undefined) behavior. rev-list failures
intentionally fall through (empty roots → vcs: "git"), same as dev.
opencode-agent bot added a commit that referenced this pull request Mar 24, 2026
Re-add tests for rev-list, show-toplevel, and git-common-dir failures.
Old tests mocked util/git (no longer imported); new tests use a real
git shim on PATH that intercepts specific subcommands, matching the
pattern from worktree-remove.test.ts.
Replace PATH shim approach with a proper Effect mock layer that
intercepts specific git subcommands and returns exit code 128.
Uses the same mockSpawner pattern from installation.test.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant