Skip to content

Commit 4de578a

Browse files
author
Kevin Arthur
committed
fix(editor): preserve unreadable settings instead of discarding them
An unparsable settings blob fell back to defaults and was overwritten by the next save, so a user's theme, panel layout and custom shortcuts disappeared with no trace and nothing to recover from. The load path now quarantines the verbatim payload, its source key and a timestamp under `varve-editor-settings.corrupt` before returning defaults. `readQuarantinedSettings()` exposes it for a future recovery surface; one slot is kept and an identical payload is not rewritten. A user-visible notice is still missing, which is recorded in the audit rather than presented as a complete recovery flow. Evidence: storytold/lightcraft#103, whose thread records the upstream `.corrupt-<time>` remedy.
1 parent e00a228 commit 4de578a

5 files changed

Lines changed: 234 additions & 61 deletions

File tree

‎docs/audits/lightcraft/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ Research status and engineering status are separate fields in the ledger.
9292
| `out-of-scope` | Outside the product boundary, with the reason recorded |
9393
| `uncertain` | Needs a reproduction or a decision that is not available |
9494

95+
`duplicate_of` names the canonical issue when a record repeats an established
96+
finding. A duplicate keeps its own reproduction conditions and is never counted
97+
as independent evidence.
98+
9599
`screened-for-varve` is a queue position, not a finding. Nothing is reported as
96100
fixed because an issue is closed upstream, and nothing is reported as a Varve
97101
defect from an upstream report alone.

‎docs/audits/lightcraft/findings.md‎

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,35 @@ verifying file is the evidence.
9595
| Slider values cannot be typed, and sliders have no reset | #1435, #1436, #532 | Handled. `RangeValueControl` pairs the range with a `NumberField` that edits the same value, and the shared `Slider` renders a reset button when `onReset` is provided. |
9696
| Library/catalog lock, catalog format versioning, journal recovery | #99–#102, #2124, #2130 | Out of scope: Varve has no photo catalog. The equivalent *document* concerns are owned by the lifecycle and history systems (`docs/architecture/lifecycle-system.md`, `docs/architecture/…` history docs) and were not changed from this evidence. |
9797

98+
## 3a. Unreadable settings were discarded — preservation implemented
99+
100+
**Evidence.** storytold/lightcraft#103 — *"Settings files: unreadable
101+
prefs/presets reset to defaults …"*. The thread records the upstream remedy:
102+
damaged files are kept as `.corrupt-<time>`, reported to the user, and never
103+
overwritten during that session.
104+
105+
**Varve path.** `packages/editor/src/settings.ts` `loadSettings` caught the
106+
parse failure and returned defaults. The stored blob was left in place for the
107+
rest of that session, but the next settings save overwrote it, so a user's
108+
theme, panel layout and custom shortcuts were gone without a trace.
109+
110+
**Decision.** The catch now calls `quarantineCorruptSettings()`, which writes
111+
the verbatim payload plus its source key (`varve-editor-settings` or the legacy
112+
`strata-editor-settings`) and a timestamp to `varve-editor-settings.corrupt`
113+
before returning defaults. `readQuarantinedSettings()` exposes the preserved
114+
copy for a future recovery surface. One slot is kept, and an identical payload
115+
is not rewritten, so repeated loads do not churn storage.
116+
117+
**Acceptance criteria.** (a) An unreadable current blob is preserved verbatim
118+
and the caller still receives defaults. (b) A legacy blob is preserved and its
119+
source is reported. (c) Repeated loads do not replace an identical quarantine.
120+
(d) No quarantine exists when the stored settings are valid. Covered by
121+
`packages/editor/src/settings.test.ts` → "settings quarantine".
122+
123+
**Not done.** There is no user-visible notice yet; Varve has no global notice
124+
surface, and inventing one is a design decision larger than this batch. The
125+
class stays in §4 for that half.
126+
98127
## 4. Screened, not claimed
99128

100129
These reach a Varve subsystem but need a reproduction before a defect can be
@@ -105,7 +134,7 @@ claimed. They stay on the queue; they are not reported as fixed.
105134
| Preview/export divergence | #605, #787, #709, #960 | Varve exports through the same engine and settles fonts and image resources before replay (`SpecPanel/export.ts`), but no test compares a zoomed preview against the exported raster for the same camera. Needs a pixel comparison. |
106135
| Deterministic export bytes | #180, #1373 | Varve injects `pHYs` into PNG without a timestamp; PDF metadata dates were not audited. Needs a byte-diff of two exports. |
107136
| Mask overlay obscures the adjustment being made | #519, #1800, #1712, #1214 | Varve has a show-all-masks overlay; whether it hides while a slider is dragged was not verified. |
108-
| Settings reset silently when the stored blob is unreadable | #103 | Varve's `loadSettings` returns defaults on parse failure and does not preserve the corrupt payload. Preference loss only; the fix needs a user-visible notice surface, which does not exist yet. |
137+
| Settings reset silently when the stored blob is unreadable | #103 | Preservation is implemented (§3a); a user-visible recovery notice is still missing, so the class is not closed. |
109138
| Export overwrites an existing file without a decision | #93, #1405, #1944 | Varve's destination adapters were not audited for collision handling. Data-integrity concern; needs a test against the real write path. |
110139
| GPU path renders wrong pixels after device loss | #78, #230, #1948, #1764 | Varve's WebGPU/WebGL2 paths fall back to Canvas2D, but no evidence was gathered for device-loss recovery. Needs a forced-loss run. |
111140

@@ -166,3 +195,33 @@ that exists.
166195
no page asserted byte-identical or lossless text preservation.
167196
- The gradient/pattern and PDF pages were reviewed and left unchanged — their
168197
stated limitations still match the code.
198+
199+
## 9. Reconciliation with the independent classification pass
200+
201+
A second, independent pass classified all 981 records from their bodies. It
202+
proposed 366 records as "applicable work"; this ledger keeps 90 in that queue.
203+
The difference is deliberate, not an oversight:
204+
205+
- That pass counted capability requests as applicable work. A request is not a
206+
failure, and Varve does not adopt a feature because another product has it.
207+
The ledger files those under `feature-request` with an explicit reason.
208+
- It counted photo-catalog behaviour (culling, stacks, virtual copies, missing
209+
file relinking, sidecar ownership) as applicable because the *mechanism*
210+
reads as generic. Varve has no catalog, so there is no code path to fix.
211+
- It proposed `already-handled` for lightcraft-side fixes (for example #93,
212+
#98, #103, #180). Those say what upstream shipped, not what Varve does; this
213+
ledger verified Varve source separately and only then used that verdict.
214+
215+
What was adopted from the pass:
216+
217+
- **The duplicate map** (58 records) is now `duplicate_of` in the ledger, so
218+
repeated reports cannot inflate the evidence for a finding.
219+
- **Two corrections** to the screened queue: #2462 records that the planar-TIFF
220+
fix in #1983 was incomplete (so the resource-bound class stays open), and
221+
#674 records that its submitted fix was reverted by its author (a closed
222+
issue is not a landed fix).
223+
- **Title/body contradictions** worth remembering before citing an issue as
224+
proof: #1952 (the alpha direction is the opposite of its summary), #342
225+
(a file-dialog extension filter, not a decoder defect), #1093 (collapse, not
226+
close), #465 (verified working in a later comment), #2166 (a migration gap
227+
for old documents, not a live colour bug).

0 commit comments

Comments
 (0)