Files
image-workbench-desktop/docs/archive/v3.9.0-runtime-recovery-diagnostics.md
T

37 lines
2.4 KiB
Markdown

> **⚠️ 历史·过程留档(已归档,2026-10-16)**:本文为**当时**记录,**不代表现状**;现状以 `docs/standards/architecture-current-state.md` 为准,规则见 `docs/standards/`。
# v3.9.0 Runtime Recovery and Diagnostics
## Scope
v3.9.0 extends the v3.8 runtime boundaries with a pure run-record contract, recovery candidate validation, redacted diagnostic summaries and local metrics. The implementation remains incremental and preserves the existing app.js compatibility entry.
## Runtime contracts
- `runtime-record.js`: normalized run states, legal transitions, legacy conversion, interruption marking and diagnostic projection.
- `runtime-recovery.js`: parses the existing `iwb_web_running` payload, excludes terminal/cancelled records, validates node/task existence and creates recoverable candidates.
- `runtime-diagnostic-record.js`: bounded, non-sensitive diagnostic records with stable error classes.
- `runtime-metrics.js`: in-memory aggregate counters and request-duration averages; no user payloads are persisted or uploaded.
## Page integration
- Startup recovery continues to use `iwb_web_running` and its existing resume UI.
- Old `running` records are validated before becoming recoverable candidates.
- Cancelled, completed, missing-node and missing-task records no longer trigger recovery prompts.
- Storage health checks execute through `RuntimeBoundary`; failures increment a local metric without interrupting page startup.
- Diagnostic export includes a safe metrics summary in addition to the existing task, storage, lifecycle and scheduler summaries.
- Persisted run records retain legacy `status` and `jobs` fields and add `runtimeState` for forward-compatible diagnostics.
## Compatibility locks
- LocalStorage keys are unchanged.
- IndexedDB database `iwb_web`, physical version `3`, and stores `images`, `logs`, `kv` are unchanged.
- Existing backup and generation payload/result formats are unchanged.
- Diagnostics exclude API keys, authorization headers, complete prompts, image data, raw request payloads and raw responses.
- Browser-safe IIFE modules and single-file app.js fallback remain supported.
## Verification
- Runtime contract tests cover legal transitions, interruption, cancellation exclusion, missing entity validation, redaction and metrics reset.
- Existing unit, integration and Playwright suites remain required release gates.