Repository navigation
refactor(state,mpc,api): remove dead storage, planner and backup leftovers - #1456
Merged
Merged
Conversation
…overs - #49 Keep on a driver draft now takes the driver update lock and removes the record before the saved original, so an expiry already in flight finishes first and Keep answers 409 instead of "kept" for a reverted draft. - #20 History maintenance runs only the plain SQLite stages. Remove the Parquet archive pipeline (rolloff, aggregate/sample archive, legacy compaction, cold/diagnostic Parquet pruning, Store.Prune) and the unused retentionDays closure of rolloffLoop; keep the Parquet readers. - #40 Drop the hot-history alias (s.hot, hotPath, hotWriteMu), dead hot-only branches and readers, forceRotate, heldBytes, RotateHistory and the test-only historyWriter.maintainHistory. - #41 Remove the always-empty ImportedHistoryFiles filter, the unused coldDir parameter of legacyHistoryIdle and the test-only backup.Restore; round-trip tests now use RestoreContents. - #29 Remove the recourse/multistage challenger, unix and auto transports, transport Health and the stateful shadow evaluator. The worker request keeps the same solver settings as constants; the Energyplan process transport and Core DP shadow are unchanged. - #47 Remove the always-zero PV nameplate and load caps (Service fields, Plan.pv_nameplate_w/load_max_w, forecast ACLimitW/ClampForecasts and their web chart caps), the load rain-check and test-only wrappers. A single sanitiser still maps NaN or negative load to 0 W. - #48 Handshake errors now say the bundled Energyplan worker does not match Core and to run `ftw update` or reinstall. Drop PYTHONPATH and fix stale Update Center, CVXPY, Python shadow and scenario comments. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The shared PV scenarios in buildRequest were reachable only by calling ExternalOptimizer directly with a risk margin; production runs through EnergyplanOptimizer, which applies the margin to the slots and zeroes it before the request. Removing that dead block left the native contract test asking for three scenarios. It now checks that a margin never builds a scenario model. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
…d-leftovers # Conflicts: # go/internal/mpc/service.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 2 of the multi-agent hardening and refactor review. A skeptic confirmed each finding against the code, and a second reviewer checked this diff and ran its tests. Removals follow the owner decisions of 2026-09-26.
Changes
ftw updateor reinstall this release" instead of pointing to the Update Center. Dropped the ModuleDir/PYTHONPATH env for the compiled binaries (Energyplan and forecast_rust). Fixed stale comments: CVXPY, Python shadow, sidecar update controls, and the MaxExportW "Startup-only" note (a reload now refreshes it). Also rewrote two comments in mpc.go and service.go that still described scenarios being sent to the worker.Evidence
All commands run from go/ with GOTMPDIR=/home/fredde/.cache/go-tmp and the scratchpad Go toolchain (absolute path, since PATH exports were refused by the worktree guard).
Review
I found no blocker or should-fix; the three nits are optional. Each removal is unreachable in production and every reference to it is gone. #49 fixes the root cause.
#49 (hardening): Keep now takes driverUpdateMu with a blocking Lock, the same way expireDraft does, and removes the record before the original. An expiry already in flight therefore finishes first, and Keep then answers 409 instead of a false 200 "kept". The new test fails without the fix and passes with it, including under -race. There is no deadlock: Keep is only an HTTP handler, and every other holder of the lock is either TryLock or expireDraft.
#20/#40/#41 (storage): In production rolloffLoop still calls only MaintainPlainHistory. The stage list, the per-stage budget and the pending/failed classification match the old plain branch exactly: maintenanceBudgetSpent reduced to stageErr != nil for these stages. s.hot was always an alias of s.history, so the removed branches in cost.go and store.go were dead. checkpointLiveHistory was a direct call to CheckpointHistory. RecordHistory, now under historyWriteMu, is test-only. ImportedHistoryFiles always returned an empty map. ftw-backup already used RestoreContents. …
🤖 Generated with Claude Code
https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7