Releases: aipartnerup/apcore-python
Releases · aipartnerup/apcore-python
Release 0.6.0
Added
Extension System
- ExtensionManager / ExtensionPoint - Added a unified extension-point framework for
discoverer,middleware,acl,span_exporter, andmodule_validator - Extension wiring - Added
apply()support to connect registered extensions intoRegistryandExecutor
Async Task & Cancellation
- AsyncTaskManager - Added background task orchestration with status tracking, cancellation, concurrency limits, shutdown, and cleanup
- TaskStatus / TaskInfo - Added task lifecycle enum and metadata dataclass for async task management
- CancelToken / ExecutionCancelledError - Added cooperative cancellation primitives and integrated cancellation checks into executor flows
Trace Context & Observability
- TraceContext / TraceParent - Added W3C Trace Context utilities for
inject(),extract(), and strict parsing viafrom_traceparent() - Context.create(trace_parent=...) - Added distributed-tracing entry support by accepting inbound trace context
- OTLPExporter top-level export - Added OTLP exporter re-exports in observability and top-level public API
Registry Enhancements
- Custom discoverer/validator hooks - Added
set_discoverer()andset_validator()integration paths - Module describe support - Added
Registry.describe()for human-readable module descriptions - Hot-reload APIs - Added
watch(),unwatch(), and file-change handling helpers for extension directories - Validation constants/protocols - Added
MAX_MODULE_ID_LENGTH,RESERVED_WORDS,Discoverer, andModuleValidatorexports
Changed
Public API Surface
- Expanded top-level
apcoreexports to include cancellation, extensions, async task types, trace context types, additional registry protocols/constants, and new error classes
Error System
- Added
ModuleExecuteErrorandInternalErrorto the framework error hierarchy and exports - Extended
ErrorCodeswith additional constants used by newer execution/extension paths
Fixed
Execution & Redaction
- executor - Added recursive
_secret_key redaction for nested dictionaries - executor - Preserved explicit cancellation semantics by re-raising
ExecutionCancelledError
Import Graph Robustness
- Reduced import-coupling risk across middleware/observability/trace typing paths while preserving existing runtime behavior and public interfaces
Release 0.5.0
Changed
API Naming
- decorator - Renamed
_generate_input_model/_generate_output_modeltogenerate_input_model/generate_output_modelas public API - context_logger - Renamed
formatparameter tooutput_formatto avoid shadowing Python builtin - registry - Renamed
_write_lockto_lockfor clearer intent
Type Annotations
- decorator - Replaced bare
dictwithdict[str, Any]in_normalize_result,annotations,metadata,_async_execute,_sync_execute - bindings - Fixed
_build_model_from_json_schemaparameter type fromdicttodict[str, Any] - scanner - Fixed
rootsparameter type fromlist[dict]tolist[dict[str, Any]] - metrics - Fixed
snapshotreturn type fromdicttodict[str, Any] - executor - Removed redundant string-quoted forward references in
from_registry; fixedmiddlewaresparameter type tolist[Middleware] | None
Code Quality
- executor - Extracted
_convert_validation_errors()helper to eliminate 6 duplicated validation error conversion patterns - executor - Refactored
call_async()andstream()to use new async middleware manager methods - executor - Removed internal
_execute_on_error_asyncmethod (replaced byMiddlewareManager.execute_on_error_async) - loader - Use
self._resolver.clear_cache()instead of accessing private_file_cachedirectly - tracing - Replaced
print()withsys.stdout.write()inStdoutExporter - acl / loader - Changed hardcoded logger names to
logging.getLogger(__name__)
Added
Async Middleware
- MiddlewareManager - Added
execute_before_async(),execute_after_async(),execute_on_error_async()for proper async middleware dispatch withinspect.iscoroutinefunctiondetection - RefResolver - Added
clear_cache()public method for cache management - Executor - Added
clear_async_cache()public method
Schema Export
- SchemaExporter - Added
streaminghint toexport_mcp()annotations fromModuleAnnotations
Fixed
Memory Safety
- context - Changed
Identity.rolesfrom mutablelist[str]to immutabletuple[str, ...]in frozen dataclass
Observability
- context_logger / metrics - Handle cases where
before()was never called inObsLoggingMiddlewareandMetricsMiddleware
Security
- acl - Added explicit
encoding="utf-8"to YAML file open
Release 0.4.0
Added
Streaming Support
- Executor.stream() - New async generator method for streaming module execution
- Implements same 6-step pipeline as
call_async()(context, safety, lookup, ACL, input validation, middleware before) - Falls back to
call_async()yielding single chunk for non-streaming modules - For streaming modules, iterates
module.stream()and yields each chunk - Accumulates chunks via shallow merge for output validation and after-middleware
- Full error handling with middleware recovery
- ModuleAnnotations.streaming - New
streaming: bool = Falsefield to indicate if a module supports streaming execution - Test coverage - Added 5 comprehensive tests in
test_executor_stream.py: - Fallback behavior for non-streaming modules
- Multi-chunk streaming
- Module not found error handling
- Before/after middleware integration
- Disjoint key accumulation via shallow merge
Release 0.3.0
Release version 0.3.0
See CHANGELOG.md for details.