Commit f5cf019
fix(csharp): reconcile FR5a envelope drifts — 3 fixtures off the ledger
Three drifts between the C# port and the TS reference port for FR5a /
ADR-0009 envelope shape, now closed:
1. error-parse-malformed-json (server/csharp/MetaObjects/Parser.cs:97-110):
The malformed-JSON catch in ParseJson threw without an envelope, so the
conformance adapter's fallback synthesized format=json + empty files[].
Now builds a $-rooted JsonSource(files=[sourceName ?? "<unknown>"],
jsonPath="$") and threads it through ParseException.Envelope. Mirrors
TS parser-json.ts:25-29.
2. error-reserved-word-as-attr (server/csharp/MetaObjects/Parser.cs:711-806):
ApplyInlineAttrsAndUnknownKeys pushed each attr key onto the JSONPath
builder BEFORE the ERR_RESERVED_ATTR / ERR_UNKNOWN_ATTR / ERR_BAD_ATTR_VALUE
checks, so emitted envelopes threaded one level too deep (down to the
offending @attr). TS parser-core.ts:626-690 never pushes the attr key in
this loop — the path stays at the parent node. Removed the PushKey/Pop
so all errors raised from the inline-attr loop surface at the parent's
canonical path (the node body that contains the bad key). This is the
FR5a contract.
3. error-yaml-reserved-as-attr (server/csharp/MetaObjects/YamlDesugar.cs:284-310):
The YAML desugar pre-empted ERR_RESERVED_ATTR by dropping
@-prefixed-reserved keys and emitting its own desugar diagnostic — which
carried no envelope, so the YAML harness synthesized format=yaml +
jsonPath="$". TS yaml-desugar.ts:197-203 and Java YamlDesugar.java:340-349
PASS THROUGH @-prefixed reserved keys to the canonical parser, which owns
the ERR_RESERVED_ATTR diagnostic and emits it with the proper
JsonSource envelope (format=json + parent node's JSONPath). Aligned C# to
that contract. Updated the YamlDesugarTests unit test to match the new
behavior.
Both ledger files now empty (full FR5a envelope parity with TS for the
JSON and YAML corpora). Verified: 302 conformance tests pass; the wider
C# test suite (Render 88, Cli 7, Codegen 165) is unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a971644 commit f5cf019
5 files changed
Lines changed: 115 additions & 109 deletions
File tree
- server/csharp
- MetaObjects.Conformance.Tests
- MetaObjects
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| 4 | + | |
8 | 5 | | |
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
7 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
99 | 106 | | |
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
103 | | - | |
| 110 | + | |
| 111 | + | |
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
| |||
712 | 720 | | |
713 | 721 | | |
714 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
715 | 732 | | |
716 | 733 | | |
717 | 734 | | |
718 | 735 | | |
719 | 736 | | |
720 | 737 | | |
721 | 738 | | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
| 739 | + | |
726 | 740 | | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
739 | 749 | | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
753 | 770 | | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
| 771 | + | |
| 772 | + | |
767 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
768 | 778 | | |
769 | | - | |
770 | | - | |
771 | | - | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
772 | 782 | | |
773 | | - | |
774 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
775 | 787 | | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
790 | 793 | | |
791 | | - | |
| 794 | + | |
792 | 795 | | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
797 | 799 | | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | 800 | | |
807 | | - | |
| 801 | + | |
808 | 802 | | |
809 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
810 | 807 | | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
811 | 816 | | |
812 | 817 | | |
813 | 818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
285 | 286 | | |
286 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
287 | 293 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
| 294 | + | |
297 | 295 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
307 | 303 | | |
308 | 304 | | |
309 | 305 | | |
| |||
0 commit comments