Summary#
- Add
ownercolumn (default'AgentSDE') toTaskEntity,JobEntity, andWebhookDeliveryEntityfor multi-tenant data isolation - Update
TaskEntityunique constraint from['issue', 'repo']to['owner', 'issue', 'repo'] - Create
TenantModulewithTenantConfigServicethat reads the tenant org fromConfigService - Inject
TenantConfigServiceintoTaskStateService,SqliteJobQueue, andWebhookController; scope all DB queries byowner - Update all affected unit and integration test modules with
TenantConfigServicemocks - Fix pre-existing
watchdog.service.spec.tsflakiness: pinSTUCK_THRESHOLD_MS/SLOW_THRESHOLD_MSenv vars inbeforeEachso tests are environment-independent
Test plan#
- All 756 unit and integration tests pass
-
TaskStateServicequeries (findByIssueAndRepo,findByStatus,findByStatuses,findAll,createTask) all scoped byowner -
SqliteJobQueuequeries (onModuleInit,enqueue,processNext) all scoped byowner -
WebhookControllersetsowneron everyWebhookDeliveryEntitysave - Integration tests (
replan-directive,restart-directive,blocked-persistent-*) all pass withTenantConfigServicemocks - Lint clean (
npm run lintzero warnings)
Closes #355
🤖 Generated with Claude Code