Repository navigation
feat(rust): read YAML, resolve sources and config, add naming (R3) - #603
Merged
Merged
Conversation
…eview) The Rust loader reads authoring YAML (ADR-0006 desugar, the coercion guard, line and column on every YAML error), and the crate resolves a project: the .metaobjects/config.json reader, source kinds, directory discovery, the embedded iam and ai library sources, and the naming strategies, pluralizers and collection-name collision check. Passes yaml-conformance 15 of 19, and source-resolution-conformance and naming-conformance in full.
…ent coercion errors
Keep lane A's per-phase timing and validate module alongside the YAML, source, config and naming work: the YAML parse and desugar is its own timed phase, and load_bench keeps its phase tables with json, yaml and project modes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
[]suffix isisArray, sigil-free attributes, anchors/aliases, theERR_YAML_COERCIONguard,ERR_MALFORMED_YAML, and a line and column on every error from a YAML file), and the crate resolves a project the way the other ports do: the.metaobjects/config.jsonreader (same schema and defaults as the TypeScript reader), the four source kinds, directory discovery (symlinks followed,_pendingskipped), the embeddediam/ailibrary sources (build.rsembeds the repo-rootlibrary/deliberately; the crate ispublish = false), and naming — strategies, pluralizers and the collection-name collision check. Newsaphyrdependency.source-resolution-conformance(all 28 cases) andnaming-conformancepass in full;yaml-conformancepasses 15 of 19. The four ledgered fixtures stay ledgered on purpose —error-yaml-coerced-bool-in-intanderror-yaml-coerced-num-in-enumexpect the attribute-schema pass'sERR_BAD_ATTR_VALUEafter the coercion error, andyaml-ref-root-escapeandyaml-reporting-via-of-bareneed the ADR-0059 reference rules; all four belong to the validation lane (PR 602 stack), as do 11 newer metamodel fixtures that fail unlisted. Ledgers may only shrink.load_benchgained an optionaljson|yaml|projectmode argument (jsonstays the default, so PR 602's committed 20x baseline comparison is unchanged), and the merge with origin/main keeps lane A's per-phase timing and validate module while timing the YAML parse/desugar as its own phase besidejson parse.Load-time (20x model, release build):
Re-measured on a machine at load average ~50: wall-clock not comparable, peak memory JSON 34.8 MB / YAML 35.7 MB and the phase ratios are the reliable readings.
This branch overlaps merged PR 602 in
CHANGELOG.md,examples/load_bench.rs,src/lib.rsandsrc/loader.rs, so it stays rebasable.Gate. Two no-mistakes runs. Run 1 found two parity bugs against the TypeScript reference (sibling error indices after an unreadable YAML child; one
ERR_YAML_COERCIONper bad string-array element), both fixed with tests; its Test step recorded an exception for a first-commandcargo fmt --checkfailure the pipeline fixed before the full affected CI passed. Run 2, after merging PR 602, passed with no findings.Validation
Risk Assessment
✅ Low: The change is a well-bounded port checked line-for-line against the TypeScript reference and pinned by four conformance corpora plus behavior tests; the two recorded round-1 fixes are correctly applied, the merge with lane A keeps both sides' work (yaml phase beside json phase, bench mode argument with json default), and no concrete failing sequence, intent contradiction, or unrequired component was found.
Testing
Exercised the merged Rust loader end-to-end: the shared yaml-conformance corpus (19 fixtures, 4 lane-A-ledgered) through the real Loader plus the source-resolution and naming corpora and the config/project-load suites all passed; the two run-1 adversarial regressions passed; load_bench ran in json, yaml and project modes with the yaml phase row present and lane A's baseline comparison intact with json still the default. No failures; no UI surface so no screenshots. Broad regression was the already-passing configured command scripts/ci_local.sh --affected --strict-toolchains.
Evidence: load_bench json mode (phase table + baseline-compatible default)
Evidence: load_bench yaml mode (yaml parse and desugar phase row)
Evidence: load_bench project mode (config read + directory walk)
Evidence: Conformance and loader-edge test transcripts
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
scripts/ci-local.sh --affected --strict-toolchainscargo test --test yaml_conformance --test source_resolution_conformance --test naming_conformance (in server/rust/metaobjects)cargo test --test config_reader --test project_load --test loader_edgescargo test --test loader_edges -- a_bad_yaml_child_keeps_later_sibling_indices_stable string_array_coercion_reports_every_bad_elementcargo run --release --example load_bench -- 20 5 jsoncargo run --release --example load_bench -- 20 5 yamlcargo run --release --example load_bench -- 20 5 projectcargo run --release --example load_bench -- 20 3 --baseline baselines/load-20x.json (default mode = json)Broad regression: scripts/ci_local.sh --affected --strict-toolchains already ran and passed at this target commit (baseline run)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.