Conversation
This commit renames the project from "claudine" to "@dean0x/delegate" to avoid
trademark concerns with Anthropic's "Claude" branding. This is a clean break with
no data migration from ~/.claudine/.
Breaking Changes:
- Package: claudine → @dean0x/delegate (scoped npm namespace)
- CLI command: claudine → delegate
- MCP server name: claudine → delegate
- Error class: ClaudineError → DelegateError
- Type guards: isClaudineError → isDelegateError; toClaudineError → toDelegateError
- Environment variables: CLAUDINE_* → DELEGATE_*
- Data paths: ~/.claudine/ → ~/.delegate/
- Git artifacts: claudine/task-{id} → delegate/task-{id}
- Patch directory: .claudine-patches → .delegate-patches
Changes:
- Rename across ~80 files: source code, tests, configuration, documentation
- Update package.json with scoped name and publishConfig
- Update npm registry references in CI/CD workflows
- Regenerate package-lock.json
- Update all user-facing strings (help text, examples, error messages)
- All 844+ tests passing, build and typecheck verified
This ships as v0.4.0 - the first release under the new name.
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Review Summary by QodoRename project from claudine to @dean0x/delegate
WalkthroughsDescription• Comprehensive project rename from claudine to @dean0x/delegate across 117 files to resolve
trademark concerns with Anthropic's "Claude" branding
• **Core changes**: Renamed ClaudineError to DelegateError, ClaudineEvent to DelegateEvent
throughout codebase (src/ and tests/)
• **Environment variables**: Updated CLAUDINE_DATABASE_PATH → DELEGATE_DATABASE_PATH,
CLAUDINE_DATA_DIR → DELEGATE_DATA_DIR, CLAUDINE_WORKER → DELEGATE_WORKER, CLAUDINE_TASK_ID
→ DELEGATE_TASK_ID, and autoscaling-related variables
• **File system paths**: Changed database from ~/.claudine/claudine.db to
~/.delegate/delegate.db, patch directory from .claudine-patches/ to .delegate-patches/, git
branches from claudine/task-{id} to delegate/task-{id}
• **CLI and branding**: Updated all command references from claudine to delegate, process titles
from claudine-cli/claudine-mcp to delegate-cli/delegate-mcp, logging messages, and help text
• **Documentation**: Updated 25+ docs including README, ROADMAP, release notes (v0.2.0-v0.3.3),
architecture guides, and testing documentation
• **Launch materials**: Added new Discord, LinkedIn, and Twitter announcement templates
• **Testing**: Updated 50+ test files with new error classes, environment variables, temporary
directory naming, and assertions
• **Verification**: All 844+ tests passing, TypeScript compilation clean, zero "claudine" references
remaining in src/ and tests/
Diagramflowchart LR
A["Old Project<br/>claudine"] -->|Rename| B["New Project<br/>@dean0x/delegate"]
C["ClaudineError<br/>ClaudineEvent"] -->|Rename| D["DelegateError<br/>DelegateEvent"]
E["~/.claudine/<br/>claudine.db"] -->|Migrate Paths| F["~/.delegate/<br/>delegate.db"]
G["CLAUDINE_*<br/>env vars"] -->|Update| H["DELEGATE_*<br/>env vars"]
I["claudine CLI<br/>commands"] -->|Update| J["delegate CLI<br/>commands"]
K["Documentation<br/>25+ files"] -->|Update| L["Delegate<br/>branding"]
File Changes1. src/cli.ts
|
Code Review by Qodo
1. Unstructured console.warn config log
|
Replace all 113 `any` types across 12 test infrastructure files with proper types: `unknown`, concrete interface types, `Record<string, unknown>`, and typed function signatures. No biome-ignore suppressions needed. Files modified: - test-doubles.ts: TestEventBus handler maps, payloads, event signatures - test-factories.ts: Mock factories, assertion helpers, mock verification - test-helpers.ts: MockFunction, RetryTestFunction, createMockFunction - event-helpers.ts: TestableEventBus interface, event collection types - event-spy.ts: subscribe/unsubscribe cast types - test-container.ts: Container resolution casts to concrete types - factories.ts: EventFactory payload, withError parameter - mock-process-spawner.ts: ChildProcess cast via unknown - test-data.ts: Event bus emit/once handler types - mocks.ts: Event bus emit/once data types - async-helpers.ts: waitForEvent emitter parameter type - setup.ts: clearTimeout/clearInterval cast types Co-Authored-By: Claude <noreply@anthropic.com>
Replace all 119 `any` type annotations with proper types across 8 test files: specific interfaces (DelegateRequest, Task, TaskOutput, Worker), Record<string, unknown> for event payloads, branded types (TaskId) for repository calls, and typed mock arrays. Two unavoidable `as any` casts in cli.test.ts for setting readonly fields on test mocks are suppressed with biome-ignore comments. Co-Authored-By: Claude <noreply@anthropic.com>
…orce error level Replace all `any` types across 17 test files with proper type-safe alternatives: branded types (TaskId/WorkerId), interface casts for private field access (DatabaseInternals), domain event types (TaskResumedEvent), concrete types (TestEventBus, WorktreeManager), and unknown where specific types are unnecessary. Update biome.json tests/ override from "warn" to "error" so new any introductions fail the lint check immediately.
- Fix ClaudineEvent type reference in event-spy.ts (code bug) - Update social-preview.svg title and install command - Update .gitignore paths from claudine to delegate - Update release notes index to reference v0.4.0 - Remove phantom config/mcp-servers.example.json from files array
…ependencies afterScheduleId was accepted by the domain model, CLI, and MCP adapter but never persisted by the repository or enforced by the handler. This was a complete stub. Repository: persist after_schedule_id in save/update/rowToSchedule roundtrip. Handler: on ScheduleTriggered, look up the chained schedule's latest execution and inject a dependsOn entry if the target task is still non-terminal. If the target already completed, skip the dependency (correct semantic: "run after A finishes" + "A already finished" = "run now"). Tests: 4 new behavioral tests covering inject-when-running, skip-when-completed, skip-when-no-history, and skip-when-no-taskId.
…on rejection Workers are independent Claude Code instances, not nested sessions. When a worker spawns inside an existing Claude Code session (e.g., delegate CLI running in Claude Code), the inherited CLAUDECODE environment variable causes Claude to reject the spawn with 'nested session' error. Fix: explicitly remove CLAUDECODE from env when spawning workers. Workers will have DELEGATE_WORKER flag but no CLAUDECODE, allowing them to spawn independently even when delegate itself runs in Claude Code.
Add test to verify that process spawner removes CLAUDECODE env var from worker environment. This ensures workers can spawn as independent Claude Code instances even when delegate itself runs in a Claude Code session.
…ent nesting rejection Workers fail instantly with "Claude Code cannot be launched inside another Claude Code session" when the MCP server runs within Claude Code. The issue isn't just CLAUDECODE— Claude Code's nesting check triggers on any CLAUDE_CODE_* prefixed vars: - CLAUDECODE (stripped before, now via filter) - CLAUDE_CODE_ENTRYPOINT (was NOT stripped) - CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS (was NOT stripped) Solution: Filter strips both CLAUDECODE and any CLAUDE_CODE_* prefixed vars, making it future-proof for additional Claude Code environment variables. Tests: Added 3 comprehensive env var tests - Verify all known nesting indicators are stripped - Verify future CLAUDE_CODE_* flags are handled - Verify safe vars (CLAUDE_API_KEY, ANTHROPIC_API_KEY, PATH, HOME) pass through All 258 implementation tests pass, biome/typecheck clean.
Add skipScheduleExecutor: true to all CLI bootstrap calls. Short-lived commands (delegate, status, logs, cancel, etc.) no longer start the ScheduleExecutor's 60-second tick loop. This prevents race conditions where the executor timer blocks process.exit() and the shell kills the process, orphaning spawned workers. Only the MCP server daemon (index.ts) needs the executor running continuously. CLI commands exit cleanly immediately after completion. Fixes the known issue where schedule create/list/get commands would hang until either (a) a schedule fired, or (b) the shell forced termination.
ConsoleLogger ignored the configured logLevel, printing all DEBUG messages unconditionally. Now accepts a LogLevel parameter (default INFO) and filters messages the same way StructuredLogger does. Bootstrap passes the resolved logLevel to both logger implementations.
Replace nested ternary operator with explicit switch statement for better clarity and maintainability. Also remove redundant comments from test suite that describe obvious code behavior. Changes: - Extract logLevel resolution into dedicated function with switch statement - Remove unnecessary comments from ConsoleLogger test suite - Preserve all functionality and test coverage
Replace resolveLogLevel closure with type-safe Record lookup map. The closure accepted loose `string` type instead of Configuration['logLevel'] union. The Record approach is more concise, eliminates the switch statement, and ensures exhaustive mapping at compile time.
- Add process.exit(0) to scheduleCreate success path (prevents async handles keeping CLI alive) - Rename CLAUDINE_WORKER → DELEGATE_WORKER in cleanup script to match source code - Move social-preview.svg to .github/assets/ and gitignore launch/ directory
Patch completion strategy writes patch files to .delegate-patches/ in working directory. This directory must be gitignored to prevent patch artifacts from appearing as untracked files and being accidentally committed.
## Summary - Regenerated `package-lock.json` to include all platform-specific Biome binaries (Linux x64, Linux x64 musl, darwin arm64, etc.) ## Problem CI failing on every push with: ``` Error: Cannot find module '@biomejs/cli-linux-x64/biome' ``` The lockfile was regenerated on macOS during the project rename (#60, 3643 lines changed) and only contained `@biomejs/cli-darwin-arm64`. When `npm ci` ran on the Ubuntu GitHub Actions runner, it found no Linux binary entry, skipped it (optional dep), and biome failed at runtime. ## Fix `rm -rf node_modules package-lock.json && npm install` — the regenerated lockfile now includes entries for `@biomejs/cli-linux-x64` and `@biomejs/cli-linux-x64-musl`. ## Test plan - [x] `npm run build` passes locally - [x] `npm run check` (biome) passes locally - [ ] CI passes on GitHub Actions (Linux runner) — **this is the real validation** Co-authored-by: Dean Sharon <deanshrn@gmain.com>
Summary
Complete project rename from
claudineto@dean0x/delegateplus 5 bug fixes discovered during live validation. 15 commits, 136 files changed.Rename (commits 1-5):
noExplicitAnywarnings, enforced biome formattingBug fixes (commits 6-15):
CLAUDE_CODE_*env vars from spawned workers to prevent nested session rejectionafterScheduleId) — enforce execution order between schedules via dependency injection into spawned tasksskipScheduleExecutoroption to preventScheduleExecutortimer from blocking CLI exitlogLevel(was printing DEBUG lines at INFO level)process.exit(0)inscheduleCreate, rename staleCLAUDINE_WORKERreference in cleanup script, untracklaunch/marketing filesQuality:
Test plan
npm run buildpassesnpm run test:cli— 86 tests passnpm run test:implementations— 265 tests passnpm run test:handlers— 84 tests passnpm run test:core— 317 tests passgrep -r "CLAUDINE" scripts/returns nothinglaunch/files untracked,social-preview.svgmoved to.github/assets/