feat: add resetScores devtools command#1005
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c15e5824e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR adds a
Confidence Score: 3/5The change is devtools-only and ADB-gated, so blast radius is limited, but the error-recovery restart path silently drops its own result, which can leave the wallet stopped with no log evidence. The core stop → delete → restart contract works correctly on the happy path. On the failure path, the app/src/main/java/to/bitkit/repositories/LightningRepo.kt — specifically the error recovery branch in
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/repositories/LightningRepo.kt | Adds resetPathfindingScores() with a stop → delete VSS keys → restart flow; the error-recovery restart call discards its Result, leaving the node silently stopped on restart failure |
| app/src/debug/java/to/bitkit/dev/DevToolsProvider.kt | Wires ResetScores command and DevResult.Ack type cleanly following existing patterns; latestPathfindingScoresSyncTimestamp correctly forwarded from NodeProbeReadiness |
Sequence Diagram
sequenceDiagram
participant ADB as adb shell
participant DTP as DevToolsProvider
participant LR as LightningRepo
participant VSS as VssBackupClientLdk
ADB->>DTP: call("resetScores")
DTP->>LR: resetPathfindingScores()
LR->>LR: waitForNodeToStop()
LR->>LR: stop()
LR->>VSS: setup(walletIndex)
LR->>VSS: deleteObject("scorer")
LR->>VSS: deleteObject("external_pathfinding_scores_cache")
alt VSS delete succeeds
LR->>LR: "start(walletIndex, shouldRetry=false)"
LR-->>DTP: Result.success(Unit)
DTP-->>ADB: "{"success":true}"
else VSS delete fails
LR->>LR: "start(walletIndex, shouldRetry=false) [result discarded]"
LR-->>DTP: Result.failure(error)
DTP-->>ADB: "{"error":"..."}"
end
Reviews (1): Last reviewed commit: "feat: add resetScores devtools command" | Re-trigger Greptile
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This PR adds a
resetScoresdevtools command that wipes the persisted pathfinding scores, so mainnet probe runs can start from a fresh scorer.Description
ResetScoresto the debug devtools ContentProvider, callable over adb like the existing probe commandsLightningRepo.resetPathfindingScores(): stops the node, deletes thescorerandexternal_pathfinding_scores_cacheVSS keys, then restarts the node (external scores are re-downloaded on startup)latestPathfindingScoresSyncTimestampin theprobeReadinessresponse, so e2e can gate probing on a fresh post-reset scores syncWithout the reset, locally learned scores accumulate in VSS under the probe seed across nightly runs (probe results train the scorer), so consecutive scorer A/B runs are not comparable.
Pairs with:
Preview
QA Notes
Manual Tests
resetScores: returns{"success":true}in ~7s.deleteObjectsuccess forscorerandexternal_pathfinding_scores_cache→ node rebuild without cache merge → freshExternal scores merged successfullyafter restart.regression:adb content callprobeReadiness: still returns readiness JSON, now includinglatestPathfindingScoresSyncTimestamp.Automated Checks
PROBE_RESET_SCORES=true: readiness gated on a post-reset scores sync timestamp.Made with Cursor