You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Draft PR #218 is the sole writer for src/components/editorDocumentSnapshot.ts. The public createEditorDocumentSnapshot(editor, mode) surface is statically typed with EditorMode = 'markdown' | 'html', but the implementation does not validate the runtime mode. A JavaScript/untyped/deserialized caller can therefore pass mode='md': with no editor Inkspan returns a frozen snapshot that advertises the invalid mode, and with a live editor it silently falls through to HTML for value while retaining the invalid token in snapshot.mode.
This diverges from the explicit fail-closed runtime editor-mode contract already established for the serialization helpers and can make local snapshot evidence internally inconsistent.
Test-first acceptance
Continue only on existing Draft PR fix(reliability): bound cyclic document snapshot traversal #218 / branch fix/document-snapshot-cycle-217; do not create a competing writer for src/components/editorDocumentSnapshot.ts. Freeze if that exact branch/path moves independently.
RED through public createEditorDocumentSnapshot(): prove an invalid runtime mode is accepted both before editor creation and with a live editor; for the live-editor case, instrument getHTML() / getJSON() and require rejection before editor state is read.
GREEN at the public snapshot boundary: accept exactly markdown and html; reject every other runtime value with the stable payload-redacted RangeError('Editor mode must be markdown or html.') before the null-editor branch or editor inspection.
Do not coerce, normalize, alias, stringify, or reflect rejected mode values. Add no network, persistence, transport, authorization, tenancy, credential, model/provider, migration, retention, deployment, or durable-audit authority.
Reacquire exact-head CI, Security Scan, SAST, packed-package, browser and Office evidence after RED and GREEN.
Integration boundary
Keep #218 Draft/unmerged while #118 owns the unchanged protected v0.6.0 source identity. Any #218 head/live-base movement invalidates predecessor evidence.
Buyer-visible snapshot data-integrity boundary
Draft PR #218 is the sole writer for
src/components/editorDocumentSnapshot.ts. The publiccreateEditorDocumentSnapshot(editor, mode)surface is statically typed withEditorMode = 'markdown' | 'html', but the implementation does not validate the runtime mode. A JavaScript/untyped/deserialized caller can therefore passmode='md': with no editor Inkspan returns a frozen snapshot that advertises the invalid mode, and with a live editor it silently falls through to HTML forvaluewhile retaining the invalid token insnapshot.mode.This diverges from the explicit fail-closed runtime editor-mode contract already established for the serialization helpers and can make local snapshot evidence internally inconsistent.
Test-first acceptance
fix/document-snapshot-cycle-217; do not create a competing writer forsrc/components/editorDocumentSnapshot.ts. Freeze if that exact branch/path moves independently.createEditorDocumentSnapshot(): prove an invalid runtime mode is accepted both before editor creation and with a live editor; for the live-editor case, instrumentgetHTML()/getJSON()and require rejection before editor state is read.markdownandhtml; reject every other runtime value with the stable payload-redactedRangeError('Editor mode must be markdown or html.')before the null-editor branch or editor inspection.Integration boundary
Keep #218 Draft/unmerged while #118 owns the unchanged protected
v0.6.0source identity. Any #218 head/live-base movement invalidates predecessor evidence.