Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6a1fd2a
docs(workflow): add incremental commit and PR workflow instructions
almog8k Feb 8, 2026
969b7e2
feat(config): add queue, polling, and HTTP retry configuration
almog8k Feb 8, 2026
b419a00
chore(docs): remove implementation-plan.md from git tracking
almog8k Feb 8, 2026
4e63eb5
feat(constants): add service tokens for cleaner implementation
almog8k Feb 8, 2026
e45bebc
refactor(config): combine polling config into queue section
almog8k Feb 8, 2026
3bae874
feat(errors): add custom error classes and core types
almog8k Feb 8, 2026
82ab7af
feat(validation): add task parameter validation infrastructure
almog8k Feb 8, 2026
d5dd374
chore(deps): add zod as direct dependency
almog8k Feb 8, 2026
c83baac
feat(errors): add ErrorHandler for centralized error handling
almog8k Feb 9, 2026
a53b011
docs(testing): update testing guide with hybrid architecture
almog8k Feb 9, 2026
920cd42
feat(strategies): add strategy pattern with factory and tiles-deletio…
almog8k Feb 9, 2026
9ba7105
chore: remove demo code (logistics, seeder)
almog8k Feb 9, 2026
44fd6a9
chore: add helm/local.yaml to .gitignore
almog8k Feb 10, 2026
8289f6c
feat: update project references from jobnik-worker-boilerplate to cle…
almog8k Feb 10, 2026
9776cc4
feat(worker): add explicit capability pairs configuration
almog8k Feb 10, 2026
6b71b86
refactor(validation): move validation to strategies with logger context
almog8k Feb 12, 2026
e9facc2
refactor(validation): simplify validation method and improve error lo…
almog8k Feb 12, 2026
708a445
fix: ensure stack trace is captured for custom errors
almog8k Feb 12, 2026
fafe8dd
fix(tests): use faker for dynamic job and task IDs in strategy tests
almog8k Feb 17, 2026
21a0bc9
refactor(strategy): update resolveWithContext to return ITaskStrategy…
almog8k Feb 17, 2026
5ffcda2
refactor(tests): update strategyFactory tests to use handle and check…
almog8k Feb 17, 2026
92e2a9d
refactor(strategy): simplify StrategyFactory and update ITaskStrategy…
almog8k Feb 18, 2026
9d687f8
refactor(values): clean up jobDefinitions structure in values.yaml
almog8k Feb 18, 2026
45a68f5
refactor(tests): remove redundant logging assertions in tests
almog8k Feb 22, 2026
1ed8e3f
refactor(helm): remove local.yaml
almog8k Feb 22, 2026
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
19 changes: 13 additions & 6 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Cleaner** is a TypeScript-based worker service built on the MapColonies Jobnik SDK framework. It is a distributed task processing worker that handles cleanup operations as part of the raster processing pipeline.

This project is based on the `jobnik-worker-boilerplate` template and follows the MapColonies ecosystem conventions for observability, configuration, and deployment.
This project is based on the `cleaner` template and follows the MapColonies ecosystem conventions for observability, configuration, and deployment.

## Quick Reference

Expand Down Expand Up @@ -55,15 +55,22 @@ npm run lint:fix # Auto-fix linting issues

## Important Notes for AI Agents

1. **Remove Demo Code**: The `logistics/` folder and `seeder.ts` are examples. Replace with actual cleaner implementation.
1. **Incremental Commits & PRs**: Always implement changes in small commits grouped into reviewable PRs. After implementing each part:
- Stage files with `git add`
- Stop and wait for user confirmation before committing
- Only commit after explicit user approval
- Use conventional commits: `<type>(<scope>): <description>`
- When enough commits are accumulated (3-5 related commits), STOP and tell user to create PR before continuing

2. **Package Metadata**: Update `package.json` name from `jobnik-worker-boilerplate` to `cleaner`.
2. **Remove Demo Code**: The `logistics/` folder and `seeder.ts` are examples. Replace with actual cleaner implementation.

3. **Type Safety**: Define job/stage types in `src/cleaner/types.ts` and update `worker.ts` with correct generic parameters.
3. **Package Metadata**: Update `package.json` name from `cleaner` to `cleaner`.

4. **Path Aliases**: Use `@common/` for imports from `src/common/`.
4. **Type Safety**: Define job/stage types in `src/cleaner/types.ts` and update `worker.ts` with correct generic parameters.

5. **Endpoints**: `/metrics` (Prometheus), `/liveness` (health check).
5. **Path Aliases**: Use `@common/` for imports from `src/common/`.

6. **Endpoints**: `/metrics` (Prometheus), `/liveness` (health check).

## Common Tasks

Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ typings/
.env.test
config.json

# Local configuration overrides
config/local.json
helm/local.yaml

# Local documentation (can be regenerated)
ai-docs/implementation-plan.md

# parcel-bundler cache (https://parceljs.org/)
.cache

Expand Down
19 changes: 13 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Cleaner** is a TypeScript-based worker service built on the MapColonies Jobnik SDK framework. It is a distributed task processing worker that handles cleanup operations as part of the raster processing pipeline.

This project is based on the `jobnik-worker-boilerplate` template and follows the MapColonies ecosystem conventions for observability, configuration, and deployment.
This project is based on the `cleaner` template and follows the MapColonies ecosystem conventions for observability, configuration, and deployment.

## Quick Reference

Expand Down Expand Up @@ -55,15 +55,22 @@ npm run lint:fix # Auto-fix linting issues

## Important Notes for AI Agents

1. **Remove Demo Code**: The `logistics/` folder and `seeder.ts` are examples. Replace with actual cleaner implementation.
1. **Incremental Commits & PRs**: Always implement changes in small commits grouped into reviewable PRs. After implementing each part:
- Stage files with `git add`
- Stop and wait for user confirmation before committing
- Only commit after explicit user approval
- Use conventional commits: `<type>(<scope>): <description>`
- When enough commits are accumulated (3-5 related commits), STOP and tell user to create PR before continuing

2. **Package Metadata**: Update `package.json` name from `jobnik-worker-boilerplate` to `cleaner`.
2. **Remove Demo Code**: The `logistics/` folder and `seeder.ts` are examples. Replace with actual cleaner implementation.

3. **Type Safety**: Define job/stage types in `src/cleaner/types.ts` and update `worker.ts` with correct generic parameters.
3. **Package Metadata**: Update `package.json` name from `cleaner` to `cleaner`.

4. **Path Aliases**: Use `@common/` for imports from `src/common/`.
4. **Type Safety**: Define job/stage types in `src/cleaner/types.ts` and update `worker.ts` with correct generic parameters.

5. **Endpoints**: `/metrics` (Prometheus), `/liveness` (health check).
5. **Path Aliases**: Use `@common/` for imports from `src/common/`.

6. **Endpoints**: `/metrics` (Prometheus), `/liveness` (health check).

## Common Tasks

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const workerBuilder: FactoryFunction<IWorker> = (container: DependencyCon

### 5. Rename Throughout the Project

Update references to `jobnik-worker-boilerplate` in:
Update references to `cleaner` in:
- `package.json` - name, description, author
- `helm/Chart.yaml` - name, description
- `helm/values.yaml` - mclabels, configManagement.name, image.repository
Expand Down
96 changes: 83 additions & 13 deletions ai-docs/common-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ In `common/constants.ts`:

```typescript
export const SERVICES = {
CONFIG: Symbol.for('Config'),
LOGGER: Symbol.for('Logger'),
TRACER: Symbol.for('Tracer'),
METRICS: Symbol.for('Metrics'),
JOBNIK_SDK: Symbol.for('JobnikSDK'),
WORKER: Symbol.for('Worker'),
CONFIG: Symbol('Config'),
LOGGER: Symbol('Logger'),
TRACER: Symbol('Tracer'),
METRICS: Symbol('Metrics'),
JOBNIK_SDK: Symbol('JobnikSDK'),
WORKER: Symbol('Worker'),
// Add new tokens here
CLEANER_SERVICE: Symbol.for('CleanerService'),
} as const;
CLEANER_SERVICE: Symbol('CleanerService'),
} satisfies Record<string, symbol>;
```

**Note**: Strategy classes are registered using their task type string directly (e.g., `'tiles-deletion'`) rather than Symbol tokens. This eliminates the need for an additional mapping layer.

## Task Handling

### Task Handler Structure
Expand Down Expand Up @@ -170,13 +172,81 @@ export class MyService {

```
config/
default.json # Base config (always loaded)
development.json # Merged when NODE_ENV=development
production.json # Merged when NODE_ENV=production
test.json # Merged when NODE_ENV=test
local.json # Local overrides (gitignored)
default.json # Base config (always loaded)
development.json # Merged when NODE_ENV=development
production.json # Merged when NODE_ENV=production
test.json # Merged when NODE_ENV=test
local.json # Local overrides (gitignored)
custom-environment-variables.json # Environment variable mappings
helm/
values.yaml # Helm chart default values
local.yaml # Local Helm overrides (gitignored)
templates/configmap.yaml # ConfigMap template
```

### Adding New Configuration Values

**IMPORTANT**: When adding new configuration values, you MUST update ALL configuration files to maintain sync across all deployment levels:

1. **`config/default.json`** - Add the configuration with default values
2. **`config/custom-environment-variables.json`** - Add environment variable mappings
3. **`helm/values.yaml`** - Add Helm chart values
4. **`helm/values-local.yaml`** - Add local development values (if needed)
5. **`helm/templates/configmap.yaml`** - Add to ConfigMap template

**Example:**

Adding a new `queue.jobManagerBaseUrl` configuration:

**1. config/default.json**

```json
{
"queue": {
"jobManagerBaseUrl": "http//localhost:8080"
}
}
```

**2. config/custom-environment-variables.json**

```json
{
"queue": {
"jobManagerBaseUrl": "QUEUE_JOB_MANAGER_BASE_URL"
}
}
```

**3. helm/values.yaml**

```yaml
env:
queue:
jobManagerBaseUrl: 'http//localhost:8080'
```

**4. helm/local.yaml** (for local development)

```yaml
env:
queue:
jobManagerBaseUrl: 'http://localhost:8080'
```

**5. helm/templates/configmap.yaml**

```yaml
data:
QUEUE_JOB_MANAGER_BASE_URL: { { .Values.env.queue.jobManagerBaseUrl | quote } }
```

This ensures configuration works correctly in:

- Local development (default.json, local.json)
- CI/CD environments (environment variables)
- Kubernetes deployments (Helm charts)

## Error Handling

### In Task Handlers
Expand Down
Loading
Loading