Add explain command to preview structure resolution#143
Draft
Add explain command to preview structure resolution#143
explain command to preview structure resolution#143Conversation
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.
Motivation
generate --dry-runwhich simulates file operations and diffs.Description
explainimplemented instructkit/commands/explain.pythat resolves structure definitions and reports files, folders, nestedfolders[].structtraversal, declared variables and resolved values, hooks (rendered but not executed), remote file references (detected but not fetched), and configured conflict behavior.ExplainCommandtoget_parser()instructkit/main.py.--json/-o json, accept--vars,--mappings-file, and--file-strategy, and use the same Jinja2 rendering environment/filters for variable resolution andwithrendering.docs/cli-reference.md,README.md) withexplainusage, examples, and guidance on how it differs fromgenerate --dry-run.tests/test_explain_command.pyto cover CLI registration, nested structures, remote references, rendered hooks/variables, conflict behavior for existing files, text and JSON outputs, and ensure no side effects (no fetches, no subprocess runs).Testing
pytest tests/test_explain_command.pyand the new tests passed.pytest, resulting in all tests passing (158 passed).python -m compileall structkit tests/test_explain_command.pywhich succeeded.python -m structkit.main explain project/python --jsonto verify JSON output, which produced the expected explanation output.Codex Task