Repository navigation
Conversation
A spec that did not parse escaped `lc status` and `lc materialize --check` as a raw ScannerError, and it was one case of several: an empty or non-UTF-8 file, a top-level list, and any wrong-typed field that reached ASTRA's semantic checks (`outputs: 5`, `decisions: [a]`) all tracebacked the same way. The gate now asks ASTRA the way `astra validate` does: - Schema first, for the analysis and every universe, and the semantic checks only once that passes. They assume the structure holds and crashed on it. The universe schema was not checked at all before, so a universe with `decisions: [a]` or an unknown key passed the gate. - A file that is not a spec at all reaches lc as astra's one SpecLoadError, naming the file (and the line and column for YAML). `_validate` refuses with it, and so does `lc run`'s read_spec, whose probe reads the inputs the file declares. Nothing broader is caught: an exception from astra on a file that does load is astra's bug, not the user's spec. Requires the astra-tools release with SpecLoadError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #200. Paired with astra-project/astra-tools#122. Draft until that is released: this branch imports
astra.helpers.SpecLoadError, so it needs the astra-tools pin bumped to that release (a last commit here). Until then CI fails on the import.Summary
The ScannerError in #200 was one case of a wider problem. On
main, any of these tracebacks out oflc statusandlc materialize --check:astra.yamlor universe that is empty, not UTF-8, or a top-level listoutputs: 5ordecisions: [a]lc's gate now asks ASTRA the way
astra validatedoes:decisions: [a]or an unknown key used to pass the gate.SpecLoadError, which names the file (and the line and column for YAML).plan._validaterefuses with it.lc run'sread_specrefuses with it too, because the probe reads the inputs that file declares.Nothing broader is caught: an exception from astra on a file that does load is astra's bug, and reporting it as "your spec does not validate" would blame the user for it.
This is an alternative to #252 and #258, which both catch
yaml.YAMLErrorin_validateand fix the case in the issue but not the others above. The CLI test here is adapted from #258's.Tests
test_plan.py: each kind of file that won't load, refused with the file's name; a structural error in the analysis or a universe, refused before the semantic stage.test_run.py:read_specon a malformed spec.test_cli.py:lc statuson the spec from the issue gives exit 1 and no traceback.main.plan.build, with a wrong-typed value in every field of a spec, universe and sub-analysis, crashes in 192 of 448 cases onmainand in none on this branch.SpecLoadErroruntil the pin moves.CLAUDE.md: the "Known violation, unfixed" paragraph becomes the invariant, and the gate's paragraph records the two-stage order and why it is load-bearing.🤖 Generated with Claude Code