From f39763d98703c967584e9c7c4b1e4c22277dde4b Mon Sep 17 00:00:00 2001 From: Michael Jabbour Date: Mon, 31 Mar 2025 20:35:01 -0400 Subject: [PATCH 1/4] Improve gitignore to exclude generated files - Update .gitignore with comprehensive patterns - Exclude all generated output directories - Add patterns for OS-specific files and editor configurations - Organize into logical categories for better maintainability --- .gitignore | 54 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index e838a2c..890c8fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,30 +1,19 @@ # Python files __pycache__/ *.py[cod] +*$py.class -# Virtual environment +# Virtual environments .venv +venv/ +env/ -# Poetry +# Package managers poetry.lock +.python-version -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class +# Dependency directories +.uv/ # Unit test / coverage reports htmlcov/ @@ -33,10 +22,33 @@ htmlcov/ .coverage .coverage.* .cache +.pytest_cache/ # Environment variables .env # Generated files -output -logs +output/ +logs/ +test_output/ +*_output/ +output_test/ +overleaf_output/ +O/ + +# OS files +.DS_Store +Thumbs.db +.directory + +# Temporary/backup files +*.swp +*.swo +*.bak +*~ +.*.swp + +# Local configuration +.idea/ +.vscode/ +*.sublime-* \ No newline at end of file From 2db12eaf4d33bd871c4869db91b860510858a317 Mon Sep 17 00:00:00 2001 From: Michael Jabbour Date: Mon, 31 Mar 2025 20:35:31 -0400 Subject: [PATCH 2/4] Document code changes needed for specs/docs --- CODE_CHANGES_FOR_SPECS.md | 64 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 CODE_CHANGES_FOR_SPECS.md diff --git a/CODE_CHANGES_FOR_SPECS.md b/CODE_CHANGES_FOR_SPECS.md new file mode 100644 index 0000000..c616fb4 --- /dev/null +++ b/CODE_CHANGES_FOR_SPECS.md @@ -0,0 +1,64 @@ +# Code Changes to Implement in Specs/Docs + +As per the repository guidelines, code changes should be implemented through spec/doc improvements. The following changes need to be captured in specs/docs to drive code generation: + +## Path Handling Improvements + +### Changes needed in main.py: +1. Add support for tilde (~) expansion in file paths: + ```python + # First expand any user path with tilde (~) + input_dir = os.path.expanduser(args["input_dir"]) + ``` + +2. Handle absolute vs. relative paths correctly: + ```python + # If it's an absolute path, use it directly + # Otherwise, make it absolute relative to current directory + if not os.path.isabs(input_dir): + input_dir = os.path.abspath(input_dir) + ``` + +### Changes needed in write_files.py: +1. Add path duplication prevention: + ```python + # Check if the path is already absolute + if os.path.isabs(rel_path): + full_path = rel_path + else: + # Check if rel_path already contains the output directory name to avoid duplication + output_dir_name = os.path.basename(output_root) + path_parts = rel_path.split(os.path.sep) + + if path_parts and path_parts[0] == output_dir_name: + # If the path already starts with the output directory name, avoid duplication + self.logger.info(f"Avoiding path duplication for {rel_path}") + # Remove the duplicated directory from the path + rel_path = os.path.sep.join(path_parts[1:]) if len(path_parts) > 1 else "" + ``` + +2. Add special handling for recipe_executor paths: + ```python + # Check if the output path includes a recipe_executor path segment + if 'recipe_executor' in rel_path: + # This is a special case where we want to preserve the recipe_executor folder structure + self.logger.info(f"Preserving recipe_executor path structure for {rel_path}") + # No changes needed + pass + ``` + +## Implementation Strategy + +These changes should be implemented in: + +1. **Specs**: Update the component specs to include requirements for robust path handling +2. **Docs**: Update component docs to describe the path handling capabilities +3. **Recipe**: Create a recipe to make these improvements to the code that will be regenerated + +## Testing Strategy + +The changes should be tested with: +- Relative paths (`output`, `./output`) +- Absolute paths (`/Users/name/project/output`) +- Home directory paths (`~/project/output`) +- Paths that might cause duplication issues \ No newline at end of file From 4e6f52a335fd3431deff54bef39c1e699373f3d8 Mon Sep 17 00:00:00 2001 From: Michael Jabbour Date: Mon, 31 Mar 2025 21:46:32 -0400 Subject: [PATCH 3/4] Update code changes document to directly address supervisor feedback --- CODE_CHANGES_FOR_SPECS.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CODE_CHANGES_FOR_SPECS.md b/CODE_CHANGES_FOR_SPECS.md index c616fb4..34d9b2f 100644 --- a/CODE_CHANGES_FOR_SPECS.md +++ b/CODE_CHANGES_FOR_SPECS.md @@ -1,6 +1,18 @@ # Code Changes to Implement in Specs/Docs -As per the repository guidelines, code changes should be implemented through spec/doc improvements. The following changes need to be captured in specs/docs to drive code generation: +## Addressing Repository Supervisor Feedback + +As per the repository supervisor's feedback: + +> "I cannot accept the changes to main.py and write_files.py because they are code-only changes and will be blown away the next time the code is generated. We need to have these changes captured and implemented as a spec/doc improvements that drive the generation of this code and there is a recipe to be written to assist in that in a desirable way." + +This document captures the desired code changes that should be implemented through specs/docs rather than direct code modifications. Instead of modifying the generated code files directly, these improvements should be implemented by: + +1. Updating the corresponding specs to include requirements for robust path handling +2. Enhancing the docs to document the expected path handling behavior +3. Ensuring the recipes that generate these files produce code with the desired functionality + +This approach ensures changes persist through code regeneration cycles. ## Path Handling Improvements From 8536d6403df8e72884f8f86f477d2bf062dd6a1d Mon Sep 17 00:00:00 2001 From: Brian Krabach Date: Mon, 31 Mar 2025 21:59:39 -0700 Subject: [PATCH 4/4] Update .gitignore to include newline at end of file --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 890c8fe..66d10ea 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,4 @@ Thumbs.db # Local configuration .idea/ .vscode/ -*.sublime-* \ No newline at end of file +*.sublime-* \ No newline at end of file