Repository navigation
v0.85.0
Added
-
SyntaxIntegrityError Exception (ARCH-STRICT-SCOPE-001):
- Previous:
FluentBundle.add_resource()returned Junk entries silently in strict mode - Issue: Financial applications require fail-fast behavior; silent failures during resource loading are unacceptable for monetary formatting
- Added:
SyntaxIntegrityErrorexception raised in strict mode when syntax errors (Junk entries) are detected - Exception attributes:
junk_entries: tuple[Junk, ...]- Junk AST nodes representing syntax errorssource_path: str | None- Optional path to source file for error contextcontext: IntegrityContext- Structured diagnostic context
- Export: Available from
ftllexenginetop-level package - Location:
integrity.py,runtime/bundle.py_register_resource() - Impact: Complete strict mode coverage for both syntax (SyntaxIntegrityError) and formatting (FormattingIntegrityError)
- Previous:
-
API Boundary Type Validation (SEC-INPUT-VALIDATION-001):
- Previous:
add_resource()andvalidate_resource()accepted any type without validation - Issue: Passing
bytesinstead ofstrcould cause confusing downstream errors; type safety requires explicit validation at public API boundaries - Added:
isinstance(source, str)check at entry point with descriptiveTypeError - Error message includes: actual type received, guidance to decode bytes (
source.decode('utf-8')) - Locations:
FluentBundle.add_resource()- raisesTypeErrorfor non-string sourceFluentBundle.validate_resource()- raisesTypeErrorfor non-string sourcevalidate_resource()standalone function - raisesTypeErrorfor non-string source
- Impact: Clear error messages at API boundaries; defense-in-depth type safety
- Previous: