Skip to content

chore: launch readiness - Biome, tests, docs (#53, #54, #55, #56)#59

Merged
dean0x merged 7 commits intomainfrom
chore/launch-readiness
Feb 21, 2026
Merged

chore: launch readiness - Biome, tests, docs (#53, #54, #55, #56)#59
dean0x merged 7 commits intomainfrom
chore/launch-readiness

Conversation

@dean0x
Copy link
Owner

@dean0x dean0x commented Feb 21, 2026

Summary

Completes all remaining items from the launch readiness checklist (#56):

  • chore: Add Biome, eliminate 22 as-any casts #53 Biome + as any elimination: Installed Biome 2.4.4 with noExplicitAny: error for src/, warn for tests/. Applied auto-formatting. Replaced ~39 as any casts with proper typing; remaining 4 have biome-ignore suppression with documented justification.
  • test: Add tests for critical untested source files #54 Test coverage: Added 247 new tests across 6 previously untested modules (task-manager, recovery-manager, container, autoscaling-manager, event-driven-worker-pool, worktree-manager). Fixed pre-existing TaskFactory.build() Object.freeze mutation bug.
  • docs: Add CONTRIBUTING.md, .env.example, housekeeping #55 Docs housekeeping: Fixed .gitignore (removed CLAUDE.md entry, duplicate coverage/, duplicate .memory/). Updated LICENSE year to 2024-2026. Created .env.example and CONTRIBUTING.md.
  • Bonus: Fixed 2 flaky integration tests caused by same-millisecond checkpoint timestamp race condition.

Commits

  1. chore: add Biome linter/formatter (#53) — biome.json, scripts, CI step
  2. style: apply Biome formatting to existing code — mechanical auto-format
  3. fix: eliminate as-any casts with proper typing (#53) — type fixes + biome-ignore
  4. style: apply Biome formatting to test files — mechanical import reordering
  5. test: add tests for 6 untested modules (#54) — 247 new tests + factory fix
  6. docs: add CONTRIBUTING.md, .env.example, fix .gitignore and LICENSE (#55)
  7. fix: resolve flaky checkpoint tests — same-millisecond timestamp race

Test plan

  • npm run typecheck passes
  • npm run check (Biome lint+format) passes — 0 errors, 264 warnings (all noExplicitAny in tests/, configured as warn)
  • npm run build succeeds
  • npm run test:core — 317/317
  • npm run test:handlers — 80/80
  • npm run test:services — 168/168 (new)
  • npm run test:repositories — 109/109
  • npm run test:adapters — 40/40
  • npm run test:implementations — 255/255
  • npm run test:cli — 86/86
  • npm run test:scheduling — 73/73
  • npm run test:checkpoints — 36/36
  • npm run test:error-scenarios — 32/32
  • npm run test:integration — 54/54 (3x stable)
  • grep -r 'as any' src/ shows only biome-ignore suppressed lines

Closes #53, #54, #55, #56

Dean Sharon added 7 commits February 21, 2026 12:37
- Install @biomejs/biome with noExplicitAny enforcement
- Add lint, format, check scripts to package.json
- Add Biome check step to CI between typecheck and build
- Configure: error in src/, warn in tests/
Mechanical auto-format of all src/ and tests/ files.
No logic changes - whitespace and trailing comma adjustments only.
- Replace `as any` casts with proper types across src/:
  - cli.ts: generic container.resolve<T>, TaskId() branding, Priority enum
  - task-queue.ts: HeapNode interface for typed __insertionOrder access
  - queue-handler.ts: typed __correlationId via BaseEvent, typed respond()
  - event-bus.ts: respond/respondError on EventBus interface, R=unknown
  - errors.ts: narrow error cast to { message: unknown }
  - worktree-manager.ts: NodeJS.ErrnoException for error.code
  - output-repository.ts: Record<string, unknown>, catch (error: unknown)
  - database.ts: catch (error: unknown) with instanceof check
  - mcp-adapter.ts: MCPToolResponse interface, Task[] narrowing
- Add __correlationId to BaseEvent for first-class request-response
- Add biome-ignore suppressions for genuine TS limitations (DI container,
  EventEmitter compat, DRY helper architecture exception)
- Auto-fix import organization via Biome assist
Mechanical import organization applied by `npx biome check --write tests/`.
New test files (247 tests total):
- task-manager.test.ts (49 tests): delegate, getStatus, getLogs, cancel,
  retry chain tracking, resume with checkpoint enrichment
- recovery-manager.test.ts (31 tests): QUEUED re-queuing, stale RUNNING
  detection, duplicate prevention, error propagation
- container.test.ts (42 tests): singleton/transient/value registration,
  circular dependency detection, async resolution, dispose ordering
- autoscaling-manager.test.ts (54 tests): start/stop lifecycle, event
  handling, checkScaling logic, debounced WorkerKilled, policy variants
- event-driven-worker-pool.test.ts (37 tests): spawn with resource checks,
  worktree creation/fallback, kill lifecycle, timeout guards
- worktree-manager.test.ts (34 tests): branch sanitization, merge
  strategies (PR/auto/manual/patch), auto-commit, safety checks

Also:
- Fix TaskFactory.build() Object.freeze mutation bug (spread instead of
  mutating frozen createTask() return value)
- Add test:services script and include in test:all chain
- Update CLAUDE.md with test:services documentation
)

- Remove CLAUDE.md from .gitignore (checked into repo)
- Remove duplicate coverage/ entry (already at line 41)
- Remove duplicate .memory/ block
- Update LICENSE year to 2024-2026
- Add .env.example with all 21 configuration variables and defaults
- Add CONTRIBUTING.md with dev setup, test groups, code style, PR process
Root cause: auto-created checkpoints (from TaskCompleted event) and
manually-saved test checkpoints could share the same created_at
millisecond. Since findLatest uses ORDER BY created_at DESC LIMIT 1,
the returned checkpoint was non-deterministic with equal timestamps.

Fix: delete auto-created checkpoints before saving test-specific ones,
ensuring findLatest always returns the intended checkpoint.
@qodo-free-for-open-source-projects

Review Summary by Qodo

Launch readiness: Biome integration, comprehensive test coverage, and code quality improvements

✨ Enhancement 🧪 Tests 📝 Documentation

Grey Divider

Walkthroughs

Description
• **Biome linter/formatter integration**: Installed Biome 2.4.4 with strict type checking
  (noExplicitAny: error for src/, warn for tests/). Applied comprehensive formatting across
  codebase with ~39 as any casts replaced with proper typing; remaining 4 have documented
  biome-ignore suppressions.
• **Extensive test coverage**: Added 247 new unit tests across 6 previously untested modules
  (TaskManager, RecoveryManager, Container, AutoscalingManager, EventDrivenWorkerPool,
  GitWorktreeManager) with comprehensive scenario coverage including error handling and edge cases.
• **Code quality improvements**: Reorganized imports alphabetically by type throughout codebase,
  added trailing commas for consistency, improved multi-line formatting, and enhanced type safety with
  explicit generic types and interface signatures.
• **Documentation and configuration updates**: Created CONTRIBUTING.md and .env.example, fixed
  .gitignore duplicates, updated LICENSE year to 2024-2026, and added Biome linting step to CI
  pipeline.
• **Bug fixes**: Fixed pre-existing TaskFactory.build() Object.freeze mutation bug and resolved 2
  flaky integration tests caused by same-millisecond checkpoint timestamp race conditions.
Diagram
flowchart LR
  A["Source Code"] -->|"Biome Linting"| B["Type Safety"]
  A -->|"Auto-formatting"| C["Code Quality"]
  D["Test Modules"] -->|"247 New Tests"| E["Test Coverage"]
  F["CI Pipeline"] -->|"Add Biome Check"| G["Quality Gates"]
  H["Documentation"] -->|"CONTRIBUTING.md<br/>.env.example"| I["Developer Guidance"]
  B --> J["Launch Ready"]
  C --> J
  E --> J
  G --> J
  I --> J
Loading

Grey Divider

File Changes

1. tests/unit/core/dependency-graph.test.ts Formatting +550/-88

Biome formatting applied to dependency graph tests

• Reordered import statement to alphabetical order (describe, expect, it)
• Applied Biome formatting: added trailing commas to object literals throughout test file
• Expanded inline object literals into multi-line format for improved readability
• Consistently formatted TaskDependency array definitions with proper indentation

tests/unit/core/dependency-graph.test.ts


2. src/cli.ts ✨ Enhancement +137/-113

Type safety improvements and Biome formatting in CLI module

• Reorganized imports: grouped by type, sorted alphabetically within groups
• Replaced as any type assertions with proper generic types (container.resolve<TaskManager>())
• Applied Biome formatting: trailing commas, line breaks for long function signatures
• Enhanced type safety: added DelegateRequest type, Priority enum usage, TaskId() wrapping
• Improved code readability: multi-line function parameters, consistent spacing

src/cli.ts


3. tests/unit/services/task-manager.test.ts 🧪 Tests +872/-0

New comprehensive test suite for TaskManagerService

• Added comprehensive unit tests for TaskManagerService (872 lines, 247 new tests)
• Tests cover: delegate(), getStatus(), getLogs(), cancel(), retry(), resume() methods
• Includes retry chain tracking, checkpoint integration, and error propagation scenarios
• Uses mock EventBus and CheckpointRepository following event-driven architecture pattern

tests/unit/services/task-manager.test.ts


View more (117)
4. tests/unit/services/recovery-manager.test.ts 🧪 Tests +590/-0

New comprehensive test suite for RecoveryManager

• Added comprehensive unit tests for RecoveryManager (590 lines)
• Tests cover startup recovery logic: QUEUED re-queueing, stale RUNNING task failure detection,
 recent RUNNING re-queueing
• Includes duplicate detection, error propagation, and mixed scenario handling
• Uses pure mocks for TaskRepository, TaskQueue, and EventBus

tests/unit/services/recovery-manager.test.ts


5. src/services/handlers/query-handler.ts Formatting +16/-16

Import reorganization and Biome formatting in query handler

• Reorganized imports: grouped by module type, sorted alphabetically within groups
• Applied Biome formatting: trailing commas in arrays and object literals
• Improved import organization: types separated from values

src/services/handlers/query-handler.ts


6. .github/workflows/ci.yml ⚙️ Configuration changes +4/-1

Add Biome linting step to CI workflow

• Added new CI step: npm run check for Biome linting and format validation
• Positioned after type checking and before build step
• Ensures code quality checks run in CI pipeline

.github/workflows/ci.yml


7. tests/integration/task-persistence.test.ts Formatting +289/-310

Biome formatting and EventBus constructor fixes

• Applied Biome formatting: reorganized imports alphabetically, fixed indentation throughout file
• Fixed EventBus constructor calls to pass (config, logger) instead of just (logger)
• Standardized code formatting with consistent spacing and line breaks
• All test logic and assertions remain functionally identical

tests/integration/task-persistence.test.ts


8. tests/unit/services/worktree-manager.test.ts 🧪 Tests +658/-0

New comprehensive unit tests for GitWorktreeManager

• Added 658 lines of comprehensive unit tests for GitWorktreeManager class
• Tests cover worktree lifecycle (create, remove, complete), branch sanitization, safety checks, and
 merge strategies
• Tests include PR creation, auto-merge, manual, and patch strategies with proper error handling
• Tests verify worktree cleanup behavior, status queries, and configuration options

tests/unit/services/worktree-manager.test.ts


9. tests/unit/services/autoscaling-manager.test.ts 🧪 Tests +687/-0

New comprehensive unit tests for autoscaling policies

• Added 687 lines of unit tests for AutoscalingManager, DefaultAutoscalingPolicy, and
 AggressiveAutoscalingPolicy
• Tests cover event-driven behavior (WorkerKilled, SystemResourcesUpdated), scaling decisions, and
 resource constraints
• Tests verify policy thresholds, target worker calculations, and custom configuration options
• Includes tests for setup, start/stop, status reporting, and scaling opportunity detection

tests/unit/services/autoscaling-manager.test.ts


10. tests/unit/implementations/event-driven-worker-pool.test.ts 🧪 Tests +633/-0

New comprehensive unit tests for EventDrivenWorkerPool

• Added 633 lines of unit tests for EventDrivenWorkerPool class
• Tests cover worker spawning, killing, timeout behavior, and process lifecycle events
• Tests verify worktree integration, cleanup strategies (keep/delete/auto), and resource monitoring
• Includes tests for concurrent operations, event emissions, and error handling

tests/unit/implementations/event-driven-worker-pool.test.ts


11. src/adapters/mcp-adapter.ts Formatting +152/-105

Biome formatting and type annotation improvements

• Applied Biome formatting: reorganized imports alphabetically and by type
• Fixed multi-line string formatting for schema descriptions and JSON responses
• Added explicit return type annotations (Promise<MCPToolResponse>) to handler methods
• Added [key: string]: unknown index signature to MCPToolResponse interface for type safety

src/adapters/mcp-adapter.ts


12. tests/unit/utils/continuation-prompt.test.ts Formatting +2/-2

Biome import formatting

• Applied Biome formatting: reorganized imports alphabetically
• Reordered import statements to follow consistent ordering convention
• No functional changes to test logic or assertions

tests/unit/utils/continuation-prompt.test.ts


13. src/services/handlers/dependency-handler.ts Formatting +51/-64

Biome formatting and import organization in dependency handler

• Reorganized imports alphabetically and by type (interfaces, types, classes) following Biome
 formatting standards
• Added trailing commas to function parameters and object literals for consistency
• Reformatted multi-line function signatures and object literals to improve readability
• Fixed line wrapping for long conditional expressions (e.g., dependencyPrompt assignment)

src/services/handlers/dependency-handler.ts


14. tests/unit/core/container.test.ts 🧪 Tests +647/-0

New comprehensive unit tests for Container DI system

• Added comprehensive test suite for dependency injection container with 40+ test cases
• Tests cover registration (singleton, transient, value), resolution (async/sync), circular
 dependency detection, and error handling
• Tests verify caching behavior, factory execution, and service lifecycle management
• Tests include child container creation, inheritance, and isolation patterns

tests/unit/core/container.test.ts


15. tests/unit/adapters/mcp-adapter.test.ts Formatting +150/-148

Biome formatting and import reorganization in MCP adapter tests

• Reorganized imports alphabetically and by category (Vitest, types, implementations, utilities)
• Applied Biome formatting: added trailing commas, reformatted multi-line function calls and object
 literals
• Simplified error object construction by removing unnecessary line breaks
• Reformatted helper function signatures and return statements for consistency

tests/unit/adapters/mcp-adapter.test.ts


16. tests/integration/event-flow.test.ts Formatting +238/-246

Biome formatting and import reorganization in event flow integration tests

• Reorganized imports alphabetically and by module (crypto, fs, path, vitest, src modules, fixtures)
• Fixed indentation and formatting of test body (moved from column 2 to column 4 indent)
• Applied Biome formatting: added trailing commas, reformatted multi-line function calls and arrow
 functions
• Improved readability of event handler setup and test assertions

tests/integration/event-flow.test.ts


17. tests/integration/worker-pool-management.test.ts Formatting +230/-242

Biome formatting and import reorganization in worker pool tests

• Reorganized imports alphabetically and by module (crypto, vitest, src modules, fixtures)
• Fixed indentation of test bodies (moved from column 2 to column 4 indent)
• Applied Biome formatting: added trailing commas, reformatted multi-line function calls and arrow
 functions
• Improved readability of event listener setup and test logic

tests/integration/worker-pool-management.test.ts


18. src/implementations/event-driven-worker-pool.ts Formatting +73/-86

Biome formatting and import reorganization in worker pool implementation

• Reorganized imports alphabetically and by category (Node.js modules, domain types, error handling,
 interfaces)
• Applied Biome formatting: added trailing commas to function parameters and object literals
• Reformatted multi-line function calls and conditional expressions for consistency
• Improved code readability with consistent line wrapping and spacing

src/implementations/event-driven-worker-pool.ts


19. src/implementations/database.ts Formatting +29/-23

Biome formatting and import reorganization in database implementation

• Reorganized imports alphabetically (fs, os, path order corrected)
• Applied Biome formatting: added trailing commas, reformatted multi-line SQL queries and method
 chains
• Improved error handling with proper type checking (error instanceof Error)
• Fixed line wrapping for long method chains and SQL statements

src/implementations/database.ts


20. .env.example Additional files +40/-0

...

.env.example


21. CLAUDE.md Additional files +1/-0

...

CLAUDE.md


22. CONTRIBUTING.md Additional files +79/-0

...

CONTRIBUTING.md


23. LICENSE Additional files +1/-1

...

LICENSE


24. biome.json Additional files +43/-0

...

biome.json


25. package.json Additional files +10/-3

...

package.json


26. src/bootstrap.ts Additional files +81/-72

...

src/bootstrap.ts


27. src/core/config-validator.ts Additional files +15/-30

...

src/core/config-validator.ts


28. src/core/configuration.ts Additional files +42/-27

...

src/core/configuration.ts


29. src/core/container.ts Additional files +27/-51

...

src/core/container.ts


30. src/core/dependency-graph.ts Additional files +11/-25

...

src/core/dependency-graph.ts


31. src/core/domain.ts Additional files +44/-44

...

src/core/domain.ts


32. src/core/errors.ts Additional files +21/-57

...

src/core/errors.ts


33. src/core/events/event-bus.ts Additional files +74/-67

...

src/core/events/event-bus.ts


34. src/core/events/events.ts Additional files +28/-17

...

src/core/events/events.ts


35. src/core/events/handlers.ts Additional files +36/-38

...

src/core/events/handlers.ts


36. src/core/interfaces.ts Additional files +48/-21

...

src/core/interfaces.ts


37. src/core/result.ts Additional files +12/-31

...

src/core/result.ts


38. src/implementations/checkpoint-repository.ts Additional files +8/-8

...

src/implementations/checkpoint-repository.ts


39. src/implementations/dependency-repository.ts Additional files +44/-64

...

src/implementations/dependency-repository.ts


40. src/implementations/logger.ts Additional files +6/-13

...

src/implementations/logger.ts


41. src/implementations/output-capture.ts Additional files +31/-27

...

src/implementations/output-capture.ts


42. src/implementations/output-repository.ts Additional files +32/-49

...

src/implementations/output-repository.ts


43. src/implementations/process-spawner.ts Additional files +16/-21

...

src/implementations/process-spawner.ts


44. src/implementations/resource-monitor.ts Additional files +26/-44

...

src/implementations/resource-monitor.ts


45. src/implementations/schedule-repository.ts Additional files +27/-36

...

src/implementations/schedule-repository.ts


46. src/implementations/task-queue.ts Additional files +37/-28

...

src/implementations/task-queue.ts


47. src/implementations/task-repository.ts Additional files +40/-58

...

src/implementations/task-repository.ts


48. src/index.ts Additional files +7/-9

...

src/index.ts


49. src/services/autoscaling-manager.ts Additional files +34/-80

...

src/services/autoscaling-manager.ts


50. src/services/github-integration.ts Additional files +24/-39

...

src/services/github-integration.ts


51. src/services/handler-setup.ts Additional files +65/-92

...

src/services/handler-setup.ts


52. src/services/handlers/checkpoint-handler.ts Additional files +26/-32

...

src/services/handlers/checkpoint-handler.ts


53. src/services/handlers/output-handler.ts Additional files +11/-14

...

src/services/handlers/output-handler.ts


54. src/services/handlers/persistence-handler.ts Additional files +25/-25

...

src/services/handlers/persistence-handler.ts


55. src/services/handlers/queue-handler.ts Additional files +66/-51

...

src/services/handlers/queue-handler.ts


56. src/services/handlers/schedule-handler.ts Additional files +58/-92

...

src/services/handlers/schedule-handler.ts


57. src/services/handlers/worker-handler.ts Additional files +56/-68

...

src/services/handlers/worker-handler.ts


58. src/services/handlers/worktree-handler.ts Additional files +35/-35

...

src/services/handlers/worktree-handler.ts


59. src/services/process-connector.ts Additional files +10/-18

...

src/services/process-connector.ts


60. src/services/recovery-manager.ts Additional files +19/-23

...

src/services/recovery-manager.ts


61. src/services/schedule-executor.ts Additional files +27/-40

...

src/services/schedule-executor.ts


62. src/services/schedule-manager.ts Additional files +60/-75

...

src/services/schedule-manager.ts


63. src/services/task-manager.ts Additional files +57/-65

...

src/services/task-manager.ts


64. src/services/worktree-manager.ts Additional files +158/-171

...

src/services/worktree-manager.ts


65. src/types.ts Additional files +4/-3

...

src/types.ts


66. src/utils/continuation-prompt.ts Additional files +1/-5

...

src/utils/continuation-prompt.ts


67. src/utils/cron.ts Additional files +34/-34

...

src/utils/cron.ts


68. src/utils/git-state.ts Additional files +10/-8

...

src/utils/git-state.ts


69. src/utils/index.ts Additional files +6/-7

...

src/utils/index.ts


70. src/utils/retry.ts Additional files +51/-62

...

src/utils/retry.ts


71. src/utils/validation.ts Additional files +39/-49

...

src/utils/validation.ts


72. tests/constants.ts Additional files +29/-29

...

tests/constants.ts


73. tests/fixtures/event-spy.ts Additional files +17/-25

...

tests/fixtures/event-spy.ts


74. tests/fixtures/factories.ts Additional files +25/-35

...

tests/fixtures/factories.ts


75. tests/fixtures/index.ts Additional files +2/-2

...

tests/fixtures/index.ts


76. tests/fixtures/mock-data.ts Additional files +9/-9

...

tests/fixtures/mock-data.ts


77. tests/fixtures/mock-process-spawner.ts Additional files +18/-13

...

tests/fixtures/mock-process-spawner.ts


78. tests/fixtures/mock-resource-monitor.ts Additional files +3/-3

...

tests/fixtures/mock-resource-monitor.ts


79. tests/fixtures/mocks.ts Additional files +43/-52

...

tests/fixtures/mocks.ts


80. tests/fixtures/no-op-spawner.ts Additional files +17/-7

...

tests/fixtures/no-op-spawner.ts


81. tests/fixtures/test-container.ts Additional files +31/-47

...

tests/fixtures/test-container.ts


82. tests/fixtures/test-data.ts Additional files +33/-31

...

tests/fixtures/test-data.ts


83. tests/fixtures/test-db.ts Additional files +5/-5

...

tests/fixtures/test-db.ts


84. tests/fixtures/test-doubles.ts Additional files +33/-55

...

tests/fixtures/test-doubles.ts


85. tests/fixtures/test-helpers.ts Additional files +22/-32

...

tests/fixtures/test-helpers.ts


86. tests/helpers/test-factories.ts Additional files +58/-50

...

tests/helpers/test-factories.ts


87. tests/integration/service-initialization.test.ts Additional files +15/-20

...

tests/integration/service-initialization.test.ts


88. tests/integration/task-dependencies.test.ts Additional files +32/-36

...

tests/integration/task-dependencies.test.ts


89. tests/integration/task-resumption.test.ts Additional files +19/-11

...

tests/integration/task-resumption.test.ts


90. tests/integration/task-scheduling.test.ts Additional files +14/-20

...

tests/integration/task-scheduling.test.ts


91. tests/security/resource-exhaustion.test.ts Additional files +8/-8

...

tests/security/resource-exhaustion.test.ts


92. tests/setup.ts Additional files +14/-11

...

tests/setup.ts


93. tests/unit/cli.test.ts Additional files +103/-134

...

tests/unit/cli.test.ts


94. tests/unit/core/config-validator.test.ts Additional files +29/-33

...

tests/unit/core/config-validator.test.ts


95. tests/unit/core/configuration.test.ts Additional files +55/-55

...

tests/unit/core/configuration.test.ts


96. tests/unit/core/domain.test.ts Additional files +46/-47

...

tests/unit/core/domain.test.ts


97. tests/unit/core/errors.test.ts Additional files +31/-57

...

tests/unit/core/errors.test.ts


98. tests/unit/core/events/event-bus-request.test.ts Additional files +82/-80

...

tests/unit/core/events/event-bus-request.test.ts


99. tests/unit/core/events/event-bus.test.ts Additional files +27/-21

...

tests/unit/core/events/event-bus.test.ts


100. tests/unit/core/result.test.ts Additional files +36/-84

...

tests/unit/core/result.test.ts


101. tests/unit/error-scenarios/database-failures.test.ts Additional files +19/-22

...

tests/unit/error-scenarios/database-failures.test.ts


102. tests/unit/error-scenarios/network-failures.test.ts Additional files +17/-17

...

tests/unit/error-scenarios/network-failures.test.ts


103. tests/unit/implementations/checkpoint-repository.test.ts Additional files +37/-31

...

tests/unit/implementations/checkpoint-repository.test.ts


104. tests/unit/implementations/console-logger.test.ts Additional files +8/-10

...

tests/unit/implementations/console-logger.test.ts


105. tests/unit/implementations/database.test.ts Additional files +50/-31

...

tests/unit/implementations/database.test.ts


106. tests/unit/implementations/dependency-repository.test.ts Additional files +20/-29

...

tests/unit/implementations/dependency-repository.test.ts


107. tests/unit/implementations/output-capture.test.ts Additional files +22/-31

...

tests/unit/implementations/output-capture.test.ts


108. tests/unit/implementations/process-spawner.test.ts Additional files +15/-15

...

tests/unit/implementations/process-spawner.test.ts


109. tests/unit/implementations/schedule-repository.test.ts Additional files +3/-9

...

tests/unit/implementations/schedule-repository.test.ts


110. tests/unit/implementations/structured-logger.test.ts Additional files +14/-22

...

tests/unit/implementations/structured-logger.test.ts


111. tests/unit/implementations/system-resource-monitor.test.ts Additional files +42/-39

...

tests/unit/implementations/system-resource-monitor.test.ts


112. tests/unit/implementations/task-queue.test.ts Additional files +54/-52

...

tests/unit/implementations/task-queue.test.ts


113. tests/unit/implementations/task-repository.test.ts Additional files +4/-4

...

tests/unit/implementations/task-repository.test.ts


114. tests/unit/implementations/test-logger.test.ts Additional files +8/-9

...

tests/unit/implementations/test-logger.test.ts


115. tests/unit/implementations/test-resource-monitor.test.ts Additional files +9/-9

...

tests/unit/implementations/test-resource-monitor.test.ts


116. tests/unit/retry-functionality.test.ts Additional files +14/-18

...

tests/unit/retry-functionality.test.ts


117. tests/unit/services/handler-setup.test.ts Additional files +28/-24

...

tests/unit/services/handler-setup.test.ts


118. tests/unit/services/handlers/checkpoint-handler.test.ts Additional files +28/-31

...

tests/unit/services/handlers/checkpoint-handler.test.ts


119. tests/unit/services/handlers/dependency-handler.test.ts Additional files +43/-47

...

tests/unit/services/handlers/dependency-handler.test.ts


120. Additional files not shown Additional files +0/-0

...

Additional files not shown


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (1)

Grey Divider


Action required

1. as any remains in src 📎 Requirement gap ✓ Correctness
Description
The PR keeps as any casts in src/ (and adds Biome suppressions), violating the requirement to
eliminate all as any usage. This undermines the intended type-safety improvements and can
reintroduce unsafe runtime behavior.
Code

src/core/events/handlers.ts[53]

+    // biome-ignore lint/suspicious/noExplicitAny: TS can't infer payload type from string event type in DRY helper
Evidence
PR Compliance ID 16 requires zero as any occurrences under src/, but the updated code explicitly
suppresses the rule and continues to call eventBus.emit(eventType as any, payload as any).
Additional as any casts remain in src/core/events/event-bus.ts as well.

Eliminate all 'as any' casts from src/
src/core/events/handlers.ts[48-54]
src/core/events/event-bus.ts[503-552]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR leaves `as any` casts in `src/` and adds Biome suppressions, which violates the requirement that there be zero `as any` occurrences under `src/`.

## Issue Context
`as any` is being used to bypass EventBus typing limitations (string event names and convenience helpers). The goal is to preserve the ergonomics while keeping type safety.

## Fix Focus Areas
- src/core/events/handlers.ts[48-54]
- src/core/events/event-bus.ts[500-555]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Queue arg type mismatch 🐞 Bug ✓ Correctness
Description
Multiple integration tests pass a Logger object into new PriorityTaskQueue(logger), but the
constructor expects a numeric maxQueueSize. At runtime this coerces to NaN, disabling the queue
full check and potentially masking resource-exhaustion behavior in tests.
Code

tests/integration/task-persistence.test.ts[30]

+      const queue1 = new PriorityTaskQueue(logger);
Evidence
PriorityTaskQueue stores the constructor argument in maxQueueSize and uses it in a numeric
comparison to enforce the queue limit; passing a non-number (Logger object) results in
this.heap.length >= this.maxQueueSize always being false (because maxQueueSize becomes NaN),
so the DoS guard is effectively disabled during these tests.

src/implementations/task-queue.ts[24-37]
tests/integration/task-persistence.test.ts[24-31]
tests/integration/event-flow.test.ts[32-40]
tests/integration/worker-pool-management.test.ts[158-163]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Several integration tests call `new PriorityTaskQueue(logger)` even though `PriorityTaskQueue` expects a numeric `maxQueueSize`. This disables the queue-size guard at runtime due to `NaN` coercion and can mask failures.

### Issue Context
`PriorityTaskQueue` enforces DoS protection via `if (this.heap.length &gt;= this.maxQueueSize)`.

### Fix Focus Areas
- tests/integration/task-persistence.test.ts[24-32]
- tests/integration/event-flow.test.ts[32-41]
- tests/integration/worker-pool-management.test.ts[158-165]

### Expected change
Replace `new PriorityTaskQueue(logger)` with `new PriorityTaskQueue()` (or `new PriorityTaskQueue(&lt;number&gt;)` if the test needs a small limit).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Unstable created_at ordering 🐞 Bug ⛯ Reliability
Description
Repositories order by created_at DESC without a tie-breaker, so rows with identical timestamps can
be returned in arbitrary order (affecting pagination and findLatest). The PR’s tests work around
this by forcing distinct timestamps, which can hide the underlying nondeterminism rather than fixing
it.
Code

tests/unit/implementations/task-repository.test.ts[R61-62]

+          createdAt: Date.now() + i * 100, // Ensure distinct timestamps
        });
Evidence
The task repository and checkpoint repository rely on ORDER BY created_at DESC only. When multiple
rows share the same millisecond timestamp (common in tests and possible in production under load),
SQLite is free to return any row among ties, making pagination and findLatest nondeterministic;
the tests explicitly force distinct timestamps to avoid this.

src/implementations/task-repository.ts[152-166]
src/implementations/checkpoint-repository.ts[75-80]
tests/unit/implementations/task-repository.test.ts[55-74]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
DB queries that rely on `ORDER BY created_at DESC` without a tie-breaker can return nondeterministic results when multiple rows share the same `created_at` value (same millisecond). This can break pagination determinism and cause `findLatest` to pick the wrong checkpoint.

### Issue Context
Tests currently work around this by forcing distinct timestamps, which reduces the chance of catching real-world timestamp tie bugs.

### Fix Focus Areas
- src/implementations/task-repository.ts[152-166]
- src/implementations/checkpoint-repository.ts[75-87]
- tests/unit/implementations/task-repository.test.ts[55-75]

### Expected change
Add a stable secondary ordering key (e.g., `id`/autoincrement `id`) to queries that order by `created_at`, and update any indexes if needed (especially for checkpoints where `id` is an integer primary key).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

// generic helper call site. This is a TypeScript limitation, not a design flaw.
// Safety: EventBus.emit() wraps payload in createEvent() which adds eventId/timestamp.
// The alternative would be no DRY helper at all - this trade-off is acceptable.
// biome-ignore lint/suspicious/noExplicitAny: TS can't infer payload type from string event type in DRY helper

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. as any remains in src 📎 Requirement gap ✓ Correctness

The PR keeps as any casts in src/ (and adds Biome suppressions), violating the requirement to
eliminate all as any usage. This undermines the intended type-safety improvements and can
reintroduce unsafe runtime behavior.
Agent Prompt
## Issue description
The PR leaves `as any` casts in `src/` and adds Biome suppressions, which violates the requirement that there be zero `as any` occurrences under `src/`.

## Issue Context
`as any` is being used to bypass EventBus typing limitations (string event names and convenience helpers). The goal is to preserve the ergonomics while keeping type safety.

## Fix Focus Areas
- src/core/events/handlers.ts[48-54]
- src/core/events/event-bus.ts[500-555]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

// Phase 1: Create and persist tasks
const database1 = new Database(dbPath);
const repository1 = new SQLiteTaskRepository(database1);
const queue1 = new PriorityTaskQueue(logger);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Queue arg type mismatch 🐞 Bug ✓ Correctness

Multiple integration tests pass a Logger object into new PriorityTaskQueue(logger), but the
constructor expects a numeric maxQueueSize. At runtime this coerces to NaN, disabling the queue
full check and potentially masking resource-exhaustion behavior in tests.
Agent Prompt
### Issue description
Several integration tests call `new PriorityTaskQueue(logger)` even though `PriorityTaskQueue` expects a numeric `maxQueueSize`. This disables the queue-size guard at runtime due to `NaN` coercion and can mask failures.

### Issue Context
`PriorityTaskQueue` enforces DoS protection via `if (this.heap.length >= this.maxQueueSize)`.

### Fix Focus Areas
- tests/integration/task-persistence.test.ts[24-32]
- tests/integration/event-flow.test.ts[32-41]
- tests/integration/worker-pool-management.test.ts[158-165]

### Expected change
Replace `new PriorityTaskQueue(logger)` with `new PriorityTaskQueue()` (or `new PriorityTaskQueue(<number>)` if the test needs a small limit).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@dean0x dean0x merged commit 8575cde into main Feb 21, 2026
1 check passed
@dean0x dean0x deleted the chore/launch-readiness branch February 21, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: Add Biome, eliminate 22 as-any casts

1 participant