Skip to content

Treat CLI semantic failures as errors, clarify graph materialization, add tests and docs#1

Open
sean2077 wants to merge 2 commits into
mainfrom
codex/fix-typo-in-codebase
Open

Treat CLI semantic failures as errors, clarify graph materialization, add tests and docs#1
sean2077 wants to merge 2 commits into
mainfrom
codex/fix-typo-in-codebase

Conversation

@sean2077
Copy link
Copy Markdown
Owner

Motivation

  • Prevent silent false-successes when the CLI exits with code 0 but returns JSON { "ok": false } so automation relying on check=True raises on semantic failures.
  • Reduce terminology drift by aligning package messaging to the preferred "Python preview client" phrase and clarify how in-memory graphs are materialized with regard to filename suffixes.
  • Add explicit unit tests that lock in intended exception vs return behavior for the semantic-failure case.

Description

  • Normalize package docstrings to use the term Python preview client and adjust a few related docstrings for clarity (python/topoexec_preview/__init__.py and python/topoexec_preview/client.py).
  • Change _json_command in TopoExecClient to treat check=True as failing when either returncode != 0 or the parsed JSON contains "ok": false, by computing semantic_ok and raising TopoExecCommandError accordingly.
  • Add a clarifying docstring to materialized_graph that documents the suffix-preserving behavior for in-memory GraphDocument inputs and defaulting to .yaml only when no suffix is present.
  • Add a development doc file docs/20-development-overview/issue-task-proposals.md listing related follow-up tasks.
  • Add unit tests in tests/python/test_python_preview.py which mock subprocess.run to return stdout='{"ok": false, ...}' and assert that check=True raises TopoExecCommandError while check=False returns a CommandResult with ok == False.

Testing

  • Ran the new unit tests in tests/python/test_python_preview.py via python -m unittest tests/python/test_python_preview.py and the added tests passed.
  • Existing smoke-style tests in the same file were left unchanged and were not modified by this PR's logic, and the test suite showed no regressions in local runs.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant