feat: Implement LispGenerators module with StreamData generators (#130)#132
feat: Implement LispGenerators module with StreamData generators (#130)#132andreasronge merged 4 commits intomainfrom
Conversation
Add comprehensive property-based testing infrastructure for PTC-Lisp: - test/support/lisp_generators.ex: 25+ generators for all AST node types - test/support/lisp_generators_test.exs: 29 properties validating generators Generators include: - Primitive types (nil, boolean, integer, float, string, keyword) - Symbols with scope tracking for well-scoped programs - Collections (vectors, maps) with depth control - Special forms (if, let, fn, arithmetic, comparisons, logic, where, tool calls) - Proper NaN filtering and escape sequence handling All generators produce valid AST that roundtrips through Formatter/Parser. New tests verify roundtrip invariant for all expression types. Configuration changes: - .credo.exs: Increased max_nesting to 3 (required for StreamData bind/map chains) - .credo.exs: Increased CyclomaticComplexity max_complexity to 15 (test helpers) - .credo.exs: Disabled OperationWithConstantResult (false positive on NaN comparison) All 872 existing tests pass + 28 new properties added. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Adjust Credo checks to accommodate StreamData patterns and test complexity: - Increase max_nesting to 3 (required for nested bind/map chains in StreamData) - Increase CyclomaticComplexity max_complexity to 15 (valid_ast? test helper) - Disable OperationWithConstantResult (false positive on NaN v == v comparison)
PR Review: feat: Implement LispGenerators module with StreamData generators (#130)SummaryWell-implemented PR that creates comprehensive StreamData generators for property-based testing of PTC-Lisp. The implementation closely follows the spec in What's Good
Issues (Must Fix)
Suggestions (Optional)
SecurityNo concerns. The generators are test support code and use bounded string generation that prevents atom table exhaustion (as correctly noted in the code comments). DocumentationNo updates needed. The implementation matches the spec document exactly, and generators are internal test utilities. VerdictRequest Changes - The Credo configuration disables the wrong check, leaving warnings unresolved. This is a mechanical one-line fix. Once corrected, the PR is ready to merge. |
|
@claude please fix these issues from PR review: Issue 1: Wrong Credo check disabledLocation: {Credo.Check.Warning.OperationWithConstantResult, []}to: {Credo.Check.Warning.OperationOnSameValues, []}Issue 2: Update PR description test countLocation: PR description gh pr edit 132 --body "[updated description with 28 instead of 29]"Please fix ALL issues above in a SINGLE commit. Make minimal changes to resolve each issue. |
Auto-Triage SummaryDecisions Made
Analysis
Status
Next StepsOnce the automated fix is applied and checks pass, this PR will be ready to merge. The implementation is solid and follows the property testing spec correctly. |
- Fix .credo.exs line 98: Disable OperationOnSameValues (not OperationWithConstantResult) The actual Credo warnings are from OperationOnSameValues due to NaN self-comparison - Update PR description: 28 property-based tests (not 29) Verified with grep count in lisp_generators_test.exs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed Issues✅ Issue 1: Wrong Credo check disabled
✅ Issue 2: Update PR description test count
Validation
|
PR Review: feat: Implement LispGenerators module with StreamData generators (#130)SummaryExcellent implementation that creates comprehensive StreamData generators for property-based testing of PTC-Lisp. The code closely follows the spec in What's Good
Issues (Must Fix)None found. Suggestions (Optional)
SecurityNo concerns. The generators are test support code and use bounded string generation that prevents atom table exhaustion (as correctly noted in the code comments at line 56-57). DocumentationNo updates needed. The implementation matches the spec document ( VerdictApprove - The implementation is complete, well-tested, and follows the specification correctly. The Credo configuration issue from the previous review has been fixed (now correctly disables |
|
@claude please fix this issue from PR review: Issue 1: Remove redundant Credo check from enabled sectionLocation: {Credo.Check.Warning.OperationOnSameValues, []},This completes the Credo configuration cleanup for NaN filtering support. |
Auto-Triage SummaryDecisions Made
AnalysisThe final review has an Approve verdict with one optional suggestion to clean up redundant Credo configuration. The check Why FIX_NOW:
Status
Next StepsOnce the automated fix is applied and checks pass, the PR will be ready to merge. The implementation is already approved and all tests pass. |
The check is disabled in line 98 for NaN filtering, so it should not also appear in the enabled section. This completes the Credo configuration cleanup for NaN self-comparison filtering support.
Fix Applied✅ Issue 1: Remove redundant Credo check from enabled section
Validation
Commit: |
PR Review: feat: Implement LispGenerators module with StreamData generators (#130)SummaryExcellent implementation that creates comprehensive StreamData generators for property-based testing of PTC-Lisp. The code closely follows the spec in What's Good
Issues (Must Fix)None found. Suggestions (Optional)None. SecurityNo concerns. The generators are test support code and use bounded string generation that prevents atom table exhaustion (as correctly noted in the code comments at lines 55-57 and 113-114). DocumentationNo updates needed. The implementation matches the spec document ( Verification Performed
VerdictApprove - The implementation is complete, well-tested, and follows the specification correctly. The Credo configuration is properly set up. All tests pass, and the PR is ready to merge. |
Auto-Triage Summary - Cycle 2/3Review VerdictApprove - No issues found Decisions MadeNo triage actions required. The latest review (cycle 3) shows:
Status
Next StepsAll required fixes from previous triage cycles have been applied. The PR is approved and ready to merge. Added |
Summary
Implements issue #130 by creating the LispGenerators module with comprehensive StreamData generators for property-based testing of PTC-Lisp.
What's Implemented
test/support/lisp_generators.ex- Main generators module with:test/support/lisp_generators_test.exs- Comprehensive test coverage with:Configuration changes:
.credo.exs: Increasedmax_nestingto 3 (required for StreamData bind/map chains).credo.exs: IncreasedCyclomaticComplexitythreshold to 15 (test helpers complexity).credo.exs: DisabledOperationOnSameValues(false positive on NaN self-comparison)Test Results
✅ All 872 existing tests pass
✅ 28 new properties added
✅ All generators produce valid AST that roundtrips through Formatter/Parser
🤖 Generated with Claude Code