搜索

PythonReactSEOPDF
GitHub Skill

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.

f4ah6o☆ 0 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

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

  1. Generate or sync PBT templates

    • Full regenerate: Run ./scripts/self_pbt.sh from repo root.
      • This script runs: generate → sync → moon info → moon fmt
    • Sync existing files: Run moon run src/aletheia -- sync ./src
  2. Review generated files

    • Check src/aletheia.pbt.md, src/cli/cli.pbt.md, and src/parser/parser.pbt.md for template correctness.
    • Keep templates as mbt nocheck until the property logic is valid; switch to mbt check only after validating semantics.
    • If you still have .pbt.mbt.md, rename to .pbt.md to 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 (default src,main,module).
      • pbt_min_cases: minimum test case count to generate (default 1).
      • pbt_min_roundtrip, pbt_min_idempotent, pbt_min_pipeline, pbt_min_invariant, pbt_min_oracle: per-pattern minimums (default 0).
    • Use moon run src/aletheia -- generate ./src --explain to see skipped packages and reasons.
  3. 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
  4. Verify

    • Run moon test (or moon test --update if snapshots intentionally change).
    • Review *.mbti diffs generated by moon info.

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 via moon 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

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!