Skip to content

Semantic validation rejects SDL with imports and reports errors only as a count #1548

Open

Description

@doublewhy

Problem

raes semantic validate reads one document as text, so it cannot validate SDL that uses imports, and it hides the reason. When it does find semantic errors, it reports only how many.

  1. Imports. The command parses the document with parse_sdl(), which refuses top-level imports with SDLParseError("SDL imports require file-backed parsing via parse_sdl_file()") (raes/parser.py:383 on dev a4357f9a). The CLI reports every SDLParseError with the message "SDL input was rejected at the parse stage.", and an error without structured diagnostics, like this one, only as the generic sdl.parse code (raes_cli/_semantic_sdl.py:69-87). On dev a4357f9a:

    $ raes semantic validate contracts/fixtures/sdl/variation-points-v1/composition/root.yaml
    validate: invalid
    error [sdl.parse] SDL input was rejected at the parse stage.
    

    It exits 1, although the composed scenario is valid.

  2. Semantic errors. An SDLValidationError becomes one diagnostic, "SDL semantic validation reported N error(s)." (_semantic_sdl.py:88-95), which names none of the errors. docs(explain): point getting-started at raes semantic validate #1489 shows first-scenario.sdl.yaml with a broken link reported this way, while parse_sdl_file() on the same text names the error: Infrastructure 'web' links to undefined 'missing-network'.

#1489 and #1492 document both limits in docs/explain/getting-started.md and docs/public/guides/cli.md, so the guides describe current behavior, but the command still cannot validate a composed scenario.

Scope

Done when

  • raes semantic validate contracts/fixtures/sdl/variation-points-v1/composition/root.yaml exits 0.
  • SDL with imports read from standard input gets a diagnostic that names file-backed parsing.
  • A document with semantic errors gets one diagnostic per error, naming it, and the exit code is unchanged.
  • The guide text matches the new behavior.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions