Commit 22df596
committed
schema: address eighth Copilot review round (plan 156)
Three review findings:
1. validate.go::claimedScopeMatches — the max-exceeded recovery
used to fire for any already-claimed scope, including
matchers with an unbounded `max == 0`. A non-contiguous
occurrence of a `repeat: { min: 1 }` scope (no upper bound)
was silently flagged as "exceeds allowed occurrences". Skip
unbounded matchers in the helper so the diagnostic only
fires when there really is a max to exceed. Test:
TestPlan156_UnboundedRepeatDoesNotFlagAsExceeded.
2. parse_inline.go — revert the `closed: true` + empty
`sections: []` relaxation from the previous round.
`Schema.IsEmpty` ignores `Closed`, so an empty-sections
closed schema is skipped by Validate entirely — the
relaxation didn't actually enable the "forbid any top-level
headings" use case. Restore the stricter check that
requires a non-empty `sections:` list and document the
IsEmpty rationale.
3. plan/156_schema-entry-unification.md — task 4 now notes
explicitly that MDS020's file-schema check still routes
through its legacy `parseSchema`/`parsedSchema` pipeline
so the `{field}` heading/body sync feature survives. The
new `parse_file.go` is exercised by schema-package tests
and prepares the ground for the cutover in a follow-up
plan; proto.md authors don't yet benefit from the new
Matcher / fmvar / digits semantics.
https://claude.ai/code/session_012GGH62fZUzLuzP8T4ocGkJ1 parent ddf3cc2 commit 22df596
4 files changed
Lines changed: 63 additions & 14 deletions
File tree
- internal/schema
- plan
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
75 | 72 | | |
76 | 73 | | |
77 | | - | |
| 74 | + | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
462 | 495 | | |
463 | 496 | | |
464 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
248 | 252 | | |
249 | 253 | | |
250 | 254 | | |
| |||
255 | 259 | | |
256 | 260 | | |
257 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
258 | 270 | | |
259 | 271 | | |
260 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
142 | 148 | | |
143 | 149 | | |
144 | 150 | | |
| |||
0 commit comments