Add honest baseline validation for examples - #1
Merged
Conversation
Reviewer's GuideEstablishes automated validation and CI to ensure all 21 documented pattern examples meet a minimal structural contract and compile under Python 3.10 and 3.12, while aligning documentation and quick start instructions with the new baseline. Sequence diagram for CI validation and example compilationsequenceDiagram
actor Developer
participant GitHubActions
participant validate_repository_py as validate_repository.py
participant compileall as python_compileall
Developer->>GitHubActions: push or pull_request to master
GitHubActions->>GitHubActions: actions/checkout@v4
GitHubActions->>GitHubActions: actions/setup-python@v5 (3.10, 3.12)
GitHubActions->>validate_repository_py: python scripts/validate_repository.py
validate_repository_py->>validate_repository_py: validate_pattern(root, name)
validate_repository_py-->>GitHubActions: exit_code (0 or 1)
GitHubActions->>compileall: python -m compileall pattern_directories
compileall-->>GitHubActions: syntax_check_result
GitHubActions-->>Developer: CI status badge update
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The list of pattern directories is hard-coded both in
PATTERN_DIRECTORIESand in thecompileallcommand; consider deriving a single source of truth (e.g., fromPATTERN_DIRECTORIESor the README) to avoid drift when patterns are added or renamed. - The validation script enforces exactly 21 patterns via a magic number; if the set of patterns is expected to evolve, it may be clearer to assert against a derived count (e.g., from a patterns table in the README) rather than a literal constant.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The list of pattern directories is hard-coded both in `PATTERN_DIRECTORIES` and in the `compileall` command; consider deriving a single source of truth (e.g., from `PATTERN_DIRECTORIES` or the README) to avoid drift when patterns are added or renamed.
- The validation script enforces exactly 21 patterns via a magic number; if the set of patterns is expected to evolve, it may be clearer to assert against a derived count (e.g., from a patterns table in the README) rather than a literal constant.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
What changed
.env.exampleWhy
The repository promised 21 runnable examples but had no automated validation and instructed users to copy an environment template that did not exist. This establishes a credential-free baseline without pretending external LLM calls are tested end to end.
Validation
python scripts/validate_repository.pypython -m compileallacross all 21 pattern directoriesgit diff --checkSummary by Sourcery
Add automated validation and CI to ensure all documented LLM pattern examples meet a minimal runnable contract and compile under supported Python versions.
New Features:
Enhancements:
CI: