Repository navigation
Conversation
alphacrack
reviewed
Nov 14, 2026
alphacrack
left a comment
Owner
There was a problem hiding this comment.
Thanks for the fix, and the tests are clear. A few notes:
maithili_dsl/cli.py:126-128: everyOSError(PermissionError,IsADirectoryErrorwhen a directory is passed, and so on) returnsEXIT_NOT_FOUND(3) even though the path exists, which is misleading for scripts that check exit codes. Consider a separateEXIT_READ_ERRORand updatingtest_unreadable_file_returns_not_foundto match.CHANGELOG.md:11: please mention the new exit code7(EXIT_BAD_ENCODING), since it's a public CLI contract change.- Nit:
tests/test_security.py:25:EXIT_BAD_ENCODINGbreaks the alphabetical import order.
What blocks the merge: the protect-main ruleset requires the ci-ok status check, which has never reported for this PR. The only CI run for d51ccbf (run 35372204218, 2026-09-18) failed with zero jobs, so the workflow never actually started. The branch is also 2 commits behind main.
To unblock: merge or rebase main into the branch (or push any new commit) so CI runs again. The maintainer may need to approve the fork run, and ci-ok then has to pass. No approving review is required by the ruleset.
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.
Summary
Handle invalid UTF-8 and file-read failures before linting or executing a
.dmaisource file. Invalid encodings now produce a concise Maithili message and dedicated exit code instead of a raw Python traceback.Motivation / Audit Reference
Closes #27.
Test Evidence
pytest -v --cov=maithili_dsl --cov-report=term-missing— 162 passed, 95.00% total coverage;cli.py97%error.dmaifailed as expectedpython -m maithili_dsl --versionreports0.4.0Security Considerations
The file is still read before any linting, transpilation, import validation, or execution. Malformed input now fails closed at that boundary. The generic
OSErrormessage does not expose local path or exception details.Breaking Changes
None. Valid UTF-8 programs retain their existing behavior and exit codes. Invalid encodings now have the documented non-zero
EXIT_BAD_ENCODINGcode instead of an uncaught exception.Checklist