aletheia-self-pbt
Sub skill for pbt-workflow-guide. Self-dogfooding workflow for the f4ah6o/aletheia.mbt repo, covering PBT generation, template updates, and validation.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Aletheia Self PBT
Overview
Self-dogfooding workflow for the f4ah6o/aletheia.mbt MoonBit repo. This skill covers the complete pipeline: analyzer/patterns/generator/cli. The tool validates its own quality using comprehensive property-based testing with 50+ tests and 100% pass rate.
Role in the Root Workflow
This is a sub skill of pbt-workflow-guide. Use it only when the target repository is f4ah6o/aletheia.mbt (this repo).
Use this skill when changing Aletheia's analyzer/patterns/generator/cli pipeline or regenerating this repo's .pbt.md files. For using Aletheia on other repos, use aletheia-pbt. For PBT design guidance (patterns, generators, shrinking, state machines), use pbt-workflow-guide.
v0.4.0 Enhancement Plan (Complete)
The comprehensive PBT enhancement plan has been completed across 6 phases:
- Phase 1: Enhanced shrinking system with advanced strategies
- Phase 2: Statistics integration for test insights
- Phase 3: Enhanced invariant detection for collections
- Phase 4: Size parameter control for recursive types
- Phase 5: Stateful PBT workflow enhancements
- Phase 6: Documentation and example improvements
Workflow
-
Generate or sync PBT templates
-
Full regenerate: Run
./scripts/self_pbt.shfrom repo root.- This script runs: generate → sync → moon info → moon fmt
-
Sync existing files: Run
moon run src/aletheia -- sync ./src
-
Full regenerate: Run
-
Review generated files
- Check
src/aletheia.pbt.md,src/cli/cli.pbt.md, andsrc/parser/parser.pbt.mdfor template correctness. - Keep templates as
mbt nocheckuntil the property logic is valid; switch tombt checkonly after validating semantics. - If you still have
.pbt.mbt.md, rename to.pbt.mdto avoid MoonBit treating it as source. - For generation filtering, you can configure
moon.mod.json:-
pbt_generic_names: comma-separated generic package names to avoid in output names (defaultsrc,main,module). -
pbt_min_cases: minimum test case count to generate (default1). -
pbt_min_roundtrip,pbt_min_idempotent,pbt_min_pipeline,pbt_min_invariant,pbt_min_oracle: per-pattern minimums (default0).
-
- Use
moon run src/aletheia -- generate ./src --explainto see skipped packages and reasons.
- Check
-
Update detection/template logic (as needed)
- Pattern detection:
src/patterns/patterns.mbt - Signature extraction/type inference:
src/analyzer/function_extractor.mbt - Property templates:
src/generator/property_gen.mbt - CLI wiring:
src/cli/main.mbt
- Pattern detection:
-
Verify
- Run
moon test(ormoon test --updateif snapshots intentionally change). - Review
*.mbtidiffs generated bymoon info.
- Run
Important: Always Run Before Committing
Always run ./scripts/self_pbt.sh before committing PBT changes.
This script ensures:
- Generated test files are properly formatted with
moon fmt - PBT templates are synchronized correctly
- Interface files (
*.mbti) are updated viamoon info
Self-Testing Coverage
The tool validates itself with comprehensive property-based tests:
- Total Tests: 50+
- Pass Rate: 100%
- Pattern Coverage: All 5 pattern types (Round-Trip, Idempotent, Producer-Consumer, Invariant, Oracle)
- State Machine Testing: Full stateful PBT workflow validation
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!