Skip to content

Handle generate config errors cleanly#169

Merged
httpdss merged 1 commit into
mainfrom
issue-164-generate-clean-config-errors
Jun 27, 2026
Merged

Handle generate config errors cleanly#169
httpdss merged 1 commit into
mainfrom
issue-164-generate-clean-config-errors

Conversation

@httpdss

@httpdss httpdss commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add GenerateConfigError for expected structure config load/shape failures.
  • Load and validate structure YAML before creating backup/output directories, so invalid config does not leave partial side effects.
  • Report missing files, invalid YAML, read errors, and top-level non-mapping YAML as clean ❗ ... errors with exit code 1 and no traceback.
  • Preserve MCP generate behavior by converting clean CLI SystemExit failures into string errors for MCP callers.

Verification

  • pre-commit run --all-files passed
  • pytest -q passed: 195 passed
  • git diff --check passed
  • Ad-hoc verification script /tmp/hermes-verify-structkit-generate-clean-errors-* passed for invalid YAML, top-level non-mapping YAML, and missing file; it verified exit code 1, no Traceback, and no output directory side effects. Script was removed after execution.

Closes #164

@httpdss httpdss merged commit 2193969 into main Jun 27, 2026
3 checks passed
@httpdss httpdss deleted the issue-164-generate-clean-config-errors branch June 27, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle invalid structure YAML in generate without tracebacks or partial side effects

1 participant