Skip to content

Commit f1124b8

Browse files
cadamsdotcomclaude
andcommitted
Remove worker system from codebase and documentation
CodeLeash is a demonstration of agentic software development, not a production application. The worker system can be rebuilt using the patterns already in the repo (repository, service, container DI) when actually needed. Removing it keeps the scaffold focused on what it teaches: TDD enforcement, code quality checks, and full-stack integration. Also pins chardet<6 to fix a spurious RequestsDependencyWarning in requests 2.32.5 (psf/requests#7220 is merged but unreleased). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 423d77c commit f1124b8

32 files changed

Lines changed: 56 additions & 1733 deletions

.claude/commands/review.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Check for these classes of issues:
4646
- All shared instances (services, repositories, clients) should be created as factory methods in `Container` and accessed via the dependency layers:
4747
- **Routes**: Use `Depends()` with functions from `app/core/service_dependencies.py`
4848
- **Auth**: Access container via `_get_container()` in `app/core/auth_dependencies.py`
49-
- **Worker**: Access container via `app/core/worker_dependencies.py`
5049
- **Scripts/CLI**: Direct `_get_container()` calls are acceptable
5150
- **Tests**: Direct instantiation is acceptable
5251
- Watch for `SomeService(...)` or `SomeRepository(...)` constructor calls in route handlers, other services, or middleware - these should use the container instead.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ COPY static ./static
7878
COPY --from=frontend-builder /app/dist ./dist
7979

8080
# 5. Copy entrypoints (change occasionally)
81-
COPY main.py worker.py ./
81+
COPY main.py ./
8282

8383
# 6. Copy app code last (changes most frequently)
8484
COPY app ./app

app/core/container.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from app.core.auth import AuthService
99
from app.core.supabase import get_supabase_client, get_supabase_service_client
1010
from app.repositories.greeting import GreetingRepository
11-
from app.repositories.job import JobRepository
1211
from app.services.greeting import GreetingService
1312

1413

@@ -41,14 +40,6 @@ def get_greeting_service(self) -> GreetingService:
4140
)
4241
return self._instances["greeting_service"]
4342

44-
def get_job_repository(self) -> JobRepository:
45-
"""Get JobRepository instance."""
46-
if "job_repository" not in self._instances:
47-
self._instances["job_repository"] = JobRepository(
48-
self.get_supabase_service_client()
49-
)
50-
return self._instances["job_repository"]
51-
5243
def get_auth_service(self) -> AuthService:
5344
"""Get AuthService instance."""
5445
if "auth_service" not in self._instances:

app/core/metrics.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -291,58 +291,3 @@ def record_retry_success(operation: str) -> None:
291291
def record_retry_failed(operation: str) -> None:
292292
"""Record a failed retry (max attempts exhausted)"""
293293
retry_failures_total.labels(operation=operation, commit_sha=_get_commit_sha()).inc()
294-
295-
296-
# =============================================================================
297-
# WORKER / QUEUE METRICS
298-
# =============================================================================
299-
300-
worker_restarts_total = Counter(
301-
"worker_restarts_total",
302-
"Total number of worker restarts",
303-
["reason", "commit_sha"],
304-
)
305-
306-
queue_jobs_processed_total = Counter(
307-
"queue_jobs_processed_total",
308-
"Total number of queue jobs processed",
309-
["queue", "status", "commit_sha"],
310-
)
311-
312-
queue_job_duration_seconds = Histogram(
313-
"queue_job_duration_seconds",
314-
"Queue job processing duration in seconds",
315-
["queue", "commit_sha"],
316-
buckets=(0.1, 0.5, 1.0, 5.0, 10.0, 30.0, 60.0, 120.0, 300.0, float("inf")),
317-
)
318-
319-
queue_depth = Gauge(
320-
"queue_depth",
321-
"Number of pending jobs in queue",
322-
["queue"],
323-
)
324-
325-
326-
# Worker/Queue Helpers
327-
def record_worker_restart(reason: str) -> None:
328-
"""Record a worker restart event"""
329-
worker_restarts_total.labels(reason=reason, commit_sha=_get_commit_sha()).inc()
330-
331-
332-
def record_queue_job_processed(queue: str, status: str) -> None:
333-
"""Record a processed queue job"""
334-
queue_jobs_processed_total.labels(
335-
queue=queue, status=status, commit_sha=_get_commit_sha()
336-
).inc()
337-
338-
339-
def record_queue_job_duration(queue: str, duration: float) -> None:
340-
"""Record queue job processing duration"""
341-
queue_job_duration_seconds.labels(
342-
queue=queue, commit_sha=_get_commit_sha()
343-
).observe(duration)
344-
345-
346-
def update_queue_depth_gauge(queue_name: str, depth: int) -> None:
347-
"""Update the queue depth gauge for a specific queue"""
348-
queue_depth.labels(queue=queue_name).set(depth)

app/core/worker_dependencies.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)