Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::CompactorRegistry Class Reference

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.
 
CompactionManagerdefault_manager ()
 Get the default CompactionManager reference.
 

Detailed Description

Per-identity compactor registry and dispatch.

Resolution order when compaction triggers:

  1. Per-identity compactor (if registered for the exact identity)
  2. Global custom compactor (identity="", if registered)
  3. Built-in default (v1.8.4 value-density via CompactionManager)

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.

Version
1.9.9

Definition at line 72 of file compactor_registry.h.

Constructor & Destructor Documentation

◆ CompactorRegistry()

entropic::CompactorRegistry::CompactorRegistry ( CompactionManager default_manager)
explicit

Construct with default compactor.

Construct with default compactor wrapping CompactionManager.

Parameters
default_managerReference to v1.8.4 CompactionManager.
Version
1.9.9
Parameters
default_managerv1.8.4 CompactionManager reference.

Definition at line 468 of file compactor_registry.cpp.

Member Function Documentation

◆ compact()

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.

Parameters
identityCurrent identity name.
messagesMessages to compact.
configCompaction configuration.
Returns
CompactionResult with compacted messages and metadata.

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.

Version
1.9.9
Parameters
identityCurrent identity name.
messagesMessages to compact.
configCompaction configuration.
Returns
CompactionResult with metadata.

Definition at line 536 of file compactor_registry.cpp.

◆ default_manager()

CompactionManager & entropic::CompactorRegistry::default_manager ( )
inline

Get the default CompactionManager reference.

Returns
Reference to the v1.8.4 CompactionManager. @utility
Version
1.9.9

Definition at line 147 of file compactor_registry.h.

◆ deregister_compactor()

entropic_error_t entropic::CompactorRegistry::deregister_compactor ( const std::string &  identity)

Deregister a compactor for a specific identity.

Parameters
identityIdentity name ("" for global fallback).
Returns
ENTROPIC_OK on success (idempotent).

After deregistration, the identity falls back to the global custom compactor (if any), then to the built-in default.

@threadsafety Write-locks the registry.

Version
1.9.9
Parameters
identityIdentity name ("" for global).
Returns
ENTROPIC_OK (idempotent).

Definition at line 517 of file compactor_registry.cpp.

◆ has_custom_compactor()

bool entropic::CompactorRegistry::has_custom_compactor ( const std::string &  identity) const

Check if a custom compactor is registered for an identity.

Parameters
identityIdentity name.
Returns
true if a non-default compactor will be used.

@threadsafety Read-locks the registry.

Version
1.9.9
Parameters
identityIdentity name.
Returns
true if per-identity or global custom registered.

Definition at line 626 of file compactor_registry.cpp.

◆ register_compactor()

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.

Parameters
identityIdentity name ("" for global fallback).
compactorC function pointer.
user_dataOpaque pointer passed to compactor.
Returns
ENTROPIC_OK on success. ENTROPIC_ERROR_INVALID_CONFIG if compactor is NULL.

Replaces any previously registered compactor for this identity.

@threadsafety Write-locks the registry.

Version
1.9.9
Parameters
identityIdentity name ("" for global fallback).
compactorC function pointer.
user_dataOpaque pointer.
Returns
ENTROPIC_OK or ENTROPIC_ERROR_INVALID_CONFIG.

Definition at line 488 of file compactor_registry.cpp.


The documentation for this class was generated from the following files: