docs: consolidate tasks and clean up legacy files

This commit consolidates all outstanding tasks from `TODO.md`, `BUILD_ISSUES.md`, and inline `TODO` comments into a single `TASKS.md` file. This new file serves as the single source of truth for all pending development work, categorized by priority.

The task list has been enhanced with additional context, linking tasks to the architectural vision in `refactor.md` and making them more actionable for developers.

The following legacy files have been removed to avoid confusion:
- `TODO.md`
- `BUILD_ISSUES.md`

The `AGENTS.md` file has also been updated to remove a temporary debug log and now directs agents to the new `TASKS.md` file for guidance.
This commit is contained in:
google-labs-jules[bot] 2025-10-05 00:01:42 +00:00
parent dcdc272990
commit 3ad00de327

View File

@ -1,75 +1,72 @@
# Consolidated Tasks for Tercul # 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. This document is the single source of truth for all outstanding development tasks, aligned with the architectural vision in `refactor.md`.
--- ---
## Urgent: Build Failures ## 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`. These issues are currently breaking the build and must be resolved before any other work can proceed. They are all related to the ongoing refactor, where repositories are being replaced by application services. The `r.App` object in the resolver does not have direct repository access anymore.
- [ ] **Resolver Errors:** - [ ] **Fix Resolver Build Errors in `internal/adapters/graphql/schema.resolvers.go`:**
- [ ] `internal/adapters/graphql/schema.resolvers.go:10:2: "log" imported and not used` - [ ] `line 10`: Remove the unused "log" import.
- [ ] `internal/adapters/graphql/schema.resolvers.go:1071:24: r.App.AuthorRepo undefined (type *app.Application has no field or method AuthorRepo)` - [ ] `lines 1071, 1073`: Replace `r.App.AuthorRepo` calls with the appropriate application service method (e.g., `r.App.Authors.FindByID`).
- [ ] `internal/adapters/graphql/schema.resolvers.go:1073:24: r.App.AuthorRepo undefined (type *app.Application has no field or method AuthorRepo)` - [ ] `line 1089`: Correct the call to `r.App.Localization.GetAuthorBiography` as the method does not exist. The correct service and method must be identified.
- [ ] `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)` - [ ] `lines 1141, 1143`: Replace `r.App.UserRepo` calls with the correct user application service method.
- [ ] `internal/adapters/graphql/schema.resolvers.go:1141:22: r.App.UserRepo undefined (type *app.Application has no field or method UserRepo)` - [ ] `lines 1212, 1225`: Replace `r.App.TagRepo` calls with the correct tag application service method.
- [ ] `internal/adapters/graphql/schema.resolvers.go:1143:24: r.App.UserRepo undefined (type *app.Application has no field or method UserRepo)` - [ ] `lines 1249, 1262`: Replace `r.App.CategoryRepo` calls with the correct category application service method.
- [ ] `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 ## High Priority
### Architecture & Refactoring ### Architecture & Refactoring (see `refactor.md`)
- [ ] **Implement Full Observability:** - [ ] **Implement Full Observability:**
- [ ] Centralize logging across the application. - [ ] **Centralized Logging:** Ensure all services use the structured `zerolog` logger from `internal/platform/log`. Add request/user/span IDs to the logging context in the HTTP middleware.
- [ ] Add Prometheus metrics for key operations. - [ ] **Metrics:** Add Prometheus metrics for API request latency, error rates, and database query performance. Expose them on the `/metrics` endpoint.
- [ ] Add OpenTelemetry tracing for distributed request tracing. - [ ] **Tracing:** Instrument all application services and data layer methods with OpenTelemetry tracing.
- [ ] **Establish CI/CD Pipeline:** - [ ] **Establish CI/CD Pipeline:**
- [ ] Add `make lint test test-integration` to the CI pipeline. - [ ] **CI:** Create a `Makefile` target `lint-test` that runs `golangci-lint` and `go test ./...`. Configure the CI pipeline to run this on every push.
- [ ] Set up automated deployments to a staging environment. - [ ] **CD:** Set up automated deployments to a staging environment upon a successful merge to the main branch.
- [ ] **Refactor Testing Utilities:** - [ ] **Refactor Testing Utilities:**
- [ ] Remove database logic from `internal/testutil/testutil.go` to support mock-based integration tests. - [ ] **Decouple from DB:** Remove all database connection logic from `internal/testutil/testutil.go`. Tests should use mock repositories and services, not a live database. This is a key step towards faster, more reliable unit tests.
### Features ### Features
- [ ] **Implement Analytics Features:** - [ ] **Implement Analytics Features:**
- [ ] Implement view counting for works and translations. - **Context:** This is required for user engagement insights. The following counts need to be implemented and stored, likely on the `Work` and `Translation` models.
- [ ] Implement like counting for works and translations. - [ ] Implement view counting.
- [ ] Implement comment counting for works. - [ ] Implement like counting.
- [ ] Implement bookmark counting for works. - [ ] Implement comment counting.
- [ ] Implement translation counting for works. - [ ] Implement bookmark counting.
- [ ] Implement translation analytics to show popular translations. - [ ] Implement translation counting.
- *Note: This is referenced in both `TODO.md` and `internal/jobs/linguistics/work_analysis_service.go`.* - [ ] Implement a service to calculate popular translations based on the above metrics.
- *Note: This is referenced in the old `TODO.md` and a TODO comment in `internal/jobs/linguistics/work_analysis_service.go`.*
- [ ] **Complete Unfinished Implementations:** - [ ] **Complete Unfinished Implementations:**
- [ ] `internal/app/work/commands.go`: Implement the `MergeWork` function. - [ ] `internal/app/work/commands.go`: Implement the `MergeWork` command. This should handle merging duplicate work entries.
- [ ] `internal/app/search/service.go`: Get content from the translation service. - [ ] `internal/app/search/service.go`: The search service needs to fetch content from the translation service to enrich its search index.
- [ ] `cmd/tools/enrich/main.go`: The tool is broken and needs to be fixed. - [ ] `cmd/tools/enrich/main.go`: This command-line tool is broken. It needs to be investigated, fixed, and documented.
--- ---
## Medium Priority ## Medium Priority
### Performance ### Performance
- [ ] **Batch Weaviate Operations:** Implement batching for Weaviate client operations to improve throughput. - [ ] **Batch Weaviate Operations:** Refactor the Weaviate client in `internal/platform/search` to support batching of create/update operations to improve indexing performance.
- [ ] **Add Performance Benchmarks:** Create benchmarks for critical API paths and business logic to monitor performance over time. - [ ] **Add Performance Benchmarks:** Using Go's built-in benchmarking tools, add benchmarks for critical API queries and commands to detect performance regressions.
### Code Quality & Architecture ### Code Quality & Architecture
- [ ] **Expand Weaviate Client:** Add support for all models to the Weaviate client. - [ ] **Expand Weaviate Client:** The client in `internal/platform/search` should be extended to support indexing all relevant domain models (e.g., Authors, Tags).
- [ ] **Add Documentation:** Improve code documentation and generate API documentation. - [ ] **Add Documentation:** Add GoDoc comments to all public functions and types in the `internal/app` and `internal/domain` packages.
- [ ] **Refactor Caching:** Replace bespoke cached repositories with the decorator pattern in `internal/data/cache`. - [ ] **Refactor Caching:** As per `refactor.md`, replace the current bespoke cached repositories with a decorator pattern in `internal/data/cache`. This will simplify cache invalidation logic.
- [ ] **Improve Configuration Handling:** Replace ad-hoc config with environment variable parsing and validation (e.g., using `koanf` or `envconfig`). - [ ] **Improve Configuration Handling:** Replace the global config object with struct-based configuration loaded from environment variables (e.g., using `koanf` or `envconfig`), as outlined in `refactor.md`.
### Monitoring & Logging ### Monitoring & Logging
- [ ] **Add Monitoring:** Add monitoring for background jobs and API endpoints. - [ ] **Add Job Monitoring:** Add specific monitoring and alerting for background jobs in `internal/jobs` to track success, failure, and duration.
- [ ] **Add Linguistics Metrics:** Add metrics for linguistics pipeline (analysis duration, cache hit/miss, provider usage). - [ ] **Add Linguistics Metrics:** Add Prometheus metrics for the linguistics pipeline, including analysis duration, cache hit/miss rates, and third-party API usage.
--- ---
## Low Priority ## Low Priority
- [ ] **Refactor Transactional Runner:** Refactor `RunTransactional` in `internal/testutil/testutil.go` to be more mock-friendly. - [ ] **Refactor Transactional Runner:** Refactor the `RunTransactional` helper in `internal/testutil/testutil.go` to be more friendly to mock-based testing, likely by allowing a mock DB transaction to be passed in.