Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
…htconeResearch#200) `lc status` and `lc materialize --check` tracebacked out of a malformed `astra.yaml`. `plan._validate` reports what ASTRA's *validation* finds, but a file that is not YAML at all fails inside the loader, before there is anything to validate — so the `ScannerError` escapes the gate, and the CLI shows a traceback instead of the one-line error the group boundary translates a `ProjectError` into. Fold `yaml.YAMLError` into the same `problems` list the gate already renders, so the existing header and the two-space indentation carry the parse error too. The loader's own error already names the file, the line and the column, which is where the fix goes, so it needs no reformatting. Universes are parsed inside the gate as well, since `validate_universe_file` loads both files, so a broken universe reaches the same clean error. - `test_a_spec_that_is_not_yaml_is_a_clean_error` and `test_a_universe_that_is_not_yaml_is_a_clean_error` in `tests/test_plan.py`. - `test_status_on_a_spec_that_is_not_yaml_is_a_clean_error` in `tests/test_cli.py` pins the CLI surface: exit 1, no traceback. 🤖 Generated with [Alpha](https://github.com/Mutantcat-Working-Group/Alpha)
tyza66
force-pushed
the
fix/plan-validate-unparseable-yaml
branch
from
November 4, 2026 02:05
59a692f to
5776a31
Compare
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.
The bug
A spec that does not parse escaped as a raw
yaml.scanner.ScannerError, solc statusandlc materialize --checktracebacked.plan._validateis thegate that turns a bad spec into ASTRA's own errors, but it only catches what
validation reports — a file that is not YAML at all fails inside
astra.helpers.load_yamlbefore there is anything to validate, so theScannerErrorescapes the gate and the CLI, which only translates aProjectErrorat the_EngineErrorGroupboundary.lc materializemasked itonly because the dirty-tree refusal fires first.
The fix
One
try/except yaml.YAMLErroraround theproblemsconstruction and theuniverse loop in
plan._validate, settingproblems = [str(exc)]. The parseerror joins the same list the gate already renders, so the existing header and
two-space indentation carry it and no new rendering is added:
YAML's own error already names the file, the line and the column, which is what
the issue asked for, so it is reused verbatim rather than rebuilt from
problem_mark. Universes are covered for free:validate_universe_fileloadsboth the analysis and the universe, so every file is parsed inside the gate,
and the
load_yamlcallsbuildmakes afterwards are then safe.Tests
test_a_spec_that_is_not_yaml_is_a_clean_errorandtest_a_universe_that_is_not_yaml_is_a_clean_errorintests/test_plan.py.test_status_on_a_spec_that_is_not_yaml_is_a_clean_errorintests/test_cli.pypins the CLI surface: exit 1,does not validatein theoutput, no traceback.
What I ran on Windows:
ruff check src/ tests/is clean, andmypy src/reports no new errors (the 49 it does report are pre-existing POSIX-attribute
and
fcntl/getuidfailures in_sandbox_exec.py,engine/container.pyandengine/compute/, present onmaintoo).tests/test_plan.pyandtests/test_cli.pytogether are 82 passed, 1 failed, where the failure istest_a_declared_input_outside_the_project_keeps_its_absolute_pathcomparing aWindows backslash path against a POSIX one — also failing on
main. Across a16-file subset, 528 passed and 72 failed, and the same 72 fail identically on
pristine
main. The container and compute integration suites, plustest_compute_local.py/test_compute_slurm.py, do not run on Windows, sothis PR's CI is their real run.
Disclosure
This change was written with AI assistance, using
Alpha.