You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to abbe811, addressing every finding of a three-lens
adversarial review plus the broken rust cross-language backend.
Rust backend (never actually ran)
- examples/tryparse links libl4yaml.so and libleanshared.so but cargo
baked no rpath, so every suiterunner invocation died with exit 127
(loader error) and scored as a parse rejection — masked by tee until
the pipefail fix. l4yaml-sys/build.rs now exports both library dirs
over its links="l4yaml" metadata channel and a new l4yaml/build.rs
turns them into -Wl,-rpath args (the cargo mirror of tryparse_c's
CMake BUILD_RPATH). Verified: binary runs with no LD_LIBRARY_PATH;
all four backends now agree exactly on all five presets
(unlimited 783/86/151; others 774/95/151).
ScalarPref.preserve edge cases (review blockers/minors)
- Plain negative numbers re-quoted: isPlainSafe rejects every leading
indicator, so preserve turned plain -1 into "-1" — which the new
style-aware safe_load reads back as a STRING. New isPlainSafePreserve
admits leading '-' followed by a non-space (ns-plain-first [126]),
used only in the preserve arm; existing prefs untouched.
- Literal/folded content without a honored newline fell into the plain
path (`>- 42` re-emitted as plain 42, string→int). Block styles now
fall back to double quotes: block scalars always resolve to strings.
- Single-quoted content with CR/C0/C1 controls was emitted raw (CR
reparses as folding — silent corruption). New singleQuotedRepresentable
(printable+tab per c-printable) gates the style; else escaped
double quotes.
- 17 new #guard tests pin the preserve semantics (Tests/Guards/Dump.lean).
Python compat (review blockers/minors)
- Mapping KEYS lost their types: _dump_mapping quoted every key via
_quote_scalar(str(key)), so {42: ...} came back {'42': ...}. Keys now
serialize through _python_to_yaml (non-scalar keys raise TypeError,
as pyyaml does).
- _fidelity_config now validates known DumpConfig fields (types, enums,
Nat-ness of indent/lineWidth) and wraps malformed config YAML in
ConfigError: the Lean config reader silently falls back to ALL
defaults on any bad field, which would quietly discard the fidelity
settings over a cosmetic typo.
- safe_dump_all newline-terminates chunks so '---' no longer glues onto
the previous document (stream now reparses to the same documents).
- _find_library: directory-valued L4YAML_LIB now tries platform library
names (darwin .dylib included); stale pre-0.5.0 libraries produce an
OSError with a rebuild hint instead of an opaque AttributeError.
- 10 new pytest regressions (negative ints/floats, non-string keys,
config validation, dump_all reparse).
Tests and CI
- Dropped test_tab_as_separation_accepted: it codified acceptance of
"key:\n\t value", a leniency no yaml-test-suite case adjudicates
(Y79Y pins tab-before-indicator as fail, tab-before-scalar same-line
as valid; the next-line form is spec-questionable and PyYAML rejects
it). The rejection test keeps its probed input; the comment now
states the leniency without asserting it.
- Workflow venv step: PYTHONPATH/PYTHONNOUSERSITE now exported locally
before the in-step pip/pytest checks (GITHUB_ENV only affects later
steps), and venv creation failure gets an actionable error.
- TryDump.lean doc lists the "preserve" scalarStyle.
Verified: full lake build green (all guards), dumproundtrip 117/117
(default config unchanged), 206/206 across both pytest suites under the
hermetic CI environment, and a follow-up confirmation review reported
10/10 fix areas confirmed; its one new finding (negative indent
bypassing validation into the same silent-fallback) is fixed and
tested here.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments