openclaw/scripts/tests
Jason (Json) 27aa0742fc
improve(doctor): updates scan retained transcripts once instead of twice (#177933)
* perf(doctor): reuse clean transcript-label scans within one update

The pre-plugin and post-plugin Doctor processes of one update both scanned
every retained transcript for labels. A complete, clean scan now returns a
receipt through the existing Doctor result channel; the installed driver
keeps it for that operation only and passes it to the post-plugin Doctor.
Reuse requires unchanged physical database generations, native write tokens
and file-family observations. Any missing, stale, invalid or oversized
receipt falls back to a full scan. The three legacy-cron substeps are now
timed separately.

* fix(doctor): bind transcript-scan reuse to the canonical database owner

The backup inventory records canonical database paths, but Doctor can
discover a database through a symlinked state directory, so a clean scan
was never reused. Reuse now matches by the canonical owner, and the scan,
its read connection and any repair use that admitted owner instead of the
mutable alias. A scan whose alias changes while it runs is not certified.
Routine missing, stale, empty or oversized hints rescan quietly; malformed
hints still warn.

* test(update): load the Doctor scan-receipt owner in wrapper and restart checks

update-doctor-result now imports the scan-receipt schema at module load.
The PR wrapper's runtime inventory did not list that module, and the
production restart fixture stubbed it, so its schema was not callable.
Both now include the real module.

* test(doctor): budget the cron readiness test for its child deadlines

The cron readiness process test capped itself at 45s while Doctor, Gateway
start, and status each run in sequence under their own 30s deadlines. On a
loaded runner every child finished within its deadline and Vitest still
killed the test 37ms past the cap. Derive the budget from the child
deadlines through getCliProcessTestTimeout like the rest of the file.
2026-10-20 10:28:42 -07:00
..
update-restart-module-outcome.mjs improve(doctor): updates scan retained transcripts once instead of twice (#177933) 2026-10-20 10:28:42 -07:00
update-restart-swap-fixture.mjs refactor(update): share strict missing-path handling (#177435) 2026-10-19 10:20:24 -07:00