easystitch-client AutoDigitizeSettings.stitchPreference type drifts from workspace contract #75
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Where:
src/lib/easystitch-client.ts:17-19vssrc/components/workspace/types.ts:27.Bug:
stitchPreference: "balanced" | "quality" | "speed"(easystitch-client.ts:18).StitchPreference = 'balanced' | 'detail' | 'speed'(types.ts:27).'balanced'(useWorkspace.ts:59).The file's own header (
easystitch-client.ts:3-5) says: "The shapes here must match those exactly; drift between these surfaces is a bug."Why it doesn't crash at runtime:
src/lib/digitize-adapters.ts:59-64mapStitchPreferencerewrites"detail"→"quality"before the client type sees it. So today it works by accident — the moment someone callsdigitize()with raw settings (or bypasses the adapter), TypeScript will accept"detail"but the service will reject it as not in["balanced","quality","speed"].Fix consistent with existing patterns:
"detail"in the UI; the service uses"quality". Rename client side to"detail"and updatemapStitchPreferenceto be a no-op (drop the function entirely)."quality"and updateRightPanel's stitchPreference picker (src/components/workspace/RightPanel.tsx) to match.Recommended: rename the client to
"detail"so the workspace stays the source of truth —mapStitchPreferencebecomes identity, and theDigitizeAdapterscomment about "the service caps at 10" stays accurate.Acceptance:
grep -rn '"quality"\|"detail"' src/shows one vocabulary;mapStitchPreferenceeither disappears or is a trivial identity;tsc -p tsconfig.jsonis clean.