3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-18 22:25:44 +01:00

Answer stability round 1: 1 🔴, 2 🟡 (0 misread); hold a pair whose opener may capture a held pair's delimiter, draw repeated units, pin the carry guards

This commit is contained in:
2026-10-30 01:37:16 +01:00
committed by Lillem4n
parent 47b990feea
commit f151ea5c09
4 changed files with 23 additions and 3 deletions
+5 -1
View File
@@ -217,7 +217,11 @@ const lineLeaf = fc.oneof(
{ arbitrary: fc.record({ attrs: fc.constantFrom({ id: 'a' }, { id: 'a', odd: 'b' }), marks: lineMarks }).map((held): AdfNode => ({ ...held, type: 'mention' })), weight: 1 },
)
export const lineContainer = fc.constantFrom<LineContainer>('heading', 'paragraph', 'table-cell')
export const markedLine = fc.array(lineLeaf, { maxLength: 10, minLength: 1 })
// A unit repeated is the line where one misread run re-pairs every copy after it.
const repeatedUnit = fc
.tuple(fc.array(lineLeaf, { maxLength: 2 }), fc.array(lineLeaf, { maxLength: 3, minLength: 1 }), fc.integer({ max: 5, min: 2 }), fc.array(lineLeaf, { maxLength: 2 }))
.map(([head, unit, repeats, tail]) => [...head, ...Array.from({ length: repeats }, () => unit.map((node) => ({ ...node }))).flat(), ...tail])
export const markedLine = fc.oneof(fc.array(lineLeaf, { maxLength: 10, minLength: 1 }), repeatedUnit)
export const adfDocument = fc.oneof(
{ arbitrary: fc.array(positions.block, { depthIdentifier, maxLength: 4, minLength: 1 }).map((content): AdfDocument => ({ content, type: 'doc', version: 1 })), weight: 30 },