Added "What's New in v0.3" section covering species, concepts,
sub_concepts, concept_comparison, template species inheritance,
and life arc field requirements. Updated quick start example
with v0.3 syntax including species and type system declarations.
Added tests verifying semantic token highlighting for concept,
sub_concept (enum and record forms), and concept_comparison
declarations. Made token_type_index pub(crate) for test access.
Updated binary format spec for v0.3.0 type system changes:
- Section 3 (Types): concept, sub_concept, concept_comparison encoding
- Section 4 (Characters): Value/Expression discriminant renames
- Section 5 (Templates): species_base field for inheritance
- Section 12 (Life Arcs): required_fields with type annotations
- Section 13 (Enums): note on sub_concept enum distinction
- Changelog and version history updated
Also fixed clippy/import issues in LSP semantic tokens module.
Added top-level keyword completions for:
- concept: with semicolon-terminated snippet
- sub_concept: with dot notation snippet
- concept_comparison: with brace-delimited snippet
Added test verifying type system keywords appear in
completions with correct snippet formatting.
Updated extension.toml:
- Version bumped to 0.3.0
- Grammar rev updated to v0.3 tree-sitter commit
Updated Zed highlights.scm with type system support:
- concept, sub_concept, concept_comparison keywords
- any keyword highlighting
- Named field highlights for type system declarations
- Template species reference highlighting
- sub_concept_field property highlighting
Added optional requires clause to life_arc declarations:
life_arc Baker requires { skill_level: Number } { ... }
Includes new FieldRequirement AST type, requires keyword token,
and parser support for the requires clause.
Added grammar rules for v0.3 type system declarations:
- concept_declaration: semicolon-terminated base type
- sub_concept: enum and record forms with dot notation
- concept_comparison: nested pattern matching with variant_pattern
- any_type: named node for the 'any' keyword
- template species extension: optional ': Species' syntax
Updated query files:
- highlights.scm: new keywords and named field highlights
- outline.scm: concept/sub_concept/concept_comparison in outline
- indents.scm: indentation for new brace-delimited nodes
Fixed pre-existing query issues:
- Replaced invalid repeat_node reference with decorator_node
- Removed invalid '?' punctuation reference
Added comprehensive test corpus (type_system.txt) covering:
- concept declaration (simple and multiple)
- sub_concept enum and record forms
- concept_comparison with any/is conditions
- template with species extension
- full combined example
Checks that concept_comparison variant names exist in the referenced
concept's enum sub-concepts and that all variants are covered
(exhaustiveness checking).
ConceptRegistry tracks all concepts and sub_concepts, providing lookup
and validation for sub-concept variant/field references. Supports both
enum and record sub-concept kinds.
When a template extends a species via species_base, shared field names
must have compatible types. Range values are compatible with their
underlying numeric types (Number or Decimal).
When a template has a species_base, its fields are loaded first as the
lowest priority layer. Override order: species -> includes -> template
-> character (last-one-wins for field values).
Added optional species_base field to Template struct enabling
template-species inheritance syntax: `template Name: Species { ... }`.
Updated LALRPOP grammar and all Template construction sites.
Added validation that sub_concept declarations reference an existing
parent concept. Produces clear error message with guidance to add
the missing concept declaration.
Changed sub_concept syntax from heuristic parent extraction to
explicit dot notation: `sub_concept Parent.Name { ... }`
The old syntax inferred the parent concept from the name using
uppercase letter heuristics. The new syntax makes the parent
concept explicit and unambiguous.
Added type_system_tests module with comprehensive tests.
Added complete support for the new type system syntax including:
- concept: Base type declarations
- sub_concept: Enum and record sub-type definitions
- concept_comparison: Compile-time pattern matching with conditional guards
Parser changes:
- Added VariantPattern, FieldCondition, and Condition AST nodes
- Implemented "is" keyword for pattern matching (e.g., "CupType is Glass or CupType is Plastic")
- Added Value::Any variant to support universal type matching
- Disambiguated enum-like vs record-like sub_concept syntax
LSP updates:
- Added Value::Any match arms across code_actions, completion, hover, inlay_hints, and semantic_tokens
- Type inference and formatting support for Any values
Example fixes:
- Fixed syntax error in baker-family behaviors (missing closing brace in nested if)
- Removed deprecated core_enums.sb file
Added AST structures for new type system:
- ConceptDecl: Base type definition
- SubConceptDecl: Enum or record subtype with SubConceptKind
- ConceptComparisonDecl: Compile-time enum mapping
- ConceptMapping: Individual mapping entry
Added Declaration enum variants and stubs throughout codebase
for LSP, resolve, and semantic analysis modules.
Added four keywords for new type system:
- concept: Base type definition
- sub_concept: Enum/record sub-type definition
- concept_comparison: Compile-time enum mapping
- any: Universal type for dynamic contexts
Also added:
- CLAUDE.md with project instructions and commit guidelines
- Test coverage for new keywords
- Crate-level deny directives for unused variables and dead code
Fixed pre-existing clippy issues to pass pre-commit hooks.
BREAKING CHANGES:
- Relationship syntax now requires blocks for all participants
- Removed self/other perspective blocks from relationships
- Replaced 'guard' keyword with 'if' for behavior tree decorators
Language Features:
- Add tree-sitter grammar with improved if/condition disambiguation
- Add comprehensive tutorial and reference documentation
- Add SBIR v0.2.0 binary format specification
- Add resource linking system for behaviors and schedules
- Add year-long schedule patterns (day, season, recurrence)
- Add behavior tree enhancements (named nodes, decorators)
Documentation:
- Complete tutorial series (9 chapters) with baker family examples
- Complete reference documentation for all language features
- SBIR v0.2.0 specification with binary format details
- Added locations and institutions documentation
Examples:
- Convert all examples to baker family scenario
- Add comprehensive working examples
Tooling:
- Zed extension with LSP integration
- Tree-sitter grammar for syntax highlighting
- Build scripts and development tools
Version Updates:
- Main package: 0.1.0 → 0.2.0
- Tree-sitter grammar: 0.1.0 → 0.2.0
- Zed extension: 0.1.0 → 0.2.0
- Storybook editor: 0.1.0 → 0.2.0
Separate if(expr) condition from if(expr) { child } decorator to fix
grammar conflicts. Simplify decorator_params to accept only integer,
range, or duration.
Add comprehensive example demonstrating all major features of the
Storybook DSL through Lewis Carroll's Alice in Wonderland.
Contents:
- 12 characters (Alice, WhiteRabbit, CheshireCat, MadHatter, etc.)
- 7 relationships with named participant blocks
- 3 institutions (tea parties, royal court)
- 1 schedule (Mad Tea Party eternal rotation)
- 12 behavior trees using new syntax features
- 1 life arc (Alice's journey)
Demonstrates:
- Cross-file template resolution (schema/templates.sb)
- Template inheritance and includes
- Strict template validation
- Action parameters and repeater decorators
- Named participant relationship blocks
- Species-based character typing
- Rich prose blocks throughout
All content validates successfully.
Add syntax enhancements for more expressive behavior trees and relationships.
Action parameters:
- Support typed/positional parameters: WaitDuration(2.0)
- Support named parameters: SetValue(field: value)
- Enable inline values without field names
Repeater decorator:
- Add * { node } syntax for repeating behavior nodes
- Maps to Decorator("repeat", node)
Named participant blocks:
- Replace self/other blocks with named participant syntax
- Support multi-party relationships
- Example: Alice { role: seeker } instead of self { role: seeker }
Schedule block syntax:
- Require braces for schedule blocks to support narrative fields
- Update tests to use new syntax: 04:00 -> 06:00: Activity { }
Enable characters to inherit from templates defined in different files
across the project structure.
- Add file_index field to NameEntry to track declaration source files
- Update NameTable::from_files() to set file indices when merging tables
- Change conversion pipeline to pass &[ast::File] instead of flat arrays
- Update merge functions to use two-level indexing:
all_files[entry.file_index].declarations[entry.decl_index]
- Update all affected tests to use new signatures