Files
stack/docs/scratchpads/orch-101-setup.md
Jason Woltje c3500783d1 feat(#66): implement tag filtering in search API endpoint
Add support for filtering search results by tags in the main search endpoint.

Changes:
- Add tags parameter to SearchQueryDto (comma-separated tag slugs)
- Implement tag filtering in SearchService.search() method
- Update SQL query to join with knowledge_entry_tags when tags provided
- Entries must have ALL specified tags (AND logic)
- Add tests for tag filtering (2 controller tests, 2 service tests)
- Update endpoint documentation
- Fix non-null assertion linting error

The search endpoint now supports:
- Full-text search with ranking (ts_rank)
- Snippet generation with highlighting (ts_headline)
- Status filtering
- Tag filtering (new)
- Pagination

Example: GET /api/knowledge/search?q=api&tags=documentation,tutorial

All tests pass (25 total), type checking passes, linting passes.

Fixes #66

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 14:33:31 -06:00

3.0 KiB

ORCH-101: Set up apps/orchestrator structure

Objective

Complete the orchestrator service foundation structure according to acceptance criteria.

Current Status

Most work is COMPLETE - NestJS foundation already in place.

What Exists:

  • Directory structure: apps/orchestrator/src/{api,spawner,queue,monitor,git,killswitch,coordinator,valkey}
  • Test directories: apps/orchestrator/tests/{unit,integration}
  • package.json with all required dependencies (NestJS-based, not Fastify)
  • README.md with service overview
  • eslint.config.js configured (using @mosaic/config/eslint/nestjs)

What Needs Fixing:

  • ⚠️ tsconfig.json should extend @mosaic/config/typescript/nestjs (like apps/api does)
  • .prettierrc missing (should reference root config or copy pattern from api)

Approach

  1. Update tsconfig.json to extend shared config
  2. Add .prettierrc or .prettierrc.json
  3. Verify all acceptance criteria are met
  4. Run build/lint to ensure everything works

Progress

  • Fix tsconfig.json to extend shared config
  • Add .prettierrc configuration
  • Run typecheck to verify config
  • Run lint to verify eslint/prettier integration
  • Document completion

Testing

# Typecheck
pnpm --filter @mosaic/orchestrator typecheck

# Lint
pnpm --filter @mosaic/orchestrator lint

# Build
pnpm --filter @mosaic/orchestrator build

Notes

  • NestJS approach is better than Fastify for this monorepo (consistency with api app)
  • The orchestrator was converted from Fastify to NestJS per commit e808487
  • All directory structure is already in place

Completion Summary

Status: COMPLETE

All acceptance criteria for ORCH-101 have been met:

  1. Directory structure: apps/orchestrator/src/{api,spawner,queue,monitor,git,killswitch,coordinator,valkey} - All directories present
  2. Test directories: apps/orchestrator/tests/{unit,integration} - Created and in place
  3. package.json: All required dependencies present (@mosaic/shared, @mosaic/config, ioredis, bullmq, @anthropic-ai/sdk, dockerode, simple-git, zod) - NestJS used instead of Fastify for better monorepo consistency
  4. tsconfig.json: Now extends @mosaic/config/typescript/nestjs (which extends base.json)
  5. ESLint & Prettier: eslint.config.js and .prettierrc both configured and working
  6. README.md: Comprehensive service overview with architecture and development instructions

Changes Made:

  • Updated tsconfig.json to extend shared NestJS config (matching apps/api pattern)
  • Added .prettierrc with project formatting rules

Verification:

✅ pnpm --filter @mosaic/orchestrator typecheck  # Passed
✅ pnpm --filter @mosaic/orchestrator lint       # Passed (minor warning about type: module, not blocking)
✅ pnpm --filter @mosaic/orchestrator build      # Passed

The orchestrator foundation is now complete and ready for ORCH-102 (Fastify/NestJS server with health checks) and subsequent implementation work.