You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> apcore only defines the adapter interface specification (see [Adapter Development Guide](./docs/guides/adapter-development.md)); it does not include any framework-specific implementations. The community or official team can develop adapters in independent repositories (e.g., `apcore-fastapi`, `apcore-flask`, `apcore-django`), built on top of the core `module()` and External Binding mechanisms.
99
+
> apcore only defines the adapter interface specification (see [Adapter Development Guide](./docs/guides/adapter-development.md)); it does not include any framework-specific implementations. The community or official team can develop adapters in independent repositories (e.g., `flask-apcore`, `django-apcore`), built on top of the core `module()` and External Binding mechanisms.
Copy file name to clipboardExpand all lines: docs/api/registry-api.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -677,7 +677,7 @@ Steps:
677
677
678
678
### 9.1 Custom Discoverer
679
679
680
-
> **Reserved — Not Implemented.** The `set_discoverer()` API below is a reserved design; current SDKs do not support it. Documentation is retained for future reference.
680
+
> Implemented in apcore-python v0.5.1+ and apcore-typescript v0.3.0+.
681
681
682
682
```python
683
683
from apcore import Registry, ModuleDiscoverer
@@ -706,7 +706,7 @@ registry.discover()
706
706
707
707
### 9.2 Module Validator
708
708
709
-
> **Reserved — Not Implemented.** The `set_validator()` API below is a reserved design; current SDKs do not support it. Documentation is retained for future reference.
709
+
> Implemented in apcore-python v0.5.1+ and apcore-typescript v0.3.0+.
710
710
711
711
```python
712
712
from apcore import Registry, ModuleValidator
@@ -735,7 +735,7 @@ registry.discover()
735
735
736
736
### 9.3 Hot Reload (Development Mode)
737
737
738
-
> **Reserved — Not Implemented.** The `watch()` / `unwatch()` API below is a reserved design; current SDKs do not support it. Documentation is retained for future reference.
738
+
> Implemented in apcore-python v0.5.1+ and apcore-typescript v0.3.0+. Python requires the optional `watchdog` dependency.
Copy file name to clipboardExpand all lines: docs/architecture.md
+74-23Lines changed: 74 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,26 +87,39 @@ extensions/
87
87
88
88
### 2.1 Module
89
89
90
-
Modules are the smallest execution unit in apcore.
90
+
Modules are the smallest execution unit in apcore. Modules can be defined via the `@module` decorator (primary approach) or by providing a class with an `execute()` method and required schema attributes. No abstract base class inheritance is required.
91
+
92
+
**Decorator approach (recommended):**
93
+
94
+
```python
95
+
from apcore import module
96
+
97
+
@module(id="executor.greet", tags=["greeting"])
98
+
defgreet(name: str) -> dict:
99
+
"""Generate greeting message"""
100
+
return {"message": f"Hello, {name}!"}
101
+
```
102
+
103
+
**Class-based approach (no ABC required):**
91
104
92
105
```python
93
-
classModule(ABC):
94
-
"""Module base class"""
106
+
classSendEmailModule:
107
+
"""Send email module"""
95
108
96
109
# ====== Core Layer (Required) ======
97
-
input_schema: ClassVar[Type[BaseModel]]
98
-
output_schema: ClassVar[Type[BaseModel]]
99
-
description: ClassVar[str]
110
+
input_schema= SendEmailInput #Type[BaseModel] or JSON Schema dict
111
+
output_schema= SendEmailOutput #Type[BaseModel] or JSON Schema dict
apcore provides a formal `ExtensionManager` API for managing pluggable extension points. The five built-in extension points are: `discoverer`, `middleware`, `acl`, `span_exporter`, and `module_validator`.
505
+
506
+
### 5.1 ExtensionManager API
507
+
508
+
The `ExtensionManager` provides a unified interface for registering, retrieving, and applying extensions:
509
+
510
+
| Method | Signature | Description |
511
+
|--------|-----------|-------------|
512
+
|`register`|`register(point_name, extension)`| Register an extension for a named extension point |
513
+
|`get`|`get(point_name)`| Retrieve the single registered extension, or `None`|
514
+
|`get_all`|`get_all(point_name)`| Retrieve all registered extensions for a point as a list |
515
+
|`unregister`|`unregister(point_name, extension)`| Remove a registered extension; returns `bool`|
516
+
|`apply`|`apply(registry, executor)`| Apply all registered extensions to the given registry and executor |
517
+
|`list_points`|`list_points()`| List all registered extension points as a list of `ExtensionPoint`|
> **Backward compatibility note:** The informal patterns shown above (subclassing, function-based APIs) continue to work. The `ExtensionManager` provides a formal unified API on top of these patterns for implementations that need programmatic extension point management.
3.`ObsLoggingMiddleware` -- Logs with timing already set up (innermost).
99
101
102
+
### W3C Trace Context
103
+
104
+
apcore supports [W3C Trace Context](https://www.w3.org/TR/trace-context/) for distributed tracing interoperability. The `TraceContext` class provides methods to inject and extract `traceparent` headers, enabling trace propagation across service boundaries.
105
+
106
+
| Method | Description |
107
+
|--------|-------------|
108
+
|`TraceContext.inject(context)`| Convert an apcore `Context` into a headers dict (`dict[str, str]` / `Record<string, string>`) containing a `traceparent` key |
109
+
|`TraceContext.extract(headers)`| Parse a `traceparent` header from an incoming request headers dict and return a `TraceParent`|
110
+
|`TraceContext.from_traceparent(str)`| Strict parsing of a `traceparent` string into a `TraceParent` object |
|**Extension point framework**| All five extension points (SchemaLoader, ModuleLoader, IDConverter, ACLChecker, Executor) | PROTOCOL_SPEC §10.3, §10.6 |
167
+
|**Extension point framework**| All five extension points (discoverer, middleware, acl, span_exporter, module_validator) via `ExtensionManager` with `register()`, `get()`, `get_all()`, `unregister()`, `apply()`, `list_points()`. Note: these names map to actual runtime extension needs rather than the original theoretical design names (SchemaLoader, ModuleLoader, IDConverter, ACLChecker, Executor).| PROTOCOL_SPEC §10.3, §10.6 |
168
168
|**Extension point chain**|`first_success`, `all`, `fallback` strategies | PROTOCOL_SPEC §10.3 |
The following features are specified in PROTOCOL_SPEC but not yet fully implemented in current SDK releases (apcore-python, apcore-typescript). Implementers **should** document these deviations in their conformance declarations.
580
+
581
+
| Feature | Spec Reference | Current Status |
582
+
|---------|---------------|----------------|
583
+
| `Config` class (YAML loading, env override, schema validation) | PROTOCOL_SPEC §8.1, §8.2, §8.3 | Stub implementation only. YAML loading, environment variable override, and `validate_config()` schema validation are not implemented. |
584
+
| Registry schema query/export methods (`get_schema`, `export_schema`, etc.) | PROTOCOL_SPEC §11.2 | Not on `Registry`. A standalone `SchemaExporter` class is available for schema export. |
585
+
| Error codes `GENERAL_NOT_IMPLEMENTED` and `DEPENDENCY_NOT_FOUND` | PROTOCOL_SPEC §7.2, §7.7 | Error code constants defined but corresponding error classes not yet implemented. |
586
+
| Version negotiation | PROTOCOL_SPEC §12.3 | `negotiate_version()` algorithm not yet implemented. |
0 commit comments