# Consolidated Tasks for Tercul This document is the single source of truth for all outstanding development tasks. It is generated from `TODO.md`, `BUILD_ISSUES.md`, and inline `TODO` comments. --- ## Urgent: Build Failures These issues are currently breaking the build and must be resolved before any other work can proceed. All issues are located in `internal/adapters/graphql/schema.resolvers.go`. - [ ] **Resolver Errors:** - [ ] `internal/adapters/graphql/schema.resolvers.go:10:2: "log" imported and not used` - [ ] `internal/adapters/graphql/schema.resolvers.go:1071:24: r.App.AuthorRepo undefined (type *app.Application has no field or method AuthorRepo)` - [ ] `internal/adapters/graphql/schema.resolvers.go:1073:24: r.App.AuthorRepo undefined (type *app.Application has no field or method AuthorRepo)` - [ ] `internal/adapters/graphql/schema.resolvers.go:1089:36: r.App.Localization.GetAuthorBiography undefined (type *"tercul/internal/app/localization".Service has no field or method GetAuthorBiography)` - [ ] `internal/adapters/graphql/schema.resolvers.go:1141:22: r.App.UserRepo undefined (type *app.Application has no field or method UserRepo)` - [ ] `internal/adapters/graphql/schema.resolvers.go:1143:24: r.App.UserRepo undefined (type *app.Application has no field or method UserRepo)` - [ ] `internal/adapters/graphql/schema.resolvers.go:1212:20: r.App.TagRepo undefined (type *app.Application has no field or method TagRepo)` - [ ] `internal/adapters/graphql/schema.resolvers.go:1225:32: r.App.TagRepo undefined (type *app.Application has no field or method TagRepo)` - [ ] `internal/adapters/graphql/schema.resolvers.go:1249:25: r.App.CategoryRepo undefined (type *app.Application has no field or method CategoryRepo)` - [ ] `internal/adapters/graphql/schema.resolvers.go:1262:32: r.App.CategoryRepo undefined (type *app.Application has no field or method CategoryRepo)` --- ## High Priority ### Architecture & Refactoring - [ ] **Implement Full Observability:** - [ ] Centralize logging across the application. - [ ] Add Prometheus metrics for key operations. - [ ] Add OpenTelemetry tracing for distributed request tracing. - [ ] **Establish CI/CD Pipeline:** - [ ] Add `make lint test test-integration` to the CI pipeline. - [ ] Set up automated deployments to a staging environment. - [ ] **Refactor Testing Utilities:** - [ ] Remove database logic from `internal/testutil/testutil.go` to support mock-based integration tests. ### Features - [ ] **Implement Analytics Features:** - [ ] Implement view counting for works and translations. - [ ] Implement like counting for works and translations. - [ ] Implement comment counting for works. - [ ] Implement bookmark counting for works. - [ ] Implement translation counting for works. - [ ] Implement translation analytics to show popular translations. - *Note: This is referenced in both `TODO.md` and `internal/jobs/linguistics/work_analysis_service.go`.* - [ ] **Complete Unfinished Implementations:** - [ ] `internal/app/work/commands.go`: Implement the `MergeWork` function. - [ ] `internal/app/search/service.go`: Get content from the translation service. - [ ] `cmd/tools/enrich/main.go`: The tool is broken and needs to be fixed. --- ## Medium Priority ### Performance - [ ] **Batch Weaviate Operations:** Implement batching for Weaviate client operations to improve throughput. - [ ] **Add Performance Benchmarks:** Create benchmarks for critical API paths and business logic to monitor performance over time. ### Code Quality & Architecture - [ ] **Expand Weaviate Client:** Add support for all models to the Weaviate client. - [ ] **Add Documentation:** Improve code documentation and generate API documentation. - [ ] **Refactor Caching:** Replace bespoke cached repositories with the decorator pattern in `internal/data/cache`. - [ ] **Improve Configuration Handling:** Replace ad-hoc config with environment variable parsing and validation (e.g., using `koanf` or `envconfig`). ### Monitoring & Logging - [ ] **Add Monitoring:** Add monitoring for background jobs and API endpoints. - [ ] **Add Linguistics Metrics:** Add metrics for linguistics pipeline (analysis duration, cache hit/miss, provider usage). --- ## Low Priority - [ ] **Refactor Transactional Runner:** Refactor `RunTransactional` in `internal/testutil/testutil.go` to be more mock-friendly.