Commit ba407fc
committed
fix: preserve dual-schema-source guard through layer translation
Copilot review (PR #288): when a single config layer sets both a
non-empty `schema:` and a non-empty `inline-schema:`,
extractSchemaSourceFromSettings returned at the `schema` arm and
TranslateLayerSettings then stripped both keys, silently dropping
the inline source. The rule's rejectDualSchemaSettings guard in
ApplySettings was bypassed because translation removed the keys
before ApplySettings ran, and top-level cfg.Rules / overrides /
convention presets are not covered by validateKindSchemaSources.
TranslateLayerSettings now detects a dual-source layer
(hasDualSchemaSource, mirroring rejectDualSchemaSettings'
non-empty semantics) and passes the layer through untouched, so
the keys survive deep-merge and the existing guard still surfaces
the original "cannot set both" config error. Cross-layer
composition is unaffected — the check only fires when one map
carries both. Added regression tests; new code is 100% line and
branch covered.1 parent 38a0b69 commit ba407fc
2 files changed
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| 459 | + | |
| 460 | + | |
| 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 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
459 | 501 | | |
460 | 502 | | |
461 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
350 | 360 | | |
351 | 361 | | |
352 | 362 | | |
| |||
361 | 371 | | |
362 | 372 | | |
363 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
364 | 385 | | |
365 | 386 | | |
366 | 387 | | |
| |||
0 commit comments