Repository navigation
fix: keep a crashed Inspector run from looking like a clean scan - #4351
Conversation
A failed nightly run still wrote completedAt, so the moderator validation report treated that row as a clean scan and dropped older nightly findings. findingsCompletedAt stays on the last findings scan, and a crash remains eligible for the next inventory claim. Ref openclaw#4221 Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
@SebTardif is attempting to deploy a commit to the OpenClaw Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesSeparate completed Inspector findings from failed attempts so crashes preserve findings and remain eligible for another scan. Example: Inspector 0.4.3 targeting OpenClaw 2026.10.16 crashes after f036-plugin 1.0.0 recorded missing-api.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a current-main defect and has no blocking code findings; acceptance of its historical-row policy remains unresolved. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe nightly worker submits Inspector results to Convex, which stores findings and scan metadata consumed by moderator validation reports and inventory claims. flowchart LR
Worker[Inspector worker] --> Endpoint[Results endpoint]
Endpoint --> Recorder[Scan recorder]
Recorder --> Storage[Findings and scan states]
Storage --> Report[Moderator validation report]
Storage --> Claims[Inventory scan claims]
Technical reviewBest possible solution: Separate findings completion from attempts in the existing recorder, preserve stored findings, and explicitly settle the treatment of ambiguous historical rows. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the failed-attempt-to-false-clean path; contributor terminal output demonstrates the symptom and recovery, but this read-only review executed no target code. Is this the best way to solve the issue? Best-fix verdict: best at the existing persistence owner; filtering failed rows loses same-tuple successes, and a fixed lookback hides older findings, while separate timestamps handle both. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d6ed83f06536. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 3, 2026, 3:43 PM ET / 20:43 UTC (Revision 2). |
|
@clawsweeper re-review The pull body now records the v0.25.1 upgrade on the same local database. The stored scan rows are shown before the deploy and after the crash posted by this head. |
|
🦞👀 Re-review progress:
|
…pector-success-markers
|
Failed Plugin Inspector attempts no longer establish a clean result. Ambiguous historical attempts remain unknown until a verified successful scan; actual prior findings and verified completion time/source survive crashes, and failed attempts stay eligible for retry. Inspector remains advisory; ClawScan trust and publication behavior are unchanged. LOC: +933/−72 (7 files against integrated main). No blocking findings remain. Head: Real disposable Convex proof used the same persisted database before and after upgrade, through the moderator report and worker claim/results HTTP routes:
A main-era outcome-only verified row retains completion time 100 when its exact tuple crashes. Missing/malformed failure payloads clear stale timeout diagnostics. Negative controls preserve private-package exclusion and report authorization (anonymous 401, ordinary account 403, moderator 200). Temporary fixtures were removed and the final schema push/codegen typechecked. The query-page regression uses the real paginator over a fixture index: 61 publish-only rows read 63 rows before and at most 26 afterward, with identical latest verdict. Failure-only/ambiguous history can still require every distinct Inspector/target tuple; retries overwrite a tuple. No cap hides older evidence and no production backfill is included. Legacy publish findings remain visible while scan metadata stays unknown without verified completion. Integration gate repair removes only an obsolete 17-line detailed setup-prompt test and unused parser import. Main #4467 retired that interface after #4132 added the test. Current compact prompt/CLI and scalar parser/scanner/API regressions remain. The Inspector patch is unchanged against the integrated main; five files are byte-identical to Local validation: 580 focused tests (including 452 Inspector tests), static checks, full TypeScript/schema/CLI/admin types, production build, package checks, secretless HTTP, and real local Convex schema push/codegen passed. Full unchanged local coverage passed 8,987 tests with 5 existing skips at Crashes were simulated through supported worker payloads; no actual Inspector/provider execution, external dispatch, production writes/backfill, or manual deployment occurred. This is persisted-state/API proof, not a production observation. |
What Problem This Solves
A crashed Plugin Inspector run still stored
completedAt. The moderator validation report treats the newest scan row as finished, so a crash with no matching nightly warnings was reported as clean and older nightly findings dropped out.A crash with no earlier findings scan should stay not-scanned, and that release should stay in the next inventory claim. A later crash of a tuple that already stored findings should keep those findings.
Rows written by the current stable release have
completedAtand do not havefindingsCompletedAtorinspectionFailed. This pull adds those fields as optional and does not rewrite old rows. An old findings scan still loads. An old crash that was stored only ascompletedAtstill looks like a finished scan, because the stable release never recorded that the attempt crashed. That historical choice needs a maintainer decision.This does not reopen closed pull #3973. That pull was closed unmerged.
Ref #4221
Evidence
Local anonymous Convex at 127.0.0.1:3252. Stable tag v0.25.1, commit 1f3ab43, wrote two packages and their scan rows. Candidate commit 9200630 was then deployed onto that same database.
v0.25.1
packages:ingestPackageInspectorScanResultsInternalstored a findings scan for f036-plugin 1.0.0, inspector 0.4.3, target 2026.10.16, code missing-api. The same stable mutation stored a crash-only attempt for f036-crash-plugin.convex data packageInspectorScanStatesshowed neither row hadfindingsCompletedAtorinspectionFailed:packages:listPluginValidationReportPageInternalon that stable deployment:The candidate deploy added one index and reported Convex functions ready. The same report query, before any new write, returned the same two scan results.
convex datastill showed the original rows, including the f036-plugincompletedAt1793737944366 and the applied sdk inventory.The candidate
packages:ingestPackageInspectorScanResultsInternalthen postedinspectionFailedfor the f036-plugin tuple.convex dataafter that write:The report for f036-plugin stayed
statuserror, finding missing-api,scannedAt1793737944366.packages:previewPackageInspectorScanBatchInternalfor inspector 0.4.3 and target 2026.10.16 returned item packageName f036-plugin and skipped f036-crash-plugin with reason unchanged-findings-scan.Real behavior proof
packages:ingestPackageInspectorScanResultsInternal, and readpackages:listPluginValidationReportPageInternalpluspackageInspectorScanStates. Deployed this pull onto that database, read the same report and rows again, postedinspectionFailedfor the f036-plugin tuple, then read the report, the rows, andpackages:previewPackageInspectorScanBatchInternal.