Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Claudine Configuration
# All values are optional - defaults shown below are applied automatically.
# See src/core/configuration.ts for Zod schema and validation rules.

# Core settings
TASK_TIMEOUT=1800000 # Task timeout in ms (default: 30min, max: 1h)
MAX_OUTPUT_BUFFER=10485760 # Max output buffer in bytes (default: 10MB, max: 1GB)
CPU_CORES_RESERVED=2 # CPU cores reserved for system (default: 2, max: 32)
MEMORY_RESERVE=2684354560 # Memory reserve in bytes (default: 2.5GB, max: 64GB)
LOG_LEVEL=info # Log level: debug | info | warn | error

# EventBus resource limits
EVENTBUS_MAX_LISTENERS_PER_EVENT=100 # Max listeners per event type (default: 100)
EVENTBUS_MAX_TOTAL_SUBSCRIPTIONS=1000 # Global subscription limit (default: 1000)

# Worktree management (EXPERIMENTAL - default OFF)
USE_WORKTREES_BY_DEFAULT=false # Enable git worktrees for task isolation
WORKTREE_MAX_AGE_DAYS=30 # Max age before auto-cleanup (days)
WORKTREE_MAX_COUNT=50 # Max concurrent worktrees
WORKTREE_REQUIRE_SAFETY_CHECK=true # Check safety before worktree removal

# Process management
PROCESS_KILL_GRACE_PERIOD_MS=5000 # Grace period before SIGKILL (ms)
RESOURCE_MONITOR_INTERVAL_MS=5000 # Resource check interval (ms)
WORKER_MIN_SPAWN_DELAY_MS=10000 # Min delay between worker spawns (ms)
WORKER_SETTLING_WINDOW_MS=15000 # Settling window for new workers (ms)

# Event system
EVENT_REQUEST_TIMEOUT_MS=5000 # Event request-response timeout (ms)
EVENT_CLEANUP_INTERVAL_MS=60000 # Event history cleanup interval (ms)

# Storage
FILE_STORAGE_THRESHOLD_BYTES=102400 # Threshold for file-based storage (bytes, default: 100KB)

# Retry behavior
RETRY_INITIAL_DELAY_MS=1000 # Initial retry delay (ms)
RETRY_MAX_DELAY_MS=30000 # Max retry delay (ms)

# Recovery
TASK_RETENTION_DAYS=7 # Days to retain completed tasks
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ jobs:

- name: Run type checking
run: npm run typecheck


- name: Lint and format check
run: npm run check

- name: Build project
run: npm run build

Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,8 @@ temp/
.docs/
.claude/
.mcp.json
CLAUDE.md
output/
coverage/
.claudine/

# Local memory/session files
.memory/

# Local memory/session files
.memory/
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ npm run dev
# Test - Smart Grouping (v0.3.2+)
npm run test:core # Core domain logic (~3s) - SAFE in Claude Code
npm run test:handlers # Service handlers (~3s) - SAFE in Claude Code
npm run test:services # Service-layer tests (~2s) - SAFE in Claude Code
npm run test:repositories # Data layer (~2s) - SAFE in Claude Code
npm run test:adapters # MCP adapter (~2s) - SAFE in Claude Code
npm run test:implementations # Other implementations (~2s) - SAFE in Claude Code
Expand Down
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributing to Claudine

## Development Setup

```bash
git clone https://github.com/dean0x/claudine.git
cd claudine
npm install
npm run build
```

## Running Tests

Claudine uses [Vitest](https://vitest.dev/) with grouped test commands. The full suite is memory-intensive, so tests are split into safe groups:

```bash
# Safe to run from Claude Code or any environment
npm run test:core # Core domain logic (~3s)
npm run test:handlers # Service handlers (~3s)
npm run test:services # Service layer (task-manager, recovery, etc.)
npm run test:repositories # Data layer (~2s)
npm run test:adapters # MCP adapter (~2s)
npm run test:implementations # Implementation layer (~2s)
npm run test:cli # CLI tests (~2s)
npm run test:integration # Integration tests

# Full suite - local terminal or CI only
npm run test:all
```

`npm test` is intentionally blocked with a warning. Use `npm run test:all` for the full suite in a local terminal or CI. Individual groups are always safe.

## Code Style

This project uses [Biome](https://biomejs.dev/) for linting and formatting:

```bash
npm run check # Lint + format check
npm run check:fix # Auto-fix lint + format issues
npm run lint # Lint only
npm run format:fix # Format only
```

Biome enforces `noExplicitAny` as an error in `src/` and a warning in `tests/`. Use `biome-ignore` comments with justification for genuine TypeScript limitations.

## Architecture

Claudine uses an event-driven architecture. Key rules:

- **All state changes go through EventBus** - no direct repository access from services
- **Commands** use fire-and-forget `emit()`
- **Queries** use request-response `request()`
- **Result types everywhere** - never throw in business logic
- **Dependency injection** - all components receive dependencies via constructor

See `docs/architecture/` for detailed documentation.

## Pull Request Process

1. Create a feature branch from `main`
2. Make your changes with tests
3. Ensure all checks pass: `npm run typecheck && npm run check && npm run build && npm run test:all`
4. Open a PR against `main`

### Commit Messages

Follow [Conventional Commits](https://www.conventionalcommits.org/):

- `feat:` new features
- `fix:` bug fixes
- `test:` adding or updating tests
- `docs:` documentation changes
- `chore:` tooling, CI, dependencies
- `style:` formatting (no logic changes)
- `refactor:` code restructuring (no behavior change)

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 dean0x
Copyright (c) 2024-2026 dean0x

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
43 changes: 43 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": ["src/**", "tests/**"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 120
},
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"suspicious": {
"noExplicitAny": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"overrides": [
{
"includes": ["tests/**"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "warn"
}
}
}
}
]
}
164 changes: 164 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading