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:
40
tests/examples/equality.sb
Normal file
40
tests/examples/equality.sb
Normal file
@@ -0,0 +1,40 @@
|
||||
// Test equality expressions in life arcs
|
||||
|
||||
life_arc NameCheck {
|
||||
state checking {
|
||||
on name is "Alice" -> found_alice
|
||||
on name is "Bob" -> found_bob
|
||||
}
|
||||
state found_alice {
|
||||
on ready -> checking
|
||||
}
|
||||
state found_bob {
|
||||
on ready -> checking
|
||||
}
|
||||
}
|
||||
|
||||
life_arc StatusCheck {
|
||||
state monitoring {
|
||||
on status is active -> active_state
|
||||
on status is inactive -> inactive_state
|
||||
}
|
||||
state active_state {
|
||||
on status is inactive -> inactive_state
|
||||
}
|
||||
state inactive_state {
|
||||
on status is active -> active_state
|
||||
}
|
||||
}
|
||||
|
||||
life_arc FlagCheck {
|
||||
state idle {
|
||||
on completed is true -> done
|
||||
on completed is false -> working
|
||||
}
|
||||
state working {
|
||||
on completed is true -> done
|
||||
}
|
||||
state done {
|
||||
on completed is false -> working
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user