|
4 | 4 | ## Assessor: Orchestrator |
5 | 5 |
|
6 | 6 | ### Status Summary |
7 | | -The project is in **Epic 43: Final Polish & Debt Paydown**. Most core functionality for Phase 1-15 is complete. Reporting (M43.1) is verified complete. |
| 7 | +The project is in **Epic 43: Final Polish & Debt Paydown**. Most core functionality for Phase 1-15 is complete. Reporting (M43.1) is verified complete. However, a deep code scan has revealed several TODOs and potential gaps that need addressing before 1.0. |
8 | 8 |
|
9 | | -### Missing Features / Gaps |
| 9 | +### Critical Gaps (Must Fix for 1.0) |
10 | 10 | 1. **Event-Sourced Policy Updates (M43.2)**: |
11 | | - * `PolicyUpdated` event is not defined in `pkg/store`. |
12 | | - * `pkg/graph/projection.go` has a TODO to handle this event. |
13 | | - * Currently, policy updates are applied directly to the graph via `PolicyEngine.syncGraph`, bypassing the event log. This violates strict event sourcing. |
| 11 | + * `pkg/graph/projection.go`: `PolicyUpdated` event handling is stubbed. |
| 12 | + * `pkg/graph/projection.go`: `ProviderObserved` event handling is stubbed. |
| 13 | + * Currently, policy updates bypass the event log, violating the core "Event Sourcing" non-negotiable. |
14 | 14 | 2. **Hardcoded Forecast Parameters (M43.3)**: |
15 | | - * `pkg/engine/forecast/service.go` has a hardcoded `resetAt` (24 hours). |
16 | | - * It should be derived from pool configuration. |
17 | | -3. **Missing Tests (M43.3)**: |
18 | | - * `pkg/mcp` has no tests. |
19 | | - * `pkg/blob` has no tests. |
20 | | -4. **Graph Optimization (M43.2)**: |
21 | | - * `pkg/graph/projection.go` uses O(E) linear search for constraints. Needs adjacency list or index. |
| 15 | + * `pkg/engine/forecast/service.go`: `resetAt` is hardcoded to 24 hours. Needs to be derived from pool config. |
| 16 | +3. **Graph Performance (M43.2)**: |
| 17 | + * `pkg/graph/projection.go`: Uses O(E) linear search. Needs adjacency list index for performance. |
| 18 | +4. **Pool Identification Bug (M43.3)**: |
| 19 | + * `pkg/api/server.go`: TODO "Use the correct pool ID". This suggests the API might be logging the wrong pool ID in events. |
22 | 20 |
|
23 | | -### Recommendations for Improvements |
24 | | -1. **Formalize Policy Events**: Define `EventTypePolicyUpdated` and ensure policy changes are recorded in the event log. |
25 | | -2. **Configuration-driven Forecasts**: Inject pool configuration into the forecaster to determine correct reset windows. |
26 | | -3. **Test Coverage**: Add unit tests for the missing packages. |
27 | | -4. **Graph Indexing**: Implement the adjacency list in `GraphProjection`. |
| 21 | +### Moderate Gaps (Should Fix) |
| 22 | +1. **Federation Logic**: |
| 23 | + * `pkg/api/federation.go`: `RemainingGlobal` is hardcoded to 0. This might break federation decisions. |
| 24 | +2. **Poller Improvements**: |
| 25 | + * `pkg/engine/poller.go`: Missing `provider_error` event emission. |
| 26 | + * `pkg/engine/poller.go`: Units are not configurable (hardcoded "requests"). |
| 27 | +3. **Provider Metadata**: |
| 28 | + * `pkg/provider/federated/provider.go`: Version hardcoded to "1.0.0". |
| 29 | + |
| 30 | +### Missing Tests (M43.3) |
| 31 | +1. `pkg/mcp`: No tests. |
| 32 | +2. `pkg/blob`: No tests. |
| 33 | + |
| 34 | +### Recommendations |
| 35 | +1. **Prioritize M43.2**: Finish the Graph Projection work to ensure Event Sourcing compliance. |
| 36 | +2. **Prioritize M43.3**: Fix the hardcoded `resetAt` and the API pool ID TODO. |
| 37 | +3. **New Task M43.4**: Address Federation and Poller TODOs (RemainingGlobal, configurable units). |
| 38 | +4. **Tests**: Ensure `pkg/mcp` and `pkg/blob` get at least basic coverage. |
28 | 39 |
|
29 | 40 | ### Next Actions |
30 | | -Execute `M43.2` and `M43.3` as planned in `TASKS.md`. |
| 41 | +Execute `M43.2` immediately. |
0 commit comments