// The board answers "Use ."; agents may save the instruction or only the // reference, so a document passes when it holds the complete marker token. export const submittedReferencePattern = (marker: string) => { if (!marker) throw new Error("A submitted reference marker is required"); // "_" may be Markdown emphasis (_X_ or __X__) but not a joined word (old_X, X_extra). const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); return new RegExp(`(? !!marker && typeof body === "string" && submittedReferencePattern(marker).test(body);