|
Entropic 2.3.8
Local-first agentic inference engine
|
Per-identity compactor registry and dispatch. More...
#include <entropic/core/compactor_registry.h>
Public Member Functions | |
| CompactorRegistry (CompactionManager &default_manager) | |
| Construct with default compactor. | |
| entropic_error_t | register_compactor (const std::string &identity, entropic_compactor_fn compactor, void *user_data) |
| Register a compactor for a specific identity. | |
| entropic_error_t | deregister_compactor (const std::string &identity) |
| Deregister a compactor for a specific identity. | |
| CompactionResult | compact (const std::string &identity, const std::vector< Message > &messages, const CompactionConfig &config) |
| Run compaction using the appropriate compactor. | |
| bool | has_custom_compactor (const std::string &identity) const |
| Check if a custom compactor is registered for an identity. | |
| CompactionManager & | default_manager () |
| Get the default CompactionManager reference. | |
Per-identity compactor registry and dispatch.
Resolution order when compaction triggers:
Custom compactor failure is non-fatal: falls back to default with a WARNING log. Only if both custom AND default fail does the registry return ENTROPIC_ERROR_COMPACTION_FAILED.
Definition at line 72 of file compactor_registry.h.
|
explicit |
Construct with default compactor.
Construct with default compactor wrapping CompactionManager.
| default_manager | Reference to v1.8.4 CompactionManager. |
| default_manager | v1.8.4 CompactionManager reference. |
Definition at line 468 of file compactor_registry.cpp.
| CompactionResult entropic::CompactorRegistry::compact | ( | const std::string & | identity, |
| const std::vector< Message > & | messages, | ||
| const CompactionConfig & | config | ||
| ) |
Run compaction using the appropriate compactor.
Resolve and call the appropriate compactor.
| identity | Current identity name. |
| messages | Messages to compact. |
| config | Compaction configuration. |
Resolution: per-identity → global custom → built-in default. On custom compactor failure, falls back to default with WARNING.
@threadsafety Read-locks to snapshot, releases before calling.
| identity | Current identity name. |
| messages | Messages to compact. |
| config | Compaction configuration. |
Definition at line 536 of file compactor_registry.cpp.
|
inline |
Get the default CompactionManager reference.
Definition at line 147 of file compactor_registry.h.
| entropic_error_t entropic::CompactorRegistry::deregister_compactor | ( | const std::string & | identity | ) |
Deregister a compactor for a specific identity.
| identity | Identity name ("" for global fallback). |
After deregistration, the identity falls back to the global custom compactor (if any), then to the built-in default.
@threadsafety Write-locks the registry.
| identity | Identity name ("" for global). |
Definition at line 517 of file compactor_registry.cpp.
| bool entropic::CompactorRegistry::has_custom_compactor | ( | const std::string & | identity | ) | const |
Check if a custom compactor is registered for an identity.
| identity | Identity name. |
@threadsafety Read-locks the registry.
| identity | Identity name. |
Definition at line 626 of file compactor_registry.cpp.
| entropic_error_t entropic::CompactorRegistry::register_compactor | ( | const std::string & | identity, |
| entropic_compactor_fn | compactor, | ||
| void * | user_data | ||
| ) |
Register a compactor for a specific identity.
| identity | Identity name ("" for global fallback). |
| compactor | C function pointer. |
| user_data | Opaque pointer passed to compactor. |
Replaces any previously registered compactor for this identity.
@threadsafety Write-locks the registry.
| identity | Identity name ("" for global fallback). |
| compactor | C function pointer. |
| user_data | Opaque pointer. |
Definition at line 488 of file compactor_registry.cpp.