sanitizeFileSegment in packages/core/src/recommendation-export/index.ts is not injective:
"my view" -> "my-view"
"my-view" -> "my-view" <-- same file
Two saved views with those ids write the same export under
.quality/generated/recommendations/, and one silently overwrites the other.
Pre-existing: the views parser has never enforced an id shape, so both ids have
always been accepted. Surfaced during review of #15, which removed the unused
schema pattern that had documented the constraint without enforcing it.
A fix was tried in #15 and reverted: appending a digest when sanitizing is lossy
makes the segment unique, but renames the export file for every id that needs
sanitizing, breaking anything that addresses an existing export by name. That
trade needs its own change and a migration note.
Referenced from the comment on sanitizeFileSegment.
sanitizeFileSegmentinpackages/core/src/recommendation-export/index.tsis not injective:Two saved views with those ids write the same export under
.quality/generated/recommendations/, and one silently overwrites the other.Pre-existing: the views parser has never enforced an id shape, so both ids have
always been accepted. Surfaced during review of #15, which removed the unused
schema pattern that had documented the constraint without enforcing it.
A fix was tried in #15 and reverted: appending a digest when sanitizing is lossy
makes the segment unique, but renames the export file for every id that needs
sanitizing, breaking anything that addresses an existing export by name. That
trade needs its own change and a migration note.
Referenced from the comment on
sanitizeFileSegment.