Skip to content

symfonic.platform.core_preferences

core_preferences

Explicitly migrate legacy DomainTemplate.core_preferences values.

CorePreference is natural-language review guidance. It is not an executable tool policy, so this adapter deliberately does not guess whether a statement should become a guard or a precondition. It only preserves the parts the native prompt and metacognition composition can represent exactly: the statement, its sensitivity tags, and its priority.

The adapter belongs at a platform composition root because it is the one place allowed to know both the legacy value and the native capability values. The governance capability itself remains independent of the legacy agent package.

CorePreferenceMigration dataclass

CorePreferenceMigration(guardrails: tuple[Guardrail, ...])

The native inputs faithfully copied from legacy core preferences.

sources belong in PromptingCapability and sensitive_terms belongs in governance(reflector=..., sensitive_terms=...). A caller that needs an executable tool decision must still supply a guard or precondition; preference prose alone cannot determine that decision.

sensitive_terms property

sensitive_terms: tuple[str, ...]

The deduplicated tag set the native review gate watches.

sources property

sources: tuple[Any, ...]

Authored prompt sources, in the legacy priority order.

core_preference_migration

core_preference_migration(preferences: Iterable[CorePreference]) -> CorePreferenceMigration

Copy legacy preferences into the public native composition values.

No statement is parsed or reclassified. In particular, this function never manufactures a guard, precondition, approval, or refusal from the statement text. The prompt compiler keeps the legacy descending-priority rendering rule through :func:guardrail_sources; the original input order remains the stable tie-breaker.

Source code in src/symfonic/platform/core_preferences.py
def core_preference_migration(
    preferences: Iterable[CorePreference],
) -> CorePreferenceMigration:
    """Copy legacy preferences into the public native composition values.

    No statement is parsed or reclassified.  In particular, this function
    never manufactures a guard, precondition, approval, or refusal from the
    statement text.  The prompt compiler keeps the legacy descending-priority
    rendering rule through :func:`guardrail_sources`; the original input order
    remains the stable tie-breaker.
    """
    return CorePreferenceMigration(
        guardrails=tuple(
            Guardrail(
                statement=preference.statement,
                sensitive_tags=tuple(preference.sensitive_tags),
                priority=preference.priority,
            )
            for preference in preferences
        )
    )