Skip to content

Releases: aiperceivable/apcore-python

Release 0.15.1

31 Mar 10:11

Choose a tag to compare

Changed

  • Env prefix convention simplified — Removed the ^APCORE_[A-Z0-9] reservation rule from Config._validate_env_prefix(). Sub-packages now use single-underscore prefixes (APCORE_MCP, APCORE_OBSERVABILITY, APCORE_SYS) instead of the double-underscore form. Only the exact APCORE prefix is reserved for the core namespace.
  • Built-in namespace env prefixes: APCORE__OBSERVABILITYAPCORE_OBSERVABILITY, APCORE__SYSAPCORE_SYS.

Release 0.15.0

31 Mar 06:43

Choose a tag to compare

Added

Config Bus Architecture (§9.4–§9.14)

  • Config.register_namespace(name, schema=None, env_prefix=None, defaults=None) — Class-level namespace registration. Any package can claim a named config subtree with optional JSON Schema validation, env prefix, and default values. Global registry is shared across all Config instances. Late registration is allowed; call config.reload() afterward to apply defaults and env overrides.
  • config.get("namespace.key.path") — Dot-path access with namespace resolution. First segment resolves to a registered namespace; remaining segments traverse the subtree.
  • config.namespace(name) — Returns the full config subtree for a registered namespace as a dict.
  • config.bind(ns, type) / config.get_typed(path, type) — Typed namespace access; bind returns a view of the namespace deserialized into type, get_typed deserializes a single dot-path value.
  • config.mount(namespace, from_file=...|from_dict=...) — Attach external config sources to a namespace without a unified YAML file. Primary integration path for third-party packages with existing config systems.
  • Config.registered_namespaces() — Class-level introspection; returns names of all registered namespaces.
  • Unified YAML with namespace partitioning — Single YAML file with namespace-keyed top-level sections. Automatic mode detection: legacy mode (no apcore: key, fully backward compatible) vs. namespace mode (apcore: key present). _config is a reserved meta-namespace (strict, allow_unknown).
  • Per-namespace env override with longest-prefix-match dispatch — Each namespace declares its own env_prefix. APCORE__ double-underscore convention for apcore sub-packages (e.g., APCORE__OBSERVABILITY, APCORE__SYS) to avoid collision with the existing single-underscore APCORE_ prefix used for flat keys.
  • Hot-reload namespace supportconfig.reload() re-reads YAML, re-detects mode, re-applies namespace defaults and env overrides, re-validates, and re-reads mounted files.
  • New error codesCONFIG_NAMESPACE_DUPLICATE, CONFIG_NAMESPACE_RESERVED, CONFIG_ENV_PREFIX_CONFLICT, CONFIG_MOUNT_ERROR, CONFIG_BIND_ERROR

Error Formatter Registry (§8.8)

  • ErrorFormatter protocol — Interface for adapter-specific error formatters. Implementations transform ModuleError into the surface-specific wire format (e.g., MCP camelCase, JSON-RPC code mapping).
  • ErrorFormatterRegistry — Shared registry for surface-specific formatters:
  • ErrorFormatterRegistry.register(surface, formatter) — register a formatter for a named surface
  • ErrorFormatterRegistry.get(surface) — retrieve a registered formatter
  • ErrorFormatterRegistry.format(surface, error) — format an error, falling back to error.to_dict() if no formatter is registered for that surface
  • New error codeERROR_FORMATTER_DUPLICATE

Built-in Namespace Registrations (§9.15)

  • observability namespace (APCORE__OBSERVABILITY env prefix) — apcore pre-registers this namespace, promoting the existing apcore.observability.* flat config keys (tracing, metrics, logging, error_history, platform_notify) into a named subtree. Adapter packages (apcore-mcp, apcore-a2a, apcore-cli) should read from this namespace rather than independent logging defaults.
  • sys_modules namespace (APCORE__SYS env prefix) — apcore pre-registers this namespace, promoting the existing apcore.sys_modules.* flat keys into a named subtree. register_sys_modules() prefers config.namespace("sys_modules") in namespace mode with config.get("sys_modules.*") legacy fallback. Both registrations are 1:1 migrations of existing keys; there are no breaking changes.

Event Type Naming Convention and Collision Fix (§9.16)

  • Canonical event names — Two confirmed event type collisions in apcore-python are resolved:
  • "module_health_changed" (previously used for both enable/disable toggles and error-rate recovery) split into apcore.module.toggled (toggle on/off) and apcore.health.recovered (error rate recovery)
  • "config_changed" (previously used for both key updates and module reload) split into apcore.config.updated (runtime key update via system.control.update_config) and apcore.module.reloaded (hot-reload via system.control.reload_module)
  • Naming conventionapcore.* is reserved for core framework events. Adapter packages use their own prefix: apcore-mcp.*, apcore-a2a.*, apcore-cli.*.
  • Transition aliases — All four legacy short-form names (module_health_changed, config_changed) continue to be emitted alongside the canonical names during the transition period.

Release 0.14.0

25 Mar 02:09

Choose a tag to compare

Added

  • Middleware priorityMiddleware base class now accepts priority: int (0-1000, default 0). Higher priority executes first; equal priority preserves registration order. BeforeMiddleware and AfterMiddleware adapters also accept priority.
  • Priority range validationValueError raised for priority values outside 0-1000

Breaking Changes

  • Middleware default priority changed from 0 to 100 per PROTOCOL_SPEC §11.2. Middleware without explicit priority will now execute before priority-0 middleware.

Release 0.13.2

22 Mar 12:51

Choose a tag to compare

Changed

  • Rebrand: aipartnerup → aiperceivable

Release 0.13.1

19 Mar 07:32

Choose a tag to compare

Added

  • Dict schema support — Modules can now define input_schema / output_schema as plain JSON Schema dicts instead of Pydantic model classes. A _DictSchemaAdapter transparently wraps dict schemas at registration time so all internal code paths (executor, schema exporter, get_definition) work without changes.

Fixed

  • get_definition() crash on dict schemas — Previously called .model_json_schema() on dict objects, causing AttributeError
  • Executor crash on dict schemascall(), call_async(), and stream() all called .model_validate() on dict objects

Improved

  • File header docstrings — Enhanced docstrings for errors.py, executor.py, and version.py

Release 0.13.0

12 Mar 06:49

Choose a tag to compare

Added

  • Caching/pagination annotationsModuleAnnotations gains 5 new fields: cacheable, cache_ttl, cache_key_fields, paginated, pagination_style (all optional with defaults, backward compatible)
  • pagination_style Literal type — Typed as Literal["cursor", "offset", "page"] instead of free-form str
  • sunset_date — New field on ModuleDescriptor for module deprecation lifecycle (ISO 8601 date)
  • on_suspend() / on_resume() lifecycle hooks — Duck-typed optional hooks for state preservation during hot-reload; integrated into ReloadModuleModule and registry watchdog
  • MCP _meta export — Schema exporter includes cacheable, cacheTtl, cacheKeyFields, paginated, paginationStyle in _meta sub-dict
  • Suspend/resume teststests/test_suspend_resume.py covering state transfer, backward compatibility, error handling

Changed

  • Rebranded — "module development framework" → "module standard" in pyproject.toml, __init__.py, README, and internal docstrings
  • Module Protocolon_suspend/on_resume deliberately kept OUT of Protocol (duck-typed via hasattr/callable)

Release 0.12.0

11 Mar 08:26

Choose a tag to compare

Changed

  • ExecutionCancelledError now extends ModuleError (was bare Exception) with error code EXECUTION_CANCELLED, aligning with PROTOCOL_SPEC §8.7 error hierarchy
  • ErrorCodes — Added EXECUTION_CANCELLED constant

Release 0.11.0

09 Mar 07:09

Choose a tag to compare

Added

  • Full lifecycle integration tests (tests/integration/test_full_lifecycle.py) — 8 tests covering the complete 11-step pipeline with all gates (ACL + Approval + Middleware + Schema validation) enabled simultaneously, nested module calls, shared context.data, error propagation, and ACL conditions.

System Modules — AI Bidirectional Introspection

Built-in system.* modules that allow AI agents to query, monitor

  • system.health.summary — Aggregate health status across all registered modules (healthy/degraded/unhealthy classification based on error rate thresholds).
  • system.health.module — Per-module health detail including recent errors from ErrorHistory.
  • system.manifest.module — Single module introspection (schema, annotations, tags, source path).
  • system.manifest.full — Full registry manifest with filtering by tags/prefix.
  • system.usage.summary — Usage statistics across all modules (call counts, error rates, avg latency).
  • system.usage.module — Per-module usage detail with hourly trend data.
  • system.control.update_config — Runtime config hot-patching with constraint validation.
  • system.control.reload_module — Hot-reload a module from disk without restart.
  • system.control.toggle_feature — Enable/disable modules at runtime with reason tracking.
  • register_sys_modules() — Auto-registration wiring for all system modules.

Observability

  • ErrorHistory — Ring buffer tracking recent errors with deduplication and per-module querying.
  • ErrorHistoryMiddleware — Middleware that records ModuleError details into ErrorHistory.
  • UsageCollector — Per-module call counting, latency histograms, and hourly bucketed trend data.
  • PlatformNotifyMiddleware — Threshold-based sensor that emits events on error rate spikes.

Event System

  • EventEmitter — Global event bus with async subscriber dispatch and thread-pool execution.
  • EventSubscriber protocol — Interface for event consumers.
  • ApCoreEvent — Frozen dataclass for typed events (module lifecycle, errors, config changes).
  • WebhookSubscriber — HTTP POST event delivery with retry.
  • A2ASubscriber — Agent-to-Agent protocol event bridge.

APCore Unified Client

  • APCore.on() / APCore.off() — Event subscription management via the unified client.
  • APCore.disable() / APCore.enable() — Module toggle control via the unified client.
  • APCore.discover() / APCore.list_modules() — Discovery and listing via the unified client.

Public API Exports

  • ModuleDisabledError — Error class for MODULE_DISABLED code, raised when a disabled module is called.
  • ReloadFailedError — Error class for RELOAD_FAILED code (retryable).
  • SchemaStrategy — Enum for schema resolution strategy (yaml_first, native_first, yaml_only).
  • ExportProfile — Enum for schema export profiles (mcp, openai, anthropic, generic).

Registry

  • Module toggle — APCore client now supports disable()/enable() for module toggling via system.control.toggle_feature, with ModuleDisabledError enforcement and event emission.
  • Version negotiationnegotiate_version() for SDK/module version compatibility checking.

Changed

  • WebhookSubscriber / A2ASubscriber now require optional dependency aiohttp. Install with pip install apcore[events]. Core SDK no longer fails to import when aiohttp is not installed.

Fixed

  • aiohttp hard import in events/subscribers.py broke core SDK import when aiohttp was not installed. Changed to try/except ImportError guard with clear error message at runtime.
  • A2ASubscriber.on_event ImportError for missing aiohttp was silently swallowed by the broad except Exception block. Moved guard before the try block to surface the error correctly.
  • README Access Control example now includes required Executor and Registry imports.
  • pyproject.toml repository/issues/changelog URLs now point to apcore-python (was incorrectly pointing to apcore).
  • CHANGELOG [0.7.1] compare link added (was missing from link references).

Release 0.10.0

08 Mar 03:00

Choose a tag to compare

Added

APCore Unified Client

  • APCore.stream() — Stream module output chunk by chunk via the unified client.
  • APCore.validate() — Non-destructive preflight check via the unified client.
  • APCore.describe() — Get module description info (for AI/LLM use).
  • APCore.use_before() — Add before function middleware via the unified client.
  • APCore.use_after() — Add after function middleware via the unified client.
  • APCore.remove() — Remove middleware by identity via the unified client.

Global Entry Points (apcore.*)

  • apcore.stream() — Global convenience for streaming module calls.
  • apcore.validate() — Global convenience for preflight validation.
  • apcore.register() — Global convenience for direct module registration.
  • apcore.describe() — Global convenience for module description.
  • apcore.use() — Global convenience for adding middleware.
  • apcore.use_before() — Global convenience for adding before middleware.
  • apcore.use_after() — Global convenience for adding after middleware.
  • apcore.remove() — Global convenience for removing middleware.

Error Hierarchy

  • FeatureNotImplementedError — New error class for GENERAL_NOT_IMPLEMENTED code (renamed from NotImplementedError to avoid Python stdlib clash).
  • DependencyNotFoundError — New error class for DEPENDENCY_NOT_FOUND code.

Changed

  • APCore client and apcore.* global functions now provide full feature parity with Executor.

Release 0.9.0

06 Mar 08:46

Choose a tag to compare

Added

Enhanced Executor.validate() Preflight

  • PreflightCheckResult — New frozen dataclass representing a single preflight check result with check, passed, and error fields.
  • PreflightResult — New dataclass returned by Executor.validate(), containing per-check results and requires_approval flag. Duck-type compatible with ValidationResult via .valid and .errors properties.
  • Full 6-check preflightvalidate() now runs Steps 1–6 of the pipeline (module_id format, module lookup, call chain safety, ACL, approval detection, schema validation) without executing module code or middleware.

Changed

Executor Pipeline

  • Step renumbering — Approval Gate renumbered from Step 4.5 to Step 5; all subsequent steps shifted +1 (now 11 clean steps).
  • validate() return type — Changed from ValidationResult to PreflightResult. Backward compatible: .valid and .errors still work identically for existing consumers (e.g., apcore-mcp router).
  • validate() signature — Added optional context parameter for call-chain checks; inputs now defaults to {}.

Public API

  • Exported PreflightCheckResult and PreflightResult from apcore top-level package.