feat: implement storybook DSL with template composition and validation

Add complete domain-specific language for authoring narrative content for
agent simulations.

Features:
- Complete parser using LALRPOP + logos lexer
- Template composition (includes + multiple inheritance)
- Strict mode validation for templates
- Reserved keyword protection
- Semantic validators (trait ranges, schedule overlaps, life arcs, behaviors)
- Name resolution and cross-reference tracking
- CLI tool (validate, inspect, query commands)
- Query API with filtering
- 260 comprehensive tests (unit, integration, property-based)

Implementation phases:
- Phase 1 (Parser): Complete
- Phase 2 (Resolution + Validation): Complete
- Phase 3 (Public API + CLI): Complete

BREAKING CHANGE: Initial implementation
This commit is contained in:
2026-02-08 13:24:35 +00:00
commit 9c20dd4092
59 changed files with 25484 additions and 0 deletions

52
lefthook.yml Normal file
View File

@@ -0,0 +1,52 @@
# lefthook.yml - Git hooks configuration
# https://github.com/evilmartians/lefthook
# Validate commit messages follow conventional commits format
commit-msg:
commands:
conventional-commit:
run: |
commit_msg=$(cat {1})
# Conventional commit pattern
pattern="^(feat|fix|docs|style|refactor|perf|test|chore|build|ci|revert)(\(.+\))?: .{1,}"
if ! echo "$commit_msg" | grep -qE "$pattern"; then
echo "❌ Invalid commit message format!"
echo ""
echo "Commit message must follow conventional commits:"
echo " <type>(<scope>): <description>"
echo ""
echo "Types: feat, fix, docs, style, refactor, perf, test, chore, build, ci, revert"
echo ""
echo "Example:"
echo " feat(auth): add user login endpoint"
echo " fix(ui): resolve button alignment issue"
echo " docs: update README with installation steps"
echo ""
echo "Your message:"
echo " $commit_msg"
exit 1
fi
# Run checks before commit
pre-commit:
parallel: true
commands:
fmt:
glob: "*.rs"
run: cargo fmt --check
stage_fixed: true
clippy:
glob: "*.rs"
run: cargo clippy --workspace --all-targets -- -D warnings
trailing-whitespace:
glob: "*.{rs,toml,md,yml,yaml}"
run: |
if grep -n '[[:space:]]$' {staged_files}; then
echo "❌ Found trailing whitespace in staged files"
exit 1
fi