Commit 56fa627
committed
schema: count out-of-order run before reporting min shortfall
claimOutOfOrder previously emitted "matched 1 times, required at
least N" the moment it recovered, even when the document
contained a contiguous run of N+ same-scope headings before the
expected position. A doc like `## B, ## B, ## A` against an
`A, B (repeat: min 2)` schema satisfies B's minimum count — only
the ordering is wrong, which the out-of-order message already
calls out. The spurious cardinality diagnostic added confusion.
The recovery path still claims only the leading occurrence so
child recursion has a single anchor; the new countMatchingRun
helper walks ahead at the expected level (skipping deeper
headings as body content) and reports the actual run length.
Regression: TestPlan156_OutOfOrderRunCountsAvailableMatches.
https://claude.ai/code/session_012GGH62fZUzLuzP8T4ocGkJ1 parent 5951924 commit 56fa627
2 files changed
Lines changed: 82 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
744 | 740 | | |
745 | 741 | | |
746 | | - | |
747 | | - | |
| 742 | + | |
748 | 743 | | |
749 | | - | |
| 744 | + | |
750 | 745 | | |
751 | 746 | | |
752 | 747 | | |
| |||
769 | 764 | | |
770 | 765 | | |
771 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
772 | 795 | | |
773 | 796 | | |
774 | 797 | | |
| |||
0 commit comments