Commit 0c7f923
Make the SWML spec-source skips loud instead of silently-clean
GEN-FRESH-SWML could exit 0 having compared nothing. generate-swml-verbs.ts
guarded both porting-sdk spec reads with fs.existsSync and fell through to a
friendly "skipped ... using committed <file>" log. Under --check that is a false
green: the skip means emitFile is never called for that output, so nothing lands
in staleFiles, so finalizeCheck's `if (CHECK && staleFiles.length)` is false and
the process exits 0. The committed file is never compared against anything.
Measured on this repo with PORTING_SDK pointed at a copy whose only difference is
a removed schema.json:
before rc=0
checked src/SwmlVerbMethods.generated.ts (39 verb methods)
checked src/PlatformContracts.generated.ts (9 types)
skipped SWML verb contracts (no schema.json at .../schema.json; using
committed src/swml_verbs_generated.ts).
All 192 committed SWML verb config types went uncompared while the gate reported
success. This matters now: porting-sdk/schema.json is the legacy hand-maintained
SWML spec slated for deletion (porting-sdk task #199). On the day it is removed,
the other nine ports' generators die loudly and this one would have gone green.
Both spec sources are TRACKED files in porting-sdk, so once psdk itself resolves
they are present in every legitimate configuration — there is no caller that
genuinely needs the skip. The one real soft-fail case (a published consumer with
no adjacent porting-sdk) is the separate `!psdk` branch above, which already
treats an unverifiable --check as a hard failure (exit 2). These two guards were
the inconsistent ones; they now match that precedent. No opt-out flag is added,
because no legitimate caller needs one.
Non-check generate runs fail hard too: emitting a partial tree while exiting 0
would silently leave a committed file at a stale revision.
after rc=1
generate-swml-verbs: SWML verb contracts: spec source not found at
.../schema.json. Refusing to skip — under --check a skip would leave
the committed src/swml_verbs_generated.ts compared against nothing and
still exit 0 (a false green).
The happy path is unchanged (rc=0, all three files checked: 39 verb methods /
9 platform types / 192 verb config types) and the committed generated files are
NOT stale — no generated output is modified by this commit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MjEro9sSs5TLq66rTzSq6Z1 parent c1b532e commit 0c7f923
1 file changed
Lines changed: 39 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
600 | 626 | | |
601 | | - | |
| 627 | + | |
602 | 628 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
613 | 633 | | |
614 | 634 | | |
615 | 635 | | |
616 | 636 | | |
617 | 637 | | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
632 | 646 | | |
633 | 647 | | |
634 | 648 | | |
| |||
0 commit comments