Skip to content

symfonic.platform.sqlite_invocation_refusal

sqlite_invocation_refusal

Opt-in host observation of one owner-approved compatibility refusal.

CORE-137 accepts the bare SQLite path refusal, not all retired settings. Traceback provenance identifies the shipped guard; it is not tamperproof. The guard module is read from sys.modules, never imported, so observing a native agent does not load the cutover package. Compose this wrapper in ScopedAgentRegistry's composer. No defaults change. Wrap once: nested observers can produce duplicate observations. Earlier retired settings can stop guard evaluation before SQLite is reached. Dispatch rejection and migration-refusal counts may describe the same attempt and must not be summed.

SqliteInvocationRefusal dataclass

SqliteInvocationRefusal(entrypoint: str, reason_code: str = 'legacy_sqlite_path', surface: str = 'FrameworkConfig.dev_sqlite_checkpoint_path', boundary: str = 'invocation', approval_reference: str = 'CORE-1:4ea3d6e3-7ce2-4895-b04b-0d36be5b4c9b')

Closed metadata with no input, configuration value or exception prose.

observe_sqlite_refusal

observe_sqlite_refusal(agent: Any, *, refusal_observer: Callable[[SqliteInvocationRefusal], None] | None = None) -> Any

Wrap run and streaming iteration; disabled observation returns the agent.

Ordinary observer failures preserve the original exception via bare raise. BaseException (including cancellation) propagates, like native observation.

Source code in src/symfonic/platform/sqlite_invocation_refusal.py
def observe_sqlite_refusal(
    agent: Any, *, refusal_observer: Callable[[SqliteInvocationRefusal], None] | None = None,
) -> Any:
    """Wrap run and streaming iteration; disabled observation returns the agent.

    Ordinary observer failures preserve the original exception via bare raise.
    BaseException (including cancellation) propagates, like native observation.
    """
    return agent if refusal_observer is None else _ObservedAgent(agent, refusal_observer)